Fix NBT type issues
Addresses two issues: - MC-135506: Experience should save as Integers - Allay duplication cooldown is saved and exposed as a long, but loaded as an int
This commit is contained in:
@@ -8,19 +8,19 @@
|
||||
|
||||
public Allay(EntityType<? extends Allay> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -113,6 +114,12 @@
|
||||
this.dynamicVibrationListener = new DynamicGameEventListener<>(new VibrationSystem.Listener(this));
|
||||
@@ -114,6 +115,12 @@
|
||||
this.dynamicJukeboxListener = new DynamicGameEventListener<>(new Allay.JukeboxListener(this.vibrationUser.getPositionSource(), ((GameEvent) GameEvent.JUKEBOX_PLAY.value()).notificationRadius()));
|
||||
}
|
||||
+
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public void setCanDuplicate(boolean canDuplicate) {
|
||||
+ this.entityData.set(Allay.DATA_CAN_DUPLICATE, canDuplicate);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
+
|
||||
@Override
|
||||
protected Brain.Provider<Allay> brainProvider() {
|
||||
return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES);
|
||||
@@ -126,7 +133,7 @@
|
||||
|
||||
@Override
|
||||
@@ -70,6 +70,15 @@
|
||||
return this.jukeboxPos == null || !this.jukeboxPos.closerToCenterThan(this.position(), (double) ((GameEvent) GameEvent.JUKEBOX_PLAY.value()).notificationRadius()) || !this.level().getBlockState(this.jukeboxPos).is(Blocks.JUKEBOX);
|
||||
}
|
||||
|
||||
@@ -486,7 +499,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
- this.duplicationCooldown = (long) nbt.getInt("DuplicationCooldown");
|
||||
+ this.duplicationCooldown = nbt.getLong("DuplicationCooldown"); // Paper - Load as long
|
||||
this.entityData.set(Allay.DATA_CAN_DUPLICATE, nbt.getBoolean("CanDuplicate"));
|
||||
}
|
||||
|
||||
@@ -506,7 +519,7 @@
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user