mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-16 12:21:25 +01:00
Fix shulker color setting
This commit is contained in:
parent
225ede02ce
commit
95ab688877
@ -346,11 +346,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
updateCustomName();
|
||||
}
|
||||
String nameplateVisible = data().<Object> get(NPC.NAMEPLATE_VISIBLE_METADATA, true).toString();
|
||||
if (nameplateVisible.equals("hover")) {
|
||||
((LivingEntity) getEntity()).setCustomNameVisible(false);
|
||||
} else {
|
||||
((LivingEntity) getEntity()).setCustomNameVisible(Boolean.parseBoolean(nameplateVisible));
|
||||
}
|
||||
((LivingEntity) getEntity()).setCustomNameVisible(Boolean.parseBoolean(nameplateVisible));
|
||||
|
||||
if (data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
NMS.setKnockbackResistance((LivingEntity) getEntity(), 1D);
|
||||
} else {
|
||||
@ -408,7 +405,6 @@ public class CitizensNPC extends AbstractNPC {
|
||||
}
|
||||
|
||||
private static final SetMultimap<ChunkCoord, NPC> CHUNK_LOADERS = HashMultimap.create();
|
||||
|
||||
private static final String NPC_METADATA_MARKER = "NPC";
|
||||
private static boolean SUPPORT_GLOWING = true;
|
||||
private static boolean SUPPORT_SILENT = true;
|
||||
|
@ -150,8 +150,9 @@ public class TabListRemover {
|
||||
entity.getSkinTracker().notifyRemovePacketSent(entry.player.getUniqueId());
|
||||
}
|
||||
|
||||
if (sendAll)
|
||||
if (sendAll) {
|
||||
entryIterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,9 +48,7 @@ public class ScoreboardTrait extends Trait {
|
||||
}
|
||||
}
|
||||
|
||||
if (SUPPORT_TEAM_SETOPTION)
|
||||
|
||||
{
|
||||
if (SUPPORT_TEAM_SETOPTION) {
|
||||
try {
|
||||
team.setOption(Option.NAME_TAG_VISIBILITY, nameVisibility ? OptionStatus.ALWAYS : OptionStatus.NEVER);
|
||||
} catch (NoSuchMethodError e) {
|
||||
|
@ -35,7 +35,7 @@ public class ShulkerTrait extends Trait {
|
||||
NMS.setPeekShulker(npc.getEntity(), peek);
|
||||
lastPeekSet = peek;
|
||||
}
|
||||
NMS.setShulkerColor((Shulker) npc.getEntity(), color);
|
||||
((Shulker) npc.getEntity()).setColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.lang.reflect.Modifier;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -402,10 +401,6 @@ public class NMS {
|
||||
BRIDGE.setShouldJump(entity);
|
||||
}
|
||||
|
||||
public static void setShulkerColor(Entity entity, DyeColor color) {
|
||||
BRIDGE.setShulkerColor(entity, color);
|
||||
}
|
||||
|
||||
public static void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
BRIDGE.setSitting(ocelot, sitting);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package net.citizensnpcs.util;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
@ -135,8 +134,6 @@ public interface NMSBridge {
|
||||
|
||||
public void setShouldJump(Entity entity);
|
||||
|
||||
public void setShulkerColor(Entity entity, DyeColor color);
|
||||
|
||||
public void setSitting(Ocelot ocelot, boolean sitting);
|
||||
|
||||
public void setSitting(Tameable tameable, boolean sitting);
|
||||
|
@ -920,10 +920,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
setSitting((Tameable) ocelot, sitting);
|
||||
|
@ -979,10 +979,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
setSitting((Tameable) ocelot, sitting);
|
||||
|
@ -991,10 +991,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
setSitting((Tameable) ocelot, sitting);
|
||||
|
@ -1026,10 +1026,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
setSitting((Tameable) ocelot, sitting);
|
||||
|
@ -1073,10 +1073,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
// sitting removed
|
||||
|
@ -197,29 +197,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void h(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
super.h(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.h(x, y, z);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Vector vector = new Vector(x, y, z);
|
||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||
if (!event.isCancelled()) {
|
||||
vector = event.getCollisionVector();
|
||||
super.h(vector.getX(), vector.getY(), vector.getZ());
|
||||
}
|
||||
// when another entity collides, this method is called to push the
|
||||
// NPC so we prevent it from doing anything if the event is
|
||||
// cancelled.
|
||||
}
|
||||
|
||||
@Override
|
||||
public CraftPlayer getBukkitEntity() {
|
||||
if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) {
|
||||
@ -269,6 +246,29 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
return skinTracker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void h(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
super.h(x, y, z);
|
||||
return;
|
||||
}
|
||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||
if (!npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true)) {
|
||||
super.h(x, y, z);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Vector vector = new Vector(x, y, z);
|
||||
NPCPushEvent event = Util.callPushEvent(npc, vector);
|
||||
if (!event.isCancelled()) {
|
||||
vector = event.getCollisionVector();
|
||||
super.h(vector.getX(), vector.getY(), vector.getZ());
|
||||
}
|
||||
// when another entity collides, this method is called to push the
|
||||
// NPC so we prevent it from doing anything if the event is
|
||||
// cancelled.
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
|
@ -1079,10 +1079,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
// sitting removed
|
||||
|
@ -16,7 +16,6 @@ import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -858,10 +857,6 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShulkerColor(org.bukkit.entity.Entity entity, DyeColor color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSitting(Ocelot ocelot, boolean sitting) {
|
||||
setSitting((Tameable) ocelot, sitting);
|
||||
|
Loading…
Reference in New Issue
Block a user