Skip to content

Commit

Permalink
fix MTE block opacity (GregTechCEu#2440)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Apr 4, 2024
1 parent 069c586 commit 323d93a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public int getLightValue(@NotNull IBlockState state, @NotNull IBlockAccess world
public int getLightOpacity(@NotNull IBlockState state, @NotNull IBlockAccess world, @NotNull BlockPos pos) {
// since it is called on neighbor blocks
MetaTileEntity metaTileEntity = getMetaTileEntity(world, pos);
return metaTileEntity == null ? 0 : metaTileEntity.getLightOpacity();
return metaTileEntity == null ? 255 : metaTileEntity.getLightOpacity();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public boolean placeBlockAt(@NotNull ItemStack stack, @NotNull EntityPlayer play
// prevent rendering glitch before meta tile entity sync to client, but after block placement
// set opaque property on the placing on block, instead during set of meta tile entity
boolean superVal = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ,
newState.withProperty(BlockMachine.OPAQUE, metaTileEntity != null && metaTileEntity.isOpaqueCube()));
newState.withProperty(BlockMachine.OPAQUE, metaTileEntity == null || metaTileEntity.isOpaqueCube()));
if (superVal && !world.isRemote) {
BlockPos possiblePipe = pos.offset(side.getOpposite());
Block block = world.getBlockState(possiblePipe).getBlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import java.util.List;

import static gregtech.api.capability.GregtechDataCodes.IS_TAPED;
import static gregtech.api.capability.GregtechDataCodes.TAG_KEY_PAINTING_COLOR;

public class MetaTileEntityCrate extends MetaTileEntity {

Expand Down Expand Up @@ -75,11 +74,6 @@ public boolean hasFrontFacing() {
return false;
}

@Override
public int getLightOpacity() {
return 1;
}

@Override
public String getHarvestTool() {
return ModHandler.isMaterialWood(material) ? ToolClasses.AXE : ToolClasses.WRENCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) {
return new MetaTileEntityDrum(metaTileEntityId, material, tankSize);
}

@Override
public int getLightOpacity() {
return 1;
}

@Override
public boolean isOpaqueCube() {
return false;
}

@Override
public String getHarvestTool() {
return ModHandler.isMaterialWood(material) ? ToolClasses.AXE : ToolClasses.WRENCH;
Expand Down

0 comments on commit 323d93a

Please sign in to comment.