SPIGOT-5053: Initialize beacon with stored levels where available

This commit is contained in:
md_5 2019-06-10 19:09:51 +10:00
parent b1c5fd6817
commit 411609dc81

View File

@ -119,7 +119,7 @@
public void a(SoundEffect soundeffect) {
this.world.a((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
@@ -254,8 +309,10 @@
@@ -254,8 +309,11 @@
@Override
public void load(NBTTagCompound nbttagcompound) {
super.load(nbttagcompound);
@ -128,6 +128,7 @@
+ // Craftbukkit start - persist manually set non-default beacon effects (SPIGOT-3598)
+ this.primaryEffect = MobEffectList.fromId(nbttagcompound.getInt("Primary"));
+ this.secondaryEffect = MobEffectList.fromId(nbttagcompound.getInt("Secondary"));
+ this.levels = nbttagcompound.getInt("Levels"); // SPIGOT-5053, use where available
+ // Craftbukkit end
if (nbttagcompound.hasKeyOfType("CustomName", 8)) {
this.customName = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"));