mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 05:02:18 +00:00
Regenerate patches with relative headers. This should lower conflicts in future PRs.
Convert Forge to use Official mappings. Mojang released their obfuscation mappings but we have not used them up until now due to wanting to get their license to be more explicitly permissive. It is clear that their intent is to allow us to use their names for developing mods like this. See the full wording, and our interpretation here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
This commit is contained in:
1 parent
802298d99d
commit
a95b968c13
832 files changed
+4464
-4373
No files matched your search
@@ -64,7 +64,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
|
||||
for (final EquipmentSlotType slot : EquipmentSlotType.values())
|
||||
{
|
||||
if (slot.getSlotType() == slotType)
|
||||
if (slot.getType() == slotType)
|
||||
{
|
||||
slots.add(slot);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
@Override
|
||||
public ItemStack getStackInSlot(final int slot)
|
||||
{
|
||||
return entity.getItemStackFromSlot(validateSlotIndex(slot));
|
||||
return entity.getItemBySlot(validateSlotIndex(slot));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -95,7 +95,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
|
||||
final ItemStack existing = entity.getItemStackFromSlot(equipmentSlot);
|
||||
final ItemStack existing = entity.getItemBySlot(equipmentSlot);
|
||||
|
||||
int limit = getStackLimit(slot, stack);
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
{
|
||||
if (existing.isEmpty())
|
||||
{
|
||||
entity.setItemStackToSlot(equipmentSlot, reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, limit) : stack);
|
||||
entity.setItemSlot(equipmentSlot, reachedLimit ? ItemHandlerHelper.copyStackWithSize(stack, limit) : stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -136,7 +136,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
|
||||
final ItemStack existing = entity.getItemStackFromSlot(equipmentSlot);
|
||||
final ItemStack existing = entity.getItemBySlot(equipmentSlot);
|
||||
|
||||
if (existing.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
@@ -147,7 +147,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
{
|
||||
if (!simulate)
|
||||
{
|
||||
entity.setItemStackToSlot(equipmentSlot, ItemStack.EMPTY);
|
||||
entity.setItemSlot(equipmentSlot, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
return existing;
|
||||
@@ -156,7 +156,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
{
|
||||
if (!simulate)
|
||||
{
|
||||
entity.setItemStackToSlot(equipmentSlot, ItemHandlerHelper.copyStackWithSize(existing, existing.getCount() - toExtract));
|
||||
entity.setItemSlot(equipmentSlot, ItemHandlerHelper.copyStackWithSize(existing, existing.getCount() - toExtract));
|
||||
}
|
||||
|
||||
return ItemHandlerHelper.copyStackWithSize(existing, toExtract);
|
||||
@@ -167,7 +167,7 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
public int getSlotLimit(final int slot)
|
||||
{
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
return equipmentSlot.getSlotType() == EquipmentSlotType.Group.ARMOR ? 1 : 64;
|
||||
return equipmentSlot.getType() == EquipmentSlotType.Group.ARMOR ? 1 : 64;
|
||||
}
|
||||
|
||||
protected int getStackLimit(final int slot, @Nonnull final ItemStack stack)
|
||||
@@ -179,9 +179,9 @@ public abstract class EntityEquipmentInvWrapper implements IItemHandlerModifiabl
|
||||
public void setStackInSlot(final int slot, @Nonnull final ItemStack stack)
|
||||
{
|
||||
final EquipmentSlotType equipmentSlot = validateSlotIndex(slot);
|
||||
if (ItemStack.areItemStacksEqual(entity.getItemStackFromSlot(equipmentSlot), stack))
|
||||
if (ItemStack.matches(entity.getItemBySlot(equipmentSlot), stack))
|
||||
return;
|
||||
entity.setItemStackToSlot(equipmentSlot, stack);
|
||||
entity.setItemSlot(equipmentSlot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,14 +58,14 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
@Override
|
||||
public int getSlots()
|
||||
{
|
||||
return getInv().getSizeInventory();
|
||||
return getInv().getContainerSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
return getInv().getStackInSlot(slot);
|
||||
return getInv().getItem(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +75,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
if (stack.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
ItemStack stackInSlot = getInv().getStackInSlot(slot);
|
||||
ItemStack stackInSlot = getInv().getItem(slot);
|
||||
|
||||
int m;
|
||||
if (!stackInSlot.isEmpty())
|
||||
@@ -86,7 +86,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
if (!ItemHandlerHelper.canItemStacksStack(stack, stackInSlot))
|
||||
return stack;
|
||||
|
||||
if (!getInv().isItemValidForSlot(slot, stack))
|
||||
if (!getInv().canPlaceItem(slot, stack))
|
||||
return stack;
|
||||
|
||||
m = Math.min(stack.getMaxStackSize(), getSlotLimit(slot)) - stackInSlot.getCount();
|
||||
@@ -97,8 +97,8 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
{
|
||||
ItemStack copy = stack.copy();
|
||||
copy.grow(stackInSlot.getCount());
|
||||
getInv().setInventorySlotContents(slot, copy);
|
||||
getInv().markDirty();
|
||||
getInv().setItem(slot, copy);
|
||||
getInv().setChanged();
|
||||
}
|
||||
|
||||
return ItemStack.EMPTY;
|
||||
@@ -111,8 +111,8 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
{
|
||||
ItemStack copy = stack.split(m);
|
||||
copy.grow(stackInSlot.getCount());
|
||||
getInv().setInventorySlotContents(slot, copy);
|
||||
getInv().markDirty();
|
||||
getInv().setItem(slot, copy);
|
||||
getInv().setChanged();
|
||||
return stack;
|
||||
}
|
||||
else
|
||||
@@ -124,7 +124,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!getInv().isItemValidForSlot(slot, stack))
|
||||
if (!getInv().canPlaceItem(slot, stack))
|
||||
return stack;
|
||||
|
||||
m = Math.min(stack.getMaxStackSize(), getSlotLimit(slot));
|
||||
@@ -134,8 +134,8 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
stack = stack.copy();
|
||||
if (!simulate)
|
||||
{
|
||||
getInv().setInventorySlotContents(slot, stack.split(m));
|
||||
getInv().markDirty();
|
||||
getInv().setItem(slot, stack.split(m));
|
||||
getInv().setChanged();
|
||||
return stack;
|
||||
}
|
||||
else
|
||||
@@ -148,8 +148,8 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
{
|
||||
if (!simulate)
|
||||
{
|
||||
getInv().setInventorySlotContents(slot, stack);
|
||||
getInv().markDirty();
|
||||
getInv().setItem(slot, stack);
|
||||
getInv().setChanged();
|
||||
}
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
if (amount == 0)
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
ItemStack stackInSlot = getInv().getStackInSlot(slot);
|
||||
ItemStack stackInSlot = getInv().getItem(slot);
|
||||
|
||||
if (stackInSlot.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
@@ -186,8 +186,8 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
{
|
||||
int m = Math.min(stackInSlot.getCount(), amount);
|
||||
|
||||
ItemStack decrStackSize = getInv().decrStackSize(slot, m);
|
||||
getInv().markDirty();
|
||||
ItemStack decrStackSize = getInv().removeItem(slot, m);
|
||||
getInv().setChanged();
|
||||
return decrStackSize;
|
||||
}
|
||||
}
|
||||
@@ -195,19 +195,19 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
@Override
|
||||
public void setStackInSlot(int slot, @Nonnull ItemStack stack)
|
||||
{
|
||||
getInv().setInventorySlotContents(slot, stack);
|
||||
getInv().setItem(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotLimit(int slot)
|
||||
{
|
||||
return getInv().getInventoryStackLimit();
|
||||
return getInv().getMaxStackSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
|
||||
{
|
||||
return getInv().isItemValidForSlot(slot, stack);
|
||||
return getInv().canPlaceItem(slot, stack);
|
||||
}
|
||||
|
||||
public IInventory getInv()
|
||||
|
||||
@@ -31,7 +31,7 @@ public class PlayerArmorInvWrapper extends RangedWrapper
|
||||
|
||||
public PlayerArmorInvWrapper(PlayerInventory inv)
|
||||
{
|
||||
super(new InvWrapper(inv), inv.mainInventory.size(), inv.mainInventory.size() + inv.armorInventory.size());
|
||||
super(new InvWrapper(inv), inv.items.size(), inv.items.size() + inv.armor.size());
|
||||
inventoryPlayer = inv;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PlayerArmorInvWrapper extends RangedWrapper
|
||||
EquipmentSlotType equ = null;
|
||||
for (EquipmentSlotType s : EquipmentSlotType.values())
|
||||
{
|
||||
if (s.getSlotType() == EquipmentSlotType.Group.ARMOR && s.getIndex() == slot)
|
||||
if (s.getType() == EquipmentSlotType.Group.ARMOR && s.getIndex() == slot)
|
||||
{
|
||||
equ = s;
|
||||
break;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class PlayerMainInvWrapper extends RangedWrapper
|
||||
|
||||
public PlayerMainInvWrapper(PlayerInventory inv)
|
||||
{
|
||||
super(new InvWrapper(inv), 0, inv.mainInventory.size());
|
||||
super(new InvWrapper(inv), 0, inv.items.size());
|
||||
inventoryPlayer = inv;
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ public class PlayerMainInvWrapper extends RangedWrapper
|
||||
ItemStack inSlot = getStackInSlot(slot);
|
||||
if(!inSlot.isEmpty())
|
||||
{
|
||||
if (getInventoryPlayer().player.world.isRemote)
|
||||
if (getInventoryPlayer().player.level.isClientSide)
|
||||
{
|
||||
inSlot.setAnimationsToGo(5);
|
||||
inSlot.setPopTime(5);
|
||||
}
|
||||
else if(getInventoryPlayer().player instanceof ServerPlayerEntity) {
|
||||
getInventoryPlayer().player.openContainer.detectAndSendChanges();
|
||||
getInventoryPlayer().player.containerMenu.broadcastChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class PlayerOffhandInvWrapper extends RangedWrapper
|
||||
{
|
||||
public PlayerOffhandInvWrapper(PlayerInventory inv)
|
||||
{
|
||||
super(new InvWrapper(inv), inv.mainInventory.size() + inv.armorInventory.size(),
|
||||
inv.mainInventory.size() + inv.armorInventory.size() + inv.offHandInventory.size());
|
||||
super(new InvWrapper(inv), inv.items.size() + inv.armor.size(),
|
||||
inv.items.size() + inv.armor.size() + inv.offhand.size());
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class RecipeWrapper implements IInventory {
|
||||
* Returns the size of this inventory. Must be equivalent to {@link #getHeight()} * {@link #getWidth()}.
|
||||
*/
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
public int getContainerSize()
|
||||
{
|
||||
return inv.getSlots();
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class RecipeWrapper implements IInventory {
|
||||
* Returns the stack in this slot. This stack should be a modifiable reference, not a copy of a stack in your inventory.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
public ItemStack getItem(int slot)
|
||||
{
|
||||
return inv.getStackInSlot(slot);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class RecipeWrapper implements IInventory {
|
||||
* Attempts to remove n items from the specified slot. Returns the split stack that was removed. Modifies the inventory.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int count)
|
||||
public ItemStack removeItem(int slot, int count)
|
||||
{
|
||||
ItemStack stack = inv.getStackInSlot(slot);
|
||||
return stack.isEmpty() ? ItemStack.EMPTY : stack.split(count);
|
||||
@@ -65,7 +65,7 @@ public class RecipeWrapper implements IInventory {
|
||||
* Sets the contents of this slot to the provided stack.
|
||||
*/
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack)
|
||||
public void setItem(int slot, ItemStack stack)
|
||||
{
|
||||
inv.setStackInSlot(slot, stack);
|
||||
}
|
||||
@@ -74,11 +74,11 @@ public class RecipeWrapper implements IInventory {
|
||||
* Removes the stack contained in this slot from the underlying handler, and returns it.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack removeStackFromSlot(int index)
|
||||
public ItemStack removeItemNoUpdate(int index)
|
||||
{
|
||||
ItemStack s = getStackInSlot(index);
|
||||
ItemStack s = getItem(index);
|
||||
if(s.isEmpty()) return ItemStack.EMPTY;
|
||||
setInventorySlotContents(index, ItemStack.EMPTY);
|
||||
setItem(index, ItemStack.EMPTY);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ public class RecipeWrapper implements IInventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack)
|
||||
public boolean canPlaceItem(int slot, ItemStack stack)
|
||||
{
|
||||
return inv.isItemValid(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
public void clearContent()
|
||||
{
|
||||
for(int i = 0; i < inv.getSlots(); i++)
|
||||
{
|
||||
@@ -109,14 +109,14 @@ public class RecipeWrapper implements IInventory {
|
||||
|
||||
//The following methods are never used by vanilla in crafting. They are defunct as mods need not override them.
|
||||
@Override
|
||||
public int getInventoryStackLimit() { return 0; }
|
||||
public int getMaxStackSize() { return 0; }
|
||||
@Override
|
||||
public void markDirty() {}
|
||||
public void setChanged() {}
|
||||
@Override
|
||||
public boolean isUsableByPlayer(PlayerEntity player) { return false; }
|
||||
public boolean stillValid(PlayerEntity player) { return false; }
|
||||
@Override
|
||||
public void openInventory(PlayerEntity player) {}
|
||||
public void startOpen(PlayerEntity player) {}
|
||||
@Override
|
||||
public void closeInventory(PlayerEntity player) {}
|
||||
public void stopOpen(PlayerEntity player) {}
|
||||
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
int i = getSlot(inv, slot, side);
|
||||
return i == -1 ? ItemStack.EMPTY : inv.getStackInSlot(i);
|
||||
return i == -1 ? ItemStack.EMPTY : inv.getItem(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,7 +106,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
if (slot1 == -1)
|
||||
return stack;
|
||||
|
||||
ItemStack stackInSlot = inv.getStackInSlot(slot1);
|
||||
ItemStack stackInSlot = inv.getItem(slot1);
|
||||
|
||||
int m;
|
||||
if (!stackInSlot.isEmpty())
|
||||
@@ -117,7 +117,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
if (!ItemHandlerHelper.canItemStacksStack(stack, stackInSlot))
|
||||
return stack;
|
||||
|
||||
if (!inv.canInsertItem(slot1, stack, side) || !inv.isItemValidForSlot(slot1, stack))
|
||||
if (!inv.canPlaceItemThroughFace(slot1, stack, side) || !inv.canPlaceItem(slot1, stack))
|
||||
return stack;
|
||||
|
||||
m = Math.min(stack.getMaxStackSize(), getSlotLimit(slot)) - stackInSlot.getCount();
|
||||
@@ -153,7 +153,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!inv.canInsertItem(slot1, stack, side) || !inv.isItemValidForSlot(slot1, stack))
|
||||
if (!inv.canPlaceItemThroughFace(slot1, stack, side) || !inv.canPlaceItem(slot1, stack))
|
||||
return stack;
|
||||
|
||||
m = Math.min(stack.getMaxStackSize(), getSlotLimit(slot));
|
||||
@@ -192,8 +192,8 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
}
|
||||
|
||||
private void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
inv.markDirty(); //Notify vanilla of updates, We change the handler to be responsible for this instead of the caller. So mimic vanilla behavior
|
||||
inv.setInventorySlotContents(slot, stack);
|
||||
inv.setChanged(); //Notify vanilla of updates, We change the handler to be responsible for this instead of the caller. So mimic vanilla behavior
|
||||
inv.setItem(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,12 +208,12 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
if (slot1 == -1)
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
ItemStack stackInSlot = inv.getStackInSlot(slot1);
|
||||
ItemStack stackInSlot = inv.getItem(slot1);
|
||||
|
||||
if (stackInSlot.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
if (!inv.canExtractItem(slot1, stackInSlot, side))
|
||||
if (!inv.canTakeItemThroughFace(slot1, stackInSlot, side))
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
if (simulate)
|
||||
@@ -232,8 +232,8 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
else
|
||||
{
|
||||
int m = Math.min(stackInSlot.getCount(), amount);
|
||||
ItemStack ret = inv.decrStackSize(slot1, m);
|
||||
inv.markDirty();
|
||||
ItemStack ret = inv.removeItem(slot1, m);
|
||||
inv.setChanged();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -241,13 +241,13 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
@Override
|
||||
public int getSlotLimit(int slot)
|
||||
{
|
||||
return inv.getInventoryStackLimit();
|
||||
return inv.getMaxStackSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(int slot, @Nonnull ItemStack stack)
|
||||
{
|
||||
int slot1 = getSlot(inv, slot, side);
|
||||
return slot1 == -1 ? false : inv.isItemValidForSlot(slot1, stack);
|
||||
return slot1 == -1 ? false : inv.canPlaceItem(slot1, stack);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user