Second update pass (2/3) - 82 -> 0 errors
Second update pass which fixes all compile errors. Some parts may have aftermath effect, hence why 3rd pass will check those maked with "aftermath". Errors: 82 -> 0. Mod can be launched.
This commit is contained in:
@@ -25,6 +25,7 @@ import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -44,10 +45,11 @@ public class PacketClick extends AppEngPacket
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
private final int side;
|
||||
private EnumFacing side;
|
||||
private final float hitX;
|
||||
private final float hitY;
|
||||
private final float hitZ;
|
||||
private EnumHand hand;
|
||||
|
||||
// automatic.
|
||||
public PacketClick( final ByteBuf stream )
|
||||
@@ -55,14 +57,15 @@ public class PacketClick extends AppEngPacket
|
||||
this.x = stream.readInt();
|
||||
this.y = stream.readInt();
|
||||
this.z = stream.readInt();
|
||||
this.side = stream.readInt();
|
||||
this.side = EnumFacing.values()[ stream.readByte() ];
|
||||
this.hitX = stream.readFloat();
|
||||
this.hitY = stream.readFloat();
|
||||
this.hitZ = stream.readFloat();
|
||||
this.hand = EnumHand.values()[ stream.readByte() ];
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
|
||||
{
|
||||
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
@@ -71,10 +74,11 @@ public class PacketClick extends AppEngPacket
|
||||
data.writeInt( this.x = pos.getX() );
|
||||
data.writeInt( this.y = pos.getY() );
|
||||
data.writeInt( this.z = pos.getZ() );
|
||||
data.writeInt( this.side = side.ordinal() );
|
||||
data.writeByte( side.ordinal() );
|
||||
data.writeFloat( this.hitX = hitX );
|
||||
data.writeFloat( this.hitY = hitY );
|
||||
data.writeFloat( this.hitZ = hitZ );
|
||||
data.writeByte( hand.ordinal() );
|
||||
|
||||
this.configureWrite( data );
|
||||
}
|
||||
@@ -92,7 +96,7 @@ public class PacketClick extends AppEngPacket
|
||||
if( is.getItem() instanceof ToolNetworkTool )
|
||||
{
|
||||
final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
|
||||
tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.side], this.hitX, this.hitY, this.hitZ );
|
||||
tnt.serverSideToolLogic( is, player, this.hand, player.worldObj, new BlockPos( this.x, this.y, this.z ), this.side, this.hitX, this.hitY, this.hitZ );
|
||||
}
|
||||
|
||||
else if( maybeMemoryCard.isSameAs( is ) )
|
||||
|
||||
@@ -41,8 +41,8 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.implementations.GuICraftingCPU;
|
||||
import appeng.client.gui.implementations.GuiCraftConfirm;
|
||||
import appeng.client.gui.implementations.GuiCraftingCPU;
|
||||
import appeng.client.gui.implementations.GuiMEMonitorable;
|
||||
import appeng.client.gui.implementations.GuiNetworkStatus;
|
||||
import appeng.core.AELog;
|
||||
@@ -154,9 +154,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
||||
( (GuiCraftConfirm) gs ).postUpdate( this.list, this.ref );
|
||||
}
|
||||
|
||||
if( gs instanceof GuICraftingCPU )
|
||||
if( gs instanceof GuiCraftingCPU )
|
||||
{
|
||||
( (GuICraftingCPU) gs ).postUpdate( this.list, this.ref );
|
||||
( (GuiCraftingCPU) gs ).postUpdate( this.list, this.ref );
|
||||
}
|
||||
|
||||
if( gs instanceof GuiMEMonitorable )
|
||||
|
||||
@@ -25,6 +25,7 @@ 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.util.math.BlockPos;
|
||||
|
||||
import appeng.core.CommonHelper;
|
||||
@@ -41,6 +42,7 @@ public class PacketPartPlacement extends AppEngPacket
|
||||
private int z;
|
||||
private int face;
|
||||
private float eyeHeight;
|
||||
private EnumHand hand;
|
||||
|
||||
// automatic.
|
||||
public PacketPartPlacement( final ByteBuf stream )
|
||||
@@ -50,10 +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() ];
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight )
|
||||
public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight, final EnumHand hand )
|
||||
{
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
|
||||
@@ -63,6 +66,7 @@ public class PacketPartPlacement extends AppEngPacket
|
||||
data.writeInt( pos.getZ() );
|
||||
data.writeByte( face.ordinal() );
|
||||
data.writeFloat( eyeHeight );
|
||||
data.writeByte( hand.ordinal() );
|
||||
|
||||
this.configureWrite( data );
|
||||
}
|
||||
@@ -73,8 +77,7 @@ public class PacketPartPlacement extends AppEngPacket
|
||||
final EntityPlayerMP sender = (EntityPlayerMP) player;
|
||||
CommonHelper.proxy.updateRenderMode( sender );
|
||||
PartPlacement.setEyeHeight( this.eyeHeight );
|
||||
//TODO 1.9.4 - 2 hands! Just do something!
|
||||
PartPlacement.place( sender.getHeldItem(), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.face], sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
|
||||
PartPlacement.place( sender.getHeldItem( hand ), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.face], sender, hand, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
|
||||
CommonHelper.proxy.updateRenderMode( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,12 +33,13 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumHand;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.gui.implementations.GuICraftingCPU;
|
||||
import appeng.client.gui.implementations.GuiCraftingCPU;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
@@ -97,10 +98,23 @@ public class PacketValueConfig extends AppEngPacket
|
||||
{
|
||||
final Container c = player.openContainer;
|
||||
|
||||
//TODO 1.9.4 - 2 hands! Just do something!
|
||||
if( this.Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem )
|
||||
if( this.Name.equals( "Item" ) && ( ( player.getHeldItem( EnumHand.MAIN_HAND ) != null && player.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof IMouseWheelItem ) || ( player.getHeldItem( EnumHand.OFF_HAND ) != null && player.getHeldItem(EnumHand.OFF_HAND).getItem() instanceof IMouseWheelItem ) ) )
|
||||
{
|
||||
final ItemStack is = player.getHeldItem();
|
||||
final EnumHand hand;
|
||||
if( player.getHeldItem( EnumHand.MAIN_HAND ) != null && player.getHeldItem( EnumHand.MAIN_HAND ).getItem() instanceof IMouseWheelItem )
|
||||
{
|
||||
hand = EnumHand.MAIN_HAND;
|
||||
}
|
||||
else if( player.getHeldItem( EnumHand.OFF_HAND ) != null && player.getHeldItem( EnumHand.OFF_HAND ).getItem() instanceof IMouseWheelItem )
|
||||
{
|
||||
hand = EnumHand.OFF_HAND;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemStack is = player.getHeldItem( hand );
|
||||
final IMouseWheelItem si = (IMouseWheelItem) is.getItem();
|
||||
si.onWheel( is, this.Value.equals( "WheelUp" ) );
|
||||
}
|
||||
@@ -250,9 +264,9 @@ public class PacketValueConfig extends AppEngPacket
|
||||
else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) )
|
||||
{
|
||||
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
|
||||
if( gs instanceof GuICraftingCPU )
|
||||
if( gs instanceof GuiCraftingCPU )
|
||||
{
|
||||
( (GuICraftingCPU) gs ).clearItems();
|
||||
( (GuiCraftingCPU) gs ).clearItems();
|
||||
}
|
||||
}
|
||||
else if( c instanceof IConfigurableObject )
|
||||
|
||||
Reference in New Issue
Block a user