aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/tileentities/general
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
commitae21012d216df71f31aed6fbc9d76215fc24ceed (patch)
treecc89accbe6ce5c04b72ed3c5e46b2a185f88be6a /src/Java/gtPlusPlus/core/tileentities/general
parentba89972a22a316030f8c3bd99974f915b1d7aefc (diff)
downloadGT5-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/tileentities/general')
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java22
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java88
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java113
3 files changed, 112 insertions, 111 deletions
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
index 0f2cd3390e..49fde8ee64 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFirepit.java
@@ -6,34 +6,34 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public class TileEntityFirepit extends TileEntity{
-
+
private UUID ownerUUID;
public UUID getOwnerUUID() {
- return ownerUUID;
+ return this.ownerUUID;
}
- public void setOwnerUUID(UUID ownerUUID) {
+ public void setOwnerUUID(final UUID ownerUUID) {
this.ownerUUID = ownerUUID;
- markDirty();
+ this.markDirty();
}
@Override
- public void writeToNBT(NBTTagCompound tagCompound) {
+ public void writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
- UUID ownerUUID = getOwnerUUID();
+ final UUID ownerUUID = this.getOwnerUUID();
if (ownerUUID != null){
- tagCompound.setLong("OwnerUUIDMost", ownerUUID.getMostSignificantBits());
- tagCompound.setLong("OwnerUUIDLeast", ownerUUID.getLeastSignificantBits());
+ tagCompound.setLong("OwnerUUIDMost", ownerUUID.getMostSignificantBits());
+ tagCompound.setLong("OwnerUUIDLeast", ownerUUID.getLeastSignificantBits());
}
}
@Override
- public void readFromNBT(NBTTagCompound tagCompound) {
+ public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
- setOwnerUUID(new UUID(tagCompound.getLong("OwnerUUIDMost"), tagCompound.getLong("OwnerUUIDLeast")));
+ this.setOwnerUUID(new UUID(tagCompound.getLong("OwnerUUIDMost"), tagCompound.getLong("OwnerUUIDLeast")));
}
-
+
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
index 5d07020bf3..e003de4392 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
@@ -1,7 +1,7 @@
package gtPlusPlus.core.tileentities.general;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.inventories.*;
+import gtPlusPlus.core.inventories.InventoryFishTrap;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
@@ -16,7 +16,7 @@ public class TileEntityFishTrap extends TileEntity{
private int tickCount = 0;
private boolean isInWater = false;
- private InventoryFishTrap inventoryContents;
+ private final InventoryFishTrap inventoryContents;
private int locationX;
private int locationY;
private int locationZ;
@@ -25,38 +25,38 @@ public class TileEntityFishTrap extends TileEntity{
public TileEntityFishTrap(){
this.inventoryContents = new InventoryFishTrap();//number of slots - without product slot
- setTileLocation();
+ this.setTileLocation();
}
public boolean setTileLocation(){
if (this.hasWorldObj()){
if (!this.getWorldObj().isRemote){
- locationX = this.xCoord;
- locationY = this.yCoord;
- locationZ = this.zCoord;
+ this.locationX = this.xCoord;
+ this.locationY = this.yCoord;
+ this.locationZ = this.zCoord;
return true;
}
}
- return false;
+ return false;
}
public final boolean isSurroundedByWater(){
- setTileLocation();
- Block[] surroundingBlocks = new Block[6];
+ this.setTileLocation();
+ final Block[] surroundingBlocks = new Block[6];
if (this.hasWorldObj()){
if (!this.getWorldObj().isRemote){
- surroundingBlocks[0] = worldObj.getBlock(locationX, locationY+1, locationZ); //Above
- surroundingBlocks[1] = worldObj.getBlock(locationX, locationY-1, locationZ); //Below
- surroundingBlocks[2] = worldObj.getBlock(locationX+1, locationY, locationZ);
- surroundingBlocks[3] = worldObj.getBlock(locationX-1, locationY, locationZ);
- surroundingBlocks[4] = worldObj.getBlock(locationX, locationY, locationZ+1);
- surroundingBlocks[5] = worldObj.getBlock(locationX, locationY, locationZ-1);
+ surroundingBlocks[0] = this.worldObj.getBlock(this.locationX, this.locationY+1, this.locationZ); //Above
+ surroundingBlocks[1] = this.worldObj.getBlock(this.locationX, this.locationY-1, this.locationZ); //Below
+ surroundingBlocks[2] = this.worldObj.getBlock(this.locationX+1, this.locationY, this.locationZ);
+ surroundingBlocks[3] = this.worldObj.getBlock(this.locationX-1, this.locationY, this.locationZ);
+ surroundingBlocks[4] = this.worldObj.getBlock(this.locationX, this.locationY, this.locationZ+1);
+ surroundingBlocks[5] = this.worldObj.getBlock(this.locationX, this.locationY, this.locationZ-1);
int waterCount = 0;
int trapCount = 0;
- for (Block checkBlock : surroundingBlocks){
- if (checkBlock == Blocks.water || checkBlock == Blocks.flowing_water || checkBlock.getUnlocalizedName().toLowerCase().contains("water") || checkBlock == ModBlocks.blockFishTrap){
+ for (final Block checkBlock : surroundingBlocks){
+ if ((checkBlock == Blocks.water) || (checkBlock == Blocks.flowing_water) || checkBlock.getUnlocalizedName().toLowerCase().contains("water") || (checkBlock == ModBlocks.blockFishTrap)){
if (checkBlock != ModBlocks.blockFishTrap){
- waterCount++;
+ waterCount++;
}
else {
waterCount++;
@@ -64,11 +64,11 @@ public class TileEntityFishTrap extends TileEntity{
}
}
}
- if (waterCount >= 2 && trapCount <= 4){
+ if ((waterCount >= 2) && (trapCount <= 4)){
this.waterSides = waterCount;
return true;
}
- else if (waterCount >= 2 && trapCount > 4){
+ else if ((waterCount >= 2) && (trapCount > 4)){
Utils.LOG_INFO("Too many fish traps surrounding this one.");
Utils.LOG_INFO("Not adding Loot to the fishtrap at x["+this.locationX+"] y["+this.locationY+"] z["+this.locationZ+"] (Ticking for loot every "+this.baseTickRate+" ticks)");
}
@@ -85,8 +85,8 @@ public class TileEntityFishTrap extends TileEntity{
public boolean tryAddLoot(){
if (this.getInventory().getInventory() != null){
int checkingSlot = 0;
- ItemStack loot = generateLootForFishTrap();
- for (ItemStack contents : this.getInventory().getInventory()){
+ final ItemStack loot = this.generateLootForFishTrap();
+ for (final ItemStack contents : this.getInventory().getInventory()){
if (contents == null){
this.getInventory().setInventorySlotContents(checkingSlot, loot);
this.markDirty();
@@ -115,10 +115,10 @@ public class TileEntityFishTrap extends TileEntity{
}
private ItemStack generateLootForFishTrap() {
- int lootWeight = MathUtils.randInt(0, 100);
+ final int lootWeight = MathUtils.randInt(0, 100);
ItemStack loot;
if (lootWeight <= 10){
- loot = ItemUtils.getSimpleStack(Items.slime_ball);
+ loot = ItemUtils.getSimpleStack(Items.slime_ball);
}
else if (lootWeight <= 20){
loot = ItemUtils.getSimpleStack(Items.bone);
@@ -144,29 +144,29 @@ public class TileEntityFishTrap extends TileEntity{
this.tickCount++;
//Utils.LOG_INFO("Ticking "+this.tickCount);
//Check if the Tile is within water once per second.
- if (this.tickCount%20==0){
- this.isInWater = isSurroundedByWater();
+ if ((this.tickCount%20)==0){
+ this.isInWater = this.isSurroundedByWater();
}
else {
}
-
+
if (this.isInWater){
- calculateTickrate();
+ this.calculateTickrate();
}
-
+
//Try add some loot once every 30 seconds.
- if (this.tickCount%this.baseTickRate==0){
+ if ((this.tickCount%this.baseTickRate)==0){
if (this.isInWater){
//Add loot
Utils.LOG_INFO("Adding Loot to the fishtrap at x["+this.locationX+"] y["+this.locationY+"] z["+this.locationZ+"] (Ticking for loot every "+this.baseTickRate+" ticks)");
- tryAddLoot();
- markDirty();
- }
+ this.tryAddLoot();
+ this.markDirty();
+ }
else {
Utils.LOG_INFO("This Trap does not have enough water around it.");
Utils.LOG_INFO("Not adding Loot to the fishtrap at x["+this.locationX+"] y["+this.locationY+"] z["+this.locationZ+"] (Ticking for loot every "+this.baseTickRate+" ticks)");
- markDirty();
+ this.markDirty();
}
this.tickCount = 0;
}
@@ -177,21 +177,21 @@ public class TileEntityFishTrap extends TileEntity{
}
}
-
+
public void calculateTickrate(){
int calculateTickrate = 0;
if (this.waterSides < 2){
calculateTickrate = 0;
}
- else if (this.waterSides >= 2 && this.waterSides < 4){
+ else if ((this.waterSides >= 2) && (this.waterSides < 4)){
calculateTickrate = 3000;
}
- else if (this.waterSides >= 4 && this.waterSides < 6){
+ else if ((this.waterSides >= 4) && (this.waterSides < 6)){
calculateTickrate = 2000;
}
else if (this.waterSides == 6){
calculateTickrate = 900;
- }
+ }
this.baseTickRate = calculateTickrate;
}
@@ -199,7 +199,7 @@ public class TileEntityFishTrap extends TileEntity{
return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, 32) != null;
}
- public NBTTagCompound getTag(NBTTagCompound nbt, String tag){
+ public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag){
if(!nbt.hasKey(tag)){
nbt.setTag(tag, new NBTTagCompound());
}
@@ -208,19 +208,19 @@ public class TileEntityFishTrap extends TileEntity{
@Override
- public void writeToNBT(NBTTagCompound nbt){
+ public void writeToNBT(final NBTTagCompound nbt){
super.writeToNBT(nbt);
//Utils.LOG_INFO("Trying to write NBT data to TE.");
- NBTTagCompound chestData = new NBTTagCompound();
- inventoryContents.writeToNBT(chestData);
+ final NBTTagCompound chestData = new NBTTagCompound();
+ this.inventoryContents.writeToNBT(chestData);
nbt.setTag("ContentsChest", chestData);
}
@Override
- public void readFromNBT(NBTTagCompound nbt){
+ public void readFromNBT(final NBTTagCompound nbt){
super.readFromNBT(nbt);
//Utils.LOG_INFO("Trying to read NBT data from TE.");
- inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
+ this.inventoryContents.readFromNBT(nbt.getCompoundTag("ContentsChest"));
}
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
index 8767b6607c..7f5c0ed8da 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
@@ -1,9 +1,8 @@
package gtPlusPlus.core.tileentities.general;
-import gtPlusPlus.core.block.ModBlocks;
-
import java.util.Random;
+import gtPlusPlus.core.block.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
@@ -14,7 +13,7 @@ public class TileEntityReverter extends TileEntity
{
private static final int REVERT_CHANCE = 10;
public int radius = 16;
- public int diameter = 8 * this.radius + 4;
+ public int diameter = (8 * this.radius) + 4;
public double requiredPlayerRange = 64.0D;
public Random rand = new Random();
private int tickCount;
@@ -23,38 +22,40 @@ public class TileEntityReverter extends TileEntity
private Block[] blockData;
private byte[] metaData;
+ @Override
public boolean canUpdate(){
return true;
}
+ @Override
public void updateEntity()
{
- if (anyPlayerInRange())
+ if (this.anyPlayerInRange())
{
this.tickCount += 1;
if (this.worldObj.isRemote)
{
- double var1 = this.xCoord + this.worldObj.rand.nextFloat();
- double var3 = this.yCoord + this.worldObj.rand.nextFloat();
- double var5 = this.zCoord + this.worldObj.rand.nextFloat();
+ final double var1 = this.xCoord + this.worldObj.rand.nextFloat();
+ final double var3 = this.yCoord + this.worldObj.rand.nextFloat();
+ final double var5 = this.zCoord + this.worldObj.rand.nextFloat();
this.worldObj.spawnParticle("enchantmenttable", var1, var3, var5, 0.0D, 0.0D, 0.0D);
if (this.rand.nextInt(5) == 0)
{
- makeRandomOutline();
- makeRandomOutline();
- makeRandomOutline();
+ this.makeRandomOutline();
+ this.makeRandomOutline();
+ this.makeRandomOutline();
}
}
else
{
if ((this.blockData == null) || (this.metaData == null))
{
- captureBlockData();
+ this.captureBlockData();
this.slowScan = true;
}
- if ((!this.slowScan) || (this.tickCount % 20 == 0)) {
- if (scanAndRevertChanges())
+ if ((!this.slowScan) || ((this.tickCount % 20) == 0)) {
+ if (this.scanAndRevertChanges())
{
this.slowScan = false;
this.ticksSinceChange = 0;
@@ -80,10 +81,10 @@ public class TileEntityReverter extends TileEntity
private void makeRandomOutline()
{
- makeOutline(this.rand.nextInt(12));
+ this.makeOutline(this.rand.nextInt(12));
}
- private void makeOutline(int outline)
+ private void makeOutline(final int outline)
{
double sx = this.xCoord;
double sy = this.yCoord;
@@ -94,57 +95,57 @@ public class TileEntityReverter extends TileEntity
double dz = this.zCoord;
switch (outline)
{
- case 0:
+ case 0:
sx -= this.radius;
dx -= this.radius;
sz -= this.radius;
dz += this.radius + 1;
- case 8:
+ case 8:
sx -= this.radius;
dx += this.radius + 1;
sz -= this.radius;
dz -= this.radius;
break;
- case 1:
- case 9:
+ case 1:
+ case 9:
sx -= this.radius;
dx -= this.radius;
sz -= this.radius;
dz += this.radius + 1;
break;
- case 2:
- case 10:
+ case 2:
+ case 10:
sx -= this.radius;
dx += this.radius + 1;
sz += this.radius + 1;
dz += this.radius + 1;
break;
- case 3:
- case 11:
+ case 3:
+ case 11:
sx += this.radius + 1;
dx += this.radius + 1;
sz -= this.radius;
dz += this.radius + 1;
break;
- case 4:
+ case 4:
sx -= this.radius;
dx -= this.radius;
sz -= this.radius;
dz -= this.radius;
break;
- case 5:
+ case 5:
sx += this.radius + 1;
dx += this.radius + 1;
sz -= this.radius;
dz -= this.radius;
break;
- case 6:
+ case 6:
sx += this.radius + 1;
dx += this.radius + 1;
sz += this.radius + 1;
dz += this.radius + 1;
break;
- case 7:
+ case 7:
sx -= this.radius;
dx -= this.radius;
sz += this.radius + 1;
@@ -152,45 +153,45 @@ public class TileEntityReverter extends TileEntity
}
switch (outline)
{
- case 0:
- case 1:
- case 2:
- case 3:
+ case 0:
+ case 1:
+ case 2:
+ case 3:
sy += this.radius + 1;
dy += this.radius + 1;
break;
- case 4:
- case 5:
- case 6:
- case 7:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
sy -= this.radius;
dy += this.radius + 1;
break;
- case 8:
- case 9:
- case 10:
- case 11:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
sy -= this.radius;
dy -= this.radius;
}
if (this.rand.nextBoolean()) {
- drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
+ this.drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
} else {
- drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
+ this.drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
}
- drawParticleLine(sx, sy, sz, dx, dy, dz);
+ this.drawParticleLine(sx, sy, sz, dx, dy, dz);
}
- protected void drawParticleLine(double srcX, double srcY, double srcZ, double destX, double destY, double destZ)
+ protected void drawParticleLine(final double srcX, final double srcY, final double srcZ, final double destX, final double destY, final double destZ)
{
- int particles = 16;
+ final int particles = 16;
for (int i = 0; i < particles; i++)
{
- double trailFactor = i / (particles - 1.0D);
+ final double trailFactor = i / (particles - 1.0D);
- double tx = srcX + (destX - srcX) * trailFactor + this.rand.nextFloat() * 0.005D;
- double ty = srcY + (destY - srcY) * trailFactor + this.rand.nextFloat() * 0.005D;
- double tz = srcZ + (destZ - srcZ) * trailFactor + this.rand.nextFloat() * 0.005D;
+ final double tx = srcX + ((destX - srcX) * trailFactor) + (this.rand.nextFloat() * 0.005D);
+ final double ty = srcY + ((destY - srcY) * trailFactor) + (this.rand.nextFloat() * 0.005D);
+ final double tz = srcZ + ((destZ - srcZ) * trailFactor) + (this.rand.nextFloat() * 0.005D);
this.worldObj.spawnParticle("portal", tx, ty, tz, 0.0D, 0.0D, 0.0D);
}
}
@@ -203,10 +204,10 @@ public class TileEntityReverter extends TileEntity
for (int y = -this.radius; y <= this.radius; y++) {
for (int z = -this.radius; z <= this.radius; z++)
{
- Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- byte meta = (byte)this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ final byte meta = (byte)this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
if (this.blockData[index] != blockID) {
- if (revertBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z, blockID, meta, this.blockData[index], this.metaData[index]))
+ if (this.revertBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z, blockID, meta, this.blockData[index], this.metaData[index]))
{
reverted = true;
}
@@ -223,7 +224,7 @@ public class TileEntityReverter extends TileEntity
return reverted;
}
- private boolean revertBlock(int x, int y, int z, Block thereBlockID, byte thereMeta, Block replaceBlockID, byte replaceMeta)
+ private boolean revertBlock(final int x, final int y, final int z, final Block thereBlockID, final byte thereMeta, final Block replaceBlockID, byte replaceMeta)
{
/*if ((thereBlockID == Blocks.air) && (!replaceBlockID.getMaterial().blocksMovement()))
{
@@ -231,7 +232,7 @@ public class TileEntityReverter extends TileEntity
return false;
}*/
- if (isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
+ if (this.isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
return false;
}
if (this.rand.nextInt(5) == 0)
@@ -255,7 +256,7 @@ public class TileEntityReverter extends TileEntity
return true;
}
- private boolean isUnrevertable(Block thereBlockID, byte thereMeta, Block replaceBlockID, byte replaceMeta)
+ private boolean isUnrevertable(final Block thereBlockID, final byte thereMeta, final Block replaceBlockID, final byte replaceMeta)
{
if ((thereBlockID == ModBlocks.blockGriefSaver) || (replaceBlockID == ModBlocks.blockGriefSaver)) {
return true;
@@ -291,8 +292,8 @@ public class TileEntityReverter extends TileEntity
for (int y = -this.radius; y <= this.radius; y++) {
for (int z = -this.radius; z <= this.radius; z++)
{
- Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
- int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ final Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ final int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
this.blockData[index] = blockID;
this.metaData[index] = ((byte)meta);