1.15 port

This commit is contained in:
yueh
2020-05-18 14:02:45 +02:00
parent 0ea86c939c
commit 16d6d55d7f
630 changed files with 4211 additions and 12664 deletions
@@ -24,7 +24,7 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.INetHandler;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
@@ -42,7 +42,7 @@ public abstract class AppEngPacket implements Packet
private PacketBuffer p;
private PacketCallState caller;
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." );
}
@@ -52,7 +52,7 @@ public abstract class AppEngPacket implements Packet
return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal();
}
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
throw new UnsupportedOperationException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." );
}
+10 -10
View File
@@ -21,8 +21,8 @@ package appeng.core.sync;
import java.lang.reflect.Constructor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
@@ -264,7 +264,7 @@ public enum GuiBridge implements IGuiHandler
}
@Override
public Object getServerGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z )
public Object getServerGuiElement( final int ordinal, final PlayerEntity player, final World w, final int x, final int y, final int z )
{
final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
final GuiBridge ID = values()[ordinal >> 4];
@@ -309,7 +309,7 @@ public enum GuiBridge implements IGuiHandler
return new ContainerNull();
}
private Object getGuiObject( final ItemStack it, final EntityPlayer player, final World w, final int x, final int y, final int z )
private Object getGuiObject( final ItemStack it, final PlayerEntity player, final World w, final int x, final int y, final int z )
{
if( !it.isEmpty() )
{
@@ -354,7 +354,7 @@ public enum GuiBridge implements IGuiHandler
return newContainer;
}
public Object ConstructContainer( final InventoryPlayer inventory, final AEPartLocation side, final Object tE )
public Object ConstructContainer( final PlayerInventory inventory, final AEPartLocation side, final Object tE )
{
try
{
@@ -380,7 +380,7 @@ public enum GuiBridge implements IGuiHandler
}
}
private Constructor findConstructor( final Constructor[] c, final InventoryPlayer inventory, final Object tE )
private Constructor findConstructor( final Constructor[] c, final PlayerInventory inventory, final Object tE )
{
for( final Constructor con : c )
{
@@ -407,7 +407,7 @@ public enum GuiBridge implements IGuiHandler
}
@Override
public Object getClientGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z )
public Object getClientGuiElement( final int ordinal, final PlayerEntity player, final World w, final int x, final int y, final int z )
{
final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
final GuiBridge ID = values()[ordinal >> 4];
@@ -452,7 +452,7 @@ public enum GuiBridge implements IGuiHandler
return new GuiNull( new ContainerNull() );
}
public Object ConstructGui( final InventoryPlayer inventory, final AEPartLocation side, final Object tE )
public Object ConstructGui( final PlayerInventory inventory, final AEPartLocation side, final Object tE )
{
try
{
@@ -478,7 +478,7 @@ public enum GuiBridge implements IGuiHandler
}
}
public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final AEPartLocation side, final EntityPlayer player )
public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final AEPartLocation side, final PlayerEntity player )
{
final World w = player.getEntityWorld();
final BlockPos pos = new BlockPos( x, y, z );
@@ -522,7 +522,7 @@ public enum GuiBridge implements IGuiHandler
return false;
}
private boolean securityCheck( final Object te, final EntityPlayer player )
private boolean securityCheck( final Object te, final PlayerEntity player )
{
if( te instanceof IActionHost && this.requiredPermission != null )
{
@@ -24,7 +24,7 @@ import java.lang.reflect.InvocationTargetException;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.INetHandler;
import net.minecraft.network.PacketThreadUtil;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
@@ -39,7 +39,7 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
{
@Override
public void onPacketData( final INetworkInfo manager, final INetHandler handler, final FMLProxyPacket packet, final EntityPlayer player )
public void onPacketData( final INetworkInfo manager, final INetHandler handler, final FMLProxyPacket packet, final PlayerEntity player )
{
final ByteBuf stream = packet.payload();
@@ -54,12 +54,12 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
@Override
public void call( final AppEngPacket appEngPacket )
{
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().player );
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getInstance().player );
}
};
pack.setCallParam( callState );
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, Minecraft.getMinecraft() );
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, Minecraft.getInstance() );
callState.call( pack );
}
catch( final InstantiationException e )
@@ -23,8 +23,8 @@ import java.lang.reflect.InvocationTargetException;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.network.INetHandler;
import net.minecraft.network.PacketThreadUtil;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
@@ -39,7 +39,7 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
{
@Override
public void onPacketData( final INetworkInfo manager, final INetHandler handler, final FMLProxyPacket packet, final EntityPlayer player )
public void onPacketData( final INetworkInfo manager, final INetHandler handler, final FMLProxyPacket packet, final PlayerEntity player )
{
final ByteBuf stream = packet.payload();
@@ -59,7 +59,7 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
};
pack.setCallParam( callState );
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ( (EntityPlayerMP) player ).getServer() );
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ( (PlayerEntityMP) player ).getServer() );
callState.call( pack );
}
catch( final InstantiationException e )
@@ -19,7 +19,7 @@
package appeng.core.sync.network;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.INetHandler;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
@@ -27,6 +27,6 @@ import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
public interface IPacketHandler
{
void onPacketData( INetworkInfo manager, INetHandler handler, FMLProxyPacket packet, EntityPlayer player );
void onPacketData( INetworkInfo manager, INetHandler handler, FMLProxyPacket packet, PlayerEntity player );
}
@@ -19,7 +19,7 @@
package appeng.core.sync.network;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.ThreadQuickExitException;
import net.minecraftforge.fml.common.FMLCommonHandler;
@@ -129,7 +129,7 @@ public class NetworkHandler
this.ec.sendToAll( message.getProxy() );
}
public void sendTo( final AppEngPacket message, final EntityPlayerMP player )
public void sendTo( final AppEngPacket message, final PlayerEntityMP player )
{
this.ec.sendTo( message.getProxy(), player );
}
@@ -24,10 +24,10 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.EffectType;
@@ -74,8 +74,8 @@ public class PacketAssemblerAnimation extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final double d0 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
final double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
@@ -23,10 +23,10 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.block.Block;
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.util.math.Vec3d;
@@ -48,11 +48,11 @@ public class PacketClick extends AppEngPacket
private final int x;
private final int y;
private final int z;
private EnumFacing side;
private Direction side;
private final float hitX;
private final float hitY;
private final float hitZ;
private EnumHand hand;
private Hand hand;
private final boolean leftClick;
// automatic.
@@ -64,7 +64,7 @@ public class PacketClick extends AppEngPacket
byte side = stream.readByte();
if( side != -1 )
{
this.side = EnumFacing.values()[side];
this.side = Direction.values()[side];
}
else
{
@@ -73,17 +73,17 @@ public class PacketClick extends AppEngPacket
this.hitX = stream.readFloat();
this.hitY = stream.readFloat();
this.hitZ = stream.readFloat();
this.hand = EnumHand.values()[stream.readByte()];
this.hand = Hand.values()[stream.readByte()];
this.leftClick = stream.readBoolean();
}
// api
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
public PacketClick( final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
{
this( pos, side, hitX, hitY, hitZ, hand, false );
}
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand, boolean leftClick )
public PacketClick( final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand, boolean leftClick )
{
final ByteBuf data = Unpooled.buffer();
@@ -110,7 +110,7 @@ public class PacketClick extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final ItemStack is = player.inventory.getCurrentItem();
final IItems items = AEApi.instance().definitions().items();
@@ -22,8 +22,8 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import appeng.api.util.DimensionalCoord;
import appeng.core.sync.AppEngPacket;
@@ -41,7 +41,7 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
final int cz;
final int cdy;
private EntityPlayer talkBackTo;
private PlayerEntity talkBackTo;
// automatic.
public PacketCompassRequest( final ByteBuf stream )
@@ -70,11 +70,11 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
@Override
public void calculatedDirection( final boolean hasResult, final boolean spin, final double radians, final double dist )
{
NetworkHandler.instance().sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) this.talkBackTo );
NetworkHandler.instance().sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (PlayerEntityMP) this.talkBackTo );
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
this.talkBackTo = player;
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import appeng.core.sync.AppEngPacket;
import appeng.core.sync.network.INetworkInfo;
@@ -71,7 +71,7 @@ public class PacketCompassResponse extends AppEngPacket
}
@Override
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
CompassManager.INSTANCE.postResult( this.attunement, this.cx << 4, this.cdy << 5, this.cz << 4, this.cr );
}
@@ -32,11 +32,11 @@ import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.client.gui.implementations.GuiInterfaceTerminal;
import appeng.core.sync.AppEngPacket;
@@ -47,7 +47,7 @@ public class PacketCompressedNBT extends AppEngPacket
{
// input.
private final NBTTagCompound in;
private final CompoundNBT in;
// output...
private final ByteBuf data;
private final GZIPOutputStream compressFrame;
@@ -79,7 +79,7 @@ public class PacketCompressedNBT extends AppEngPacket
}
// api
public PacketCompressedNBT( final NBTTagCompound din ) throws IOException
public PacketCompressedNBT( final CompoundNBT din ) throws IOException
{
this.data = Unpooled.buffer( 2048 );
@@ -104,10 +104,10 @@ public class PacketCompressedNBT extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
final GuiScreen gs = Minecraft.getInstance().currentScreen;
if( gs instanceof GuiInterfaceTerminal )
{
@@ -22,8 +22,8 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import appeng.api.config.Settings;
import appeng.api.util.IConfigManager;
@@ -64,9 +64,9 @@ public final class PacketConfigButton extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final EntityPlayerMP sender = (EntityPlayerMP) player;
final PlayerEntityMP sender = (PlayerEntityMP) player;
if( sender.openContainer instanceof AEBaseContainer )
{
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
@@ -24,7 +24,7 @@ import java.util.concurrent.Future;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity;
import appeng.api.networking.IGrid;
@@ -70,7 +70,7 @@ public class PacketCraftRequest extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
if( player.openContainer instanceof ContainerCraftAmount )
{
@@ -25,9 +25,9 @@ import java.util.Map;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import appeng.api.storage.data.IAEFluidStack;
@@ -44,7 +44,7 @@ public class PacketFluidSlot extends AppEngPacket
public PacketFluidSlot( final ByteBuf stream )
{
this.list = new HashMap<>();
NBTTagCompound tag = ByteBufUtils.readTag( stream );
CompoundNBT tag = ByteBufUtils.readTag( stream );
for( final String key : tag.getKeySet() )
{
@@ -56,10 +56,10 @@ public class PacketFluidSlot extends AppEngPacket
public PacketFluidSlot( final Map<Integer, IAEFluidStack> list )
{
this.list = list;
final NBTTagCompound sendTag = new NBTTagCompound();
final CompoundNBT sendTag = new CompoundNBT();
for( Map.Entry<Integer, IAEFluidStack> fs : list.entrySet() )
{
final NBTTagCompound tag = new NBTTagCompound();
final CompoundNBT tag = new CompoundNBT();
if( fs.getValue() != null )
{
fs.getValue().writeToNBT( tag );
@@ -74,7 +74,7 @@ public class PacketFluidSlot extends AppEngPacket
}
@Override
public void clientPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final Container c = player.openContainer;
if( c instanceof IFluidSyncContainer )
@@ -84,7 +84,7 @@ public class PacketFluidSlot extends AppEngPacket
}
@Override
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, PlayerEntity player )
{
final Container c = player.openContainer;
if( c instanceof IFluidSyncContainer )
@@ -24,8 +24,8 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -121,9 +121,9 @@ public class PacketInventoryAction extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final EntityPlayerMP sender = (EntityPlayerMP) player;
final PlayerEntityMP sender = (PlayerEntityMP) player;
if( sender.openContainer instanceof AEBaseContainer )
{
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
@@ -158,7 +158,7 @@ public class PacketInventoryAction extends AppEngPacket
}
@Override
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
if( this.action == InventoryAction.UPDATE_HAND )
{
@@ -27,12 +27,12 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.items.IItemHandler;
@@ -70,7 +70,7 @@ public class PacketJEIRecipe extends AppEngPacket
{
final ByteArrayInputStream bytes = this.getPacketByteArray( stream );
bytes.skip( stream.readerIndex() );
final NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes );
final CompoundNBT comp = CompressedStreamTools.readCompressed( bytes );
if( comp != null )
{
this.recipe = new ItemStack[9][];
@@ -90,7 +90,7 @@ public class PacketJEIRecipe extends AppEngPacket
}
// api
public PacketJEIRecipe( final NBTTagCompound recipe ) throws IOException
public PacketJEIRecipe( final CompoundNBT recipe ) throws IOException
{
final ByteBuf data = Unpooled.buffer();
@@ -106,9 +106,9 @@ public class PacketJEIRecipe extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final EntityPlayerMP pmp = (EntityPlayerMP) player;
final PlayerEntityMP pmp = (PlayerEntityMP) player;
final Container con = pmp.openContainer;
if( !( con instanceof IContainerCraftingPacket ) )
@@ -23,9 +23,9 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
@@ -68,15 +68,15 @@ public class PacketLightning extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
try
{
if( Platform.isClient() && AEConfig.instance().isEnableEffects() )
{
final LightningFX fx = new LightningFX( AppEng.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
Minecraft.getInstance().effectRenderer.addEffect( fx );
}
}
catch( final Exception ignored )
@@ -35,10 +35,10 @@ import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.storage.data.IAEFluidStack;
import appeng.core.AELog;
@@ -148,10 +148,10 @@ public class PacketMEFluidInventoryUpdate extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
final GuiScreen gs = Minecraft.getInstance().currentScreen;
if( gs instanceof GuiFluidTerminal )
{
@@ -35,10 +35,10 @@ import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.implementations.GuiCraftConfirm;
@@ -146,10 +146,10 @@ public class PacketMEInventoryUpdate extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
final GuiScreen gs = Minecraft.getInstance().currentScreen;
if( gs instanceof GuiCraftConfirm )
{
@@ -23,12 +23,12 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.client.render.effects.MatterCannonFX;
import appeng.core.sync.AppEngPacket;
@@ -87,8 +87,8 @@ public class PacketMatterCannon extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
try
{
@@ -98,7 +98,7 @@ public class PacketMatterCannon extends AppEngPacket
{
final MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.DIAMOND );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
Minecraft.getInstance().effectRenderer.addEffect( fx );
}
}
catch( final Exception ignored )
@@ -22,11 +22,11 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.core.AppEng;
import appeng.core.sync.AppEngPacket;
@@ -66,8 +66,8 @@ public class PacketMockExplosion extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final World world = AppEng.proxy.getWorld();
world.spawnParticle( EnumParticleTypes.EXPLOSION_LARGE, this.x, this.y, this.z, 1.0D, 0.0D, 0.0D, new int[0] );
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import appeng.api.util.AEColor;
import appeng.core.sync.AppEngPacket;
@@ -61,7 +61,7 @@ public class PacketPaintedEntity extends AppEngPacket
}
@Override
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks );
TickHandler.INSTANCE.getPlayerColors().put( this.entityId, pc );
@@ -22,10 +22,10 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import appeng.core.AppEng;
@@ -42,7 +42,7 @@ public class PacketPartPlacement extends AppEngPacket
private int z;
private int face;
private float eyeHeight;
private EnumHand hand;
private Hand hand;
// automatic.
public PacketPartPlacement( final ByteBuf stream )
@@ -52,11 +52,11 @@ public class PacketPartPlacement extends AppEngPacket
this.z = stream.readInt();
this.face = stream.readByte();
this.eyeHeight = stream.readFloat();
this.hand = EnumHand.values()[stream.readByte()];
this.hand = Hand.values()[stream.readByte()];
}
// api
public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight, final EnumHand hand )
public PacketPartPlacement( final BlockPos pos, final Direction face, final float eyeHeight, final Hand hand )
{
final ByteBuf data = Unpooled.buffer();
@@ -72,12 +72,12 @@ public class PacketPartPlacement extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final EntityPlayerMP sender = (EntityPlayerMP) player;
final PlayerEntityMP sender = (PlayerEntityMP) player;
AppEng.proxy.updateRenderMode( sender );
PartPlacement.setEyeHeight( this.eyeHeight );
PartPlacement.place( sender.getHeldItem( this.hand ), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.face], sender, this.hand,
PartPlacement.place( sender.getHeldItem( this.hand ), new BlockPos( this.x, this.y, this.z ), Direction.VALUES[this.face], sender, this.hand,
sender.world,
PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
AppEng.proxy.updateRenderMode( null );
@@ -24,8 +24,8 @@ import java.io.IOException;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerEntityMP;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
@@ -109,9 +109,9 @@ public class PacketPatternSlot extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final EntityPlayerMP sender = (EntityPlayerMP) player;
final PlayerEntityMP sender = (PlayerEntityMP) player;
if( sender.openContainer instanceof ContainerPatternTerm )
{
final ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer;
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Container;
import appeng.container.AEBaseContainer;
@@ -59,7 +59,7 @@ public class PacketProgressBar extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final Container c = player.openContainer;
if( c instanceof AEBaseContainer )
@@ -69,7 +69,7 @@ public class PacketProgressBar extends AppEngPacket
}
@Override
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final Container c = player.openContainer;
if( c instanceof AEBaseContainer )
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import appeng.container.AEBaseContainer;
import appeng.core.sync.AppEngPacket;
@@ -55,7 +55,7 @@ public class PacketSwapSlots extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
if( player != null && player.openContainer instanceof AEBaseContainer )
{
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
@@ -59,7 +59,7 @@ public class PacketSwitchGuis extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final Container c = player.openContainer;
if( c instanceof AEBaseContainer )
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import appeng.core.AELog;
import appeng.core.sync.AppEngPacket;
@@ -84,7 +84,7 @@ public class PacketTargetFluidStack extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
if( player.openContainer instanceof ContainerFluidTerminal )
{
@@ -22,7 +22,7 @@ package appeng.core.sync.packets;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import appeng.container.AEBaseContainer;
import appeng.core.AELog;
@@ -79,7 +79,7 @@ public class PacketTargetItemStack extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
if( player.openContainer instanceof AEBaseContainer )
{
@@ -25,13 +25,13 @@ import io.netty.buffer.Unpooled;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEPartLocation;
import appeng.client.render.effects.EnergyFx;
@@ -82,8 +82,8 @@ public class PacketTransitionEffect extends AppEngPacket
}
@Override
@SideOnly( Side.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
@OnlyIn( Dist.CLIENT )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final World world = AppEng.proxy.getWorld();
@@ -105,7 +105,7 @@ public class PacketTransitionEffect extends AppEngPacket
fx.setMotionY( -0.1f * this.d.yOffset );
fx.setMotionZ( -0.1f * this.d.zOffset );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
Minecraft.getInstance().effectRenderer.addEffect( fx );
}
}
@@ -113,7 +113,7 @@ public class PacketTransitionEffect extends AppEngPacket
{
final Block block = world.getBlockState( new BlockPos( (int) this.x, (int) this.y, (int) this.z ) ).getBlock();
Minecraft.getMinecraft()
Minecraft.getInstance()
.getSoundHandler()
.playSound( new PositionedSoundRecord( block.getSoundType()
.getBreakSound(), SoundCategory.BLOCKS, ( block.getSoundType().getVolume() + 1.0F ) / 2.0F, block.getSoundType()
@@ -29,10 +29,10 @@ import io.netty.buffer.Unpooled;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Hand;
import appeng.api.config.FuzzyMode;
import appeng.api.config.Settings;
@@ -95,22 +95,22 @@ public class PacketValueConfig extends AppEngPacket
}
@Override
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final PlayerEntity player )
{
final Container c = player.openContainer;
if( this.Name.equals( "Item" ) && ( ( !player.getHeldItem( EnumHand.MAIN_HAND ).isEmpty() && player.getHeldItem( EnumHand.MAIN_HAND )
.getItem() instanceof IMouseWheelItem ) || ( !player.getHeldItem( EnumHand.OFF_HAND )
.isEmpty() && player.getHeldItem( EnumHand.OFF_HAND ).getItem() instanceof IMouseWheelItem ) ) )
if( this.Name.equals( "Item" ) && ( ( !player.getHeldItem( Hand.MAIN_HAND ).isEmpty() && player.getHeldItem( Hand.MAIN_HAND )
.getItem() instanceof IMouseWheelItem ) || ( !player.getHeldItem( Hand.OFF_HAND )
.isEmpty() && player.getHeldItem( Hand.OFF_HAND ).getItem() instanceof IMouseWheelItem ) ) )
{
final EnumHand hand;
if( !player.getHeldItem( EnumHand.MAIN_HAND ).isEmpty() && player.getHeldItem( EnumHand.MAIN_HAND ).getItem() instanceof IMouseWheelItem )
final Hand hand;
if( !player.getHeldItem( Hand.MAIN_HAND ).isEmpty() && player.getHeldItem( Hand.MAIN_HAND ).getItem() instanceof IMouseWheelItem )
{
hand = EnumHand.MAIN_HAND;
hand = Hand.MAIN_HAND;
}
else if( !player.getHeldItem( EnumHand.OFF_HAND ).isEmpty() && player.getHeldItem( EnumHand.OFF_HAND ).getItem() instanceof IMouseWheelItem )
else if( !player.getHeldItem( Hand.OFF_HAND ).isEmpty() && player.getHeldItem( Hand.OFF_HAND ).getItem() instanceof IMouseWheelItem )
{
hand = EnumHand.OFF_HAND;
hand = Hand.OFF_HAND;
}
else
{
@@ -270,7 +270,7 @@ public class PacketValueConfig extends AppEngPacket
}
@Override
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final PlayerEntity player )
{
final Container c = player.openContainer;
@@ -284,7 +284,7 @@ public class PacketValueConfig extends AppEngPacket
}
else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
final GuiScreen gs = Minecraft.getInstance().currentScreen;
if( gs instanceof GuiCraftingCPU )
{
( (GuiCraftingCPU) gs ).clearItems();