Fixed block disguises losing their state after loading from a save

This commit is contained in:
Sollace 2020-09-27 15:12:07 +02:00
parent 4af11dfd30
commit b364111df6

View file

@ -129,6 +129,11 @@ public class Disguise implements NbtSerialisable {
if (source.isClient()) { if (source.isClient()) {
entity = EntityType.fromTag(nbt).map(type -> type.create(source.getWorld())).orElse(null); entity = EntityType.fromTag(nbt).map(type -> type.create(source.getWorld())).orElse(null);
if (entity != null) { if (entity != null) {
try {
entity.fromTag(nbt);
} catch (Exception ignored) {
// Mojang pls
}
entity = EntityBehaviour.forEntity(entity).onCreate(entity, this); entity = EntityBehaviour.forEntity(entity).onCreate(entity, this);
} }
} else { } else {