mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 03:49:14 +00:00
Update mappings to 09/21 snapshots.
Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
This commit is contained in:
1 parent
5ed03945a0
commit
94e1a8e0a4
210 files changed
+1052
-978
No files matched your search
@@ -50,8 +50,8 @@ public class CapabilityItemHandler
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
NBTTagCompound itemTag = new NBTTagCompound();
|
||||
itemTag.setInteger("Slot", i);
|
||||
stack.writeToNBT(itemTag);
|
||||
itemTag.setInt("Slot", i);
|
||||
stack.write(itemTag);
|
||||
nbtTagList.add(itemTag);
|
||||
}
|
||||
}
|
||||
@@ -67,12 +67,12 @@ public class CapabilityItemHandler
|
||||
NBTTagList tagList = (NBTTagList) base;
|
||||
for (int i = 0; i < tagList.size(); i++)
|
||||
{
|
||||
NBTTagCompound itemTags = tagList.getCompoundTagAt(i);
|
||||
int j = itemTags.getInteger("Slot");
|
||||
NBTTagCompound itemTags = tagList.getCompound(i);
|
||||
int j = itemTags.getInt("Slot");
|
||||
|
||||
if (j >= 0 && j < instance.getSlots())
|
||||
{
|
||||
itemHandlerModifiable.setStackInSlot(j, ItemStack.func_199557_a(itemTags));
|
||||
itemHandlerModifiable.setStackInSlot(j, ItemStack.read(itemTags));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ public class ItemHandlerHelper
|
||||
|
||||
public static boolean canItemStacksStack(@Nonnull ItemStack a, @Nonnull ItemStack b)
|
||||
{
|
||||
if (a.isEmpty() || !a.isItemEqual(b) || a.hasTagCompound() != b.hasTagCompound())
|
||||
if (a.isEmpty() || !a.isItemEqual(b) || a.hasTag() != b.hasTag())
|
||||
return false;
|
||||
|
||||
return (!a.hasTagCompound() || a.getTagCompound().equals(b.getTagCompound())) && a.areCapsCompatible(b);
|
||||
return (!a.hasTag() || a.getTag().equals(b.getTag())) && a.areCapsCompatible(b);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,10 +79,10 @@ public class ItemHandlerHelper
|
||||
if (a.getHasSubtypes() && a.getMetadata() != b.getMetadata())
|
||||
return false;
|
||||
*/
|
||||
if (a.hasTagCompound() != b.hasTagCompound())
|
||||
if (a.hasTag() != b.hasTag())
|
||||
return false;
|
||||
|
||||
return (!a.hasTagCompound() || a.getTagCompound().equals(b.getTagCompound())) && a.areCapsCompatible(b);
|
||||
return (!a.hasTag() || a.getTag().equals(b.getTag())) && a.areCapsCompatible(b);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -179,30 +179,30 @@ public class ItemStackHandler implements IItemHandler, IItemHandlerModifiable, I
|
||||
if (!stacks.get(i).isEmpty())
|
||||
{
|
||||
NBTTagCompound itemTag = new NBTTagCompound();
|
||||
itemTag.setInteger("Slot", i);
|
||||
stacks.get(i).writeToNBT(itemTag);
|
||||
itemTag.setInt("Slot", i);
|
||||
stacks.get(i).write(itemTag);
|
||||
nbtTagList.add(itemTag);
|
||||
}
|
||||
}
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setTag("Items", nbtTagList);
|
||||
nbt.setInteger("Size", stacks.size());
|
||||
nbt.setInt("Size", stacks.size());
|
||||
return nbt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserializeNBT(NBTTagCompound nbt)
|
||||
{
|
||||
setSize(nbt.hasKey("Size", Constants.NBT.TAG_INT) ? nbt.getInteger("Size") : stacks.size());
|
||||
NBTTagList tagList = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
|
||||
setSize(nbt.contains("Size", Constants.NBT.TAG_INT) ? nbt.getInt("Size") : stacks.size());
|
||||
NBTTagList tagList = nbt.getList("Items", Constants.NBT.TAG_COMPOUND);
|
||||
for (int i = 0; i < tagList.size(); i++)
|
||||
{
|
||||
NBTTagCompound itemTags = tagList.getCompoundTagAt(i);
|
||||
int slot = itemTags.getInteger("Slot");
|
||||
NBTTagCompound itemTags = tagList.getCompound(i);
|
||||
int slot = itemTags.getInt("Slot");
|
||||
|
||||
if (slot >= 0 && slot < stacks.size())
|
||||
{
|
||||
stacks.set(slot, ItemStack.func_199557_a(itemTags));
|
||||
stacks.set(slot, ItemStack.read(itemTags));
|
||||
}
|
||||
}
|
||||
onLoad();
|
||||
|
||||
@@ -59,9 +59,9 @@ public class VanillaDoubleChestItemHandler extends WeakReference<TileEntityChest
|
||||
if (world == null || pos == null || !world.isBlockLoaded(pos))
|
||||
return null; // Still loading
|
||||
|
||||
IBlockState state = chest.func_195044_w();
|
||||
IBlockState state = chest.getBlockState();
|
||||
|
||||
EnumFacing[] horizontals = EnumFacing.HORIZONTALS;
|
||||
EnumFacing[] horizontals = EnumFacing.BY_HORIZONTAL_INDEX;
|
||||
for (int i = horizontals.length - 1; i >= 0; i--) // Use reverse order so we can return early
|
||||
{
|
||||
EnumFacing enumfacing = horizontals[i];
|
||||
@@ -99,7 +99,7 @@ public class VanillaDoubleChestItemHandler extends WeakReference<TileEntityChest
|
||||
private TileEntityChest getOtherChest()
|
||||
{
|
||||
TileEntityChest tileEntityChest = get();
|
||||
return tileEntityChest != null && !tileEntityChest.isInvalid() ? tileEntityChest : null;
|
||||
return tileEntityChest != null && !tileEntityChest.isRemoved() ? tileEntityChest : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -232,6 +232,6 @@ public class VanillaDoubleChestItemHandler extends WeakReference<TileEntityChest
|
||||
if (this == NO_ADJACENT_CHESTS_INSTANCE)
|
||||
return false;
|
||||
TileEntityChest tileEntityChest = get();
|
||||
return tileEntityChest == null || tileEntityChest.isInvalid();
|
||||
return tileEntityChest == null || tileEntityChest.isRemoved();
|
||||
}
|
||||
}
|
||||
@@ -87,13 +87,13 @@ public class VanillaInventoryCodeHooks
|
||||
*/
|
||||
public static boolean dropperInsertHook(World world, BlockPos pos, TileEntityDispenser dropper, int slot, @Nonnull ItemStack stack)
|
||||
{
|
||||
EnumFacing enumfacing = world.getBlockState(pos).getValue(BlockDropper.FACING);
|
||||
EnumFacing enumfacing = world.getBlockState(pos).get(BlockDropper.FACING);
|
||||
BlockPos blockpos = pos.offset(enumfacing);
|
||||
return getItemHandler(world, (double) blockpos.getX(), (double) blockpos.getY(), (double) blockpos.getZ(), enumfacing.getOpposite())
|
||||
.map(destinationResult -> {
|
||||
IItemHandler itemHandler = destinationResult.getKey();
|
||||
Object destination = destinationResult.getValue();
|
||||
ItemStack dispensedStack = stack.copy().splitStack(1);
|
||||
ItemStack dispensedStack = stack.copy().split(1);
|
||||
ItemStack remainder = putStackInInventoryAllSlots(dropper, destination, itemHandler, dispensedStack);
|
||||
|
||||
if (remainder.isEmpty())
|
||||
@@ -117,7 +117,7 @@ public class VanillaInventoryCodeHooks
|
||||
*/
|
||||
public static boolean insertHook(TileEntityHopper hopper)
|
||||
{
|
||||
EnumFacing hopperFacing = hopper.func_195044_w().getValue(BlockHopper.FACING);
|
||||
EnumFacing hopperFacing = hopper.getBlockState().get(BlockHopper.FACING);
|
||||
return getItemHandler(hopper, hopperFacing)
|
||||
.map(destinationResult -> {
|
||||
IItemHandler itemHandler = destinationResult.getKey();
|
||||
|
||||
@@ -109,7 +109,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
stack = stack.copy();
|
||||
if (!simulate)
|
||||
{
|
||||
ItemStack copy = stack.splitStack(m);
|
||||
ItemStack copy = stack.split(m);
|
||||
copy.grow(stackInSlot.getCount());
|
||||
getInv().setInventorySlotContents(slot, copy);
|
||||
getInv().markDirty();
|
||||
@@ -134,7 +134,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
stack = stack.copy();
|
||||
if (!simulate)
|
||||
{
|
||||
getInv().setInventorySlotContents(slot, stack.splitStack(m));
|
||||
getInv().setInventorySlotContents(slot, stack.split(m));
|
||||
getInv().markDirty();
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
stack = stack.copy();
|
||||
if (!simulate)
|
||||
{
|
||||
ItemStack copy = stack.splitStack(m);
|
||||
ItemStack copy = stack.split(m);
|
||||
copy.grow(stackInSlot.getCount());
|
||||
setInventorySlotContents(slot1, copy);
|
||||
return stack;
|
||||
@@ -161,7 +161,7 @@ public class SidedInvWrapper implements IItemHandlerModifiable
|
||||
stack = stack.copy();
|
||||
if (!simulate)
|
||||
{
|
||||
setInventorySlotContents(slot1, stack.splitStack(m));
|
||||
setInventorySlotContents(slot1, stack.split(m));
|
||||
return stack;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user