1.15 port
This commit is contained in:
@@ -22,10 +22,10 @@ package appeng.debug;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlockCubeGenerator extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
final TileCubeGenerator tcg = this.getTileEntity( w, pos );
|
||||
if( tcg != null )
|
||||
|
||||
@@ -22,10 +22,10 @@ package appeng.debug;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlockPhantomNode extends AEBaseTileBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
final TilePhantomNode tpn = this.getTileEntity( w, pos );
|
||||
tpn.triggerCrashMode();
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.debug;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.PlayerEntityMP;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
@@ -67,8 +67,8 @@ public class TileChunkLoader extends AEBaseTile implements ITickable
|
||||
final MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
if( server != null )
|
||||
{
|
||||
final List<EntityPlayerMP> pl = server.getPlayerList().getPlayers();
|
||||
for( final EntityPlayerMP p : pl )
|
||||
final List<PlayerEntityMP> pl = server.getPlayerList().getPlayers();
|
||||
for( final PlayerEntityMP p : pl )
|
||||
{
|
||||
p.sendMessage( new TextComponentString( "Can't chunk load.." ) );
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
@@ -39,7 +39,7 @@ public class TileCubeGenerator extends AEBaseTile implements ITickable
|
||||
private int size = 3;
|
||||
private ItemStack is = ItemStack.EMPTY;
|
||||
private int countdown = 20 * 10;
|
||||
private EntityPlayer who = null;
|
||||
private PlayerEntity who = null;
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
@@ -50,7 +50,7 @@ public class TileCubeGenerator extends AEBaseTile implements ITickable
|
||||
|
||||
if( this.countdown % 20 == 0 )
|
||||
{
|
||||
for( final EntityPlayer e : AppEng.proxy.getPlayers() )
|
||||
for( final PlayerEntity e : AppEng.proxy.getPlayers() )
|
||||
{
|
||||
e.sendMessage( new TextComponentString( "Spawning in... " + ( this.countdown / 20 ) ) );
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class TileCubeGenerator extends AEBaseTile implements ITickable
|
||||
this.world.setBlockToAir( this.pos );
|
||||
|
||||
final Item i = this.is.getItem();
|
||||
final EnumFacing side = EnumFacing.UP;
|
||||
final Direction side = Direction.UP;
|
||||
|
||||
final int half = (int) Math.floor( this.size / 2 );
|
||||
|
||||
@@ -79,13 +79,13 @@ public class TileCubeGenerator extends AEBaseTile implements ITickable
|
||||
for( int z = -half; z < half; z++ )
|
||||
{
|
||||
final BlockPos p = this.pos.add( x, y - 1, z );
|
||||
i.onItemUse( this.who, this.world, p, EnumHand.MAIN_HAND, side, 0.5f, 0.0f, 0.5f );
|
||||
i.onItemUse( this.who, this.world, p, Hand.MAIN_HAND, side, 0.5f, 0.0f, 0.5f );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void click( final EntityPlayer player )
|
||||
void click( final PlayerEntity player )
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public class TileCubeGenerator extends AEBaseTile implements ITickable
|
||||
{
|
||||
this.is = ItemStack.EMPTY;
|
||||
|
||||
if( player.isSneaking() )
|
||||
if( player.isShiftKeyDown() )
|
||||
{
|
||||
this.size--;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import javax.annotation.Nullable;
|
||||
import com.google.common.math.IntMath;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
@@ -47,9 +47,9 @@ public class TileEnergyGenerator extends AEBaseTile implements ITickable, IEnerg
|
||||
public void update()
|
||||
{
|
||||
int tier = 1;
|
||||
final EnumSet<EnumFacing> validEnergyReceivers = EnumSet.noneOf( EnumFacing.class );
|
||||
final EnumSet<Direction> validEnergyReceivers = EnumSet.noneOf( Direction.class );
|
||||
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
for( Direction facing : Direction.values() )
|
||||
{
|
||||
final TileEntity te = this.getWorld().getTileEntity( this.getPos().offset( facing ) );
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TileEnergyGenerator extends AEBaseTile implements ITickable, IEnerg
|
||||
|
||||
final int energyToInsert = IntMath.pow( BASE_ENERGY, tier );
|
||||
|
||||
for( EnumFacing facing : validEnergyReceivers )
|
||||
for( Direction facing : validEnergyReceivers )
|
||||
{
|
||||
final TileEntity te = this.getWorld().getTileEntity( this.getPos().offset( facing ) );
|
||||
final IEnergyStorage cap = te.getCapability( CapabilityEnergy.ENERGY, facing.getOpposite() );
|
||||
@@ -81,7 +81,7 @@ public class TileEnergyGenerator extends AEBaseTile implements ITickable, IEnerg
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable EnumFacing facing )
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( capability == CapabilityEnergy.ENERGY )
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public class TileEnergyGenerator extends AEBaseTile implements ITickable, IEnerg
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( capability == CapabilityEnergy.ENERGY )
|
||||
{
|
||||
|
||||
@@ -25,10 +25,10 @@ import java.util.Queue;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
@@ -72,7 +72,7 @@ public class TileItemGen extends AEBaseTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable EnumFacing facing )
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY == capability )
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public class TileItemGen extends AEBaseTile
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY == capability )
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.debug;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
@@ -60,7 +60,7 @@ public class TilePhantomNode extends AENetworkTile
|
||||
if( this.proxy != null )
|
||||
{
|
||||
this.crashMode = true;
|
||||
this.proxy.setValidSides( EnumSet.allOf( EnumFacing.class ) );
|
||||
this.proxy.setValidSides( EnumSet.allOf( Direction.class ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.world.World;
|
||||
@@ -56,14 +56,14 @@ import appeng.util.Platform;
|
||||
public class ToolDebugCard extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
if( player.isSneaking() )
|
||||
if( player.isShiftKeyDown() )
|
||||
{
|
||||
int grids = 0;
|
||||
int totalNodes = 0;
|
||||
|
||||
@@ -22,11 +22,11 @@ package appeng.debug;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -41,14 +41,14 @@ public class ToolEraser extends AEBaseItem
|
||||
private static final int BLOCK_ERASE_LIMIT = 90000;
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
final IBlockState state = world.getBlockState( pos );
|
||||
final BlockState state = world.getBlockState( pos );
|
||||
|
||||
List<BlockPos> next = new ArrayList<>();
|
||||
next.add( pos );
|
||||
@@ -61,7 +61,7 @@ public class ToolEraser extends AEBaseItem
|
||||
|
||||
for( final BlockPos wc : c )
|
||||
{
|
||||
final IBlockState c_state = world.getBlockState( wc );
|
||||
final BlockState c_state = world.getBlockState( wc );
|
||||
|
||||
if( state == c_state )
|
||||
{
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package appeng.debug;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.world.World;
|
||||
@@ -36,7 +36,7 @@ import appeng.worldgen.meteorite.StandardWorld;
|
||||
public class ToolMeteoritePlacer extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
|
||||
@@ -20,14 +20,14 @@ package appeng.debug;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,7 +46,7 @@ import appeng.util.Platform;
|
||||
public class ToolReplicatorCard extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final EntityPlayer player, final World world, final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -57,11 +57,11 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
|
||||
if( player.isSneaking() )
|
||||
if( player.isShiftKeyDown() )
|
||||
{
|
||||
if( world.getTileEntity( pos ) instanceof IGridHost )
|
||||
{
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
final CompoundNBT tag = new CompoundNBT();
|
||||
tag.setInteger( "x", x );
|
||||
tag.setInteger( "y", y );
|
||||
tag.setInteger( "z", z );
|
||||
@@ -76,7 +76,7 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
}
|
||||
else
|
||||
{
|
||||
final NBTTagCompound ish = player.getHeldItem( hand ).getTagCompound();
|
||||
final CompoundNBT ish = player.getHeldItem( hand ).getTagCompound();
|
||||
if( ish != null )
|
||||
{
|
||||
final int src_x = ish.getInteger( "x" );
|
||||
@@ -90,8 +90,8 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
final IGridHost gh = (IGridHost) te;
|
||||
final EnumFacing sideOff = EnumFacing.VALUES[src_side];
|
||||
final EnumFacing currentSideOff = side;
|
||||
final Direction sideOff = Direction.VALUES[src_side];
|
||||
final Direction currentSideOff = side;
|
||||
final IGridNode n = gh.getGridNode( AEPartLocation.fromFacing( sideOff ) );
|
||||
if( n != null )
|
||||
{
|
||||
@@ -128,16 +128,16 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
{
|
||||
final BlockPos p = new BlockPos( min_x + i, min_y + j, min_z + k );
|
||||
final BlockPos d = new BlockPos( i + rel_x, j + rel_y, k + rel_z );
|
||||
final IBlockState state = src_w.getBlockState( p );
|
||||
final BlockState state = src_w.getBlockState( p );
|
||||
final Block blk = state.getBlock();
|
||||
final IBlockState prev = world.getBlockState( d );
|
||||
final BlockState prev = world.getBlockState( d );
|
||||
|
||||
world.setBlockState( d, state );
|
||||
if( blk != null && blk.hasTileEntity( state ) )
|
||||
{
|
||||
final TileEntity ote = src_w.getTileEntity( p );
|
||||
final TileEntity nte = blk.createTileEntity( world, state );
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
final CompoundNBT data = new CompoundNBT();
|
||||
ote.writeToNBT( data );
|
||||
nte.readFromNBT( data.copy() );
|
||||
world.setTileEntity( d, nte );
|
||||
|
||||
Reference in New Issue
Block a user