From 72f37ec0760ca9818263cad4f8f421344c4984f2 Mon Sep 17 00:00:00 2001 From: Zepalesque <60141811+Zepalesque@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:25:41 -0500 Subject: [PATCH] revert: actually that doesn't work --- .../tile/ZenithHangingSignBlockEntity.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/zepalesque/zenith/core/tile/ZenithHangingSignBlockEntity.java b/src/main/java/net/zepalesque/zenith/core/tile/ZenithHangingSignBlockEntity.java index bd1a492..2151ed2 100644 --- a/src/main/java/net/zepalesque/zenith/core/tile/ZenithHangingSignBlockEntity.java +++ b/src/main/java/net/zepalesque/zenith/core/tile/ZenithHangingSignBlockEntity.java @@ -1,33 +1,33 @@ package net.zepalesque.zenith.core.tile; import net.minecraft.core.BlockPos; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.sounds.SoundEvents; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.HangingSignBlockEntity; -import net.minecraft.world.level.block.entity.SignBlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.zepalesque.zenith.api.blockset.type.AbstractWoodSet; import java.util.function.Supplier; -public class ZenithHangingSignBlockEntity extends SignBlockEntity { - private static final int MAX_TEXT_LINE_WIDTH = 60; - private static final int TEXT_LINE_HEIGHT = 9; +public class ZenithHangingSignBlockEntity extends HangingSignBlockEntity { + protected final AbstractWoodSet woodset; - public ZenithHangingSignBlockEntity(BlockPos pos, BlockState state, Supplier> type) { - super(type.get(), pos, state); + protected ZenithHangingSignBlockEntity(BlockPos pos, BlockState state, T woodset) { + super(pos, state); + this.woodset = woodset; } - public int getTextLineHeight() { - return TEXT_LINE_HEIGHT; + // Fix to get around crashing caused by the validateBlockState method + public static ZenithHangingSignBlockEntity create(BlockPos pos, BlockState state, T set) { + return new ZenithHangingSignBlockEntity(pos, state, set) { + @Override + public BlockEntityType getType() { + return this.woodset == null ? set.hangingSignEntity().get() : this.woodset.hangingSignEntity().get(); + } + }; } - public int getMaxTextLineWidth() { - return MAX_TEXT_LINE_WIDTH; - } - - public SoundEvent getSignInteractionFailedSoundEvent() { - return SoundEvents.WAXED_HANGING_SIGN_INTERACT_FAIL; + @Override + public BlockEntityType getType() { + return this.woodset.hangingSignEntity().get(); } }