mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 06:09:05 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -21,100 +21,99 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockCampfire extends BlockLightable{
|
||||
public class BlockCampfire extends BlockLightable {
|
||||
|
||||
public BlockCampfire(boolean lit) {
|
||||
public BlockCampfire(boolean lit) {
|
||||
super(Blocks.cobblestone, lit);
|
||||
setBlockBounds(0, 0, 0, 1, 0.5f, 1);
|
||||
if(lit)
|
||||
setLightLevel(0.9375F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileCampfire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
|
||||
ItemStack item = player.inventory.getCurrentItem();
|
||||
if(item == null)
|
||||
return true;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if((item.getItem() == Items.flint || item.getItem() == Items.flint_and_steel) && unlitBlock() == this){
|
||||
super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9);
|
||||
CustomNpcs.proxy.spawnParticle("largesmoke", x + 0.5f, y + 0.5f, z + 0.5f, 0.0D, 0.0D, 0.0D, 2);
|
||||
if(item.getItem() == Items.flint)
|
||||
NoppesUtilServer.consumeItemStack(1, player);
|
||||
else
|
||||
item.damageItem(1, player);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(item.getItem() == Item.getItemFromBlock(Blocks.sand) && litBlock() == this){
|
||||
super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9);
|
||||
}
|
||||
|
||||
return true;
|
||||
if (lit)
|
||||
setLightLevel(0.9375F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxRotation(){
|
||||
return 8;
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2) {
|
||||
return new TileCampfire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
|
||||
ItemStack item = player.inventory.getCurrentItem();
|
||||
if (item == null)
|
||||
return true;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if ((item.getItem() == Items.flint || item.getItem() == Items.flint_and_steel) && unlitBlock() == this) {
|
||||
super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9);
|
||||
CustomNpcs.proxy.spawnParticle("largesmoke", x + 0.5f, y + 0.5f, z + 0.5f, 0.0D, 0.0D, 0.0D, 2);
|
||||
if (item.getItem() == Items.flint)
|
||||
NoppesUtilServer.consumeItemStack(1, player);
|
||||
else
|
||||
item.damageItem(1, player);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (item.getItem() == Item.getItemFromBlock(Blocks.sand) && litBlock() == this) {
|
||||
super.onBlockActivated(world, x, y, z, player, par6, par7, par8, par9);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int maxRotation() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister){
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
this.blockIcon = par1IconRegister.registerIcon(this.getTextureName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int p_149691_1_, int meta){
|
||||
public IIcon getIcon(int p_149691_1_, int meta) {
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random){
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(meta == 1)
|
||||
return;
|
||||
if (meta == 1)
|
||||
return;
|
||||
|
||||
if(random.nextInt(36) == 0){
|
||||
world.playSound(x + 0.5F, y + 0.5F, z + 0.5F, "fire.fire", 1.0F + random.nextFloat(), 0.3F + random.nextFloat() * 0.7f , false);
|
||||
}
|
||||
if (random.nextInt(36) == 0) {
|
||||
world.playSound(x + 0.5F, y + 0.5F, z + 0.5F, "fire.fire", 1.0F + random.nextFloat(), 0.3F + random.nextFloat() * 0.7f, false);
|
||||
}
|
||||
|
||||
TileCampfire tile = (TileCampfire) world.getTileEntity(x, y, z);
|
||||
TileCampfire tile = (TileCampfire) world.getTileEntity(x, y, z);
|
||||
|
||||
float xOffset = 0.5f, yOffset = 0.7f, zOffset = 0.5f;
|
||||
float xOffset = 0.5f, yOffset = 0.7f, zOffset = 0.5f;
|
||||
|
||||
double d0 = (double)((float)x + xOffset);
|
||||
double d1 = (double)((float)y + yOffset);
|
||||
double d2 = (double)((float)z + zOffset);
|
||||
double d0 = (double) ((float) x + xOffset);
|
||||
double d1 = (double) ((float) y + yOffset);
|
||||
double d2 = (double) ((float) z + zOffset);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if(ConfigClient.LegacyCampfire){
|
||||
if (ConfigClient.LegacyCampfire) {
|
||||
CustomNpcs.proxy.spawnParticle("largesmoke", d0, d1, d2, 0.0D, 0.0D, 0.0D, 2);
|
||||
CustomNpcs.proxy.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D, 4);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tile.updateEntity();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block unlitBlock() {
|
||||
return CustomItems.campfire_unlit;
|
||||
}
|
||||
@Override
|
||||
public Block unlitBlock() {
|
||||
return CustomItems.campfire_unlit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block litBlock() {
|
||||
return CustomItems.campfire;
|
||||
}
|
||||
@Override
|
||||
public Block litBlock() {
|
||||
return CustomItems.campfire;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user