Revive CapabilityProvider on entity revive. Madders should NOT need this, as caps are copied via NBT.

This commit is contained in:
LexManos committed 2019-03-19 21:21:37 -07:00
1 parent f5375783c6
commit 18400e8457
3 files changed
+11 -4

No files matched your search

@@ -288,7 +288,7 @@
this.field_70170_p.field_72984_F.func_76319_b();
worldserver.func_82742_i();
worldserver1.func_82742_i();
@@ -2592,4 +2628,60 @@
@@ -2592,4 +2628,63 @@
public double func_212107_bY() {
return this.field_211517_W;
}
@@ -347,5 +347,8 @@
+ public void onRemovedFromWorld() { this.isAddedToWorld = false; }
+
+ @Override
+ public void revive() { this.field_70128_L = false; }
+ public void revive() {
+ this.field_70128_L = false;
+ this.reviveCaps();
+ }
}
@@ -106,6 +106,11 @@ public abstract class CapabilityProvider<B extends CapabilityProvider<B>> implem
disp.invalidate();
}
protected void reviveCaps()
{
this.valid = true; //Stupid players don't copy the entity when transporting across worlds.
}
@Override
@Nonnull
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable EnumFacing side)
@@ -82,9 +82,8 @@ public class AttachCapabilitiesEvent<T> extends GenericEvent<T>
return view;
}
/**
* Adds a callback that is fired when the attacked object is invalidated.
* Adds a callback that is fired when the attached object is invalidated.
* Such as a Entity/TileEntity being removed from world.
* All attached providers should invalidate all of their held capability instances.
*/