From c0eea379a4cdb8ecc6af7342ba62e0dadc17b3ee Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 25 Apr 2017 11:55:31 -0700 Subject: [PATCH] Fix vanilla inventory wrappers not properly calling markDirty. Closes #3854 and #3810 Also updated IItemHandler javadocs to reflect returning EMPTY instead of NULL. --- jsons/1.11.2.json | 12 +++---- .../minecraftforge/items/IItemHandler.java | 4 +-- .../items/VanillaDoubleChestItemHandler.java | 31 +++++++++++++++++-- .../items/wrapper/SidedInvWrapper.java | 19 ++++++++---- 4 files changed, 50 insertions(+), 16 deletions(-) diff --git a/jsons/1.11.2.json b/jsons/1.11.2.json index e739c330d..3e0ff2999 100644 --- a/jsons/1.11.2.json +++ b/jsons/1.11.2.json @@ -242,13 +242,13 @@ } }, { - "name": "com.mojang:realms:1.10.14", + "name": "com.mojang:realms:1.10.16", "downloads": { "artifact": { - "size": 3162566, - "sha1": "f08caf995313992fcfe03bc12234748328471d0a", - "path": "com/mojang/realms/1.10.14/realms-1.10.14.jar", - "url": "https://libraries.minecraft.net/com/mojang/realms/1.10.14/realms-1.10.14.jar" + "size": 3257394, + "sha1": "b4948eb06ff238e45044f47aa69c2c977ce69dcb", + "path": "com/mojang/realms/1.10.16/realms-1.10.16.jar", + "url": "https://libraries.minecraft.net/com/mojang/realms/1.10.16/realms-1.10.16.jar" } } }, @@ -558,6 +558,6 @@ "minecraftArguments": "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userType ${user_type} --versionType ${version_type}", "minimumLauncherVersion": 18, "releaseTime": "2016-12-21T09:29:12+00:00", - "time": "2017-02-27T10:13:05+00:00", + "time": "2017-04-07T11:44:29+00:00", "type": "release" } diff --git a/src/main/java/net/minecraftforge/items/IItemHandler.java b/src/main/java/net/minecraftforge/items/IItemHandler.java index 2e2aaf58d..f9f725ef5 100644 --- a/src/main/java/net/minecraftforge/items/IItemHandler.java +++ b/src/main/java/net/minecraftforge/items/IItemHandler.java @@ -62,7 +62,7 @@ public interface IItemHandler * @param slot Slot to insert into. * @param stack ItemStack to insert. * @param simulate If true, the insertion is only simulated - * @return The remaining ItemStack that was not inserted (if the entire stack is accepted, then return null). + * @return The remaining ItemStack that was not inserted (if the entire stack is accepted, then return ItemStack.EMPTY). * May be the same as the input ItemStack if unchanged, otherwise a new ItemStack. **/ @Nonnull @@ -76,7 +76,7 @@ public interface IItemHandler * @param slot Slot to extract from. * @param amount Amount to extract (may be greater than the current stacks max limit) * @param simulate If true, the extraction is only simulated - * @return ItemStack extracted from the slot, must be null, if nothing can be extracted + * @return ItemStack extracted from the slot, must be ItemStack.EMPTY, if nothing can be extracted **/ @Nonnull ItemStack extractItem(int slot, int amount, boolean simulate); diff --git a/src/main/java/net/minecraftforge/items/VanillaDoubleChestItemHandler.java b/src/main/java/net/minecraftforge/items/VanillaDoubleChestItemHandler.java index da17dfde1..c736b3a66 100644 --- a/src/main/java/net/minecraftforge/items/VanillaDoubleChestItemHandler.java +++ b/src/main/java/net/minecraftforge/items/VanillaDoubleChestItemHandler.java @@ -131,6 +131,10 @@ public class VanillaDoubleChestItemHandler extends WeakReference