Fix spectral block lighting and make it full brightness
This commit is contained in:
@@ -11,7 +11,6 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
import net.minecraft.util.EnumBlockRenderType;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
@@ -34,26 +33,16 @@ public class BlockSpectral extends Block implements ITileEntityProvider {
|
|||||||
|
|
||||||
// Replaces getRenderBlockPass
|
// Replaces getRenderBlockPass
|
||||||
@Override
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public BlockRenderLayer getRenderLayer(){
|
public BlockRenderLayer getRenderLayer(){
|
||||||
return BlockRenderLayer.TRANSLUCENT;
|
return BlockRenderLayer.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// See BlockTransportationStone for what all these do
|
||||||
public EnumBlockRenderType getRenderType(IBlockState state){
|
@Override public boolean isFullCube(IBlockState state){ return false; }
|
||||||
return EnumBlockRenderType.MODEL;
|
@Override public boolean isBlockNormalCube(IBlockState state){ return false; }
|
||||||
}
|
@Override public boolean isNormalCube(IBlockState state){ return false; }
|
||||||
|
@Override public boolean isOpaqueCube(IBlockState state){ return false; }
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){
|
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
|
// // Overriden to make the block always look full brightness despite not emitting
|
||||||
// full light.
|
// // full light.
|
||||||
@Override
|
// @Override
|
||||||
public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos){
|
// public int getPackedLightmapCoords(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||||
return 15;
|
// return 15;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTileEntity(IBlockState state){
|
public boolean hasTileEntity(IBlockState state){
|
||||||
|
|||||||
@@ -62,12 +62,6 @@ public class BlockTransportationStone extends Block {
|
|||||||
return false;
|
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.
|
// ... and this one is for rendering.
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpaqueCube(IBlockState state){
|
public boolean isOpaqueCube(IBlockState state){
|
||||||
|
|||||||
@@ -282,6 +282,9 @@ public final class WizardryModels {
|
|||||||
if(location.getPath().contains("runestone") || location.getPath().contains("runestone_pedestal")){
|
if(location.getPath().contains("runestone") || location.getPath().contains("runestone_pedestal")){
|
||||||
IBakedModel original = event.getModelRegistry().getObject(location);
|
IBakedModel original = event.getModelRegistry().getObject(location);
|
||||||
event.getModelRegistry().putObject(location, new BakedModelGlowingOverlay(original, "overlay"));
|
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, "crystal_flower", new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F).setCreativeTab(WizardryTabs.WIZARDRY));
|
||||||
registerBlock(registry, "snare", new BlockSnare(Material.PLANTS).setHardness(0.0F));
|
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, "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, "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, "meteor", new Block(Material.ROCK).setLightLevel(1));
|
||||||
registerBlock(registry, "vanishing_cobweb", new BlockVanishingCobweb(Material.WEB).setLightOpacity(1).setHardness(4.0F));
|
registerBlock(registry, "vanishing_cobweb", new BlockVanishingCobweb(Material.WEB).setLightOpacity(1).setHardness(4.0F));
|
||||||
|
|||||||
Reference in New Issue
Block a user