Changed formatting to have bracing on a new line
This commit is contained in:
parent
e5eddd6c45
commit
e48eedb874
189 changed files with 6092 additions and 4041 deletions
|
@ -8,66 +8,78 @@ import net.minecraft.util.ITickable;
|
|||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
||||
|
||||
public class TileAlchemyArray extends TileInventory implements ITickable {
|
||||
public class TileAlchemyArray extends TileInventory implements ITickable
|
||||
{
|
||||
|
||||
public boolean isActive = false;
|
||||
public int activeCounter = 0;
|
||||
public boolean isActive = false;
|
||||
public int activeCounter = 0;
|
||||
|
||||
public TileAlchemyArray() {
|
||||
super(2, "alchemyArray");
|
||||
}
|
||||
public TileAlchemyArray()
|
||||
{
|
||||
super(2, "alchemyArray");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
this.isActive = tagCompound.getBoolean("isActive");
|
||||
this.activeCounter = tagCompound.getInteger("activeCounter");
|
||||
}
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
this.isActive = tagCompound.getBoolean("isActive");
|
||||
this.activeCounter = tagCompound.getInteger("activeCounter");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setBoolean("isActive", isActive);
|
||||
tagCompound.setInteger("activeCounter", activeCounter);
|
||||
}
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setBoolean("isActive", isActive);
|
||||
tagCompound.setInteger("activeCounter", activeCounter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (isActive && attemptCraft()) {
|
||||
activeCounter++;
|
||||
} else {
|
||||
isActive = false;
|
||||
activeCounter = 0;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
if (isActive && attemptCraft())
|
||||
{
|
||||
activeCounter++;
|
||||
} else
|
||||
{
|
||||
isActive = false;
|
||||
activeCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean attemptCraft() {
|
||||
AlchemyArrayEffect effect = AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(this.getStackInSlot(0), this.getStackInSlot(1));
|
||||
if (effect != null) {
|
||||
isActive = true;
|
||||
public boolean attemptCraft()
|
||||
{
|
||||
AlchemyArrayEffect effect = AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(this.getStackInSlot(0), this.getStackInSlot(1));
|
||||
if (effect != null)
|
||||
{
|
||||
isActive = true;
|
||||
|
||||
if (effect.update(this, this.activeCounter)) {
|
||||
this.decrStackSize(0, 1);
|
||||
this.decrStackSize(1, 1);
|
||||
this.worldObj.setBlockToAir(getPos());
|
||||
}
|
||||
if (effect.update(this, this.activeCounter))
|
||||
{
|
||||
this.decrStackSize(0, 1);
|
||||
this.decrStackSize(1, 1);
|
||||
this.worldObj.setBlockToAir(getPos());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeToNBT(nbttagcompound);
|
||||
return new S35PacketUpdateTileEntity(pos, this.getBlockMetadata(), nbttagcompound);
|
||||
}
|
||||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeToNBT(nbttagcompound);
|
||||
return new S35PacketUpdateTileEntity(pos, this.getBlockMetadata(), nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
super.onDataPacket(net, packet);
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
super.onDataPacket(net, packet);
|
||||
readFromNBT(packet.getNbtCompound());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue