Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void detectAndSendChanges() {
// check if parent item is gone
ItemStack parentItem = inventory.getParentItem();
if (parentItem != null) {
if (player.getCurrentEquippedItem() != parentItem) {
if (!ItemStack.areItemStacksEqual(player.getCurrentEquippedItem(), parentItem)) {
player.closeScreen();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ public int getInventoryStackLimit() {
}

@Override
public void markDirty() {
saveToNBT(containerStack.stackTagCompound);
}
public void markDirty() {}

@Override
public boolean isUseableByPlayer(EntityPlayer player) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,15 @@ private boolean placeBackpack(ItemStack stack, EntityPlayer player, World world,
boolean from) {
if (stack.stackSize == 0 || !player.canPlayerEdit(x, y, z, side, stack)) return false;
if (!stack.hasTagCompound()) stack.setTagCompound(new NBTTagCompound());

if (!stack.stackTagCompound.hasKey(TAG_TYPE)) {
stack.stackTagCompound.setByte(TAG_TYPE, BackpackTypes.getMeta(BackpackTypes.STANDARD));
}

if (!stack.stackTagCompound.hasKey(TAG_INVENTORY)) {
stack.stackTagCompound.setTag(TAG_INVENTORY, new NBTTagList());
}

// world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
BlockAdventureBackpack backpack = ModBlocks.blockBackpack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private static void createWearableInventory(ItemStack stack) {
public static ItemStack createBackpackStack(BackpackTypes type) {
ItemStack backpackStack = new ItemStack(ModItems.adventureBackpack, 1, BackpackTypes.getMeta(type));
setBackpackType(backpackStack, type);
createWearableInventory(backpackStack);
return backpackStack;
}

Expand Down