diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-03-04 12:58:47 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-03-04 12:58:47 +1000 |
commit | ae21012d216df71f31aed6fbc9d76215fc24ceed (patch) | |
tree | cc89accbe6ce5c04b72ed3c5e46b2a185f88be6a /src/Java/gtPlusPlus/core/block/general | |
parent | ba89972a22a316030f8c3bd99974f915b1d7aefc (diff) | |
download | GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.gz GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.bz2 GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.zip |
+ New texture for the slow builders ring.
+ Added the Alkalus Disk.
$ Fixed Frame Box Assembler Recipes.
$ Fixed Missing 7Li material.
$ Fixed Tiered Tanks not showing their capacity in the tooltip.
$ Fixed tooltips for alloys containing Bronze or Steel.
$ Fixed Clay Pipe Extruder Recipes.
- Removed a handful of Plasma cells for misc. materials.
% Changed the Industrial Coke Oven's tooltip, to better describe the input/output requirements.
% Cleaned up The Entire Project.
Diffstat (limited to 'src/Java/gtPlusPlus/core/block/general')
4 files changed, 461 insertions, 434 deletions
diff --git a/src/Java/gtPlusPlus/core/block/general/FirePit.java b/src/Java/gtPlusPlus/core/block/general/FirePit.java index 4dd58df6a4..cf24025124 100644 --- a/src/Java/gtPlusPlus/core/block/general/FirePit.java +++ b/src/Java/gtPlusPlus/core/block/general/FirePit.java @@ -1,13 +1,17 @@ package gtPlusPlus.core.block.general; import static net.minecraftforge.common.util.ForgeDirection.*; -import gtPlusPlus.core.block.base.BasicBlock; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import java.util.List; import java.util.Random; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.block.base.BasicBlock; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -19,10 +23,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class FirePit extends BasicBlock{ private static IIcon[] TEXTURE; @@ -40,44 +40,44 @@ public class FirePit extends BasicBlock{ GameRegistry.registerBlock(this, "blockFirePit"); LanguageRegistry.addName(this, "Fire Pit"); } - + @Override - public int tickRate(World aParWorld) { - return 30; - } - - @Override - public TileEntity createNewTileEntity(World world, int i) { - return new TileEntityFirepit(); - } - + public int tickRate(final World aParWorld) { + return 30; + } + + @Override + public TileEntity createNewTileEntity(final World world, final int i) { + return new TileEntityFirepit(); + } + @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister){ + public void registerBlockIcons(final IIconRegister par1IconRegister){ TEXTURE = new IIcon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")}; } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List){ + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List){ par3List.add(new ItemStack(par1, 1, 2)); } @Override - public void updateTick(World par1World, int x, int y, int z, Random par5Random){ + public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random){ if (!par1World.isRemote){ //Sets meta. - meta = par1World.getBlockMetadata(x, y, z); + this.meta = par1World.getBlockMetadata(x, y, z); //If Raining, Put out. - if (par1World.isRaining() - && (par1World.canLightningStrikeAt(x, y, z) - || par1World.canLightningStrikeAt(x - 1, y, z) - || par1World.canLightningStrikeAt(x + 1, y, z) - || par1World.canLightningStrikeAt(x, y, z - 1) - || par1World.canLightningStrikeAt(x, y, z + 1))){ + if (par1World.isRaining() + && (par1World.canLightningStrikeAt(x, y, z) + || par1World.canLightningStrikeAt(x - 1, y, z) + || par1World.canLightningStrikeAt(x + 1, y, z) + || par1World.canLightningStrikeAt(x, y, z - 1) + || par1World.canLightningStrikeAt(x, y, z + 1))){ //Fire goes out - par1World.setBlockMetadataWithNotify(x, y, z, 1, 4); - } + par1World.setBlockMetadataWithNotify(x, y, z, 1, 4); + } if (isNeighborBurning(par1World, x, y, z)){ //Fire can ignite from a nearby flame source. par1World.setBlockMetadataWithNotify(x, y, z, 2, 4); @@ -86,9 +86,9 @@ public class FirePit extends BasicBlock{ } @Override - public Item getItemDropped(int meta, Random par2Random, int par3){ + public Item getItemDropped(final int meta, final Random par2Random, final int par3){ switch (meta){ - case 0: + case 0: return null; default: break; @@ -97,20 +97,20 @@ public class FirePit extends BasicBlock{ } @Override - public int damageDropped(int meta){ + public int damageDropped(final int meta){ return meta; } - + @Override public boolean isOpaqueCube(){ - return false; - } + return false; + } @Override public int getRenderType(){ - return -1; - } - + return -1; + } + @Override @SideOnly(Side.CLIENT) public int getRenderBlockPass(){ @@ -121,7 +121,7 @@ public class FirePit extends BasicBlock{ public boolean renderAsNormalBlock(){ return false; } - + /*@Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aParWorld, int x, int y, int z){ return null; @@ -134,92 +134,95 @@ public class FirePit extends BasicBlock{ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_){ + public void randomDisplayTick(final World p_149734_1_, final int p_149734_2_, final int p_149734_3_, final int p_149734_4_, final Random p_149734_5_){ int l; float f; float f1; float f2; - if (meta == 2) - if (p_149734_5_.nextInt(24) == 0){ - p_149734_1_.playSound((double)((float)p_149734_2_ + 0.5F), (double)((float)p_149734_3_ + 0.5F), (double)((float)p_149734_4_ + 0.5F), "fire.fire", 1.0F + p_149734_5_.nextFloat(), p_149734_5_.nextFloat() * 0.7F + 0.3F, false); + if (this.meta == 2) { + if (p_149734_5_.nextInt(24) == 0){ + p_149734_1_.playSound(p_149734_2_ + 0.5F, p_149734_3_ + 0.5F, p_149734_4_ + 0.5F, "fire.fire", 1.0F + p_149734_5_.nextFloat(), (p_149734_5_.nextFloat() * 0.7F) + 0.3F, false); + } } - if (meta == 2) - if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)){ - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat() * 0.1F; - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (this.meta == 2) { + if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)){ + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + (p_149734_5_.nextFloat() * 0.1F); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)){ - for (l = 0; l < 2; ++l){ - f = (float)(p_149734_2_ + 1) - p_149734_5_.nextFloat() * 0.1F; - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + 1 - (p_149734_5_.nextFloat() * 0.1F); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat() * 0.1F; - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + (p_149734_5_.nextFloat() * 0.1F); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)(p_149734_4_ + 1) - p_149734_5_.nextFloat() * 0.1F; - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + 1 - (p_149734_5_.nextFloat() * 0.1F); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)(p_149734_3_ + 1) - p_149734_5_.nextFloat() * 0.1F; - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + 1 - (p_149734_5_.nextFloat() * 0.1F); + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } } - } - else{ - if (meta == 2) - for (l = 0; l < 3; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat() * 0.5F + 0.5F; - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + else{ + if (this.meta == 2) { + for (l = 0; l < 3; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + (p_149734_5_.nextFloat() * 0.5F) + 0.5F; + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } + } } } } - @SideOnly(Side.CLIENT) - public static IIcon getFireIcon(int p_149840_1_){ - return FirePit.TEXTURE[p_149840_1_]; - } + @SideOnly(Side.CLIENT) + public static IIcon getFireIcon(final int p_149840_1_){ + return FirePit.TEXTURE[p_149840_1_]; + } - @Override + @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149691_1_, int p_149691_2_){ - return FirePit.TEXTURE[0]; - } - - private static boolean isNeighborBurning(World world, int x, int y, int z){ - return canCatchFire(world, x + 1, y, z, WEST ) || - canCatchFire(world, x - 1, y, z, EAST ) || - canCatchFire(world, x, y - 1, z, UP ) || - canCatchFire(world, x, y + 1, z, DOWN ) || - canCatchFire(world, x, y, z - 1, SOUTH) || - canCatchFire(world, x, y, z + 1, NORTH); - } - - public static boolean canCatchFire(World world, int x, int y, int z, ForgeDirection face) - { - return world.getBlock(x, y, z).isFireSource(world, x, y, z, face); - } - + public IIcon getIcon(final int p_149691_1_, final int p_149691_2_){ + return FirePit.TEXTURE[0]; + } + + private static boolean isNeighborBurning(final World world, final int x, final int y, final int z){ + return canCatchFire(world, x + 1, y, z, WEST ) || + canCatchFire(world, x - 1, y, z, EAST ) || + canCatchFire(world, x, y - 1, z, UP ) || + canCatchFire(world, x, y + 1, z, DOWN ) || + canCatchFire(world, x, y, z - 1, SOUTH) || + canCatchFire(world, x, y, z + 1, NORTH); + } + + public static boolean canCatchFire(final World world, final int x, final int y, final int z, final ForgeDirection face) + { + return world.getBlock(x, y, z).isFireSource(world, x, y, z, face); + } + } diff --git a/src/Java/gtPlusPlus/core/block/general/LightGlass.java b/src/Java/gtPlusPlus/core/block/general/LightGlass.java index 5aa9f5b818..fd2d575158 100644 --- a/src/Java/gtPlusPlus/core/block/general/LightGlass.java +++ b/src/Java/gtPlusPlus/core/block/general/LightGlass.java @@ -1,29 +1,28 @@ package gtPlusPlus.core.block.general; +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; - -import java.util.Random; - import net.minecraft.block.BlockBreakable; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class LightGlass extends BlockBreakable { private int state = 0; - private int a = 255; + private final int a = 255; private int r = 255; private int g = 0; private int b = 0; private int hex; - public LightGlass(Material mat, boolean bool) + public LightGlass(final Material mat, final boolean bool) { super("blockMFEffect", mat, bool); this.setCreativeTab(AddToCreativeTab.tabBlock); @@ -38,7 +37,7 @@ public class LightGlass extends BlockBreakable * Returns the quantity of items to drop on block destruction. */ @Override - public int quantityDropped(Random rand) + public int quantityDropped(final Random rand) { return 0; } @@ -73,47 +72,53 @@ public class LightGlass extends BlockBreakable @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iIcon) + public void registerBlockIcons(final IIconRegister iIcon) { this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect"); } @Override //http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { - if(state == 0){ - g++; - if(g == 255) - state = 1; + if(this.state == 0){ + this.g++; + if(this.g == 255) { + this.state = 1; + } } - if(state == 1){ - r--; - if(r == 0) - state = 2; + if(this.state == 1){ + this.r--; + if(this.r == 0) { + this.state = 2; + } } - if(state == 2){ - b++; - if(b == 255) - state = 3; + if(this.state == 2){ + this.b++; + if(this.b == 255) { + this.state = 3; + } } - if(state == 3){ - g--; - if(g == 0) - state = 4; + if(this.state == 3){ + this.g--; + if(this.g == 0) { + this.state = 4; + } } - if(state == 4){ - r++; - if(r == 255) - state = 5; + if(this.state == 4){ + this.r++; + if(this.r == 255) { + this.state = 5; + } } - if(state == 5){ - b--; - if(b == 0) - state = 0; + if(this.state == 5){ + this.b--; + if(this.b == 0) { + this.state = 0; + } } - hex = (a << 24) + (r << 16) + (g << 8) + (b); - return hex; + this.hex = (this.a << 24) + (this.r << 16) + (this.g << 8) + (this.b); + return this.hex; } /** @@ -121,8 +126,8 @@ public class LightGlass extends BlockBreakable */ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, int posX, int posY, int posZ, Random random){ + public void randomDisplayTick(final World world, final int posX, final int posY, final int posZ, final Random random){ Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud"); - + } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java index 7fa890b6c8..8ac4e2df8d 100644 --- a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java +++ b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java @@ -1,14 +1,16 @@ package gtPlusPlus.core.block.general.antigrief; import static gtPlusPlus.core.block.ModBlocks.blockGriefSaver; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.general.TileEntityReverter; -import gtPlusPlus.core.util.Utils; import java.util.List; import java.util.Random; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.general.TileEntityReverter; +import gtPlusPlus.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -23,254 +25,267 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class TowerDevice extends Block { - private static IIcon TEX_ANTIBUILDER; - public static final int META_ANTIBUILDER = 9; - private boolean bUnbreakable; - - public TowerDevice() - { - super(Material.wood); - setHardness(10.0F); - setResistance(35.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(AddToCreativeTab.tabMachines); - } - - public int tickRate() - { - return 15; - } - - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("bUnbreakable", bUnbreakable); + private static IIcon TEX_ANTIBUILDER; + public static final int META_ANTIBUILDER = 9; + private boolean bUnbreakable; + + public TowerDevice() + { + super(Material.wood); + this.setHardness(10.0F); + this.setResistance(35.0F); + this.setStepSound(Block.soundTypeWood); + this.setCreativeTab(AddToCreativeTab.tabMachines); + } + + public int tickRate() + { + return 15; + } + + public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setBoolean("bUnbreakable", this.bUnbreakable); + } + + public void loadNBTData(final NBTTagCompound aNBT) { + this.bUnbreakable = aNBT.getBoolean("bUnbreakable"); + } + + @Override + public IIcon getIcon(final int side, final int meta) + { + return TEX_ANTIBUILDER; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) + { + TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief"); + } + + @Override + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) + { + par3List.add(new ItemStack(par1, 1, 9)); + } + + @Override + public boolean onBlockActivated(final World par1World, final int x, final int y, final int z, final EntityPlayer par5EntityPlayer, final int par6, final float par7, final float par8, final float par9) + { + final int meta = par1World.getBlockMetadata(x, y, z); + return false; + } + + @Override + public float getExplosionResistance(final Entity par1Entity, final World world, final int x, final int y, final int z, final double explosionX, final double explosionY, final double explosionZ) + { + final int meta = world.getBlockMetadata(x, y, z); + return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); + } + + @Override + public float getBlockHardness(final World world, final int x, final int y, final int z) + { + final int meta = world.getBlockMetadata(x, y, z); + return super.getBlockHardness(world, x, y, z); + } + + public static boolean areNearbyLockBlocks(final World world, final int x, final int y, final int z) + { + boolean locked = false; + for (int dx = x - 2; dx <= (x + 2); dx++) { + for (int dy = y - 2; dy <= (y + 2); dy++) { + for (int dz = z - 2; dz <= (z + 2); dz++) { + if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) { + locked = true; + } + } + } + } + return locked; + } + + public static void unlockBlock(final World par1World, final int x, final int y, final int z) + { + final Block thereBlockID = par1World.getBlock(x, y, z); + final int thereBlockMeta = par1World.getBlockMetadata(x, y, z); + if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4)) + { + changeToBlockMeta(par1World, x, y, z, 5); + par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F); + } + } + + private static void changeToBlockMeta(final World par1World, final int x, final int y, final int z, final int meta) + { + final Block thereBlockID = par1World.getBlock(x, y, z); + if ((thereBlockID == blockGriefSaver)) + { + par1World.setBlock(x, y, z, thereBlockID, meta, 3); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID); + } + } + + @Override + public void onBlockAdded(final World par1World, final int x, final int y, final int z) + { + final int meta = par1World.getBlockMetadata(x, y, z); + if (!par1World.isRemote) { + + } + } + + @Override + public void onNeighborBlockChange(final World par1World, final int x, final int y, final int z, final Block myBlockID) + { + final int meta = par1World.getBlockMetadata(x, y, z); + if (!par1World.isRemote) + { + + } + } + + @Override + public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) + { + if (!par1World.isRemote) + { + final int meta = par1World.getBlockMetadata(x, y, z); + } + } + + private void letsBuild(final World par1World, final int x, final int y, final int z) + { + + } + + private boolean isInactiveTrapCharged(final World par1World, final int x, final int y, final int z) + { + return false; + } + + private boolean isReactorReady(final World world, final int x, final int y, final int z) + { + if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) || + (world.getBlock(x, y - 1, z) != Blocks.redstone_block) || + (world.getBlock(x + 1, y, z) != Blocks.redstone_block) || + (world.getBlock(x - 1, y, z) != Blocks.redstone_block) || + (world.getBlock(x, y, z + 1) != Blocks.redstone_block) || + (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) { + return false; + } + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(final World par1World, final int x, final int y, final int z, final Random par5Random) + { + final int meta = par1World.getBlockMetadata(x, y, z); + if ((meta == 3) || (meta == 1) || (meta == 9)) { + for (int i = 0; i < 1; i++) { + this.sparkle(par1World, x, y, z, par5Random); + } + } + } + + public void sparkle(final World world, final int x, final int y, final int z, final Random rand) + { + final double offset = 0.0625D; + for (int side = 0; side < 6; side++) + { + double rx = x + rand.nextFloat(); + double ry = y + rand.nextFloat(); + double rz = z + rand.nextFloat(); + if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) { + ry = y + 1 + offset; + } + if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) { + ry = (y + 0) - offset; + } + if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) { + rz = z + 1 + offset; + } + if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) { + rz = (z + 0) - offset; + } + if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) { + rx = x + 1 + offset; + } + if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) { + rx = (x + 0) - offset; + } + if ((rx < x) || (rx > (x + 1)) || (ry < 0.0D) || (ry > (y + 1)) || (rz < z) || (rz > (z + 1))) { + world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D); + } + } + } + + public static void checkAndActivateVanishBlock(final World world, final int x, final int y, final int z) + { + final Block thereID = world.getBlock(x, y, z); + final int thereMeta = world.getBlockMetadata(x, y, z); + } + + public static void changeToActiveVanishBlock(final World par1World, final int x, final int y, final int z, final int meta) + { + changeToBlockMeta(par1World, x, y, z, meta); + par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F); + + final Block thereBlockID = par1World.getBlock(x, y, z); + par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand)); + } + + private static int getTickRateFor(final Block thereBlockID, final int meta, final Random rand) + { + return 15; + } + + @Override + public int getLightValue(final IBlockAccess world, final int x, final int y, final int z) + { + final Block blockID = world.getBlock(x, y, z); + final int meta = world.getBlockMetadata(x, y, z); + if (blockID != this) { + return 0; + } + return 10; + } + + @Override + public boolean hasTileEntity(final int metadata) + { + return (metadata == 0); + } + + @Override + public TileEntity createTileEntity(final World world, final int metadata) + { + if (metadata == 0) { + Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); + return new TileEntityReverter(); + } + return null; + } + + @Override + public Item getItemDropped(final int meta, final Random par2Random, final int par3) + { + switch (meta) + { + case 0: + return null; + } + return Item.getItemFromBlock(this); } - public void loadNBTData(NBTTagCompound aNBT) { - bUnbreakable = aNBT.getBoolean("bUnbreakable"); + @Override + public int damageDropped(final int meta) + { + return meta; } - - public IIcon getIcon(int side, int meta) - { - return TEX_ANTIBUILDER; - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief"); - } - - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(par1, 1, 9)); - } - - public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) - { - int meta = par1World.getBlockMetadata(x, y, z); - return false; - } - - public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) - { - int meta = world.getBlockMetadata(x, y, z); - return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); - } - - public float getBlockHardness(World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - return super.getBlockHardness(world, x, y, z); - } - - public static boolean areNearbyLockBlocks(World world, int x, int y, int z) - { - boolean locked = false; - for (int dx = x - 2; dx <= x + 2; dx++) { - for (int dy = y - 2; dy <= y + 2; dy++) { - for (int dz = z - 2; dz <= z + 2; dz++) { - if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) { - locked = true; - } - } - } - } - return locked; - } - - public static void unlockBlock(World par1World, int x, int y, int z) - { - Block thereBlockID = par1World.getBlock(x, y, z); - int thereBlockMeta = par1World.getBlockMetadata(x, y, z); - if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4)) - { - changeToBlockMeta(par1World, x, y, z, 5); - par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F); - } - } - - private static void changeToBlockMeta(World par1World, int x, int y, int z, int meta) - { - Block thereBlockID = par1World.getBlock(x, y, z); - if ((thereBlockID == blockGriefSaver)) - { - par1World.setBlock(x, y, z, thereBlockID, meta, 3); - par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); - par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID); - } - } - - public void onBlockAdded(World par1World, int x, int y, int z) - { - int meta = par1World.getBlockMetadata(x, y, z); - if (!par1World.isRemote) { - - } - } - - public void onNeighborBlockChange(World par1World, int x, int y, int z, Block myBlockID) - { - int meta = par1World.getBlockMetadata(x, y, z); - if (!par1World.isRemote) - { - - } - } - - public void updateTick(World par1World, int x, int y, int z, Random par5Random) - { - if (!par1World.isRemote) - { - int meta = par1World.getBlockMetadata(x, y, z); - } - } - - private void letsBuild(World par1World, int x, int y, int z) - { - - } - - private boolean isInactiveTrapCharged(World par1World, int x, int y, int z) - { - return false; - } - - private boolean isReactorReady(World world, int x, int y, int z) - { - if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) || - (world.getBlock(x, y - 1, z) != Blocks.redstone_block) || - (world.getBlock(x + 1, y, z) != Blocks.redstone_block) || - (world.getBlock(x - 1, y, z) != Blocks.redstone_block) || - (world.getBlock(x, y, z + 1) != Blocks.redstone_block) || - (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) { - return false; - } - return true; - } - - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int x, int y, int z, Random par5Random) - { - int meta = par1World.getBlockMetadata(x, y, z); - if ((meta == 3) || (meta == 1) || (meta == 9)) { - for (int i = 0; i < 1; i++) { - sparkle(par1World, x, y, z, par5Random); - } - } - } - - public void sparkle(World world, int x, int y, int z, Random rand) - { - double offset = 0.0625D; - for (int side = 0; side < 6; side++) - { - double rx = x + rand.nextFloat(); - double ry = y + rand.nextFloat(); - double rz = z + rand.nextFloat(); - if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) { - ry = y + 1 + offset; - } - if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) { - ry = y + 0 - offset; - } - if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) { - rz = z + 1 + offset; - } - if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) { - rz = z + 0 - offset; - } - if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) { - rx = x + 1 + offset; - } - if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) { - rx = x + 0 - offset; - } - if ((rx < x) || (rx > x + 1) || (ry < 0.0D) || (ry > y + 1) || (rz < z) || (rz > z + 1)) { - world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D); - } - } - } - - public static void checkAndActivateVanishBlock(World world, int x, int y, int z) - { - Block thereID = world.getBlock(x, y, z); - int thereMeta = world.getBlockMetadata(x, y, z); - } - - public static void changeToActiveVanishBlock(World par1World, int x, int y, int z, int meta) - { - changeToBlockMeta(par1World, x, y, z, meta); - par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F); - - Block thereBlockID = par1World.getBlock(x, y, z); - par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand)); - } - - private static int getTickRateFor(Block thereBlockID, int meta, Random rand) - { - return 15; - } - - public int getLightValue(IBlockAccess world, int x, int y, int z) - { - Block blockID = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - if (blockID != this) { - return 0; - } - return 10; - } - - public boolean hasTileEntity(int metadata) - { - return (metadata == 0); - } - - public TileEntity createTileEntity(World world, int metadata) - { - if (metadata == 0) { - Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); - return new TileEntityReverter(); - } - return null; - } - - public Item getItemDropped(int meta, Random par2Random, int par3) - { - switch (meta) - { - case 0: - return null; - } - return Item.getItemFromBlock(this); - } - - public int damageDropped(int meta) - { - return meta; - } } diff --git a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java index 6096da7054..9d80072b61 100644 --- a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java +++ b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.block.general.fluids; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import net.minecraft.block.material.Material; @@ -9,43 +11,45 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockFluidJackDaniels extends BlockFluidClassic { - @SideOnly(Side.CLIENT) - protected IIcon stillIcon; - @SideOnly(Side.CLIENT) - protected IIcon flowingIcon; - - public BlockFluidJackDaniels(Fluid fluid, Material material) { - super(fluid, material); - setCreativeTab(AddToCreativeTab.tabMisc); - } - - @Override - public IIcon getIcon(int side, int meta) { - return (side == 0 || side == 1)? stillIcon : flowingIcon; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister register) { - stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); - flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); - } - - @Override - public boolean canDisplace(IBlockAccess world, int x, int y, int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; - return super.canDisplace(world, x, y, z); - } - - @Override - public boolean displaceIfPossible(World world, int x, int y, int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; - return super.displaceIfPossible(world, x, y, z); - } - -} + @SideOnly(Side.CLIENT) + protected IIcon stillIcon; + @SideOnly(Side.CLIENT) + protected IIcon flowingIcon; + + public BlockFluidJackDaniels(final Fluid fluid, final Material material) { + super(fluid, material); + this.setCreativeTab(AddToCreativeTab.tabMisc); + } + + @Override + public IIcon getIcon(final int side, final int meta) { + return ((side == 0) || (side == 1))? this.stillIcon : this.flowingIcon; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(final IIconRegister register) { + this.stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); + this.flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); + } + + @Override + public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) { + return false; + } + return super.canDisplace(world, x, y, z); + } + + @Override + public boolean displaceIfPossible(final World world, final int x, final int y, final int z) { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) { + return false; + } + return super.displaceIfPossible(world, x, y, z); + } + +} |