Move ItemStack#forgeInit call earlier to allow earlier capability queries (#8096)

This commit is contained in:
sciwhiz12 authored and GitHub committed 2021-09-19 16:35:55 -07:00
1 parent a3e9d7a397
commit be1698bb15
2 files changed
+5 -13

No files matched your search

@@ -19,7 +19,7 @@
private static final Logger f_41585_ = LogManager.getLogger();
public static final ItemStack f_41583_ = new ItemStack((Item)null);
public static final DecimalFormat f_41584_ = Util.m_137469_(new DecimalFormat("#.##"), (p_41704_) -> {
@@ -127,14 +_,19 @@
@@ -127,10 +_,15 @@
p_41606_.ifPresent(this::m_41751_);
}
@@ -34,16 +34,12 @@
+ this.f_41589_ = p_41604_ == null ? null : p_41604_.m_5456_();
+ this.delegate = p_41604_ == null ? null : p_41604_.m_5456_().delegate;
+ this.f_41587_ = p_41605_;
+ this.forgeInit();
+ if (this.f_41589_ != null && this.f_41589_.isDamageable(this)) {
this.m_41721_(this.m_41773_());
}
this.m_41617_();
+ this.forgeInit();
}
private void m_41617_() {
@@ -143,18 +_,23 @@
@@ -143,14 +_,19 @@
}
private ItemStack(CompoundTag p_41608_) {
@@ -57,17 +53,13 @@
this.f_41590_ = p_41608_.m_128469_("tag");
this.m_41720_().m_142312_(this.f_41590_);
}
+ this.forgeInit();
- if (this.m_41720_().m_41465_()) {
+ if (this.m_41720_().isDamageable(this)) {
this.m_41721_(this.m_41773_());
}
this.m_41617_();
+ this.forgeInit();
}
public static ItemStack m_41712_(CompoundTag p_41713_) {
@@ -185,7 +_,7 @@
}
@@ -90,7 +90,7 @@ public abstract class CapabilityProvider<B extends CapabilityProvider<B>> implem
{
if (isLazy && !initialized)
{
doGatherCapabilities(lazyParentSupplier.get());
doGatherCapabilities(lazyParentSupplier == null ? null : lazyParentSupplier.get());
if (lazyData != null)
{
deserializeCaps(lazyData);