mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Implement getAllProperties to code and adapters
This commit is contained in:
parent
35e0a47beb
commit
017a28b3dd
@ -159,5 +159,14 @@ public class BukkitBlockRegistry extends BundledBlockRegistry {
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ? extends Property<?>> getAllProperties() {
|
||||
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||
if (adapter != null) {
|
||||
return adapter.getAllProperties();
|
||||
}
|
||||
return super.getAllProperties();
|
||||
}
|
||||
//FAWE end
|
||||
}
|
||||
|
Binary file not shown.
@ -200,6 +200,7 @@ public class BlockTypesCache {
|
||||
public static final BlockType[] values;
|
||||
public static final BlockState[] states;
|
||||
public static final boolean[] ticking;
|
||||
public static final Map<String, ? extends Property<?>> allProperties;
|
||||
|
||||
protected static final Set<String> $NAMESPACES = new LinkedHashSet<>();
|
||||
|
||||
@ -266,6 +267,14 @@ public class BlockTypesCache {
|
||||
states = stateList.toArray(new BlockState[stateList.size()]);
|
||||
ticking = Booleans.toArray(tickList);
|
||||
|
||||
allProperties = WorldEdit
|
||||
.getInstance()
|
||||
.getPlatformManager()
|
||||
.queryCapability(Capability.GAME_HOOKS)
|
||||
.getRegistries()
|
||||
.getBlockRegistry()
|
||||
.getAllProperties();
|
||||
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
|
@ -96,5 +96,12 @@ public interface BlockRegistry {
|
||||
default Collection<String> values() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an unmodifiable map of all block properties
|
||||
*
|
||||
* @return a map of states where the key is the property's ID
|
||||
*/
|
||||
Map<String, ? extends Property<?>> getAllProperties();
|
||||
//FAWE end
|
||||
}
|
||||
|
@ -80,4 +80,11 @@ public class BundledBlockRegistry implements BlockRegistry {
|
||||
return OptionalInt.empty();
|
||||
}
|
||||
|
||||
//FAWE start
|
||||
@Override
|
||||
public Map<String, ? extends Property<?>> getAllProperties() {
|
||||
return Collections.emptyMap(); // Oof
|
||||
}
|
||||
//FAWE end
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user