mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 10:56:42 +00:00
Initial attempt at binding state IDs
This commit is contained in:
committed by
Matthew Miller
parent
e69ba31d6b
commit
a3a175ab8c
@ -20,9 +20,11 @@
|
||||
package com.sk89q.worldedit.world.registry;
|
||||
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -57,4 +59,12 @@ public interface BlockRegistry {
|
||||
*/
|
||||
Map<String, ? extends Property<?>> getProperties(BlockType blockType);
|
||||
|
||||
/**
|
||||
* Retrieve the internal ID for a given state, if possible.
|
||||
*
|
||||
* @param state The block state
|
||||
* @return the internal ID of the state
|
||||
*/
|
||||
OptionalInt getInternalBlockStateId(BlockState state);
|
||||
|
||||
}
|
||||
|
@ -20,10 +20,12 @@
|
||||
package com.sk89q.worldedit.world.registry;
|
||||
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -52,4 +54,9 @@ public class BundledBlockRegistry implements BlockRegistry {
|
||||
return Collections.emptyMap(); // Oof
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptionalInt getInternalBlockStateId(BlockState state) {
|
||||
return OptionalInt.empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class BundledItemData {
|
||||
GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
gsonBuilder.registerTypeAdapter(Vector3.class, new VectorAdapter());
|
||||
Gson gson = gsonBuilder.create();
|
||||
URL url = ResourceLoader.getResource(BundledItemData.class,"items.json");
|
||||
URL url = ResourceLoader.getResource(BundledItemData.class,"items.json");F
|
||||
if (url == null) {
|
||||
throw new IOException("Could not find items.json");
|
||||
}
|
||||
|
Reference in New Issue
Block a user