mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 04:32:15 +00:00
Update to 1.17
Update to Official classnames Patchwork Make the game compile and run Merge in the new HUD overlay API Merge in the new render properties API PEEL Use Gradle 7.2 snapshot to fix eclipse integration bug in 7.1, Would use 7.0 but FG needs 7.1 for some reason. New FML installer Update to 1.17.1 Co-authored-by: LexManos <[email protected]> Co-authored-by: SizableShrimp <[email protected]> Co-authored-by: cpw <[email protected]> Co-authored-by: Curle <[email protected]> Co-authored-by: Unnoen <[email protected]> Co-authored-by: covers1624 <[email protected]> Co-authored-by: DaemonUmbra <[email protected]> Co-authored-by: gigaherz <[email protected]> Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
1 parent
064ae6961b
commit
be5446b91c
1990 files changed
+35661
-37544
No files matched your search
@@ -19,7 +19,7 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
|
||||
/**
|
||||
* Exposes the armor inventory of an {@link EntityLivingBase} as an {@link IItemHandler} using {@link EntityLivingBase#getItemStackFromSlot} and
|
||||
@@ -31,6 +30,6 @@ public class EntityArmorInvWrapper extends EntityEquipmentInvWrapper
|
||||
{
|
||||
public EntityArmorInvWrapper(final LivingEntity entity)
|
||||
{
|
||||
super(entity, EquipmentSlotType.Group.ARMOR);
|
||||
super(entity, EquipmentSlot.Type.ARMOR);
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,10 @@
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import java.util.ArrayList;
|
||||
@@ -32,10 +31,6 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Exposes the armor or hands inventory of an {@link EntityLivingBase} as an {@link IItemHandler} using {@link EntityLivingBase#getItemStackFromSlot} and
|
||||
* {@link EntityLivingBase#setItemStackToSlot}.
|
||||
@@ -50,19 +45,19 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
/**
|
||||
* The slots exposed by this wrapper, with {@link EntityEquipmentSlot#index} as the index.
|
||||
*/
|
||||
protected final List<EquipmentSlotType> slots;
|
||||
protected final List<EquipmentSlot> slots;
|
||||
|
||||
/**
|
||||
* @param entity The entity.
|
||||
* @param slotType The slot type to expose.
|
||||
*/
|
||||
public EntityEquipmentInvWrapper(final LivingEntity entity, final EquipmentSlotType.Group slotType)
|
||||
public EntityEquipmentInvWrapper(final LivingEntity entity, final EquipmentSlot.Type slotType)
|
||||
{
|
||||
this.entity = entity;
|
||||
|
||||
final List<EquipmentSlotType> slots = new ArrayList<EquipmentSlotType>();
|
||||
final List<EquipmentSlot> slots = new ArrayList<EquipmentSlot>();
|
||||
|
||||
for (final EquipmentSlotType slot : EquipmentSlotType.values())
|
||||
for (final EquipmentSlot slot : EquipmentSlot.values())
|
||||
{
|
||||
if (slot.getType() == slotType)
|
||||
{
|
||||
@@ -93,7 +88,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
if (stack.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
final EquipmentSlot equipmentSlot = validateSlotIndex(slot);
|
||||
|
||||
final ItemStack existing = entity.getItemBySlot(equipmentSlot);
|
||||
|
||||
@@ -134,7 +129,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
if (amount == 0)
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
final EquipmentSlot equipmentSlot = validateSlotIndex(slot);
|
||||
|
||||
final ItemStack existing = entity.getItemBySlot(equipmentSlot);
|
||||
|
||||
@@ -166,8 +161,8 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
@Override
|
||||
public int getSlotLimit(final int slot)
|
||||
{
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
return equipmentSlot.getType() == EquipmentSlotType.Group.ARMOR ? 1 : 64;
|
||||
final EquipmentSlot equipmentSlot = validateSlotIndex(slot);
|
||||
return equipmentSlot.getType() == EquipmentSlot.Type.ARMOR ? 1 : 64;
|
||||
}
|
||||
|
||||
protected int getStackLimit(final int slot, @Nonnull final ItemStack stack)
|
||||
@@ -178,7 +173,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
@Override
|
||||
public void setStackInSlot(final int slot, @Nonnull final ItemStack stack)
|
||||
{
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
final EquipmentSlot equipmentSlot = validateSlotIndex(slot);
|
||||
if (ItemStack.matches(entity.getItemBySlot(equipmentSlot), stack))
|
||||
return;
|
||||
entity.setItemSlot(equipmentSlot, stack);
|
||||
@@ -190,7 +185,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
return true;
|
||||
}
|
||||
|
||||
protected EquipmentSlotType validateSlotIndex(final int slot)
|
||||
protected EquipmentSlot validateSlotIndex(final int slot)
|
||||
{
|
||||
if (slot < 0 || slot >= slots.size())
|
||||
throw new IllegalArgumentException("Slot " + slot + " not in valid range - [0," + slots.size() + ")");
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
|
||||
/**
|
||||
* Exposes the hands inventory of an {@link EntityLivingBase} as an {@link IItemHandler} using {@link EntityLivingBase#getItemStackFromSlot} and
|
||||
@@ -31,6 +30,6 @@ public class EntityHandsInvWrapper extends EntityEquipmentInvWrapper
|
||||
{
|
||||
public EntityHandsInvWrapper(LivingEntity entity)
|
||||
{
|
||||
super(entity, EquipmentSlotType.Group.HAND);
|
||||
super(entity, EquipmentSlot.Type.HAND);
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
||||
@@ -28,9 +28,9 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class InvWrapper implements IItemHandlerModifiable
|
||||
{
|
||||
private final IInventory inv;
|
||||
private final Container inv;
|
||||
|
||||
public InvWrapper(IInventory inv)
|
||||
public InvWrapper(Container inv)
|
||||
{
|
||||
this.inv = inv;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
return getInv().canPlaceItem(slot, stack);
|
||||
}
|
||||
|
||||
public IInventory getInv()
|
||||
public Container getInv()
|
||||
{
|
||||
return inv;
|
||||
}
|
||||
|
||||
@@ -19,17 +19,17 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class PlayerArmorInvWrapper extends RangedWrapper
|
||||
{
|
||||
private final PlayerInventory inventoryPlayer;
|
||||
private final Inventory inventoryPlayer;
|
||||
|
||||
public PlayerArmorInvWrapper(PlayerInventory inv)
|
||||
public PlayerArmorInvWrapper(Inventory inv)
|
||||
{
|
||||
super(new InvWrapper(inv), inv.items.size(), inv.items.size() + inv.armor.size());
|
||||
inventoryPlayer = inv;
|
||||
@@ -39,10 +39,10 @@ public class PlayerArmorInvWrapper extends RangedWrapper
|
||||
@Nonnull
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
|
||||
{
|
||||
EquipmentSlotType equ = null;
|
||||
for (EquipmentSlotType s : EquipmentSlotType.values())
|
||||
EquipmentSlot equ = null;
|
||||
for (EquipmentSlot s : EquipmentSlot.values())
|
||||
{
|
||||
if (s.getType() == EquipmentSlotType.Group.ARMOR && s.getIndex() == slot)
|
||||
if (s.getType() == EquipmentSlot.Type.ARMOR && s.getIndex() == slot)
|
||||
{
|
||||
equ = s;
|
||||
break;
|
||||
@@ -56,7 +56,7 @@ public class PlayerArmorInvWrapper extends RangedWrapper
|
||||
return stack;
|
||||
}
|
||||
|
||||
public PlayerInventory getInventoryPlayer()
|
||||
public Inventory getInventoryPlayer()
|
||||
{
|
||||
return inventoryPlayer;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
||||
public class PlayerInvWrapper extends CombinedInvWrapper
|
||||
{
|
||||
public PlayerInvWrapper(PlayerInventory inv)
|
||||
public PlayerInvWrapper(Inventory inv)
|
||||
{
|
||||
super(new PlayerMainInvWrapper(inv), new PlayerArmorInvWrapper(inv), new PlayerOffhandInvWrapper(inv));
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -31,9 +31,9 @@ import javax.annotation.Nonnull;
|
||||
*/
|
||||
public class PlayerMainInvWrapper extends RangedWrapper
|
||||
{
|
||||
private final PlayerInventory inventoryPlayer;
|
||||
private final Inventory inventoryPlayer;
|
||||
|
||||
public PlayerMainInvWrapper(PlayerInventory inv)
|
||||
public PlayerMainInvWrapper(Inventory inv)
|
||||
{
|
||||
super(new InvWrapper(inv), 0, inv.items.size());
|
||||
inventoryPlayer = inv;
|
||||
@@ -54,7 +54,7 @@ public class PlayerMainInvWrapper extends RangedWrapper
|
||||
{
|
||||
inSlot.setPopTime(5);
|
||||
}
|
||||
else if(getInventoryPlayer().player instanceof ServerPlayerEntity) {
|
||||
else if(getInventoryPlayer().player instanceof ServerPlayer) {
|
||||
getInventoryPlayer().player.containerMenu.broadcastChanges();
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class PlayerMainInvWrapper extends RangedWrapper
|
||||
return rest;
|
||||
}
|
||||
|
||||
public PlayerInventory getInventoryPlayer()
|
||||
public Inventory getInventoryPlayer()
|
||||
{
|
||||
return inventoryPlayer;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
||||
public class PlayerOffhandInvWrapper extends RangedWrapper
|
||||
{
|
||||
public PlayerOffhandInvWrapper(PlayerInventory inv)
|
||||
public PlayerOffhandInvWrapper(Inventory inv)
|
||||
{
|
||||
super(new InvWrapper(inv), inv.items.size() + inv.armor.size(),
|
||||
inv.items.size() + inv.armor.size() + inv.offhand.size());
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
public class RecipeWrapper implements IInventory {
|
||||
public class RecipeWrapper implements Container {
|
||||
|
||||
protected final IItemHandlerModifiable inv;
|
||||
|
||||
@@ -113,10 +113,10 @@ public class RecipeWrapper implements IInventory {
|
||||
@Override
|
||||
public void setChanged() {}
|
||||
@Override
|
||||
public boolean stillValid(PlayerEntity player) { return false; }
|
||||
public boolean stillValid(Player player) { return false; }
|
||||
@Override
|
||||
public void startOpen(PlayerEntity player) {}
|
||||
public void startOpen(Player player) {}
|
||||
@Override
|
||||
public void stopOpen(PlayerEntity player) {}
|
||||
public void stopOpen(Player player) {}
|
||||
|
||||
}
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
package net.minecraftforge.items.wrapper;
|
||||
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.WorldlyContainer;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
@@ -31,12 +31,12 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
{
|
||||
protected final ISidedInventory inv;
|
||||
protected final WorldlyContainer inv;
|
||||
@Nullable
|
||||
protected final Direction side;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static LazyOptional<IItemHandlerModifiable>[] create(ISidedInventory inv, Direction... sides) {
|
||||
public static LazyOptional<IItemHandlerModifiable>[] create(WorldlyContainer inv, Direction... sides) {
|
||||
LazyOptional<IItemHandlerModifiable>[] ret = new LazyOptional[sides.length];
|
||||
for (int x = 0; x < sides.length; x++) {
|
||||
final Direction side = sides[x];
|
||||
@@ -45,13 +45,13 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
return ret;
|
||||
}
|
||||
|
||||
public SidedInvWrapper(ISidedInventory inv, @Nullable Direction side)
|
||||
public SidedInvWrapper(WorldlyContainer inv, @Nullable Direction side)
|
||||
{
|
||||
this.inv = inv;
|
||||
this.side = side;
|
||||
}
|
||||
|
||||
public static int getSlot(ISidedInventory inv, int slot, @Nullable Direction side)
|
||||
public static int getSlot(WorldlyContainer inv, int slot, @Nullable Direction side)
|
||||
{
|
||||
int[] slots = inv.getSlotsForFace(side);
|
||||
if (slot < slots.length)
|
||||
|
||||
Reference in new issue
Block a user