mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 12:15:53 +01:00
Fix shulker color and playing sounds
This commit is contained in:
parent
33568b24c2
commit
4da3153cdd
@ -12,6 +12,7 @@ import net.citizensnpcs.util.NMS;
|
||||
public class ShulkerTrait extends Trait {
|
||||
@Persist("color")
|
||||
private DyeColor color = DyeColor.PURPLE;
|
||||
private int lastPeekSet = 0;
|
||||
@Persist("peek")
|
||||
private int peek = 0;
|
||||
|
||||
@ -30,7 +31,10 @@ public class ShulkerTrait extends Trait {
|
||||
color = DyeColor.PURPLE;
|
||||
}
|
||||
if (npc.getEntity() instanceof Shulker) {
|
||||
if (peek != lastPeekSet) {
|
||||
NMS.setShulkerPeek((Shulker) npc.getEntity(), peek);
|
||||
lastPeekSet = peek;
|
||||
}
|
||||
NMS.setShulkerColor((Shulker) npc.getEntity(), color);
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ public class ShulkerController extends MobEntityController {
|
||||
}
|
||||
|
||||
public void setColor(DyeColor color) {
|
||||
this.datawatcher.set(bw, color.getDyeData());
|
||||
this.datawatcher.set(bw, color.getWoolData());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -963,7 +963,7 @@ public class NMSImpl implements NMSBridge {
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(Shulker shulker, DyeColor color) {
|
||||
((EntityShulker) getHandle(shulker)).getDataWatcher().set(EntityShulker.COLOR, color.getDyeData());
|
||||
((EntityShulker) getHandle(shulker)).getDataWatcher().set(EntityShulker.COLOR, color.getWoolData());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user