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
@@ -19,7 +19,7 @@
package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
@@ -42,17 +42,17 @@ public class AppEngCraftingSlot extends AppEngSlot
/**
* The player that is using the GUI where this slot resides.
*/
private final EntityPlayer thePlayer;
private final PlayerEntity thePlayer;
/**
* The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset.
*/
private int amountCrafted;
public AppEngCraftingSlot( final EntityPlayer par1EntityPlayer, final IItemHandler par2IInventory, final IItemHandler par3IInventory, final int par4, final int par5, final int par6 )
public AppEngCraftingSlot( final PlayerEntity par1PlayerEntity, final IItemHandler par2IInventory, final IItemHandler par3IInventory, final int par4, final int par5, final int par6 )
{
super( par3IInventory, par4, par5, par6 );
this.thePlayer = par1EntityPlayer;
this.thePlayer = par1PlayerEntity;
this.craftMatrix = par2IInventory;
}
@@ -138,7 +138,7 @@ public class AppEngCraftingSlot extends AppEngSlot
}
@Override
public ItemStack onTake( final EntityPlayer playerIn, final ItemStack stack )
public ItemStack onTake( final PlayerEntity playerIn, final ItemStack stack )
{
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent( playerIn, stack, new WrapperInvItemHandler( this.craftMatrix ) );
this.onCrafting( stack );
@@ -21,13 +21,13 @@ package appeng.container.slot;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
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 net.minecraftforge.items.IItemHandler;
import appeng.container.AEBaseContainer;
@@ -153,7 +153,7 @@ public class AppEngSlot extends Slot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
if( this.isSlotEnabled() )
{
@@ -176,7 +176,7 @@ public class AppEngSlot extends Slot
}
@Override
@SideOnly( Side.CLIENT )
@OnlyIn( Dist.CLIENT )
public boolean isEnabled()
{
return this.isSlotEnabled();
@@ -21,7 +21,7 @@ package appeng.container.slot;
import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@@ -42,7 +42,7 @@ public class NullSlot extends Slot
}
@Override
public ItemStack onTake( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack )
public ItemStack onTake( final PlayerEntity par1PlayerEntity, final ItemStack par2ItemStack )
{
return par2ItemStack;
}
@@ -91,7 +91,7 @@ public class NullSlot extends Slot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
return false;
}
@@ -19,7 +19,7 @@
package appeng.container.slot;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraftforge.items.IItemHandler;
@@ -29,7 +29,7 @@ public class OptionalSlotRestrictedInput extends SlotRestrictedInput
private final int groupNum;
private final IOptionalSlotHost host;
public OptionalSlotRestrictedInput( final PlacableItemType valid, final IItemHandler i, final IOptionalSlotHost host, final int slotIndex, final int x, final int y, final int grpNum, final InventoryPlayer invPlayer )
public OptionalSlotRestrictedInput( final PlacableItemType valid, final IItemHandler i, final IOptionalSlotHost host, final int slotIndex, final int x, final int y, final int grpNum, final PlayerInventory invPlayer )
{
super( valid, i, slotIndex, x, y, invPlayer );
this.groupNum = grpNum;
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -68,7 +68,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
private final IStorageMonitorable storage;
private final IContainerCraftingPacket container;
public SlotCraftingTerm( final EntityPlayer player, final IActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IItemHandler cMatrix, final IItemHandler secondMatrix, final IItemHandler output, final int x, final int y, final IContainerCraftingPacket ccp )
public SlotCraftingTerm( final PlayerEntity player, final IActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IItemHandler cMatrix, final IItemHandler secondMatrix, final IItemHandler output, final int x, final int y, final IContainerCraftingPacket ccp )
{
super( player, cMatrix, output, 0, x, y );
this.energySrc = energySrc;
@@ -85,18 +85,18 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
return false;
}
@Override
public ItemStack onTake( final EntityPlayer p, final ItemStack is )
public ItemStack onTake( final PlayerEntity p, final ItemStack is )
{
return is;
}
public void doClick( final InventoryAction action, final EntityPlayer who )
public void doClick( final InventoryAction action, final PlayerEntity who )
{
if( this.getStack().isEmpty() )
{
@@ -199,7 +199,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return maxTimesToCraft;
}
private ItemStack craftItem( final EntityPlayer p, final ItemStack request, final IMEMonitor<IAEItemStack> inv, final IItemList all )
private ItemStack craftItem( final PlayerEntity p, final ItemStack request, final IMEMonitor<IAEItemStack> inv, final IItemList all )
{
// update crafting matrix...
ItemStack is = this.getStack();
@@ -281,17 +281,17 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return ItemStack.EMPTY;
}
private boolean preCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
private boolean preCraft( final PlayerEntity p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
{
return true;
}
private void makeItem( final EntityPlayer p, final ItemStack is )
private void makeItem( final PlayerEntity p, final ItemStack is )
{
super.onTake( p, is );
}
private void postCraft( final EntityPlayer p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
private void postCraft( final PlayerEntity p, final IMEMonitor<IAEItemStack> inv, final ItemStack[] set, final ItemStack result )
{
final List<ItemStack> drops = new ArrayList<>();
@@ -19,7 +19,7 @@
package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -39,7 +39,7 @@ public class SlotDisabled extends AppEngSlot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
return false;
}
@@ -19,7 +19,7 @@
package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -33,7 +33,7 @@ public class SlotFake extends AppEngSlot
}
@Override
public ItemStack onTake( final EntityPlayer par1EntityPlayer, final ItemStack par2ItemStack )
public ItemStack onTake( final PlayerEntity par1PlayerEntity, final ItemStack par2ItemStack )
{
return par2ItemStack;
}
@@ -62,7 +62,7 @@ public class SlotFake extends AppEngSlot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
return false;
}
@@ -19,7 +19,7 @@
package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -48,7 +48,7 @@ public class SlotInaccessible extends AppEngSlot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
return false;
}
@@ -21,7 +21,7 @@ package appeng.container.slot;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -41,7 +41,7 @@ public class SlotPatternTerm extends SlotCraftingTerm
private final int groupNum;
private final IOptionalSlotHost host;
public SlotPatternTerm( final EntityPlayer player, final IActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IItemHandler cMatrix, final IItemHandler secondMatrix, final IItemHandler output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c )
public SlotPatternTerm( final PlayerEntity player, final IActionSource mySrc, final IEnergySource energySrc, final IStorageMonitorable storage, final IItemHandler cMatrix, final IItemHandler secondMatrix, final IItemHandler output, final int x, final int y, final IOptionalSlotHost h, final int groupNumber, final IContainerCraftingPacket c )
{
super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y, c );
@@ -19,9 +19,9 @@
package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Items;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.Items;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace;
@@ -55,11 +55,11 @@ public class SlotRestrictedInput extends AppEngSlot
{
private final PlacableItemType which;
private final InventoryPlayer p;
private final PlayerInventory p;
private boolean allowEdit = true;
private int stackLimit = -1;
public SlotRestrictedInput( final PlacableItemType valid, final IItemHandler i, final int slotIndex, final int x, final int y, final InventoryPlayer p )
public SlotRestrictedInput( final PlacableItemType valid, final IItemHandler i, final int slotIndex, final int x, final int y, final PlayerInventory p )
{
super( i, slotIndex, x, y );
this.which = valid;
@@ -234,7 +234,7 @@ public class SlotRestrictedInput extends AppEngSlot
}
@Override
public boolean canTakeStack( final EntityPlayer par1EntityPlayer )
public boolean canTakeStack( final PlayerEntity par1PlayerEntity )
{
return this.isAllowEdit();
}