1.15 port
This commit is contained in:
@@ -24,12 +24,12 @@ import java.util.Optional;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
@@ -41,10 +41,10 @@ import appeng.util.item.AEItemStack;
|
||||
public class TileCraftingMonitorTile extends TileCraftingTile implements IColorableTile
|
||||
{
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
private Integer dspList;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
private boolean updateList;
|
||||
|
||||
private IAEItemStack dspPlay;
|
||||
@@ -90,7 +90,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "paintedColor" ) )
|
||||
@@ -100,7 +100,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT( final NBTTagCompound data )
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setByte( "paintedColor", (byte) this.paintedColor.ordinal() );
|
||||
@@ -154,7 +154,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolourBlock( final EnumFacing side, final AEColor newPaintedColor, final EntityPlayer who )
|
||||
public boolean recolourBlock( final Direction side, final AEColor newPaintedColor, final PlayerEntity who )
|
||||
{
|
||||
if( this.paintedColor == newPaintedColor )
|
||||
{
|
||||
|
||||
@@ -25,11 +25,11 @@ import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -60,14 +60,14 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
{
|
||||
|
||||
private final CraftingCPUCalculator calc = new CraftingCPUCalculator( this );
|
||||
private NBTTagCompound previousState = null;
|
||||
private CompoundNBT previousState = null;
|
||||
private boolean isCoreBlock = false;
|
||||
private CraftingCPUCluster cluster;
|
||||
|
||||
public TileCraftingTile()
|
||||
{
|
||||
this.getProxy().setFlags( GridFlags.MULTIBLOCK, GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( EnumFacing.class ) );
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,12 +160,12 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
power = this.getProxy().isActive();
|
||||
}
|
||||
|
||||
final IBlockState current = this.world.getBlockState( this.pos );
|
||||
final BlockState current = this.world.getBlockState( this.pos );
|
||||
|
||||
// The tile might try to update while being destroyed
|
||||
if( current.getBlock() instanceof BlockCraftingUnit )
|
||||
{
|
||||
final IBlockState newState = current.withProperty( BlockCraftingUnit.POWERED, power ).withProperty( BlockCraftingUnit.FORMED, formed );
|
||||
final BlockState newState = current.withProperty( BlockCraftingUnit.POWERED, power ).withProperty( BlockCraftingUnit.FORMED, formed );
|
||||
|
||||
if( current != newState )
|
||||
{
|
||||
@@ -179,11 +179,11 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
{
|
||||
if( formed )
|
||||
{
|
||||
this.getProxy().setValidSides( EnumSet.allOf( EnumFacing.class ) );
|
||||
this.getProxy().setValidSides( EnumSet.allOf( Direction.class ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( EnumFacing.class ) );
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT( final NBTTagCompound data )
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "core", this.isCoreBlock() );
|
||||
@@ -210,7 +210,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.setCoreBlock( data.getBoolean( "core" ) );
|
||||
@@ -372,12 +372,12 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
this.isCoreBlock = isCoreBlock;
|
||||
}
|
||||
|
||||
public NBTTagCompound getPreviousState()
|
||||
public CompoundNBT getPreviousState()
|
||||
{
|
||||
return this.previousState;
|
||||
}
|
||||
|
||||
public void setPreviousState( final NBTTagCompound previousState )
|
||||
public void setPreviousState( final CompoundNBT previousState )
|
||||
{
|
||||
this.previousState = previousState;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
@@ -115,7 +115,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table, final EnumFacing where )
|
||||
public boolean pushPattern( final ICraftingPatternDetails patternDetails, final InventoryCrafting table, final Direction where )
|
||||
{
|
||||
if( this.myPattern.isEmpty() )
|
||||
{
|
||||
@@ -213,7 +213,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT( final NBTTagCompound data )
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
if( this.forcePlan && this.myPlan != null )
|
||||
@@ -221,7 +221,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
final ItemStack pattern = this.myPlan.getPattern();
|
||||
if( !pattern.isEmpty() )
|
||||
{
|
||||
final NBTTagCompound compound = new NBTTagCompound();
|
||||
final CompoundNBT compound = new CompoundNBT();
|
||||
pattern.writeToNBT( compound );
|
||||
data.setTag( "myPlan", compound );
|
||||
data.setInteger( "pushDirection", this.pushDirection.ordinal() );
|
||||
@@ -234,7 +234,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
if( data.hasKey( "myPlan" ) )
|
||||
@@ -346,7 +346,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IItemHandler getItemHandlerForSide( EnumFacing side )
|
||||
protected IItemHandler getItemHandlerForSide( Direction side )
|
||||
{
|
||||
return this.gridInvExt;
|
||||
}
|
||||
@@ -536,7 +536,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
{
|
||||
if( this.pushDirection == AEPartLocation.INTERNAL )
|
||||
{
|
||||
for( final EnumFacing d : EnumFacing.VALUES )
|
||||
for( final Direction d : Direction.VALUES )
|
||||
{
|
||||
output = this.pushTo( output, d );
|
||||
}
|
||||
@@ -555,7 +555,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
this.gridInv.setStackInSlot( 9, output );
|
||||
}
|
||||
|
||||
private ItemStack pushTo( ItemStack output, final EnumFacing d )
|
||||
private ItemStack pushTo( ItemStack output, final Direction d )
|
||||
{
|
||||
if( output.isEmpty() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user