Dieser Commit ist enthalten in:
NotMyFault 2021-07-31 14:18:04 +02:00
Ursprung 678fb0a8b3
Commit 9f3a451ef6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 158F5701A6AAD00C

Datei anzeigen

@ -63,6 +63,9 @@ public class BlockType implements Keyed, Pattern {
private final BlockTypesCache.Settings settings;
private final LazyReference<FuzzyBlockState> emptyFuzzy
= LazyReference.from(() -> new FuzzyBlockState(this));
@Deprecated
private final LazyReference<String> name = LazyReference.from(() -> WorldEdit.getInstance().getPlatformManager()
.queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getName(this));
//FAWE start
private final LazyReference<Integer> legacyId = LazyReference.from(() -> computeLegacy(0));
@ -120,6 +123,7 @@ public class BlockType implements Keyed, Pattern {
String id = getId();
return id.substring(id.indexOf(':') + 1);
}
//FAWE end
/**
* Gets the name of this block, or the ID if the name cannot be found.
@ -129,7 +133,11 @@ public class BlockType implements Keyed, Pattern {
*/
@Deprecated
public String getName() {
return getRichName().toString();
String name = this.name.getValue();
if (name == null || name.isEmpty()) {
return getId();
}
return name;
}
/*