Remove custom getLightValue from subtiles, should be implemented on a per-block basis now the usual vanilla way. May resolve lighting issues? (#3140)

This commit is contained in:
Vincent Lee committed 2020-01-22 18:18:31 -06:00
1 parent af0217153d
commit a12056fbf4
5 files changed
+7 -26

No files matched your search

@@ -298,13 +298,6 @@ public class TileEntitySpecialFlower extends TileEntity implements ITickableTile
@OnlyIn(Dist.CLIENT)
public void renderHUD(Minecraft mc) {}
/**
* Gets the light value for this SubTileEntity, this is a int (-1 to default to the flower)
*/
public int getLightValue() {
return 0;
}
/**
* Gets the comparator input value for this SubTileEntity
*/
@@ -64,7 +64,7 @@ public class BlockAlfPortal extends BlockMod implements IWandable {
@Override
public int getLightValue(@Nonnull BlockState state) {
return state.get(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0;
return state.get(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : super.getLightValue(state);
}
}
@@ -101,10 +101,12 @@ public class BlockAltar extends BlockMod {
@Override
public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
TileAltar tile = (TileAltar) world.getTileEntity(pos);
return tile != null && tile.getFluid() == Fluids.LAVA ? 15 : 0;
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileAltar && ((TileAltar) te).getFluid() == Fluids.LAVA) {
return 15;
} else {
return super.getLightValue(state, world, pos);
}
}
@Override
@@ -46,12 +46,6 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
this.teProvider = teProvider;
}
@Override
public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
return tile instanceof TileEntitySpecialFlower ? ((TileEntitySpecialFlower) tile).getLightValue() : lightValue;
}
@Override
public boolean hasComparatorInputOverride(BlockState state) {
return true;
@@ -60,14 +60,6 @@ public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandH
return SHAPE.withOffset(shift.x, shift.y, shift.z);
}
@Override
public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) {
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileEntitySpecialFlower) {
return ((TileEntitySpecialFlower) te).getLightValue();
} else return 0;
}
@Override
public boolean hasComparatorInputOverride(BlockState state) {
return true;