Complete Candle Texture + Lantern 2D Texture

This commit is contained in:
Kam committed 2025-02-12 16:46:42 -05:00
1 parent 0a04560243
commit 4905b9400a
15 files changed
+413 -86

No files matched your search

@@ -3,6 +3,7 @@ package noppes.npcs.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@@ -15,18 +16,18 @@ import noppes.npcs.blocks.tiles.TileColorable;
import java.util.Random;
public class BlockCandle extends BlockLightable{
public BlockCandle(boolean lit) {
super(Blocks.planks, lit);
super(Blocks.stone, lit);
setBlockBounds(0.3f, 0, 0.3f, 0.7f, 0.5f, 0.7f);
}
}
@Override
public int maxRotation(){
return 8;
}
@Override
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){
TileEntity tileentity = world.getTileEntity(x, y, z);
if(!(tileentity instanceof TileColorable)){
@@ -45,23 +46,23 @@ public class BlockCandle extends BlockLightable{
xOffset = 0.2f;
else if(tile.rotation == 2)
xOffset = -0.2f;
setBlockBounds(0.2f + xOffset, 0.4f, 0.2f + yOffset, 0.8f + xOffset, 0.9f, 0.8f + yOffset);
}
else if(tile.color == 1)
setBlockBounds(0.1f, 0.1f, 0.1f, 0.9f, 0.8f, 0.9f);
else
setBlockBounds(0.3f, 0, 0.3f, 0.7f, 0.5f, 0.7f);
}
@Override
@Override
public int onBlockPlaced(World world, int x, int y, int z, int side, float p_149660_6_, float p_149660_7_, float p_149660_8_, int meta){
return side;
}
@Override
@Override
public void onPostBlockPlaced(World world, int x, int y, int z, int meta) {
TileCandle tile = (TileCandle) world.getTileEntity(x, y, z);
if(meta == 1)
@@ -81,10 +82,16 @@ public class BlockCandle extends BlockLightable{
}
world.setBlockMetadataWithNotify(x, y, z, 0, 4);
}
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister par1IconRegister){
this.blockIcon = par1IconRegister.registerIcon(this.getTextureName());
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int meta){
return Blocks.soul_sand.getIcon(p_149691_1_, meta);
return this.blockIcon;
}
@Override
@@ -97,18 +104,18 @@ public class BlockCandle extends BlockLightable{
if(this == unlitBlock())
return;
TileCandle tile = (TileCandle) world.getTileEntity(x, y, z);
if(tile.color == 1){
if(tile.rotation % 2 == 0){
world.spawnParticle("smoke", x + 0.5f, y + 0.66f, z + 0.13f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", x + 0.5f, y + 0.65f, z + 0.13f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + 0.5f, y + 0.66f, z + 0.87f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", x + 0.5f, y + 0.65f, z + 0.87f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + 0.13f, y + 0.66f, z + 0.5f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", x + 0.13f, y + 0.65f, z + 0.5f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + 0.87f, y + 0.66f, z + 0.5f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", x + 0.87f, y + 0.65f, z + 0.5f, 0.0D, 0.0D, 0.0D);
}
@@ -125,11 +132,11 @@ public class BlockCandle extends BlockLightable{
world.spawnParticle("smoke", x + 0.76f, y + 0.66f, z + 0.24f, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", x + 0.76f, y + 0.65f, z + 0.24f, 0.0D, 0.0D, 0.0D);
}
}
else{
float xOffset = 0.5f, yOffset = 0.45f, zOffset = 0.5f;
if(tile.color == 2){
yOffset = 1.05f;
if(tile.rotation == 0)
@@ -144,7 +151,7 @@ public class BlockCandle extends BlockLightable{
double d0 = (double)((float)x + xOffset);
double d1 = (double)((float)y + yOffset);
double d2 = (double)((float)z + zOffset);
world.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
@@ -3,6 +3,7 @@ package noppes.npcs.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@@ -77,10 +78,16 @@ public class BlockLantern extends BlockLightable{
world.setBlockMetadataWithNotify(x, y, z, 0, 4);
}
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister par1IconRegister){
this.blockIcon = par1IconRegister.registerIcon(this.getTextureName());
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int meta){
return Blocks.soul_sand.getIcon(p_149691_1_, meta);
return this.blockIcon;
}
@Override