geforkt von Mirrors/FastAsyncWorldEdit
Implement getAllProperties to code and adapters
Dieser Commit ist enthalten in:
Ursprung
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
|
||||
}
|
||||
|
Binäre Datei nicht angezeigt.
@ -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
|
||||
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren