Fix spectral block lighting and make it full brightness

This commit is contained in:
Electroblob77
2019-09-03 17:18:20 +01:00
parent a6c24e9cb6
commit fbecce0543
4 changed files with 16 additions and 30 deletions
@@ -11,7 +11,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@@ -34,26 +33,16 @@ public class BlockSpectral extends Block implements ITileEntityProvider {
// Replaces getRenderBlockPass
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getRenderLayer(){
return BlockRenderLayer.TRANSLUCENT;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state){
return EnumBlockRenderType.MODEL;
}
// Apparently it's OK to override this, despite it being deprecated. More importantly, it being deprecated is not
// Forge's doing, rather it is Mojang themselves misusing the @Deprecated annotation to mean 'internal, don't call'.
@Override
public boolean isOpaqueCube(IBlockState state){
return false;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos){
return false;
}
// See BlockTransportationStone for what all these do
@Override public boolean isFullCube(IBlockState state){ return false; }
@Override public boolean isBlockNormalCube(IBlockState state){ return false; }
@Override public boolean isNormalCube(IBlockState state){ return false; }
@Override public boolean isOpaqueCube(IBlockState state){ return false; }
@Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){
@@ -67,12 +56,12 @@ public class BlockSpectral extends Block implements ITileEntityProvider {
}
}
// Overriden to make the block always look full brightness despite not emitting
// full light.
@Override
public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos){
return 15;
}
// // Overriden to make the block always look full brightness despite not emitting
// // full light.
// @Override
// public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos){
// return 15;
// }
@Override
public boolean hasTileEntity(IBlockState state){
@@ -62,12 +62,6 @@ public class BlockTransportationStone extends Block {
return false;
}
// Forge version of the above method. I still need to override both though because vanilla uses the other one.
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos){
return false;
}
// ... and this one is for rendering.
@Override
public boolean isOpaqueCube(IBlockState state){
@@ -282,6 +282,9 @@ public final class WizardryModels {
if(location.getPath().contains("runestone") || location.getPath().contains("runestone_pedestal")){
IBakedModel original = event.getModelRegistry().getObject(location);
event.getModelRegistry().putObject(location, new BakedModelGlowingOverlay(original, "overlay"));
}else if(location.getPath().contains("spectral_block")){
IBakedModel original = event.getModelRegistry().getObject(location);
event.getModelRegistry().putObject(location, new BakedModelGlowingOverlay(original, "spectral_block"));
}
}
}
@@ -86,7 +86,7 @@ public final class WizardryBlocks {
registerBlock(registry, "crystal_flower", new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F).setCreativeTab(WizardryTabs.WIZARDRY));
registerBlock(registry, "snare", new BlockSnare(Material.PLANTS).setHardness(0.0F));
registerBlock(registry, "transportation_stone", new BlockTransportationStone(Material.ROCK).setHardness(0.3F).setLightLevel(0.5f).setLightOpacity(0).setCreativeTab(WizardryTabs.WIZARDRY));
registerBlock(registry, "spectral_block", new BlockSpectral(Material.GLASS).setLightLevel(0.7f).setLightOpacity(0).setBlockUnbreakable().setResistance(6000000.0F));
registerBlock(registry, "spectral_block", new BlockSpectral(Material.GLASS).setLightOpacity(1).setBlockUnbreakable().setResistance(6000000.0F));
registerBlock(registry, "crystal_block", new BlockCrystal(Material.IRON).setHardness(5.0F).setResistance(10.0F).setCreativeTab(WizardryTabs.WIZARDRY));
registerBlock(registry, "meteor", new Block(Material.ROCK).setLightLevel(1));
registerBlock(registry, "vanishing_cobweb", new BlockVanishingCobweb(Material.WEB).setLightOpacity(1).setHardness(4.0F));