Some additional fixes from other branch.
This commit is contained in:
@@ -56,7 +56,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements IAEAppEngInven
|
||||
for( int x = 0; x < inv.getSlots(); x++ )
|
||||
{
|
||||
final CompoundNBT item = opt.getCompoundTag( "item" + x );
|
||||
ItemHandlerUtil.setStackInSlot( inv, x, new ItemStack( item ) );
|
||||
ItemHandlerUtil.setStackInSlot( inv, x, ItemStack.read(item) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public abstract class AEBaseInvTile extends AEBaseTile implements IAEAppEngInven
|
||||
final ItemStack is = inv.getStackInSlot( x );
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
is.writeToNBT( item );
|
||||
is.write(item);
|
||||
}
|
||||
opt.setTag( "item" + x, item );
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "paintedColor" ) )
|
||||
if( data.contains("paintedColor") )
|
||||
{
|
||||
this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )];
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "core", this.isCoreBlock() );
|
||||
data.putBoolean("core", this.isCoreBlock());
|
||||
if( this.isCoreBlock() && this.cluster != null )
|
||||
{
|
||||
this.cluster.writeToNBT( data );
|
||||
|
||||
@@ -222,7 +222,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
if( !pattern.isEmpty() )
|
||||
{
|
||||
final CompoundNBT compound = new CompoundNBT();
|
||||
pattern.writeToNBT( compound );
|
||||
pattern.write(compound);
|
||||
data.setTag( "myPlan", compound );
|
||||
data.setInteger( "pushDirection", this.pushDirection.ordinal() );
|
||||
}
|
||||
@@ -237,7 +237,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "myPlan" ) )
|
||||
if( data.contains("myPlan") )
|
||||
{
|
||||
final ItemStack myPat = new ItemStack( data.getCompoundTag( "myPlan" ) );
|
||||
|
||||
|
||||
@@ -157,18 +157,18 @@ public class TileCrank extends AEBaseTile implements ICustomCollision, ITickable
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
|
||||
{
|
||||
final double xOff = -0.15 * this.getUp().getFrontOffsetX();
|
||||
final double yOff = -0.15 * this.getUp().getFrontOffsetY();
|
||||
final double zOff = -0.15 * this.getUp().getFrontOffsetZ();
|
||||
final double xOff = -0.15 * this.getUp().getXOffset();
|
||||
final double yOff = -0.15 * this.getUp().getYOffset();
|
||||
final double zOff = -0.15 * this.getUp().getZOffset();
|
||||
return Collections.singletonList( new AxisAlignedBB( xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
final double xOff = -0.15 * this.getUp().getFrontOffsetX();
|
||||
final double yOff = -0.15 * this.getUp().getFrontOffsetY();
|
||||
final double zOff = -0.15 * this.getUp().getFrontOffsetZ();
|
||||
final double xOff = -0.15 * this.getUp().getXOffset();
|
||||
final double yOff = -0.15 * this.getUp().getYOffset();
|
||||
final double zOff = -0.15 * this.getUp().getZOffset();
|
||||
out.add( new AxisAlignedBB( xOff + 0.15, yOff + 0.15, zOff + 0.15, // ahh
|
||||
xOff + 0.85, yOff + 0.85, zOff + 0.85 ) );
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class AppEngInternalAEInventory implements IItemHandlerModifiable, Iterab
|
||||
|
||||
if( this.inv[x] != null )
|
||||
{
|
||||
this.inv[x].writeToNBT( c );
|
||||
this.inv[x].write(c);
|
||||
}
|
||||
|
||||
target.put( "#" + x, c );
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
||||
@@ -89,7 +89,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
this.cm.writeToNBT( data );
|
||||
data.setDouble( "storedPower", this.getStoredPower() );
|
||||
data.putDouble("storedPower", this.getStoredPower());
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -538,26 +538,26 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
|
||||
if( !plateA.isEmpty() )
|
||||
{
|
||||
final CompoundNBT tag = Platform.openNbtData( plateA );
|
||||
final CompoundNBT tag = plateA.getOrCreateTag();
|
||||
name += tag.getString( "InscribeName" );
|
||||
}
|
||||
|
||||
if( !plateB.isEmpty() )
|
||||
{
|
||||
final CompoundNBT tag = Platform.openNbtData( plateB );
|
||||
final CompoundNBT tag = plateB.getOrCreateTag();
|
||||
name += " " + tag.getString( "InscribeName" );
|
||||
}
|
||||
|
||||
final ItemStack startingItem = input.copy();
|
||||
final ItemStack renamedItem = input.copy();
|
||||
final CompoundNBT tag = Platform.openNbtData( renamedItem );
|
||||
final CompoundNBT tag = renamedItem.getOrCreateTag();
|
||||
|
||||
final CompoundNBT display = tag.getCompoundTag( "display" );
|
||||
tag.setTag( "display", display );
|
||||
|
||||
if( name.length() > 0 )
|
||||
{
|
||||
display.setString( "Name", name );
|
||||
display.putString("Name", name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "omniDirectional", this.omniDirectional );
|
||||
data.putBoolean("omniDirectional", this.omniDirectional);
|
||||
this.duality.writeToNBT( data );
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class TilePaint extends AEBaseTile
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "dots" ) )
|
||||
if( data.contains("dots") )
|
||||
{
|
||||
this.readBuffer( Unpooled.copiedBuffer( data.getByteArray( "dots" ) ) );
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
this.cm.writeToNBT( data );
|
||||
data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() );
|
||||
|
||||
data.setLong( "securityKey", this.securityKey );
|
||||
data.putLong( "securityKey", this.securityKey );
|
||||
this.getConfigSlot().writeToNBT( data, "config" );
|
||||
|
||||
final CompoundNBT storedItems = new CompoundNBT();
|
||||
@@ -173,7 +173,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
for( final IAEItemStack ais : this.inventory.getStoredItems() )
|
||||
{
|
||||
final CompoundNBT it = new CompoundNBT();
|
||||
ais.createItemStack().writeToNBT( it );
|
||||
ais.createItemStack().write(it);
|
||||
storedItems.setTag( String.valueOf( offset ), it );
|
||||
offset++;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.cm.readFromNBT( data );
|
||||
if( data.hasKey( "paintedColor" ) )
|
||||
if( data.contains("paintedColor") )
|
||||
{
|
||||
this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )];
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
final NBTBase obj = storedItems.getTag( (String) key );
|
||||
if( obj instanceof CompoundNBT )
|
||||
{
|
||||
this.inventory.getStoredItems().add( AEItemStack.fromItemStack( new ItemStack( (CompoundNBT) obj ) ) );
|
||||
this.inventory.getStoredItems().add( AEItemStack.fromItemStack( ItemStack.read((CompoundNBT) obj) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setDouble( "burnTime", this.getBurnTime() );
|
||||
data.setDouble( "maxBurnTime", this.getMaxBurnTime() );
|
||||
data.putDouble("burnTime", this.getBurnTime());
|
||||
data.putDouble("maxBurnTime", this.getMaxBurnTime());
|
||||
data.setInteger( "burnSpeed", this.getBurnSpeed() );
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setDouble( "internalCurrentPower", this.internalCurrentPower );
|
||||
data.putDouble("internalCurrentPower", this.internalCurrentPower);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -134,8 +134,8 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
if( from == SettingsFrom.DISMANTLE_ITEM )
|
||||
{
|
||||
final CompoundNBT tag = new CompoundNBT();
|
||||
tag.setDouble( "internalCurrentPower", this.internalCurrentPower );
|
||||
tag.setDouble( "internalMaxPower", this.getInternalMaxPower() ); // used for tool tip.
|
||||
tag.putDouble("internalCurrentPower", this.internalCurrentPower);
|
||||
tag.putDouble("internalMaxPower", this.getInternalMaxPower()); // used for tool tip.
|
||||
return tag;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class AEBasePoweredTile extends AEBaseInvTile implements IAEPowe
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setDouble( "internalCurrentPower", this.getInternalCurrentPower() );
|
||||
data.putDouble("internalCurrentPower", this.getInternalCurrentPower());
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements IWorldCallabl
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "lastRedstoneState" ) )
|
||||
if( data.contains("lastRedstoneState") )
|
||||
{
|
||||
this.lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )];
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
||||
@@ -436,7 +436,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
super.readFromNBT( data );
|
||||
this.config.readFromNBT( data );
|
||||
this.priority = data.getInteger( "priority" );
|
||||
if( data.hasKey( "paintedColor" ) )
|
||||
if( data.contains("paintedColor") )
|
||||
{
|
||||
this.paintedColor = AEColor.values()[data.getByte( "paintedColor" )];
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
super.readFromNBT( data );
|
||||
this.manager.readFromNBT( data );
|
||||
this.upgrades.readFromNBT( data, "upgrades" );
|
||||
if( data.hasKey( "lastRedstoneState" ) )
|
||||
if( data.contains("lastRedstoneState") )
|
||||
{
|
||||
this.lastRedstoneState = YesNo.values()[data.getInteger( "lastRedstoneState" )];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user