Add workarounds for the silly forge light bug. Closes #221, probably closes #251 as well

This commit is contained in:
Vincent Lee committed 2016-05-03 11:31:59 -05:00
1 parent 7a66a9756b
commit f24409f336
11 files changed
+27

No files matched your search

@@ -83,6 +83,8 @@ public class BlockAlfPortal extends BlockMod implements IWandable, ILexiconable
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return state.getValue(BotaniaStateProps.ALFPORTAL_STATE) != AlfPortalState.OFF ? 15 : 0;
}
@@ -131,6 +131,8 @@ public class BlockAltar extends BlockMod implements ILexiconable {
@Override
public int getLightValue(IBlockState state, IBlockAccess world, 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.hasLava) ? 15 : 0;
}
@@ -85,6 +85,9 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
TileEntity tile = world.getTileEntity(pos);
int currentLight = tile instanceof TileSpecialFlower ? ((TileSpecialFlower) tile).getLightValue() : -1;
if(currentLight == -1)
@@ -87,6 +87,8 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return state.getValue(BotaniaStateProps.LIVINGWOOD_VARIANT) == LivingWoodVariant.GLIMMERING ? 12 : 0;
}
@@ -171,6 +171,9 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
int currentLight = world.getTileEntity(pos) == null ? -1 : ((TileSpecialFlower) world.getTileEntity(pos)).getLightValue();
if(currentLight == -1)
currentLight = 0;
@@ -45,6 +45,8 @@ public class BlockBuriedPetals extends BlockModFlower {
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
}
@@ -161,6 +161,8 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable, IInfu
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
}
@@ -61,6 +61,8 @@ public class BlockManaFlame extends BlockMod implements ILexiconable {
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return ((TileManaFlame) world.getTileEntity(pos)).getLightColor();
}
@@ -119,6 +119,9 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
}
@@ -40,6 +40,9 @@ public class BlockSeaLamp extends BlockMod implements ILexiconable {
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return coloredLight == -1 ? (coloredLight = ColoredLightHelper.makeRGBLightValue(85, 136, 125, originalLight)) : coloredLight;
}
@@ -38,6 +38,9 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
return ColoredLightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), originalLight);
}