Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -7,14 +7,12 @@ import net.minecraft.util.ITickable;
|
|||
* Base class for tiles that tick. Allows disabling the ticking programmatically.
|
||||
*/
|
||||
// TODO - Move implementations that depend on existed ticks to new methods from here.
|
||||
public abstract class TileTicking extends TileBase implements ITickable
|
||||
{
|
||||
public abstract class TileTicking extends TileBase implements ITickable {
|
||||
private int ticksExisted;
|
||||
private boolean shouldTick = true;
|
||||
|
||||
@Override
|
||||
public final void update()
|
||||
{
|
||||
public final void update() {
|
||||
if (shouldTick()) {
|
||||
ticksExisted++;
|
||||
onUpdate();
|
||||
|
@ -22,15 +20,13 @@ public abstract class TileTicking extends TileBase implements ITickable
|
|||
}
|
||||
|
||||
@Override
|
||||
void deserializeBase(NBTTagCompound tagCompound)
|
||||
{
|
||||
void deserializeBase(NBTTagCompound tagCompound) {
|
||||
this.ticksExisted = tagCompound.getInteger("ticksExisted");
|
||||
this.shouldTick = tagCompound.getBoolean("shouldTick");
|
||||
}
|
||||
|
||||
@Override
|
||||
NBTTagCompound serializeBase(NBTTagCompound tagCompound)
|
||||
{
|
||||
NBTTagCompound serializeBase(NBTTagCompound tagCompound) {
|
||||
tagCompound.setInteger("ticksExisted", getTicksExisted());
|
||||
tagCompound.setBoolean("shouldTick", shouldTick());
|
||||
return tagCompound;
|
||||
|
@ -41,23 +37,19 @@ public abstract class TileTicking extends TileBase implements ITickable
|
|||
*/
|
||||
public abstract void onUpdate();
|
||||
|
||||
public int getTicksExisted()
|
||||
{
|
||||
public int getTicksExisted() {
|
||||
return ticksExisted;
|
||||
}
|
||||
|
||||
public void resetLifetime()
|
||||
{
|
||||
public void resetLifetime() {
|
||||
ticksExisted = 0;
|
||||
}
|
||||
|
||||
public boolean shouldTick()
|
||||
{
|
||||
public boolean shouldTick() {
|
||||
return shouldTick;
|
||||
}
|
||||
|
||||
public void setShouldTick(boolean shouldTick)
|
||||
{
|
||||
public void setShouldTick(boolean shouldTick) {
|
||||
this.shouldTick = shouldTick;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue