mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-18 05:11:37 +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 {
|
public class ShulkerTrait extends Trait {
|
||||||
@Persist("color")
|
@Persist("color")
|
||||||
private DyeColor color = DyeColor.PURPLE;
|
private DyeColor color = DyeColor.PURPLE;
|
||||||
|
private int lastPeekSet = 0;
|
||||||
@Persist("peek")
|
@Persist("peek")
|
||||||
private int peek = 0;
|
private int peek = 0;
|
||||||
|
|
||||||
@ -30,7 +31,10 @@ public class ShulkerTrait extends Trait {
|
|||||||
color = DyeColor.PURPLE;
|
color = DyeColor.PURPLE;
|
||||||
}
|
}
|
||||||
if (npc.getEntity() instanceof Shulker) {
|
if (npc.getEntity() instanceof Shulker) {
|
||||||
|
if (peek != lastPeekSet) {
|
||||||
NMS.setShulkerPeek((Shulker) npc.getEntity(), peek);
|
NMS.setShulkerPeek((Shulker) npc.getEntity(), peek);
|
||||||
|
lastPeekSet = peek;
|
||||||
|
}
|
||||||
NMS.setShulkerColor((Shulker) npc.getEntity(), color);
|
NMS.setShulkerColor((Shulker) npc.getEntity(), color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ public class ShulkerController extends MobEntityController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setColor(DyeColor color) {
|
public void setColor(DyeColor color) {
|
||||||
this.datawatcher.set(bw, color.getDyeData());
|
this.datawatcher.set(bw, color.getWoolData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -963,7 +963,7 @@ public class NMSImpl implements NMSBridge {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setShulkerColor(Shulker shulker, DyeColor color) {
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user