mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-09 04:30:51 +08:00
Reinstate localized name lookup on BlockType.
This commit is contained in:
parent
ba91dff134
commit
e0814cfe3c
@ -60,6 +60,8 @@ public class BlockType implements Keyed {
|
||||
private final LazyReference<Map<Map<Property<?>, Object>, BlockState>> blockStatesMap
|
||||
= LazyReference.from(() -> BlockState.generateStateMap(this));
|
||||
|
||||
private final LazyReference<String> name = LazyReference.from(() -> WorldEdit.getInstance().getPlatformManager()
|
||||
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getName(this));
|
||||
private final LazyReference<Integer> legacyId = LazyReference.from(() -> computeLegacy(0));
|
||||
private final LazyReference<Integer> legacyData = LazyReference.from(() -> computeLegacy(1));
|
||||
|
||||
@ -111,7 +113,11 @@ public Component getRichName() {
|
||||
*/
|
||||
@Deprecated
|
||||
public String getName() {
|
||||
return getRichName().toString();
|
||||
String name = this.name.getValue();
|
||||
if (name == null || name.isEmpty()) {
|
||||
return getId();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user