Remove guards in TileMod since forge has them now

This commit is contained in:
Vincent Lee committed 2016-06-18 14:36:36 -05:00
1 parent 8767180a7b
commit b7e77936b3
39 files changed
+41 -51

No files matched your search

@@ -108,7 +108,7 @@ public class TileAlfPortal extends TileMod {
}
@Override
public void updateEntity() {
public void update() {
IBlockState iBlockState = worldObj.getBlockState(getPos());
if(iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF) {
ticksOpen = 0;
@@ -34,7 +34,6 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.IItemHandlerModifiable;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.item.IPetalApothecary;
@@ -245,7 +244,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary {
}
@Override
public void updateEntity() {
public void update() {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1)));
boolean didChange = false;
@@ -30,7 +30,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile {
int mana;
@Override
public void updateEntity() {
public void update() {
enabled = true;
for(EnumFacing dir : EnumFacing.VALUES) {
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
@@ -22,7 +22,7 @@ public class TileBifrost extends TileMod {
public int ticks = 0;
@Override
public void updateEntity() {
public void update() {
if(!worldObj.isRemote) {
if(ticks <= 0) {
worldObj.setBlockToAir(pos);
@@ -79,7 +79,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver {
}
@Override
public void updateEntity() {
public void update() {
if(mana > 0 && recipe == null) {
for(RecipeBrew recipe : BotaniaAPI.brewRecipes)
if(recipe.matches(itemHandler)) {
@@ -37,7 +37,7 @@ public class TileCocoon extends TileMod {
public int emeraldsGiven;
@Override
public void updateEntity() {
public void update() {
timePassed++;
if(timePassed >= TOTAL_TIME)
hatch();
@@ -99,7 +99,7 @@ public class TileCraftCrate extends TileOpenCrate {
}
@Override
public void updateEntity() {
public void update() {
if (worldObj.isRemote)
return;
@@ -137,7 +137,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
}
@Override
public void updateEntity() {
public void update() {
IBlockState state = worldObj.getBlockState(getPos());
EnumFacing.Axis axis = state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION);
@@ -27,7 +27,7 @@ import java.util.List;
public class TileEnderEye extends TileMod {
@Override
public void updateEntity() {
public void update() {
if (worldObj.isRemote)
return;
@@ -18,7 +18,7 @@ public class TileForestEye extends TileMod {
public int entities = 0;
@Override
public void updateEntity() {
public void update() {
if (worldObj.isRemote)
return;
int range = 6;
@@ -42,7 +42,7 @@ public class TileHourglass extends TileSimpleInventory {
public boolean move = true;
@Override
public void updateEntity() {
public void update() {
int totalTime = getTotalTime();
if(totalTime > 0) {
if(move)
@@ -40,7 +40,7 @@ public class TileIncensePlate extends TileSimpleInventory {
public int comparatorOutput = 0;
@Override
public void updateEntity() {
public void update() {
ItemStack stack = itemHandler.getStackInSlot(0);
if(stack != null && burning) {
Brew brew = ((ItemIncenseStick) ModItems.incenseStick).getBrew(stack);
@@ -67,7 +67,7 @@ public class TileLightRelay extends TileMod implements IWandBindable {
}
@Override
public void updateEntity() {
public void update() {
ticksElapsed++;
if(bindPos.getY() > -1 && isValidBinding()) {
@@ -17,7 +17,7 @@ import vazkii.botania.common.Botania;
public class TileManaBeacon extends TileMod {
@Override
public void updateEntity() {
public void update() {
boolean redstone = false;
for(EnumFacing dir : EnumFacing.VALUES) {
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
@@ -29,7 +29,7 @@ public class TileManaFlame extends TileMod {
}
@Override
public void updateEntity() {
public void update() {
float c = 0.3F;
if(worldObj.isRemote && Math.random() < c) {
@@ -68,14 +68,6 @@ public class TileMod extends TileEntity implements ITickable {
}
@Override
public final void update() {
if (!isInvalid() && worldObj.isBlockLoaded(getPos(), !worldObj.isRemote)) {
updateEntity();
}
}
protected void updateEntity() {
// NO-OP
}
public void update() {}
}
@@ -41,7 +41,7 @@ public class TileOpenCrate extends TileSimpleInventory {
}
@Override
public void updateEntity() {
public void update() {
if (worldObj.isRemote)
return;
@@ -22,7 +22,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.mana.IManaReceiver;
@@ -102,7 +101,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver
}
@Override
public void updateEntity() {
public void update() {
// Update every tick.
recieveMana(0);
@@ -36,7 +36,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
int mana = 0;
@Override
public void updateEntity() {
public void update() {
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
if(mana >= 5 && tileBelow instanceof TileEntityMobSpawner) {
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow;
@@ -72,7 +72,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
}
@Override
public void updateEntity() {
public void update() {
if(subTile != null) {
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
if(tileBelow instanceof TileRedStringRelay) {
@@ -17,7 +17,7 @@ public class TileSpiritShrine extends TileMod {
int ticks;
@Override
public void updateEntity() {
public void update() {
if(worldObj.isRemote) {
if(ticks >= 40) {
float[][] colors = new float[][] {
@@ -16,7 +16,7 @@ import vazkii.botania.common.Botania;
public class TileStarfield extends TileMod {
@Override
public void updateEntity() {
public void update() {
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
if(!worldObj.isRemote) {
boolean newState = !worldObj.isDaytime();
@@ -69,7 +69,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
@Override
public void updateEntity() {
public void update() {
boolean removeMana = true;
if(hasValidPlatform()) {
@@ -15,7 +15,7 @@ public class TileTeruTeruBozu extends TileMod {
public boolean wasRaining = false;
@Override
public void updateEntity() {
public void update() {
if (worldObj.isRemote)
return;
@@ -15,7 +15,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemTinyPlanet;
public class TileTinyPlanet extends TileMod {
@Override
public void updateEntity() {
public void update() {
ItemTinyPlanet.applyEffect(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
}
@@ -37,7 +37,7 @@ public class TileTinyPotato extends TileMod {
}
@Override
public void updateEntity() {
public void update() {
if(worldObj.rand.nextInt(100) == 0)
jump();
@@ -53,7 +53,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
}
@Override
public void updateEntity() {
public void update() {
++ticks;
if(ticks % 20 == 0)
updateCount();
@@ -148,7 +148,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
public boolean hasCloseby;
@Override
public void updateEntity() {
public void update() {
double x = pos.getX() + 0.5;
double y = pos.getY() + 0.5;
double z = pos.getZ() + 0.5;
@@ -38,7 +38,7 @@ public class TileBellows extends TileMod {
}
@Override
public void updateEntity() {
public void update() {
boolean disable = true;
TileEntity tile = getLinkedTile();
if(!active && tile instanceof TilePool) {
@@ -25,7 +25,7 @@ public class TileDistributor extends TileMod implements IManaReceiver {
final List<IManaReceiver> validPools = new ArrayList<>();
@Override
public void updateEntity() {
public void update() {
if (worldObj.isRemote)
return;
validPools.clear();
@@ -21,7 +21,7 @@ import vazkii.botania.common.block.tile.TileMod;
public class TileManaDetector extends TileMod {
@Override
public void updateEntity() {
public void update() {
boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED);
boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0;
if(state != expectedState && !worldObj.isRemote)
@@ -214,7 +214,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
}
@Override
public void updateEntity() {
public void update() {
if(manaCap == -1)
manaCap = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.DILUTED ? MAX_MANA_DILLUTED : MAX_MANA;
@@ -69,7 +69,7 @@ public class TilePump extends TileMod {
}
@Override
public void updateEntity() {
public void update() {
hasRedstone = false;
for(EnumFacing dir : EnumFacing.VALUES) {
int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir);
@@ -45,7 +45,7 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo
}
@Override
public void updateEntity() {
public void update() {
if(!worldObj.isRemote && Botania.rfApiLoaded) {
if(deadCache)
reCache();
@@ -182,7 +182,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
}
@Override
public void updateEntity() {
public void update() {
boolean inNetwork = ManaNetworkHandler.instance.isCollectorIn(this);
boolean wasInNetwork = inNetwork;
if(!inNetwork && !isInvalid()) {
@@ -32,7 +32,7 @@ public class TileTurntable extends TileMod {
boolean backwards = false;
@Override
public void updateEntity() {
public void update() {
boolean redstone = false;
for(EnumFacing dir : EnumFacing.VALUES) {
@@ -28,7 +28,7 @@ public abstract class TileRedString extends TileMod implements ITileBound {
private BlockPos binding;
@Override
public void updateEntity() {
public void update() {
EnumFacing dir = getOrientation();
BlockPos pos_ = getPos();
int range = getRange();
@@ -19,8 +19,8 @@ public class TileRedStringComparator extends TileRedString {
int comparatorValue = 0;
@Override
public void updateEntity() {
super.updateEntity();
public void update() {
super.update();
BlockPos binding = getBinding();
EnumFacing dir = getOrientation();
IBlockState state = getStateAtBinding();
@@ -29,8 +29,8 @@ public class TileRedStringInterceptor extends TileRedString {
private static final ThreadLocal<Set<TileRedStringInterceptor>> interceptors = ThreadLocal.withInitial(HashSet::new);;
@Override
public void updateEntity() {
super.updateEntity();
public void update() {
super.update();
interceptors.get().add(this);
}