mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
state stuff
This commit is contained in:
@ -22,7 +22,7 @@ package com.sk89q.worldedit.world.registry;
|
||||
import com.sk89q.worldedit.blocks.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.registry.state.State;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -58,6 +58,6 @@ public interface BlockRegistry {
|
||||
* @return a map of states where the key is the state's ID
|
||||
*/
|
||||
@Nullable
|
||||
Map<String, ? extends State> getStates(BlockStateHolder block);
|
||||
Map<String, ? extends Property> getStates(BlockStateHolder block);
|
||||
|
||||
}
|
||||
|
@ -25,9 +25,9 @@ import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.BlockMaterial;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.util.gson.VectorAdapter;
|
||||
import com.sk89q.worldedit.registry.state.SimpleState;
|
||||
import com.sk89q.worldedit.registry.state.State;
|
||||
import com.sk89q.worldedit.registry.state.AbstractProperty;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
@ -128,7 +128,7 @@ public class BundledBlockData {
|
||||
* @return the block's states, or null if no information is available
|
||||
*/
|
||||
@Nullable
|
||||
public Map<String, ? extends State> getStatesById(String id) {
|
||||
public Map<String, ? extends Property> getStatesById(String id) {
|
||||
BlockEntry entry = findById(id);
|
||||
if (entry != null) {
|
||||
return entry.states;
|
||||
@ -151,11 +151,11 @@ public class BundledBlockData {
|
||||
private String unlocalizedName;
|
||||
public String localizedName;
|
||||
private List<String> aliases;
|
||||
public Map<String, SimpleState> states = new HashMap<>();
|
||||
public Map<String, AbstractProperty> states = new HashMap<>();
|
||||
private SimpleBlockMaterial material = new SimpleBlockMaterial();
|
||||
|
||||
void postDeserialization() {
|
||||
for (Map.Entry<String, SimpleState> state : states.entrySet()) {
|
||||
for (Map.Entry<String, AbstractProperty> state : states.entrySet()) {
|
||||
state.getValue().setName(state.getKey());
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,10 @@
|
||||
package com.sk89q.worldedit.world.registry;
|
||||
|
||||
import com.sk89q.worldedit.blocks.BlockMaterial;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.registry.state.State;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -49,7 +49,7 @@ public class BundledBlockRegistry implements BlockRegistry {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Map<String, ? extends State> getStates(BlockStateHolder block) {
|
||||
public Map<String, ? extends Property> getStates(BlockStateHolder block) {
|
||||
return BundledBlockData.getInstance().getStatesById(block.getBlockType().getId());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user