Call deserialze on capabilities in ItemStack.setItem. Closes #2384

This commit is contained in:
LexManos 2016-01-17 14:19:59 -08:00
parent 3c5103acfb
commit 812e69cee3
1 changed files with 3 additions and 2 deletions

View File

@ -180,7 +180,7 @@
} }
return multimap; return multimap;
@@ -860,6 +867,17 @@ @@ -860,6 +867,18 @@
public void func_150996_a(Item p_150996_1_) public void func_150996_a(Item p_150996_1_)
{ {
@ -194,11 +194,12 @@
+ net.minecraftforge.common.capabilities.ICapabilityProvider parent = p_150996_1_.initCapabilities(this, this.capNBT); + net.minecraftforge.common.capabilities.ICapabilityProvider parent = p_150996_1_.initCapabilities(this, this.capNBT);
+ this.capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(field_151002_e, this, parent); + this.capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(field_151002_e, this, parent);
+ } + }
+ if (this.capNBT != null && this.capabilities != null) this.capabilities.deserializeNBT(this.capNBT);
+ this.delegate = p_150996_1_ != null ? p_150996_1_.delegate : null; + this.delegate = p_150996_1_ != null ? p_150996_1_.delegate : null;
this.field_151002_e = p_150996_1_; this.field_151002_e = p_150996_1_;
} }
@@ -946,4 +964,26 @@ @@ -946,4 +965,26 @@
return false; return false;
} }
} }