Implemented renderer instance creator

This commit is contained in:
Rabbitminers 2023-04-02 16:46:15 +01:00
parent 43523302c2
commit a55ba4267a
3 changed files with 9 additions and 2 deletions

View file

@ -163,6 +163,8 @@ public abstract class BogeyRenderer {
return state.toString();
}
public abstract BogeyRenderer newInstance();
@FunctionalInterface
interface Renderer {
void render(CompoundTag bogeyData, float wheelAngle, PoseStack ms, int light, VertexConsumer vb);

View file

@ -123,4 +123,9 @@ public class StandardBogeyRenderer extends BogeyRenderer {
if (!inContraption)
ms.popPose();
}
@Override
public BogeyRenderer newInstance() {
return new StandardBogeyRenderer();
}
}

View file

@ -20,8 +20,8 @@ import net.minecraft.world.phys.Vec3;
public class StandardBogeyBlock extends AbstractBogeyBlock implements ITE<StandardBogeyTileEntity>, ProperWaterloggedBlock, ISpecialBlockItemRequirement {
private final BogeyRenderer.BogeySize size;
public StandardBogeyBlock(Properties p_i48440_1_, BogeyRenderer.BogeySize large) {
super(p_i48440_1_);
public StandardBogeyBlock(Properties props, BogeyRenderer.BogeySize large) {
super(props);
this.size = large;
registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false));
}