Highly incomplete code. First work on porting to 1.12. Still need to rework a LOT of things.

This commit is contained in:
Gunther De Wachter
2017-07-06 01:57:19 +02:00
parent d67f97cd16
commit fbcf8c4705
127 changed files with 850 additions and 425 deletions
@@ -80,7 +80,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() );
}
this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.world ) );
this.outputSlot.putStack( CraftingManager.findMatchingResult( ic, this.getPlayerInv().player.world ) );
}
@Override
@@ -159,7 +159,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) );
}
final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.world );
final ItemStack is = CraftingManager.findMatchingResult( ic, this.getPlayerInv().player.world );
this.cOut.setInventorySlotContents( 0, is );
return is;
}
@@ -31,7 +31,6 @@ 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.minecraft.util.NonNullList;
@@ -89,55 +88,55 @@ public class AppEngCraftingSlot extends AppEngSlot
par1ItemStack.onCrafting( this.thePlayer.world, this.thePlayer, this.amountCrafted );
this.amountCrafted = 0;
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.CRAFTING_TABLE ) )
{
this.thePlayer.addStat( AchievementList.BUILD_WORK_BENCH, 1 );
}
if( par1ItemStack.getItem() instanceof ItemPickaxe )
{
this.thePlayer.addStat( AchievementList.BUILD_PICKAXE, 1 );
}
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.FURNACE ) )
{
this.thePlayer.addStat( AchievementList.BUILD_FURNACE, 1 );
}
if( par1ItemStack.getItem() instanceof ItemHoe )
{
this.thePlayer.addStat( AchievementList.BUILD_HOE, 1 );
}
if( par1ItemStack.getItem() == Items.BREAD )
{
this.thePlayer.addStat( AchievementList.MAKE_BREAD, 1 );
}
if( par1ItemStack.getItem() == Items.CAKE )
{
this.thePlayer.addStat( AchievementList.BAKE_CAKE, 1 );
}
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
{
this.thePlayer.addStat( AchievementList.BUILD_BETTER_PICKAXE, 1 );
}
if( par1ItemStack.getItem() instanceof ItemSword )
{
this.thePlayer.addStat( AchievementList.BUILD_SWORD, 1 );
}
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.ENCHANTING_TABLE ) )
{
this.thePlayer.addStat( AchievementList.ENCHANTMENTS, 1 );
}
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.BOOKSHELF ) )
{
this.thePlayer.addStat( AchievementList.BOOKCASE, 1 );
}
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.CRAFTING_TABLE ) )
// {
// this.thePlayer.addStat( AchievementList.BUILD_WORK_BENCH, 1 );
// }
//
// if( par1ItemStack.getItem() instanceof ItemPickaxe )
// {
// this.thePlayer.addStat( AchievementList.BUILD_PICKAXE, 1 );
// }
//
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.FURNACE ) )
// {
// this.thePlayer.addStat( AchievementList.BUILD_FURNACE, 1 );
// }
//
// if( par1ItemStack.getItem() instanceof ItemHoe )
// {
// this.thePlayer.addStat( AchievementList.BUILD_HOE, 1 );
// }
//
// if( par1ItemStack.getItem() == Items.BREAD )
// {
// this.thePlayer.addStat( AchievementList.MAKE_BREAD, 1 );
// }
//
// if( par1ItemStack.getItem() == Items.CAKE )
// {
// this.thePlayer.addStat( AchievementList.BAKE_CAKE, 1 );
// }
//
// if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
// {
// this.thePlayer.addStat( AchievementList.BUILD_BETTER_PICKAXE, 1 );
// }
//
// if( par1ItemStack.getItem() instanceof ItemSword )
// {
// this.thePlayer.addStat( AchievementList.BUILD_SWORD, 1 );
// }
//
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.ENCHANTING_TABLE ) )
// {
// this.thePlayer.addStat( AchievementList.ENCHANTMENTS, 1 );
// }
//
// if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.BOOKSHELF ) )
// {
// this.thePlayer.addStat( AchievementList.BOOKCASE, 1 );
// }
}
@Override
@@ -153,7 +152,7 @@ public class AppEngCraftingSlot extends AppEngSlot
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
}
final NonNullList<ItemStack> aitemstack = CraftingManager.getInstance().getRemainingItems( ic, playerIn.world );
final NonNullList<ItemStack> aitemstack = CraftingManager.getRemainingItems( ic, playerIn.world );
for( int x = 0; x < this.craftMatrix.getSizeInventory(); x++ )
{
@@ -27,6 +27,8 @@ import net.minecraft.item.ItemStack;
import appeng.container.AEBaseContainer;
import appeng.tile.inventory.AppEngInternalInventory;
import javax.annotation.Nonnull;
public class AppEngSlot extends Slot
{
@@ -81,6 +83,7 @@ public class AppEngSlot extends Slot
}
@Override
@Nonnull
public ItemStack getStack()
{
if( !this.isEnabled() )
@@ -24,6 +24,8 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
public class NullSlot extends Slot
{
@@ -52,6 +54,7 @@ public class NullSlot extends Slot
}
@Override
@Nonnull
public ItemStack getStack()
{
return ItemStack.EMPTY;
@@ -22,6 +22,8 @@ package appeng.container.slot;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
public class OptionalSlotFake extends SlotFake
{
@@ -42,6 +44,7 @@ public class OptionalSlotFake extends SlotFake
}
@Override
@Nonnull
public ItemStack getStack()
{
if( !this.isEnabled() )