Start on the update
This commit is contained in:
parent
c8d8ce0241
commit
a0e6a2dc34
112 changed files with 522 additions and 503 deletions
|
@ -89,7 +89,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase implements IWrenchab
|
|||
if (this.burnTime > 0) {
|
||||
--this.burnTime;
|
||||
}
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (!this.world.isRemote) {
|
||||
if (this.burnTime != 0 || getStackInSlot(input1) != null && getStackInSlot(fuel) != null) {
|
||||
if (this.burnTime == 0 && this.canSmelt()) {
|
||||
this.currentItemBurnTime = this.burnTime = getItemBurnTime(getStackInSlot(fuel));
|
||||
|
@ -129,7 +129,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase implements IWrenchab
|
|||
Boolean hasItem = false;
|
||||
for (int inputslot = 0; inputslot < 2; inputslot++) {
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true,
|
||||
recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize) {
|
||||
recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).getCount() >= input.getCount()) {
|
||||
hasItem = true;
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase implements IWrenchab
|
|||
return true;
|
||||
if (!this.getStackInSlot(output).isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = getStackInSlot(output).stackSize + itemstack.stackSize;
|
||||
int result = getStackInSlot(output).getCount() + itemstack.getCount();
|
||||
return result <= getInventoryStackLimit() && result <= this.getStackInSlot(output).getMaxStackSize(); // Forge
|
||||
// BugFix:
|
||||
// Make
|
||||
|
@ -189,7 +189,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase implements IWrenchab
|
|||
if (this.getStackInSlot(output) == null) {
|
||||
setInventorySlotContents(output, itemstack.copy());
|
||||
} else if (this.getStackInSlot(output).getItem() == itemstack.getItem()) {
|
||||
decrStackSize(output, -itemstack.stackSize);
|
||||
decrStackSize(output, -itemstack.getCount());
|
||||
}
|
||||
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
|
||||
|
@ -204,7 +204,7 @@ public class TileAlloyFurnace extends TileLegacyMachineBase implements IWrenchab
|
|||
for (int inputSlot = 0; inputSlot < 2; inputSlot++) {
|
||||
if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true,
|
||||
recipeType.useOreDic())) {
|
||||
inventory.decrStackSize(inputSlot, input.stackSize);
|
||||
inventory.decrStackSize(inputSlot, input.getCount());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,14 +31,14 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
if (storedItem != null) {
|
||||
ItemStack fakeStack = storedItem.copy();
|
||||
fakeStack.stackSize = 1;
|
||||
fakeStack.getCount() = 1;
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else if (storedItem == null && getStackInSlot(1) != null) {
|
||||
ItemStack fakeStack = getStackInSlot(1).copy();
|
||||
fakeStack.stackSize = 1;
|
||||
fakeStack.getCount() = 1;
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else {
|
||||
setInventorySlotContents(2, null);
|
||||
|
@ -49,25 +49,25 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
storedItem = getStackInSlot(0);
|
||||
setInventorySlotContents(0, null);
|
||||
} else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) {
|
||||
if (storedItem.stackSize <= storage - getStackInSlot(0).stackSize) {
|
||||
storedItem.stackSize += getStackInSlot(0).stackSize;
|
||||
decrStackSize(0, getStackInSlot(0).stackSize);
|
||||
if (storedItem.getCount() <= storage - getStackInSlot(0).getCount()) {
|
||||
storedItem.getCount() += getStackInSlot(0).getCount();
|
||||
decrStackSize(0, getStackInSlot(0).getCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (storedItem != null && getStackInSlot(1) == null) {
|
||||
ItemStack itemStack = storedItem.copy();
|
||||
itemStack.stackSize = itemStack.getMaxStackSize();
|
||||
itemStack.getCount() = itemStack.getMaxStackSize();
|
||||
setInventorySlotContents(1, itemStack);
|
||||
storedItem.stackSize -= itemStack.getMaxStackSize();
|
||||
storedItem.getCount() -= itemStack.getMaxStackSize();
|
||||
} else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) {
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).stackSize;
|
||||
if (storedItem.stackSize >= wanted) {
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).getCount();
|
||||
if (storedItem.getCount() >= wanted) {
|
||||
decrStackSize(1, -wanted);
|
||||
storedItem.stackSize -= wanted;
|
||||
storedItem.getCount() -= wanted;
|
||||
} else {
|
||||
decrStackSize(1, -storedItem.stackSize);
|
||||
decrStackSize(1, -storedItem.getCount());
|
||||
storedItem = null;
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
}
|
||||
|
||||
if (storedItem != null) {
|
||||
storedItem.stackSize = tagCompound.getInteger("storedQuantity");
|
||||
storedItem.getCount() = tagCompound.getInteger("storedQuantity");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
|
||||
if (storedItem != null) {
|
||||
tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound()));
|
||||
tagCompound.setInteger("storedQuantity", storedItem.stackSize);
|
||||
tagCompound.setInteger("storedQuantity", storedItem.getCount());
|
||||
} else
|
||||
tagCompound.setInteger("storedQuantity", 0);
|
||||
return tagCompound;
|
||||
|
@ -156,11 +156,11 @@ public class TileDigitalChest extends TileLegacyMachineBase implements IInventor
|
|||
String name = "of nothing";
|
||||
if (storedItem != null) {
|
||||
name = storedItem.getDisplayName();
|
||||
size += storedItem.stackSize;
|
||||
size += storedItem.getCount();
|
||||
}
|
||||
if (getStackInSlot(1) != null) {
|
||||
name = getStackInSlot(1).getDisplayName();
|
||||
size += getStackInSlot(1).stackSize;
|
||||
size += getStackInSlot(1).getCount();
|
||||
}
|
||||
info.add(size + " " + name);
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@ public class TileEntityFlare extends TileEntity implements ITickable {
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
EnumDyeColor color = worldObj.getBlockState(pos).getValue(BlockFlare.COLOR);
|
||||
if(worldObj.isRemote && worldObj.isAirBlock(getPos().up())){
|
||||
ParticleSmoke particleSmokeLarge = new ParticleSmoke(worldObj , pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0, 0.0D, 0);
|
||||
EnumDyeColor color = world.getBlockState(pos).getValue(BlockFlare.COLOR);
|
||||
if(world.isRemote && world.isAirBlock(getPos().up())){
|
||||
ParticleSmoke particleSmokeLarge = new ParticleSmoke(world , pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0, 0.0D, 0);
|
||||
particleSmokeLarge.setMaxAge(250);
|
||||
if(color != EnumDyeColor.WHITE){
|
||||
float[] rgb = EntitySheep.getDyeRgb(color);
|
||||
|
@ -32,7 +32,7 @@ public class TileEntityFlare extends TileEntity implements ITickable {
|
|||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(particleSmokeLarge);
|
||||
|
||||
worldObj.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 0.3, pos.getZ() + 0.5, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 0.3, pos.getZ() + 0.5, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
{
|
||||
setInventorySlotContents(fuelslot,
|
||||
new ItemStack(getStackInSlot(fuelslot).getItem().getContainerItem()));
|
||||
} else if (getStackInSlot(fuelslot).stackSize > 1) {
|
||||
} else if (getStackInSlot(fuelslot).getCount() > 1) {
|
||||
decrStackSize(fuelslot, 1);
|
||||
} else if (getStackInSlot(fuelslot).stackSize == 1) {
|
||||
} else if (getStackInSlot(fuelslot).getCount() == 1) {
|
||||
setInventorySlotContents(fuelslot, null);
|
||||
}
|
||||
updateInventory = true;
|
||||
|
@ -86,9 +86,9 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
if (getStackInSlot(output) == null) {
|
||||
setInventorySlotContents(output, itemstack.copy());
|
||||
} else if (getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
getStackInSlot(output).stackSize += itemstack.stackSize;
|
||||
getStackInSlot(output).getCount() += itemstack.getCount();
|
||||
}
|
||||
if (getStackInSlot(input1).stackSize > 1) {
|
||||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
this.decrStackSize(input1, 1);
|
||||
} else {
|
||||
setInventorySlotContents(input1, null);
|
||||
|
@ -107,7 +107,7 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
return true;
|
||||
if (!getStackInSlot(output).isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = getStackInSlot(output).stackSize + itemstack.stackSize;
|
||||
int result = getStackInSlot(output).getCount() + itemstack.getCount();
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
|
@ -125,11 +125,11 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
}
|
||||
|
||||
public void updateState() {
|
||||
IBlockState BlockStateContainer = worldObj.getBlockState(pos);
|
||||
IBlockState BlockStateContainer = world.getBlockState(pos);
|
||||
if (BlockStateContainer.getBlock() instanceof BlockMachineBase) {
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock();
|
||||
if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != fuel > 0)
|
||||
blockMachineBase.setActive(fuel > 0, worldObj, pos);
|
||||
blockMachineBase.setActive(fuel > 0, world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
|||
|
||||
@Override
|
||||
public MultiblockControllerBase createNewMultiblock() {
|
||||
return new MultiBlockCasing(worldObj);
|
||||
return new MultiBlockCasing(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -84,7 +84,7 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (!super.world.isRemote) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (this.amplifier < 10000 && stack != null) {
|
||||
|
@ -122,7 +122,7 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
|
|||
private boolean spaceForOutput() {
|
||||
return inventory.getStackInSlot(6) == null
|
||||
|| ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true)
|
||||
&& inventory.getStackInSlot(6).stackSize < 64;
|
||||
&& inventory.getStackInSlot(6).getCount() < 64;
|
||||
}
|
||||
|
||||
private void addOutputProducts() {
|
||||
|
@ -130,7 +130,7 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
|
|||
if (inventory.getStackInSlot(6) == null) {
|
||||
inventory.setInventorySlotContents(6, new ItemStack(ModItems.uuMatter));
|
||||
} else if (ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true)) {
|
||||
inventory.getStackInSlot(6).stackSize = Math.min(64, 1 + inventory.getStackInSlot(6).stackSize);
|
||||
inventory.getStackInSlot(6).getCount() = Math.min(64, 1 + inventory.getStackInSlot(6).getCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,17 +52,17 @@ public class TilePlayerDectector extends TilePowerAcceptor {
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) {
|
||||
if (!world.isRemote && world.getWorldTime() % 20 == 0) {
|
||||
boolean lastRedstone = redstone;
|
||||
redstone = false;
|
||||
if (canUseEnergy(10)) {
|
||||
Iterator tIterator = super.worldObj.playerEntities.iterator();
|
||||
Iterator tIterator = super.world.playerEntities.iterator();
|
||||
while (tIterator.hasNext()) {
|
||||
EntityPlayer player = (EntityPlayer) tIterator.next();
|
||||
if (player.getDistanceSq((double) super.getPos().getX() + 0.5D,
|
||||
(double) super.getPos().getY() + 0.5D, (double) super.getPos().getZ() + 0.5D) <= 256.0D) {
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) worldObj.getBlockState(pos).getBlock();
|
||||
int meta = blockMachineBase.getMetaFromState(worldObj.getBlockState(pos));
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) world.getBlockState(pos).getBlock();
|
||||
int meta = blockMachineBase.getMetaFromState(world.getBlockState(pos));
|
||||
if (meta == 0) {// ALL
|
||||
redstone = true;
|
||||
} else if (meta == 1) {// Others
|
||||
|
@ -80,8 +80,8 @@ public class TilePlayerDectector extends TilePowerAcceptor {
|
|||
useEnergy(10);
|
||||
}
|
||||
if (lastRedstone != redstone) {
|
||||
WorldUtils.updateBlock(worldObj, getPos());
|
||||
worldObj.notifyNeighborsOfStateChange(getPos(), worldObj.getBlockState(getPos()).getBlock());
|
||||
WorldUtils.updateBlock(world, getPos());
|
||||
world.notifyNeighborsOfStateChange(getPos(), world.getBlockState(getPos()).getBlock());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@ public class TilePump extends TilePowerAcceptor implements IFluidHandler {
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote && worldObj.getTotalWorldTime() % 10 == 0 && !tank.isFull() && tank.getCapacity() - tank.getFluidAmount() >= 1000 && canUseEnergy(ConfigTechReborn.pumpExtractEU)) {
|
||||
FluidStack fluidStack = drainBlock(worldObj, pos.down(), false);
|
||||
if (!world.isRemote && world.getTotalWorldTime() % 10 == 0 && !tank.isFull() && tank.getCapacity() - tank.getFluidAmount() >= 1000 && canUseEnergy(ConfigTechReborn.pumpExtractEU)) {
|
||||
FluidStack fluidStack = drainBlock(world, pos.down(), false);
|
||||
if (fluidStack != null) {
|
||||
tank.fill(drainBlock(worldObj, pos.down(), true), true);
|
||||
tank.fill(drainBlock(world, pos.down(), true), true);
|
||||
useEnergy(ConfigTechReborn.pumpExtractEU);
|
||||
}
|
||||
tank.compareAndUpdate();
|
||||
|
|
|
@ -33,14 +33,14 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
if (storedItem != null) {
|
||||
ItemStack fakeStack = storedItem.copy();
|
||||
fakeStack.stackSize = 1;
|
||||
fakeStack.getCount() = 1;
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else if (storedItem == null && getStackInSlot(1) != null) {
|
||||
ItemStack fakeStack = getStackInSlot(1).copy();
|
||||
fakeStack.stackSize = 1;
|
||||
fakeStack.getCount() = 1;
|
||||
setInventorySlotContents(2, fakeStack);
|
||||
} else {
|
||||
setInventorySlotContents(2, null);
|
||||
|
@ -51,25 +51,25 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
storedItem = getStackInSlot(0);
|
||||
setInventorySlotContents(0, null);
|
||||
} else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) {
|
||||
if (storedItem.stackSize <= storage - getStackInSlot(0).stackSize) {
|
||||
storedItem.stackSize += getStackInSlot(0).stackSize;
|
||||
decrStackSize(0, getStackInSlot(0).stackSize);
|
||||
if (storedItem.getCount() <= storage - getStackInSlot(0).getCount()) {
|
||||
storedItem.getCount() += getStackInSlot(0).getCount();
|
||||
decrStackSize(0, getStackInSlot(0).getCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (storedItem != null && getStackInSlot(1) == null) {
|
||||
ItemStack itemStack = storedItem.copy();
|
||||
itemStack.stackSize = itemStack.getMaxStackSize();
|
||||
itemStack.getCount() = itemStack.getMaxStackSize();
|
||||
setInventorySlotContents(1, itemStack);
|
||||
storedItem.stackSize -= itemStack.getMaxStackSize();
|
||||
storedItem.getCount() -= itemStack.getMaxStackSize();
|
||||
} else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) {
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).stackSize;
|
||||
if (storedItem.stackSize >= wanted) {
|
||||
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).getCount();
|
||||
if (storedItem.getCount() >= wanted) {
|
||||
decrStackSize(1, -wanted);
|
||||
storedItem.stackSize -= wanted;
|
||||
storedItem.getCount() -= wanted;
|
||||
} else {
|
||||
decrStackSize(1, -storedItem.stackSize);
|
||||
decrStackSize(1, -storedItem.getCount());
|
||||
storedItem = null;
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
}
|
||||
|
||||
if (storedItem != null) {
|
||||
storedItem.stackSize = tagCompound.getInteger("storedQuantity");
|
||||
storedItem.getCount() = tagCompound.getInteger("storedQuantity");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
|
||||
if (storedItem != null) {
|
||||
tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound()));
|
||||
tagCompound.setInteger("storedQuantity", storedItem.stackSize);
|
||||
tagCompound.setInteger("storedQuantity", storedItem.getCount());
|
||||
} else {
|
||||
tagCompound.setInteger("storedQuantity", 0);
|
||||
}
|
||||
|
@ -161,15 +161,15 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
|
||||
@Override
|
||||
public void setStoredItemCount(int amount) {
|
||||
this.storedItem.stackSize = 0;
|
||||
this.storedItem.stackSize += (amount);
|
||||
this.storedItem.getCount() = 0;
|
||||
this.storedItem.getCount() += (amount);
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStoredItemType(ItemStack type, int amount) {
|
||||
this.storedItem = type;
|
||||
this.storedItem.stackSize = amount;
|
||||
this.storedItem.getCount() = amount;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
|
@ -185,11 +185,11 @@ public class TileQuantumChest extends TileLegacyMachineBase
|
|||
String name = "of nothing";
|
||||
if (storedItem != null) {
|
||||
name = storedItem.getDisplayName();
|
||||
size += storedItem.stackSize;
|
||||
size += storedItem.getCount();
|
||||
}
|
||||
if (getStackInSlot(1) != null) {
|
||||
name = getStackInSlot(1).getDisplayName();
|
||||
size += getStackInSlot(1).stackSize;
|
||||
size += getStackInSlot(1).getCount();
|
||||
}
|
||||
info.add(size + " " + name);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class TileQuantumTank extends TileLegacyMachineBase
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class TileQuantumTank extends TileLegacyMachineBase
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
|
|
|
@ -65,11 +65,11 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
charge(2);
|
||||
if (!worldObj.isRemote) {
|
||||
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj);
|
||||
if (!world.isRemote) {
|
||||
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, world);
|
||||
if (currentRecipe != null && canMake()) {
|
||||
if (tickTime >= runTime) {
|
||||
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj);
|
||||
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, world);
|
||||
if (currentRecipe != null) {
|
||||
boolean hasCrafted = false;
|
||||
if (inventory.getStackInSlot(0) == null) {
|
||||
|
@ -77,10 +77,10 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
|
|||
tickTime = -1;
|
||||
hasCrafted = true;
|
||||
} else {
|
||||
if (inventory.getStackInSlot(0).stackSize + currentRecipe.stackSize <= currentRecipe
|
||||
if (inventory.getStackInSlot(0).getCount() + currentRecipe.getCount() <= currentRecipe
|
||||
.getMaxStackSize()) {
|
||||
ItemStack stack = inventory.getStackInSlot(0);
|
||||
stack.stackSize = stack.stackSize + currentRecipe.stackSize;
|
||||
stack.getCount() = stack.getCount() + currentRecipe.getCount();
|
||||
inventory.setInventorySlotContents(0, stack);
|
||||
tickTime = -1;
|
||||
hasCrafted = true;
|
||||
|
@ -105,7 +105,7 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
|
|||
tickTime = -1;
|
||||
}
|
||||
} else {
|
||||
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj);
|
||||
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, world);
|
||||
if (currentRecipe != null) {
|
||||
inventory.setInventorySlotContents(1, currentRecipe);
|
||||
} else {
|
||||
|
@ -115,7 +115,7 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
|
|||
}
|
||||
|
||||
public boolean canMake() {
|
||||
return RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj) != null;
|
||||
return RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, world) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,7 +68,7 @@ public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable
|
|||
}
|
||||
|
||||
public void recycleItems() {
|
||||
if (this.canOpen() && !worldObj.isRemote) {
|
||||
if (this.canOpen() && !world.isRemote) {
|
||||
int random = new Random().nextInt(ScrapboxList.stacks.size());
|
||||
ItemStack out = ScrapboxList.stacks.get(random).copy();
|
||||
if (getStackInSlot(output) == null) {
|
||||
|
@ -76,7 +76,7 @@ public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable
|
|||
setInventorySlotContents(output, out);
|
||||
}
|
||||
|
||||
if (getStackInSlot(input1).stackSize > 1) {
|
||||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
useEnergy(cost);
|
||||
this.decrStackSize(input1, 1);
|
||||
} else {
|
||||
|
@ -95,11 +95,11 @@ public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable
|
|||
}
|
||||
|
||||
public void updateState() {
|
||||
IBlockState blockState = worldObj.getBlockState(pos);
|
||||
IBlockState blockState = world.getBlockState(pos);
|
||||
if (blockState.getBlock() instanceof BlockMachineBase) {
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) blockState.getBlock();
|
||||
if (blockState.getValue(BlockMachineBase.ACTIVE) != progress > 0)
|
||||
blockMachineBase.setActive(progress > 0, worldObj, pos);
|
||||
blockMachineBase.setActive(progress > 0, world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
}
|
||||
|
||||
private boolean isCoil(int x, int y, int z) {
|
||||
return worldObj.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil;
|
||||
return world.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -139,11 +139,11 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
super.updateEntity();
|
||||
// TODO improve this code a lot
|
||||
|
||||
if (worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
if (world.getTotalWorldTime() % 20 == 0) {
|
||||
checkCoils();
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
if (coilStatus == 1) {
|
||||
if (currentRecipe == null) {
|
||||
if (inventory.hasChanged || crafingTickTime != 0) {
|
||||
|
@ -205,11 +205,11 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
if (getStackInSlot(outputStackSlot) == null) {
|
||||
setInventorySlotContents(outputStackSlot, currentRecipe.getOutput().copy());
|
||||
} else {
|
||||
decrStackSize(outputStackSlot, -currentRecipe.getOutput().stackSize);
|
||||
decrStackSize(outputStackSlot, -currentRecipe.getOutput().getCount());
|
||||
}
|
||||
decrStackSize(topStackSlot, currentRecipe.getTopInput().stackSize);
|
||||
decrStackSize(topStackSlot, currentRecipe.getTopInput().getCount());
|
||||
if (currentRecipe.getBottomInput() != null) {
|
||||
decrStackSize(bottomStackSlot, currentRecipe.getBottomInput().stackSize);
|
||||
decrStackSize(bottomStackSlot, currentRecipe.getBottomInput().getCount());
|
||||
}
|
||||
resetCrafter();
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn
|
|||
return true;
|
||||
}
|
||||
if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic)) {
|
||||
if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) {
|
||||
if (stack.getCount() + inventory.getStackInSlot(slot).getCount() <= stack.getMaxStackSize()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
|
|
|
@ -26,8 +26,8 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ()))
|
||||
if (!world.isRemote) {
|
||||
if (world.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ()))
|
||||
.getBlock() == Blocks.DRAGON_EGG) {
|
||||
addEnergy(euTick);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IF
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IF
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
tank.compareAndUpdate();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IIn
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (worldObj.isRemote) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
if (getEnergy() < getMaxPower()) {
|
||||
|
@ -57,7 +57,7 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IIn
|
|||
if (burnTime > 0) {
|
||||
updateState();
|
||||
burnItem = getStackInSlot(fuelSlot);
|
||||
if (getStackInSlot(fuelSlot).stackSize == 1) {
|
||||
if (getStackInSlot(fuelSlot).getCount() == 1) {
|
||||
if(getStackInSlot(fuelSlot).getItem() == Items.LAVA_BUCKET || getStackInSlot(fuelSlot).getItem() == ForgeModContainer.getInstance().universalBucket){
|
||||
setInventorySlotContents(fuelSlot, new ItemStack(Items.BUCKET));
|
||||
} else {
|
||||
|
@ -74,11 +74,11 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IIn
|
|||
}
|
||||
|
||||
public void updateState() {
|
||||
IBlockState BlockStateContainer = worldObj.getBlockState(pos);
|
||||
IBlockState BlockStateContainer = world.getBlockState(pos);
|
||||
if (BlockStateContainer.getBlock() instanceof BlockMachineBase) {
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock();
|
||||
if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != burnTime > 0)
|
||||
blockMachineBase.setActive(burnTime > 0, worldObj, pos);
|
||||
blockMachineBase.setActive(burnTime > 0, world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,20 +23,20 @@ public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ()))
|
||||
if (!world.isRemote) {
|
||||
if (world.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1))
|
||||
} else if (world.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1))
|
||||
} else if (world.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ()))
|
||||
} else if (world.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
addEnergy(euTick);
|
||||
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ()))
|
||||
} else if (world.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
addEnergy(euTick);
|
||||
}
|
||||
|
|
|
@ -28,24 +28,24 @@ public class TileLightningRod extends TilePowerAcceptor {
|
|||
|
||||
if (onStatusHoldTicks == 0 || getEnergy() <= 0) {
|
||||
if (getBlockType() instanceof BlockMachineBase)
|
||||
((BlockMachineBase) getBlockType()).setActive(false, worldObj, pos);
|
||||
((BlockMachineBase) getBlockType()).setActive(false, world, pos);
|
||||
onStatusHoldTicks = -1;
|
||||
}
|
||||
|
||||
float weatherStrength = worldObj.getThunderStrength(1.0F);
|
||||
float weatherStrength = world.getThunderStrength(1.0F);
|
||||
if (weatherStrength > 0.2F) {
|
||||
//lightStrikeChance = (MAX - (CHANCE * WEATHER_STRENGTH)
|
||||
float lightStrikeChance = ((100F - ConfigTechReborn.LightningRodChance) * 20F);
|
||||
float totalChance = lightStrikeChance * getLightningStrikeMultiplier() * ((1.1F - weatherStrength));
|
||||
if (worldObj.rand.nextInt((int) Math.floor(totalChance)) == 0) {
|
||||
EntityLightningBolt lightningBolt = new EntityLightningBolt(worldObj,
|
||||
if (world.rand.nextInt((int) Math.floor(totalChance)) == 0) {
|
||||
EntityLightningBolt lightningBolt = new EntityLightningBolt(world,
|
||||
pos.getX() + 0.5F,
|
||||
worldObj.provider.getAverageGroundLevel(),
|
||||
world.provider.getAverageGroundLevel(),
|
||||
pos.getZ() + 0.5F, false);
|
||||
worldObj.addWeatherEffect(lightningBolt);
|
||||
worldObj.spawnEntityInWorld(lightningBolt);
|
||||
world.addWeatherEffect(lightningBolt);
|
||||
world.spawnEntity(lightningBolt);
|
||||
addEnergy(32768 * (0.3F + weatherStrength));
|
||||
((BlockMachineBase) getBlockType()).setActive(true, worldObj, pos);
|
||||
((BlockMachineBase) getBlockType()).setActive(true, world, pos);
|
||||
onStatusHoldTicks = 400;
|
||||
}
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ public class TileLightningRod extends TilePowerAcceptor {
|
|||
}
|
||||
|
||||
public float getLightningStrikeMultiplier() {
|
||||
float actualHeight = worldObj.provider.getActualHeight();
|
||||
float groundLevel = worldObj.provider.getAverageGroundLevel();
|
||||
float actualHeight = world.provider.getActualHeight();
|
||||
float groundLevel = world.provider.getAverageGroundLevel();
|
||||
for (int i = pos.getY() + 1; i < actualHeight; i++) {
|
||||
if (!isValidIronFence(i)) {
|
||||
if (groundLevel >= i)
|
||||
|
@ -68,7 +68,7 @@ public class TileLightningRod extends TilePowerAcceptor {
|
|||
}
|
||||
|
||||
public boolean isValidIronFence(int y) {
|
||||
Item itemBlock = Item.getItemFromBlock(worldObj.getBlockState(new BlockPos(pos.getX(), y, pos.getZ())).getBlock());
|
||||
Item itemBlock = Item.getItemFromBlock(world.getBlockState(new BlockPos(pos.getX(), y, pos.getZ())).getBlock());
|
||||
for (ItemStack fence : OreDictionary.getOres("fenceIron")) {
|
||||
if (fence.getItem() == itemBlock)
|
||||
return true;
|
||||
|
|
|
@ -126,7 +126,7 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrench
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote)
|
||||
if (!world.isRemote)
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick && tank.getFluidType() != null && fluids.containsKey(tank.getFluidType().getName())) {
|
||||
|
|
|
@ -25,8 +25,8 @@ public class TileSolarPanel extends TilePowerAcceptor implements ITickable {
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (worldObj.getTotalWorldTime() % 60 == 0) {
|
||||
if (!world.isRemote) {
|
||||
if (world.getTotalWorldTime() % 60 == 0) {
|
||||
shouldMakePower = isSunOut();
|
||||
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ public class TileSolarPanel extends TilePowerAcceptor implements ITickable {
|
|||
powerToAdd = 0;
|
||||
}
|
||||
|
||||
worldObj.setBlockState(getPos(),
|
||||
worldObj.getBlockState(this.getPos()).withProperty(BlockSolarPanel.ACTIVE, isSunOut()));
|
||||
world.setBlockState(getPos(),
|
||||
world.getBlockState(this.getPos()).withProperty(BlockSolarPanel.ACTIVE, isSunOut()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,8 @@ public class TileSolarPanel extends TilePowerAcceptor implements ITickable {
|
|||
}
|
||||
|
||||
public boolean isSunOut() {
|
||||
return worldObj.canBlockSeeSky(pos.up()) && !worldObj.isRaining() && !worldObj.isThundering()
|
||||
&& worldObj.isDaytime();
|
||||
return world.canBlockSeeSky(pos.up()) && !world.isRaining() && !world.isThundering()
|
||||
&& world.isDaytime();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -111,7 +111,7 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
@ -120,27 +120,27 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
// TODO optimise this code
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
if (!world.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
for (EnumFacing direction : EnumFacing.values()) {
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
if (world.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()))
|
||||
.getBlock() == Blocks.LAVA) {
|
||||
addEnergy(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.getTotalWorldTime() % 40 == 0) {
|
||||
BlockMachineBase bmb = (BlockMachineBase) worldObj.getBlockState(pos).getBlock();
|
||||
if (world.getTotalWorldTime() % 40 == 0) {
|
||||
BlockMachineBase bmb = (BlockMachineBase) world.getBlockState(pos).getBlock();
|
||||
boolean didFindLava = false;
|
||||
for (EnumFacing direction : EnumFacing.values()) {
|
||||
if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
if (world.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(),
|
||||
getPos().getZ() + direction.getFrontOffsetZ())).getBlock() == Blocks.LAVA) {
|
||||
didFindLava = true;
|
||||
}
|
||||
}
|
||||
bmb.setActive(didFindLava, worldObj, pos);
|
||||
bmb.setActive(didFindLava, world, pos);
|
||||
}
|
||||
}
|
||||
if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) {
|
||||
|
|
|
@ -19,7 +19,7 @@ public class TileWaterMill extends TilePowerAcceptor {
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
if (world.getTotalWorldTime() % 20 == 0) {
|
||||
checkForWater();
|
||||
}
|
||||
if (waterblocks > 0) {
|
||||
|
@ -30,7 +30,7 @@ public class TileWaterMill extends TilePowerAcceptor {
|
|||
public void checkForWater() {
|
||||
waterblocks = 0;
|
||||
for (EnumFacing facing : EnumFacing.HORIZONTALS) {
|
||||
if (worldObj.getBlockState(getPos().offset(facing)).getBlock() == Blocks.WATER) {
|
||||
if (world.getBlockState(getPos().offset(facing)).getBlock() == Blocks.WATER) {
|
||||
waterblocks++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class TileWindMill extends TilePowerAcceptor {
|
|||
super.updateEntity();
|
||||
if (pos.getY() > 64) {
|
||||
int actualPower = basePower;
|
||||
if (worldObj.isThundering()) {
|
||||
if (world.isThundering()) {
|
||||
actualPower *= 1.25;
|
||||
}
|
||||
addEnergy(actualPower); // Value taken from
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TileIDSU extends TilePowerAcceptor implements IWrenchable {
|
|||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
return 0.0;
|
||||
}
|
||||
return IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower;
|
||||
return IDSUManager.INSTANCE.getSaveDataForWorld(world, ownerUdid).storedPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +45,7 @@ public class TileIDSU extends TilePowerAcceptor implements IWrenchable {
|
|||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
return;
|
||||
}
|
||||
IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower = energy;
|
||||
IDSUManager.INSTANCE.getSaveDataForWorld(world, ownerUdid).storedPower = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,19 +27,19 @@ public class TileLesu extends TilePowerAcceptor {// TODO wrench
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (worldObj.isRemote) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
countedNetworks.clear();
|
||||
connectedBlocks = 0;
|
||||
for (EnumFacing dir : EnumFacing.values()) {
|
||||
if (worldObj.getTileEntity(
|
||||
if (world.getTileEntity(
|
||||
new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(),
|
||||
getPos().getZ() + dir.getFrontOffsetZ())) instanceof TileLesuStorage) {
|
||||
if (((TileLesuStorage) worldObj.getTileEntity(
|
||||
if (((TileLesuStorage) world.getTileEntity(
|
||||
new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(),
|
||||
getPos().getZ() + dir.getFrontOffsetZ()))).network != null) {
|
||||
LesuNetwork network = ((TileLesuStorage) worldObj.getTileEntity(new BlockPos(
|
||||
LesuNetwork network = ((TileLesuStorage) world.getTileEntity(new BlockPos(
|
||||
getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(),
|
||||
getPos().getZ() + dir.getFrontOffsetZ()))).network;
|
||||
if (!countedNetworks.contains(network)) {
|
||||
|
|
|
@ -14,7 +14,7 @@ public class TileLesuStorage extends TileLegacyMachineBase {
|
|||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (network == null) {
|
||||
findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
findAndJoinNetwork(world, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
} else {
|
||||
if (network.master != null
|
||||
&& network.master.getWorld().getTileEntity(new BlockPos(network.master.getPos().getX(),
|
||||
|
@ -61,6 +61,6 @@ public class TileLesuStorage extends TileLegacyMachineBase {
|
|||
public final void rebuildNetwork() {
|
||||
this.removeFromNetwork();
|
||||
this.resetNetwork();
|
||||
this.findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
this.findAndJoinNetwork(world, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
|
|||
|
||||
public int getHeat() {
|
||||
for (EnumFacing direction : EnumFacing.values()) {
|
||||
TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
TileEntity tileEntity = world.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),
|
||||
getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
||||
if (tileEntity instanceof TileMachineCasing) {
|
||||
if (((TileMachineCasing) tileEntity).isConnected()
|
||||
|
@ -89,22 +89,22 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
|
|||
Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
int heat = 0;
|
||||
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY() - 1, location.getZ()))
|
||||
if (world.getBlockState(new BlockPos(location.getX(), location.getY() - 1, location.getZ()))
|
||||
.getBlock() == tileEntity.getBlockType()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (IMultiblockPart part : casing.connectedParts) {
|
||||
BlockMachineCasing casing1 = (BlockMachineCasing) worldObj.getBlockState(part.getPos())
|
||||
BlockMachineCasing casing1 = (BlockMachineCasing) world.getBlockState(part.getPos())
|
||||
.getBlock();
|
||||
heat += casing1
|
||||
.getHeatFromState(part.getWorld().getBlockState(part.getWorldLocation().toBlockPos()));
|
||||
// TODO meta fix
|
||||
}
|
||||
|
||||
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ()))
|
||||
if (world.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ()))
|
||||
.getBlock().getUnlocalizedName().equals("tile.lava")
|
||||
&& worldObj
|
||||
&& world
|
||||
.getBlockState(new BlockPos(location.getX(), location.getY() + 1, location.getZ()))
|
||||
.getBlock().getUnlocalizedName().equals("tile.lava")) {
|
||||
heat += 500;
|
||||
|
@ -118,7 +118,7 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
|
|||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
world.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
||||
getPos().getY(), getPos().getZ());
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
|
|||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
multiblockChecker = new MultiblockChecker(worldObj, getPos().down(3));
|
||||
multiblockChecker = new MultiblockChecker(world, getPos().down(3));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,7 +94,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
|
||||
if (multiblockChecker == null) {
|
||||
BlockPos pos = getPos().offset(getFacing().getOpposite(), 2).down();
|
||||
multiblockChecker = new MultiblockChecker(worldObj, pos);
|
||||
multiblockChecker = new MultiblockChecker(world, pos);
|
||||
}
|
||||
|
||||
if (getMutliBlock()) {
|
||||
|
|
|
@ -57,7 +57,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
canUseEnergy(128.0F) &&
|
||||
!tank.isEmpty() &&
|
||||
tank.getFluid().amount >= 1000) {
|
||||
if (--wood.stackSize == 0)
|
||||
if (--wood.getCount() == 0)
|
||||
setInventorySlotContents(0, null);
|
||||
tank.drain(1000, true);
|
||||
useEnergy(128.0F);
|
||||
|
@ -66,7 +66,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
}
|
||||
}
|
||||
} else if (++tickTime > 100) {
|
||||
Random rnd = worldObj.rand;
|
||||
Random rnd = world.rand;
|
||||
addOutput(2, new ItemStack(Blocks.PLANKS, 6 + rnd.nextInt(4)));
|
||||
if (rnd.nextInt(4) != 0) {
|
||||
ItemStack pulp = ItemDusts.getDustByName("sawDust", 2 + rnd.nextInt(3));
|
||||
|
@ -85,18 +85,18 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
public void addOutput(int slot, ItemStack stack) {
|
||||
if (getStackInSlot(slot) == null)
|
||||
setInventorySlotContents(slot, stack);
|
||||
getStackInSlot(slot).stackSize += stack.stackSize;
|
||||
getStackInSlot(slot).getCount() += stack.getCount();
|
||||
}
|
||||
|
||||
public boolean canAddOutput(int slot, int amount) {
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
return stack == null || getInventoryStackLimit() - stack.stackSize >= amount;
|
||||
return stack == null || getInventoryStackLimit() - stack.getCount() >= amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
multiblockChecker = new MultiblockChecker(worldObj, getPos().down(3));
|
||||
multiblockChecker = new MultiblockChecker(world, getPos().down(3));
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
multiblockChecker = new MultiblockChecker(worldObj, getPos().down());
|
||||
multiblockChecker = new MultiblockChecker(world, getPos().down());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -85,7 +85,7 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
|
|||
|
||||
@Override
|
||||
public void setFacing(EnumFacing enumFacing) {
|
||||
worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockEnergyStorage.FACING, enumFacing));
|
||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockEnergyStorage.FACING, enumFacing));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -111,9 +111,9 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IWrenchable,
|
|||
|
||||
@Override
|
||||
public EnumFacing getFacingEnum() {
|
||||
Block block = worldObj.getBlockState(pos).getBlock();
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (block instanceof BlockEnergyStorage) {
|
||||
return ((BlockEnergyStorage) block).getFacing(worldObj.getBlockState(pos));
|
||||
return ((BlockEnergyStorage) block).getFacing(world.getBlockState(pos));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -71,9 +71,9 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
if (getStackInSlot(output) == null) {
|
||||
setInventorySlotContents(output, itemstack.copy());
|
||||
} else if (getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
getStackInSlot(output).stackSize += itemstack.stackSize;
|
||||
getStackInSlot(output).grow(itemstack.getCount());
|
||||
}
|
||||
if (getStackInSlot(input1).stackSize > 1) {
|
||||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
this.decrStackSize(input1, 1);
|
||||
} else {
|
||||
setInventorySlotContents(input1, null);
|
||||
|
@ -92,7 +92,7 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
return true;
|
||||
if (!getStackInSlot(output).isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = getStackInSlot(output).stackSize + itemstack.stackSize;
|
||||
int result = getStackInSlot(output).getCount() + itemstack.getCount();
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
|
@ -110,11 +110,11 @@ public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchabl
|
|||
}
|
||||
|
||||
public void updateState() {
|
||||
IBlockState BlockStateContainer = worldObj.getBlockState(pos);
|
||||
IBlockState BlockStateContainer = world.getBlockState(pos);
|
||||
if (BlockStateContainer.getBlock() instanceof BlockMachineBase) {
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock();
|
||||
if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != progress > 0)
|
||||
blockMachineBase.setActive(progress > 0, worldObj, pos);
|
||||
blockMachineBase.setActive(progress > 0, world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (worldObj.isRemote) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
boolean burning = isBurning();
|
||||
|
@ -70,7 +70,7 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
public void recycleItems() {
|
||||
if (this.canRecycle()) {
|
||||
ItemStack itemstack = ItemParts.getPartByName("scrap");
|
||||
int randomchance = worldObj.rand.nextInt(chance);
|
||||
int randomchance = world.rand.nextInt(chance);
|
||||
|
||||
if (getStackInSlot(output) == null) {
|
||||
useEnergy(cost);
|
||||
|
@ -80,10 +80,10 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
} else if (getStackInSlot(output).isItemEqual(itemstack)) {
|
||||
useEnergy(cost);
|
||||
if (randomchance == 1) {
|
||||
getStackInSlot(output).stackSize += itemstack.stackSize;
|
||||
getStackInSlot(output).getCount() += itemstack.getCount();
|
||||
}
|
||||
}
|
||||
if (getStackInSlot(input1).stackSize > 1) {
|
||||
if (getStackInSlot(input1).getCount() > 1) {
|
||||
useEnergy(cost);
|
||||
this.decrStackSize(input1, 1);
|
||||
} else {
|
||||
|
@ -100,7 +100,7 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
public boolean hasSlotGotSpace(int slot) {
|
||||
if (getStackInSlot(slot) == null) {
|
||||
return true;
|
||||
} else if (getStackInSlot(slot).stackSize < getStackInSlot(slot).getMaxStackSize()) {
|
||||
} else if (getStackInSlot(slot).getCount() < getStackInSlot(slot).getMaxStackSize()) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
@ -111,11 +111,11 @@ public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInv
|
|||
}
|
||||
|
||||
public void updateState() {
|
||||
IBlockState BlockStateContainer = worldObj.getBlockState(pos);
|
||||
IBlockState BlockStateContainer = world.getBlockState(pos);
|
||||
if (BlockStateContainer.getBlock() instanceof BlockMachineBase) {
|
||||
BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock();
|
||||
if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != progress > 0)
|
||||
blockMachineBase.setActive(progress > 0, worldObj, pos);
|
||||
blockMachineBase.setActive(progress > 0, world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@ public class TileTransformer extends TilePowerAcceptor implements IWrenchable, I
|
|||
|
||||
@Override
|
||||
public EnumFacing getFacingEnum() {
|
||||
Block block = worldObj.getBlockState(pos).getBlock();
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (block instanceof BlockTransformer) {
|
||||
return ((BlockTransformer) block).getFacing(worldObj.getBlockState(pos));
|
||||
return ((BlockTransformer) block).getFacing(world.getBlockState(pos));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue