Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix MTE block opacity #2440

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading