mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Ensure registration happens in order
This commit is contained in:
parent
81db96d8a2
commit
0b3f49e7fe
2 changed files with 14 additions and 6 deletions
|
@ -50,11 +50,17 @@ abstract class MixinEntity implements EntityDuck, Trackable {
|
|||
|
||||
@Override
|
||||
public DataTrackerManager getDataTrackers() {
|
||||
synchronized (this) {
|
||||
if (dataTrackerManager == null) {
|
||||
dataTrackerManager = new DataTrackerManager((Entity)(Object)this);
|
||||
// ensure lazy registration happens
|
||||
if (this instanceof Equine.Container<?> eq) {
|
||||
eq.get();
|
||||
}
|
||||
}
|
||||
return dataTrackerManager;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Accessor("submergedFluidTag")
|
||||
|
|
|
@ -52,11 +52,13 @@ abstract class MixinLivingEntity extends Entity implements LivingEntityDuck, Equ
|
|||
|
||||
@Override
|
||||
public Living<?> get() {
|
||||
synchronized (this) {
|
||||
if (caster == null) {
|
||||
caster = create();
|
||||
}
|
||||
return (Living<?>)caster;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Accessor("jumping")
|
||||
|
|
Loading…
Reference in a new issue