Most of the 1.8 Port.

This commit is contained in:
AlgorithmX2
2015-06-15 19:44:59 -05:00
parent 17465e68e8
commit 38afde724b
824 changed files with 12120 additions and 9158 deletions
@@ -23,17 +23,15 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemTool;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
import cpw.mods.fml.common.FMLCommonHandler;
public class AppEngCraftingSlot extends AppEngSlot
@@ -120,7 +118,7 @@ public class AppEngCraftingSlot extends AppEngSlot
this.thePlayer.addStat( AchievementList.bakeCake, 1 );
}
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).func_150913_i() != Item.ToolMaterial.WOOD )
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
{
this.thePlayer.addStat( AchievementList.buildBetterPickaxe, 1 );
}
@@ -142,43 +140,45 @@ public class AppEngCraftingSlot extends AppEngSlot
}
@Override
public void onPickupFromSlot( EntityPlayer par1EntityPlayer, ItemStack par2ItemStack )
public void onPickupFromSlot( EntityPlayer playerIn, ItemStack stack )
{
FMLCommonHandler.instance().firePlayerCraftingEvent( par1EntityPlayer, par2ItemStack, this.craftMatrix );
this.onCrafting( par2ItemStack );
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
this.onCrafting(stack);
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
InventoryCrafting ic = new InventoryCrafting( this.myContainer, 3, 3 );
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(ic, playerIn.worldObj);
for ( int x=0; x < this.craftMatrix.getSizeInventory(); x++ )
craftMatrix.setInventorySlotContents( x, ic.getStackInSlot( x ) );
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null);
for( int i = 0; i < this.craftMatrix.getSizeInventory(); ++i )
{
ItemStack itemstack1 = this.craftMatrix.getStackInSlot( i );
for (int i = 0; i < aitemstack.length; ++i)
{
ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i);
ItemStack itemstack2 = aitemstack[i];
if( itemstack1 != null )
{
this.craftMatrix.decrStackSize( i, 1 );
if (itemstack1 != null)
{
this.craftMatrix.decrStackSize(i, 1);
}
if( itemstack1.getItem().hasContainerItem( itemstack1 ) )
{
ItemStack itemstack2 = itemstack1.getItem().getContainerItem( itemstack1 );
if( itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage() )
{
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( this.thePlayer, itemstack2 ) );
continue;
}
if( !itemstack1.getItem().doesContainerItemLeaveCraftingGrid( itemstack1 ) || !this.thePlayer.inventory.addItemStackToInventory( itemstack2 ) )
{
if( this.craftMatrix.getStackInSlot( i ) == null )
{
this.craftMatrix.setInventorySlotContents( i, itemstack2 );
}
else
{
this.thePlayer.dropPlayerItemWithRandomChoice( itemstack2, false );
}
}
}
}
}
if (itemstack2 != null)
{
if (this.craftMatrix.getStackInSlot(i) == null)
{
this.craftMatrix.setInventorySlotContents(i, itemstack2);
}
else if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2))
{
this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false);
}
}
}
}
/**
@@ -23,7 +23,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import appeng.container.AEBaseContainer;
import appeng.tile.inventory.AppEngInternalInventory;
@@ -141,7 +140,7 @@ public class AppEngSlot extends Slot
}
@Override
public boolean func_111238_b()
public boolean canBeHovered()
{
return this.isEnabled();
}
@@ -28,7 +28,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.BlockPos;
import appeng.api.config.Actionable;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.networking.security.BaseActionSource;
@@ -140,7 +140,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
{
List<ItemStack> drops = new ArrayList<ItemStack>();
drops.add( extra );
Platform.spawnDrops( who.worldObj, (int) who.posX, (int) who.posY, (int) who.posZ, drops );
Platform.spawnDrops( who.worldObj, new BlockPos( (int) who.posX, (int) who.posY, (int) who.posZ ), drops );
return;
}
}
@@ -270,7 +270,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
if( drops.size() > 0 )
{
Platform.spawnDrops( p.worldObj, (int) p.posX, (int) p.posY, (int) p.posZ, drops );
Platform.spawnDrops( p.worldObj, new BlockPos( (int) p.posX, (int) p.posY, (int) p.posZ ), drops );
}
}
}
@@ -21,7 +21,6 @@ package appeng.container.slot;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import appeng.container.implementations.ContainerMAC;
@@ -24,7 +24,6 @@ import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.networking.security.BaseActionSource;
@@ -28,7 +28,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IItems;