Skip to content

Commit

Permalink
- Fixed a crash bug with the power level block when it was broken
Browse files Browse the repository at this point in the history
- The power level block also didn't work properly anymore. Now it works again
  • Loading branch information
McJty committed Jan 12, 2022
1 parent c0e0a54 commit ee7be70
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Upcoming:
- Fixed a crash bug with the power level block when it was broken
- The power level block also didn't work properly anymore. Now it works again

1.16-3.0.12:
- Updated to latest version of McJtyLib

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ public SUpdateTileEntityPacket getUpdatePacket() {
return new SUpdateTileEntityPacket(worldPosition, 1, getUpdateTag());
}

@Override
public void saveClientDataToNBT(CompoundNBT tagCompound) {
saveInfo(tagCompound);
}

@Override
public void loadClientDataFromNBT(CompoundNBT tagCompound) {
loadInfo(tagCompound);
}

@Override
public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
handleUpdateTag(getBlockState(), pkt.getTag());
Expand Down Expand Up @@ -109,6 +119,9 @@ protected void tickServer() {
ratio = 9;
}
}
support.setRedstoneState(this, ratio);
if (support.getPowerOutput() != ratio) {
support.setRedstoneState(this, ratio);
markDirtyClient();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public PowerLevelRenderer(TileEntityRendererDispatcher dispatcher) {

@Override
public void render(PowerLevelTileEntity te, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLightIn, int combinedOverlayIn) {
matrixStack.pushPose();
IVertexBuilder builder = buffer.getBuffer(RenderType.cutout());

BlockState state = te.getLevel().getBlockState(te.getBlockPos());
Expand All @@ -53,6 +52,7 @@ public void render(PowerLevelTileEntity te, float partialTicks, MatrixStack matr
return;
}

matrixStack.pushPose();
LogicFacing logicFacing = state.getValue(LogicSlabBlock.LOGIC_FACING);
Direction facing = logicFacing.getSide();

Expand Down

0 comments on commit ee7be70

Please sign in to comment.