1696 - find + replace pass

This commit is contained in:
modmuss50 2019-01-13 16:51:50 +00:00
parent 368e2d48df
commit b6312b124a
94 changed files with 418 additions and 419 deletions

View file

@ -60,20 +60,20 @@ public class TileAlarm extends TileEntity
// TileEntity
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
public NBTTagCompound write(NBTTagCompound compound) {
if (compound == null) {
compound = new NBTTagCompound();
}
compound.setInteger("selectedSound", this.selectedSound);
return super.writeToNBT(compound);
compound.setInt("selectedSound", this.selectedSound);
return super.write(compound);
}
@Override
public void readFromNBT(NBTTagCompound compound) {
public void read(NBTTagCompound compound) {
if (compound != null && compound.hasKey("selectedSound")) {
selectedSound = compound.getInteger("selectedSound");
selectedSound = compound.getInt("selectedSound");
}
super.readFromNBT(compound);
super.read(compound);
}
@Override

View file

@ -54,7 +54,7 @@ public class TileEntityFlare extends TileEntity implements ITickable {
}
particleSmokeLarge.multipleParticleScaleBy(0.5F);
Minecraft.getMinecraft().effectRenderer.addEffect(particleSmokeLarge);
Minecraft.getInstance().effectRenderer.addEffect(particleSmokeLarge);
world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 0.3, pos.getZ() + 0.5, 0.0D, 0.0D, 0.0D);
}

View file

@ -137,26 +137,26 @@ public class TilePump extends TilePowerAcceptor {
}
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
readFromNBTWithoutCoords(tagCompound);
public void read(NBTTagCompound tagCompound) {
super.read(tagCompound);
readWithoutCoords(tagCompound);
}
@Override
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) {
tank.readFromNBT(tagCompound);
public void readWithoutCoords(NBTTagCompound tagCompound) {
tank.read(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
writeToNBTWithoutCoords(tagCompound);
public NBTTagCompound write(NBTTagCompound tagCompound) {
super.write(tagCompound);
writeWithoutCoords(tagCompound);
return tagCompound;
}
@Override
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
tank.writeToNBT(tagCompound);
public NBTTagCompound writeWithoutCoords(NBTTagCompound tagCompound) {
tank.write(tagCompound);
return tagCompound;
}

View file

@ -57,21 +57,21 @@ public class TileQuantumTank extends TileMachineBase
public Tank tank = new Tank("TileQuantumTank", maxStorage, this);
public Inventory<TileQuantumTank> inventory = new Inventory<>(3, "TileQuantumTank", 64, this).withConfiguredAccess();
public void readFromNBTWithoutCoords(final NBTTagCompound tagCompound) {
tank.readFromNBT(tagCompound);
public void readWithoutCoords(final NBTTagCompound tagCompound) {
tank.read(tagCompound);
}
public NBTTagCompound writeToNBTWithoutCoords(final NBTTagCompound tagCompound) {
tank.writeToNBT(tagCompound);
public NBTTagCompound writeWithoutCoords(final NBTTagCompound tagCompound) {
tank.write(tagCompound);
return tagCompound;
}
public ItemStack getDropWithNBT() {
final NBTTagCompound tileEntity = new NBTTagCompound();
final ItemStack dropStack = TRContent.Machine.QUANTUM_TANK.getStack();
this.writeToNBTWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
this.writeWithoutCoords(tileEntity);
dropStack.setTag(new NBTTagCompound());
dropStack.getTag().setTag("tileEntity", tileEntity);
return dropStack;
}
@ -93,22 +93,22 @@ public class TileQuantumTank extends TileMachineBase
}
@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
readFromNBTWithoutCoords(tagCompound);
public void read(final NBTTagCompound tagCompound) {
super.read(tagCompound);
readWithoutCoords(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
writeToNBTWithoutCoords(tagCompound);
public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.write(tagCompound);
writeWithoutCoords(tagCompound);
return tagCompound;
}
@Override
public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) {
world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
readFromNBT(packet.getNbtCompound());
read(packet.getNbtCompound());
}
// ItemHandlerProvider

View file

@ -56,7 +56,7 @@ public class TileTechStorageBase extends TileMachineBase
inventory = new Inventory<>(3, name, maxCapacity, this).withConfiguredAccess();
}
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) {
public void readWithoutCoords(NBTTagCompound tagCompound) {
storedItem = ItemStack.EMPTY;
@ -65,33 +65,33 @@ public class TileTechStorageBase extends TileMachineBase
}
if (!storedItem.isEmpty()) {
storedItem.setCount(Math.min(tagCompound.getInteger("storedQuantity"), this.maxCapacity));
storedItem.setCount(Math.min(tagCompound.getInt("storedQuantity"), this.maxCapacity));
}
inventory.readFromNBT(tagCompound);
inventory.read(tagCompound);
}
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
public NBTTagCompound writeWithoutCoords(NBTTagCompound tagCompound) {
if (!storedItem.isEmpty()) {
ItemStack temp = storedItem.copy();
if (storedItem.getCount() > storedItem.getMaxStackSize()) {
temp.setCount(storedItem.getMaxStackSize());
}
tagCompound.setTag("storedStack", temp.writeToNBT(new NBTTagCompound()));
tagCompound.setInteger("storedQuantity", Math.min(storedItem.getCount(), maxCapacity));
tagCompound.setTag("storedStack", temp.write(new NBTTagCompound()));
tagCompound.setInt("storedQuantity", Math.min(storedItem.getCount(), maxCapacity));
} else {
tagCompound.setInteger("storedQuantity", 0);
tagCompound.setInt("storedQuantity", 0);
}
inventory.writeToNBT(tagCompound);
inventory.write(tagCompound);
return tagCompound;
}
public ItemStack getDropWithNBT() {
NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = new ItemStack(getBlockType(), 1);
writeToNBTWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
writeWithoutCoords(tileEntity);
dropStack.setTag(new NBTTagCompound());
dropStack.getTag().setTag("tileEntity", tileEntity);
storedItem.setCount(0);
inventory.setStackInSlot(1, ItemStack.EMPTY);
syncWithAll();
@ -197,19 +197,19 @@ public class TileTechStorageBase extends TileMachineBase
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
readFromNBT(packet.getNbtCompound());
read(packet.getNbtCompound());
}
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
readFromNBTWithoutCoords(tagCompound);
public void read(NBTTagCompound tagCompound) {
super.read(tagCompound);
readWithoutCoords(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
writeToNBTWithoutCoords(tagCompound);
public NBTTagCompound write(NBTTagCompound tagCompound) {
super.write(tagCompound);
writeWithoutCoords(tagCompound);
return tagCompound;
}

View file

@ -96,35 +96,35 @@ public class TileCable extends TileEntity
@Override
public NBTTagCompound getUpdateTag() {
return writeToNBT(new NBTTagCompound());
return write(new NBTTagCompound());
}
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
NBTTagCompound nbtTag = new NBTTagCompound();
writeToNBT(nbtTag);
write(nbtTag);
return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
}
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
readFromNBT(packet.getNbtCompound());
read(packet.getNbtCompound());
}
@Override
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
public void read(NBTTagCompound compound) {
super.read(compound);
if (compound.hasKey("TileCable")) {
power = compound.getCompoundTag("TileCable").getInteger("power");
power = compound.getCompoundTag("TileCable").getInt("power");
}
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
super.writeToNBT(compound);
public NBTTagCompound write(NBTTagCompound compound) {
super.write(compound);
if (power > 0) {
NBTTagCompound data = new NBTTagCompound();
data.setInteger("power", getEnergyStored());
data.setInt("power", getEnergyStored());
compound.setTag("TileCable", data);
}
return compound;

View file

@ -313,11 +313,11 @@ public class TileFusionControlComputer extends TilePowerAcceptor
}
@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
this.crafingTickTime = tagCompound.getInteger("crafingTickTime");
this.finalTickTime = tagCompound.getInteger("finalTickTime");
this.neededPower = tagCompound.getInteger("neededPower");
public void read(final NBTTagCompound tagCompound) {
super.read(tagCompound);
this.crafingTickTime = tagCompound.getInt("crafingTickTime");
this.finalTickTime = tagCompound.getInt("finalTickTime");
this.neededPower = tagCompound.getInt("neededPower");
this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");
if(tagCompound.hasKey("hasActiveRecipe") && tagCompound.getBoolean("hasActiveRecipe") && this.currentRecipe == null){
for (final FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) {
@ -327,20 +327,20 @@ public class TileFusionControlComputer extends TilePowerAcceptor
}
}
if(tagCompound.hasKey("size")){
this.size = tagCompound.getInteger("size");
this.size = tagCompound.getInt("size");
}
this.size = Math.min(size, maxCoilSize);//Done here to force the samller size, will be useful if people lag out on a large one.
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tagCompound.setInteger("crafingTickTime", this.crafingTickTime);
tagCompound.setInteger("finalTickTime", this.finalTickTime);
tagCompound.setInteger("neededPower", this.neededPower);
public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.write(tagCompound);
tagCompound.setInt("crafingTickTime", this.crafingTickTime);
tagCompound.setInt("finalTickTime", this.finalTickTime);
tagCompound.setInt("neededPower", this.neededPower);
tagCompound.setBoolean("hasStartedCrafting", this.hasStartedCrafting);
tagCompound.setBoolean("hasActiveRecipe", this.currentRecipe != null);
tagCompound.setInteger("size", size);
tagCompound.setInt("size", size);
return tagCompound;
}

View file

@ -108,10 +108,10 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
}
if (world.getTotalWorldTime() - lastOutput < 30 && !isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, true));
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
}
else if (world.getTotalWorldTime() - lastOutput > 30 && isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, false));
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false));
}
}
@ -173,15 +173,15 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement
}
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
tank.readFromNBT(tagCompound);
public void read(NBTTagCompound tagCompound) {
super.read(tagCompound);
tank.read(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tank.writeToNBT(tagCompound);
public NBTTagCompound write(NBTTagCompound tagCompound) {
super.write(tagCompound);
tank.write(tagCompound);
return tagCompound;
}

View file

@ -65,7 +65,7 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
if (world.getTotalWorldTime() % 20 == 0) {
canSeeSky = world.canBlockSeeSky(pos.up());
if (lastState != isSunOut()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockSolarPanel.ACTIVE, isSunOut()));
world.setBlockState(pos, world.getBlockState(pos).with(BlockSolarPanel.ACTIVE, isSunOut()));
lastState = isSunOut();
}
}
@ -138,12 +138,12 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void read(NBTTagCompound tag) {
if (world == null) {
// We are in TileEntity.create method during chunk load.
this.checkOverfill = false;
}
super.readFromNBT(tag);
super.read(tag);
}
// TileMachineBase

View file

@ -81,9 +81,9 @@ public class TileDragonEggSyphon extends TilePowerAcceptor
}
if (world.getTotalWorldTime() - lastOutput < 30 && !isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, true));
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true));
} else if (world.getTotalWorldTime() - lastOutput > 30 && isActive()) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockMachineBase.ACTIVE, false));
world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false));
}
}
}

View file

@ -64,10 +64,10 @@ public class TileWaterMill extends TilePowerAcceptor implements IToolDrop {
}
if (waterblocks > 0) {
addEnergy(waterblocks * energyMultiplier);
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockWindMill.ACTIVE, true));
world.setBlockState(pos, world.getBlockState(pos).with(BlockWindMill.ACTIVE, true));
}
else {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockWindMill.ACTIVE, false));
world.setBlockState(pos, world.getBlockState(pos).with(BlockWindMill.ACTIVE, false));
}
}

View file

@ -110,15 +110,15 @@ public class TileFluidReplicator extends TileGenericMachine implements IContaine
// TilePowerAcceptor
@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
tank.readFromNBT(tagCompound);
public void read(final NBTTagCompound tagCompound) {
super.read(tagCompound);
tank.read(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tank.writeToNBT(tagCompound);
public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.write(tagCompound);
tank.write(tagCompound);
return tagCompound;
}

View file

@ -142,7 +142,7 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
@Override
public void onDataPacket(final NetworkManager net, final SPacketUpdateTileEntity packet) {
world.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
readFromNBT(packet.getNbtCompound());
read(packet.getNbtCompound());
}
// IContainerProvider

View file

@ -125,15 +125,15 @@ public class TileIndustrialGrinder extends TileGenericMachine implements IContai
}
@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
tank.readFromNBT(tagCompound);
public void read(final NBTTagCompound tagCompound) {
super.read(tagCompound);
tank.read(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tank.writeToNBT(tagCompound);
public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.write(tagCompound);
tank.write(tagCompound);
return tagCompound;
}

View file

@ -116,15 +116,15 @@ public class TileIndustrialSawmill extends TileGenericMachine implements IContai
// TilePowerAcceptor
@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
tank.readFromNBT(tagCompound);
public void read(final NBTTagCompound tagCompound) {
super.read(tagCompound);
tank.read(tagCompound);
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tank.writeToNBT(tagCompound);
public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.write(tagCompound);
tank.write(tagCompound);
return tagCompound;
}

View file

@ -378,17 +378,17 @@ public class TileAutoCraftingTable extends TilePowerAcceptor
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
public NBTTagCompound write(NBTTagCompound tag) {
tag.setBoolean("locked", locked);
return super.writeToNBT(tag);
return super.write(tag);
}
@Override
public void readFromNBT(NBTTagCompound tag) {
public void read(NBTTagCompound tag) {
if (tag.hasKey("locked")) {
locked = tag.getBoolean("locked");
}
super.readFromNBT(tag);
super.read(tag);
}
// TileMachineBase

View file

@ -123,14 +123,14 @@ public class TilePlayerDectector extends TilePowerAcceptor implements IToolDrop
}
@Override
public void readFromNBT(NBTTagCompound tag) {
super.readFromNBT(tag);
public void read(NBTTagCompound tag) {
super.read(tag);
owenerUdid = tag.getString("ownerID");
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
super.writeToNBT(tag);
public NBTTagCompound write(NBTTagCompound tag) {
super.write(tag);
tag.setString("ownerID", owenerUdid);
return tag;
}

View file

@ -278,18 +278,18 @@ public class TileRollingMachine extends TilePowerAcceptor
}
@Override
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
public void read(final NBTTagCompound tagCompound) {
super.read(tagCompound);
this.isRunning = tagCompound.getBoolean("isRunning");
this.tickTime = tagCompound.getInteger("tickTime");
this.tickTime = tagCompound.getInt("tickTime");
this.locked = tagCompound.getBoolean("locked");
}
@Override
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
public NBTTagCompound write(final NBTTagCompound tagCompound) {
super.write(tagCompound);
tagCompound.setBoolean("isRunning", this.isRunning);
tagCompound.setInteger("tickTime", this.tickTime);
tagCompound.setInt("tickTime", this.tickTime);
tagCompound.setBoolean("locked", locked);
return tagCompound;
}

View file

@ -78,9 +78,9 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
public ItemStack getDropWithNBT() {
NBTTagCompound tileEntity = new NBTTagCompound();
ItemStack dropStack = TRContent.Machine.ADJUSTABLE_SU.getStack();
writeToNBTWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
writeWithoutCoords(tileEntity);
dropStack.setTag(new NBTTagCompound());
dropStack.getTag().setTag("tileEntity", tileEntity);
return dropStack;
}
@ -105,18 +105,18 @@ public class TileAdjustableSU extends TileEnergyStorage implements IContainerPro
// TilePowerAcceptor
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tagCompound.setInteger("output", OUTPUT);
inventory.writeToNBT(tagCompound);
public NBTTagCompound write(NBTTagCompound tagCompound) {
super.write(tagCompound);
tagCompound.setInt("output", OUTPUT);
inventory.write(tagCompound);
return tagCompound;
}
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound);
this.OUTPUT = nbttagcompound.getInteger("output");
inventory.readFromNBT(nbttagcompound);
public void read(NBTTagCompound nbttagcompound) {
super.read(nbttagcompound);
this.OUTPUT = nbttagcompound.getInt("output");
inventory.read(nbttagcompound);
}
// IContainerProvider

View file

@ -110,7 +110,7 @@ public class TileEnergyStorage extends TilePowerAcceptor
// TileMachineBase
@Override
public void setFacing(EnumFacing enumFacing) {
world.setBlockState(pos, world.getBlockState(pos).withProperty(BlockEnergyStorage.FACING, enumFacing));
world.setBlockState(pos, world.getBlockState(pos).with(BlockEnergyStorage.FACING, enumFacing));
}
@Override

View file

@ -37,12 +37,12 @@ public class IDSUSaveManger extends WorldSavedData implements IDataIDSU {
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
public void read(NBTTagCompound nbt) {
power = nbt.getDouble("power");
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
public NBTTagCompound write(NBTTagCompound compound) {
compound.setDouble("power", power);
return compound;
}

View file

@ -93,14 +93,14 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
}
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
super.readFromNBT(nbttagcompound);
public void read(NBTTagCompound nbttagcompound) {
super.read(nbttagcompound);
this.ownerUdid = nbttagcompound.getString("ownerUdid");
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
super.writeToNBT(nbttagcompound);
public NBTTagCompound write(NBTTagCompound nbttagcompound) {
super.write(nbttagcompound);
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
return nbttagcompound;
}