Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-16 04:50:10 +01:00
Change BlockEntityHandler#handleOrNewCompoundTag to a void function (#812)
Dieser Commit ist enthalten in:
Ursprung
33d8485852
Commit
1c8438d2a6
@ -71,7 +71,7 @@ public class MappedLegacyBlockItem {
|
||||
@FunctionalInterface
|
||||
public interface BlockEntityHandler {
|
||||
|
||||
CompoundTag handleOrNewCompoundTag(int block, CompoundTag tag);
|
||||
void handleCompoundTag(int block, CompoundTag tag);
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
|
@ -51,7 +51,6 @@ import com.viaversion.nbt.tag.Tag;
|
||||
import com.viaversion.viaversion.util.ComponentUtil;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import com.viaversion.viaversion.util.IdAndData;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
@ -289,7 +288,7 @@ public abstract class LegacyBlockItemRewriter<C extends ClientboundPacketType, S
|
||||
|
||||
MappedLegacyBlockItem settings = getMappedBlock(block);
|
||||
if (settings != null && settings.hasBlockEntityHandler()) {
|
||||
settings.getBlockEntityHandler().handleOrNewCompoundTag(block, tag);
|
||||
settings.getBlockEntityHandler().handleCompoundTag(block, tag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -343,7 +342,7 @@ public abstract class LegacyBlockItemRewriter<C extends ClientboundPacketType, S
|
||||
tag.putInt("y", y + (i << 4));
|
||||
tag.putInt("z", z + (chunk.getZ() << 4));
|
||||
|
||||
settings.getBlockEntityHandler().handleOrNewCompoundTag(block, tag);
|
||||
settings.getBlockEntityHandler().handleCompoundTag(block, tag);
|
||||
chunk.getBlockEntities().add(tag);
|
||||
}
|
||||
}
|
||||
|
@ -253,10 +253,7 @@ public class BlockItemPacketRewriter1_11 extends LegacyBlockItemRewriter<Clientb
|
||||
protected void registerRewrites() {
|
||||
// Handle spawner block entity (map to itself with custom handler)
|
||||
MappedLegacyBlockItem data = itemReplacements.computeIfAbsent(IdAndData.toRawData(52), s -> new MappedLegacyBlockItem(52));
|
||||
data.setBlockEntityHandler((b, tag) -> {
|
||||
EntityMappings1_11.toClientSpawner(tag, true);
|
||||
return tag;
|
||||
});
|
||||
data.setBlockEntityHandler((b, tag) -> EntityMappings1_11.toClientSpawner(tag, true));
|
||||
|
||||
enchantmentRewriter = new LegacyEnchantmentRewriter(nbtTagName());
|
||||
enchantmentRewriter.registerEnchantment(71, "§cCurse of Vanishing");
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren