Improve comments

This commit is contained in:
filoghost 2021-05-17 18:19:09 +02:00
parent 949018c60f
commit 523b866f8e
109 changed files with 874 additions and 884 deletions

View File

@ -11,7 +11,8 @@ public interface ChatComponentCustomNameEditor<T> extends CustomNameEditor {
@Override @Override
default T replaceCustomName(Object customNameObject, String target, String replacement) { default T replaceCustomName(Object customNameObject, String target, String replacement) {
// Custom name is expected to be a ChatComponentText with empty text and child components (called "siblings") that do not contain more components. // Custom name is expected to be a ChatComponentText with empty text
// and child components (called "siblings") that do not contain more components.
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
T rootComponent = (T) customNameObject; T rootComponent = (T) customNameObject;
@ -31,7 +32,7 @@ public interface ChatComponentCustomNameEditor<T> extends CustomNameEditor {
} }
if (getText(childComponent).contains(target)) { if (getText(childComponent).contains(target)) {
// Lazy initialization for performance, since this method can be called frequently. // Lazy initialization for performance, since this method can be called frequently
if (childrenContainingTarget == null) { if (childrenContainingTarget == null) {
childrenContainingTarget = new boolean[childrenSize]; childrenContainingTarget = new boolean[childrenSize];
} }
@ -40,11 +41,11 @@ public interface ChatComponentCustomNameEditor<T> extends CustomNameEditor {
} }
if (childrenContainingTarget == null) { if (childrenContainingTarget == null) {
// No match found, return original unmodified object. // No match found, return original unmodified object
return rootComponent; return rootComponent;
} }
// Clone all the objects and apply replacements where needed. // Clone all the objects and apply replacements where needed
T clonedRoot = cloneComponent(rootComponent); T clonedRoot = cloneComponent(rootComponent);
for (int i = 0; i < childrenSize; i++) { for (int i = 0; i < childrenSize; i++) {
T childComponent = children.get(i); T childComponent = children.get(i);

View File

@ -15,7 +15,11 @@ import org.bukkit.inventory.ItemStack;
public interface NMSManager { public interface NMSManager {
// A method to register all the custom entities of the plugin, it may fail. /**
* Register all the custom entities of the plugin.
*
* @throws Exception if anything during the process fails
*/
void setup() throws Exception; void setup() throws Exception;
NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentHologramLine) throws SpawnFailedException; NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentHologramLine) throws SpawnFailedException;

View File

@ -7,13 +7,18 @@ package me.filoghost.holographicdisplays.core.nms.entity;
public interface NMSArmorStand extends NMSVehicle { public interface NMSArmorStand extends NMSVehicle {
// Sets a custom name as a String.
void setCustomNameNMS(String customName); void setCustomNameNMS(String customName);
// Returns the last custom name set. /**
* Returns the last custom name set.
*/
String getCustomNameStringNMS(); String getCustomNameStringNMS();
// Returns the custom name as version-dependent NMS object (String for MC 1.12 and below, ChatComponent for MC 1.13+ a ChatComponent). /**
* Returns the custom name NMS object, whose type is version-dependent (String for MC 1.12 and below, ChatComponent
* for MC 1.13+). The returned value may differ from {@link #getCustomNameStringNMS()} even if it's a string, for
* example if the custom name has been truncated before being applied.
*/
Object getCustomNameObjectNMS(); Object getCustomNameObjectNMS();
} }

View File

@ -9,26 +9,20 @@ import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
/** /**
* An interface to represent a custom NMS entity being part of a hologram. * A custom entity that is part of a hologram.
*/ */
public interface NMSEntity { public interface NMSEntity {
// Returns the linked line, all the entities are part of a line. Should never be null.
StandardHologramLine getHologramLine(); StandardHologramLine getHologramLine();
// Sets the location through NMS.
void setLocationNMS(double x, double y, double z); void setLocationNMS(double x, double y, double z);
// Returns if the entity is dead through NMS.
boolean isDeadNMS(); boolean isDeadNMS();
// Kills the entity through NMS.
void killEntityNMS(); void killEntityNMS();
// The entity ID.
int getIdNMS(); int getIdNMS();
// Returns the bukkit entity.
org.bukkit.entity.Entity getBukkitEntityNMS(); org.bukkit.entity.Entity getBukkitEntityNMS();
boolean isTrackedBy(Player bukkitPlayer); boolean isTrackedBy(Player bukkitPlayer);

View File

@ -9,10 +9,11 @@ import org.bukkit.inventory.ItemStack;
public interface NMSItem extends NMSEntity { public interface NMSItem extends NMSEntity {
// Sets the bukkit ItemStack for this item.
void setItemStackNMS(ItemStack stack); void setItemStackNMS(ItemStack stack);
// The raw NMS ItemStack object. /**
* Returns the item stack NMS object.
*/
Object getRawItemStack(); Object getRawItemStack();
} }

View File

@ -14,7 +14,7 @@ public class RelativePlaceholder implements RelativePlaceholderReplacer {
private static final Collection<RelativePlaceholder> registry = new HashSet<>(); private static final Collection<RelativePlaceholder> registry = new HashSet<>();
// The placeholder itself, something like {player}. // The placeholder itself, something like {player}
private final String textPlaceholder; private final String textPlaceholder;
private final RelativePlaceholderReplacer replacer; private final RelativePlaceholderReplacer replacer;

View File

@ -43,23 +43,23 @@ public class PowerUps extends JavaPlugin implements Listener {
@EventHandler @EventHandler
public void onEntityDeath(EntityDeathEvent event) { public void onEntityDeath(EntityDeathEvent event) {
if (event.getEntityType() == EntityType.ZOMBIE) { if (event.getEntityType() == EntityType.ZOMBIE) {
// Remove normal drops and exp. // Remove normal drops and exp
event.getDrops().clear(); event.getDrops().clear();
event.setDroppedExp(0); event.setDroppedExp(0);
// Spawn the floating item with a label. // Spawn the floating item with a label
Hologram hologram = holographicDisplaysAPI.createHologram(event.getEntity().getLocation().add(0.0, 0.9, 0.0)); Hologram hologram = holographicDisplaysAPI.createHologram(event.getEntity().getLocation().add(0.0, 0.9, 0.0));
hologram.appendTextLine(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp"); hologram.appendTextLine(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp");
ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR)); ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));
icon.setPickupHandler((Player player) -> { icon.setPickupHandler((Player player) -> {
// Play an effect. // Play an effect
player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null); player.playEffect(hologram.getLocation(), Effect.MOBSPAWNER_FLAMES, null);
// 30 seconds of speed II. // 30 seconds of speed II
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true); player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 30 * 20, 1), true);
// Delete the hologram. // Delete the hologram
hologram.delete(); hologram.delete();
}); });
} }

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}
@Override public void setBodyPose(EulerAngle pose) {} @Override public void setBodyPose(EulerAngle pose) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -128,34 +128,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -164,7 +164,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -189,7 +189,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -42,9 +42,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
if (resendMountPacketTicks++ > 20) { if (resendMountPacketTicks++ > 20) {
@ -60,57 +60,57 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -130,13 +130,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }

View File

@ -44,9 +44,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
if (resendMountPacketTicks++ > 20) { if (resendMountPacketTicks++ > 20) {
@ -62,15 +62,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -79,35 +79,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -138,22 +138,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}
@Override public void setBodyPose(EulerAngle pose) {} @Override public void setBodyPose(EulerAngle pose) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void A_() { public void A_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -128,34 +128,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -164,7 +164,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -189,7 +189,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void A_() { public void A_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.a) { if (newItem == null || newItem == ItemStack.a) { // ItemStack.a is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -40,23 +40,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void A_() { public void A_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -65,35 +65,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -124,22 +124,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -50,17 +50,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<Class<? extends Entity>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.b); RegistryID<Class<? extends Entity>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.b);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> entity class mapping before the registration. // Save the the ID -> entity class mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the entity class. // Register the entity class
registryID.a(entityClass, id); registryID.a(entityClass, id);
// Restore the ID -> entity class mapping. // Restore the ID -> entity class mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void B_() { public void B_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -128,34 +128,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -164,7 +164,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -189,7 +189,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void B_() { public void B_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.a) { if (newItem == null || newItem == ItemStack.a) { // ItemStack.a is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -40,23 +40,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void B_() { public void B_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -65,35 +65,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -124,22 +124,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -50,17 +50,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<Class<? extends Entity>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.b); RegistryID<Class<? extends Entity>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.b);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> entity class mapping before the registration. // Save the the ID -> entity class mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the entity class. // Register the entity class
registryID.a(entityClass, id); registryID.a(entityClass, id);
// Restore the ID -> entity class mapping. // Restore the ID -> entity class mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -23,11 +23,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -56,15 +56,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -72,9 +72,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -82,35 +82,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -130,34 +130,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -166,7 +166,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -191,7 +191,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.a) { if (newItem == null || newItem == ItemStack.a) { // ItemStack.a is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -41,23 +41,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -66,35 +66,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -125,22 +125,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -56,17 +56,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.REGISTRY); RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(EntityTypes.REGISTRY);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> EntityTypes mapping before the registration. // Save the the ID -> EntityTypes mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the EntityTypes object. // Register the EntityTypes object
registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id); registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id);
// Restore the ID -> EntityTypes mapping. // Restore the ID -> EntityTypes mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }
@ -113,7 +113,7 @@ public class VersionNMSManager implements NMSManager {
nmsWorld.getChunkAt(chunkX, chunkZ).a(nmsEntity); nmsWorld.getChunkAt(chunkX, chunkZ).a(nmsEntity);
if (NMSCommons.IS_PAPER_SERVER) { if (NMSCommons.IS_PAPER_SERVER) {
try { try {
// Workaround because nmsWorld.entityList is a different class in Paper, if used without reflection it throws NoSuchFieldError. // Workaround because nmsWorld.entityList is a different class in Paper, if used without reflection it throws NoSuchFieldError
ENTITY_LIST_FIELD.get(nmsWorld).add(nmsEntity); ENTITY_LIST_FIELD.get(nmsWorld).add(nmsEntity);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -56,15 +56,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -72,9 +72,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -82,35 +82,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -130,34 +130,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -166,7 +166,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -191,7 +191,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.a) { if (newItem == null || newItem == ItemStack.a) { // ItemStack.a is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -41,23 +41,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -66,35 +66,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -125,22 +125,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -57,17 +57,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> EntityTypes mapping before the registration. // Save the the ID -> EntityTypes mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the EntityTypes object. // Register the EntityTypes object
registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id); registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id);
// Restore the ID -> EntityTypes mapping. // Restore the ID -> EntityTypes mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }
@ -114,7 +114,7 @@ public class VersionNMSManager implements NMSManager {
nmsWorld.getChunkAt(chunkX, chunkZ).a(nmsEntity); nmsWorld.getChunkAt(chunkX, chunkZ).a(nmsEntity);
if (NMSCommons.IS_PAPER_SERVER) { if (NMSCommons.IS_PAPER_SERVER) {
try { try {
// Workaround because nmsWorld.entityList is a different class in Paper, if used without reflection it throws NoSuchFieldError. // Workaround because nmsWorld.entityList is a different class in Paper, if used without reflection it throws NoSuchFieldError
ENTITY_LIST_FIELD.get(nmsWorld).add(nmsEntity); ENTITY_LIST_FIELD.get(nmsWorld).add(nmsEntity);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from ArmorStand class // Methods from ArmorStand class

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Item class // Methods from Item class

View File

@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Slime class // Methods from Slime class

View File

@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean a_(int i, ItemStack item) { public boolean a_(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void pickup(EntityHuman human) { public void pickup(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.a) { if (newItem == null || newItem == ItemStack.a) { // ItemStack.a is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -56,17 +56,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id, float sizeWidth, float sizeHeight) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id, float sizeWidth, float sizeHeight) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> EntityTypes mapping before the registration. // Save the the ID -> EntityTypes mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the EntityTypes object. // Register the EntityTypes object
registryID.a(EntityTypes.a.a(EnumCreatureType.MONSTER).a(sizeWidth, sizeHeight).b().a((String) null), id); registryID.a(EntityTypes.a.a(EnumCreatureType.MONSTER).a(sizeWidth, sizeHeight).b().a((String) null), id);
// Restore the ID -> EntityTypes mapping. // Restore the ID -> EntityTypes mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }
@ -170,12 +170,12 @@ public class VersionNMSManager implements NMSManager {
try { try {
return chatComponent.getSiblings(); return chatComponent.getSiblings();
} catch (NoSuchMethodError e) { } catch (NoSuchMethodError e) {
// The method was named differently in older 1.14 versions, use workaround. // The method was named differently in older 1.14 versions, use workaround
useNewGetSiblingsMethod = false; useNewGetSiblingsMethod = false;
} }
} }
// Access siblings field directly in older 1.14 versions. // Access siblings field directly in older 1.14 versions
try { try {
return OLD_SIBLINGS_FIELD.get(chatComponent); return OLD_SIBLINGS_FIELD.get(chatComponent);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {

View File

@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from ArmorStand class // Methods from ArmorStand class

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Item class // Methods from Item class

View File

@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Slime class // Methods from Slime class

View File

@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean a_(int i, ItemStack item) { public boolean a_(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void pickup(EntityHuman human) { public void pickup(EntityHuman human) {
if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) { if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) {
// Too low or too high, it's a bit weird./ // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.a is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.a) { if (newItem == null || newItem == ItemStack.a) { // ItemStack.a is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -55,17 +55,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id, float sizeWidth, float sizeHeight) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id, float sizeWidth, float sizeHeight) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> EntityTypes mapping before the registration. // Save the the ID -> EntityTypes mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the EntityTypes object. // Register the EntityTypes object
registryID.a(EntityTypes.a.a(EnumCreatureType.MONSTER).a(sizeWidth, sizeHeight).b().a((String) null), id); registryID.a(EntityTypes.a.a(EnumCreatureType.MONSTER).a(sizeWidth, sizeHeight).b().a((String) null), id);
// Restore the ID -> EntityTypes mapping. // Restore the ID -> EntityTypes mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }

View File

@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from ArmorStand class // Methods from ArmorStand class

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Item class // Methods from Item class

View File

@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Slime class // Methods from Slime class

View File

@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean a_(int i, ItemStack item) { public boolean a_(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void playSound(SoundEffect soundeffect, float f, float f1) { public void playSound(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void pickup(EntityHuman human) { public void pickup(EntityHuman human) {
if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) { if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) {
// Too low or too high, it's a bit weird./ // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.b is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.b) { if (newItem == null || newItem == ItemStack.b) { // ItemStack.b is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void playSound(SoundEffect soundeffect, float f, float f1) { public void playSound(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -55,17 +55,17 @@ public class VersionNMSManager implements NMSManager {
} }
public void registerCustomEntity(Class<? extends Entity> entityClass, int id, float sizeWidth, float sizeHeight) throws Exception { public void registerCustomEntity(Class<? extends Entity> entityClass, int id, float sizeWidth, float sizeHeight) throws Exception {
// Use reflection to get the RegistryID of entities. // Use reflection to get the RegistryID of entities
RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); RegistryID<EntityTypes<?>> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE);
Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID); Object[] idToClassMap = ID_TO_CLASS_MAP_FIELD.get(registryID);
// Save the the ID -> EntityTypes mapping before the registration. // Save the the ID -> EntityTypes mapping before the registration
Object oldValue = idToClassMap[id]; Object oldValue = idToClassMap[id];
// Register the EntityTypes object. // Register the EntityTypes object
registryID.a(EntityTypes.Builder.a(EnumCreatureType.MONSTER).a(sizeWidth, sizeHeight).b().a((String) null), id); registryID.a(EntityTypes.Builder.a(EnumCreatureType.MONSTER).a(sizeWidth, sizeHeight).b().a((String) null), id);
// Restore the ID -> EntityTypes mapping. // Restore the ID -> EntityTypes mapping
idToClassMap[id] = oldValue; idToClassMap[id] = oldValue;
} }

View File

@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from ArmorStand class // Methods from ArmorStand class

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Item class // Methods from Item class

View File

@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Slime class // Methods from Slime class

View File

@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean a_(int i, ItemStack item) { public boolean a_(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void playSound(SoundEffect soundeffect, float f, float f1) { public void playSound(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void pickup(EntityHuman human) { public void pickup(EntityHuman human) {
if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) { if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) {
// Too low or too high, it's a bit weird./ // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.b is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.b) { if (newItem == null || newItem == ItemStack.b) { // ItemStack.b is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void playSound(SoundEffect soundeffect, float f, float f1) { public void playSound(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from ArmorStand class // Methods from ArmorStand class

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Item class // Methods from Item class

View File

@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Slime class // Methods from Slime class

View File

@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean a_(int i, ItemStack item) { public boolean a_(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void playSound(SoundEffect soundeffect, float f, float f1) { public void playSound(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void pickup(EntityHuman human) { public void pickup(EntityHuman human) {
if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) { if (human.locY() < super.locY() - 1.5 || human.locY() > super.locY() + 1.0) {
// Too low or too high, it's a bit weird./ // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }
@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) { public void setItemStackNMS(org.bukkit.inventory.ItemStack stack) {
ItemStack newItem = CraftItemStack.asNMSCopy(stack); // ItemStack.b is returned if the stack is not valid ItemStack newItem = CraftItemStack.asNMSCopy(stack);
if (newItem == null || newItem == ItemStack.b) { if (newItem == null || newItem == ItemStack.b) { // ItemStack.b is returned if the stack is not valid
newItem = new ItemStack(Blocks.BEDROCK); newItem = new ItemStack(Blocks.BEDROCK);
} }

View File

@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void tick() { public void tick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void saveData(NBTTagCompound nbttagcompound) { public void saveData(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean a_(NBTTagCompound nbttagcompound) { public boolean a_(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound save(NBTTagCompound nbttagcompound) { public NBTTagCompound save(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void load(NBTTagCompound nbttagcompound) { public void load(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void loadData(NBTTagCompound nbttagcompound) { public void loadData(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(IChatBaseComponent ichatbasecomponent) { public void setCustomName(IChatBaseComponent ichatbasecomponent) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void playSound(SoundEffect soundeffect, float f, float f1) { public void playSound(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}
@Override public void setBodyPose(EulerAngle pose) {} @Override public void setBodyPose(EulerAngle pose) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -55,18 +55,18 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
SET_MARKER_METHOD.invoke(this, true); SET_MARKER_METHOD.invoke(this, true);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
DebugLogger.cannotSetArmorStandAsMarker(e); DebugLogger.cannotSetArmorStandAsMarker(e);
// It will still work, but the offset will be wrong. // It will still work, but the offset will be wrong
} }
super.noclip = true; super.noclip = true;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void t_() { public void t_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,24 +84,24 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@ -117,34 +117,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public boolean a(EntityHuman human, Vec3D vec3d) { public boolean a(EntityHuman human, Vec3D vec3d) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return true; return true;
} }
@Override @Override
public boolean d(int i, ItemStack item) { public boolean d(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setEquipment(int i, ItemStack item) { public void setEquipment(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -153,7 +153,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void makeSound(String sound, float f1, float f2) { public void makeSound(String sound, float f1, float f2) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -178,7 +178,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -38,54 +38,54 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void t_() { public void t_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < this.locY - 1.5 || human.locY > this.locY + 1.0) { if (human.locY < this.locY - 1.5 || human.locY > this.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
@ -100,13 +100,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }

View File

@ -39,12 +39,12 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void t_() { public void t_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
// The slime dies without a vehicle. // The slime dies without a vehicle
if (super.vehicle == null) { if (super.vehicle == null) {
killEntityNMS(); killEntityNMS();
} }
@ -52,15 +52,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -69,24 +69,24 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
@ -112,22 +112,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void makeSound(String sound, float volume, float pitch) { public void makeSound(String sound, float volume, float pitch) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}
@Override public void setBodyPose(EulerAngle pose) {} @Override public void setBodyPose(EulerAngle pose) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -55,18 +55,18 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
SET_MARKER_METHOD.invoke(this, true); SET_MARKER_METHOD.invoke(this, true);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
DebugLogger.cannotSetArmorStandAsMarker(e); DebugLogger.cannotSetArmorStandAsMarker(e);
// It will still work, but the offset will be wrong. // It will still work, but the offset will be wrong
} }
super.noclip = true; super.noclip = true;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void t_() { public void t_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -84,24 +84,24 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@ -117,34 +117,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public boolean a(EntityHuman human, Vec3D vec3d) { public boolean a(EntityHuman human, Vec3D vec3d) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return true; return true;
} }
@Override @Override
public boolean d(int i, ItemStack item) { public boolean d(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setEquipment(int i, ItemStack item) { public void setEquipment(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -153,7 +153,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void makeSound(String sound, float f1, float f2) { public void makeSound(String sound, float f1, float f2) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -178,7 +178,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -38,54 +38,54 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void t_() { public void t_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < this.locY - 1.5 || human.locY > this.locY + 1.0) { if (human.locY < this.locY - 1.5 || human.locY > this.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
@ -100,13 +100,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }

View File

@ -39,12 +39,12 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void t_() { public void t_() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
// The slime dies without a vehicle. // The slime dies without a vehicle
if (super.vehicle == null) { if (super.vehicle == null) {
killEntityNMS(); killEntityNMS();
} }
@ -52,15 +52,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -69,24 +69,24 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
@ -112,22 +112,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void makeSound(String sound, float volume, float pitch) { public void makeSound(String sound, float volume, float pitch) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}
@Override public void setBodyPose(EulerAngle pose) {} @Override public void setBodyPose(EulerAngle pose) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -55,15 +55,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -71,9 +71,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -81,34 +81,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@ -129,34 +129,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -165,7 +165,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -190,7 +190,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -42,9 +42,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
if (resendMountPacketTicks++ > 20) { if (resendMountPacketTicks++ > 20) {
@ -60,56 +60,56 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -129,13 +129,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }

View File

@ -44,9 +44,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
if (resendMountPacketTicks++ > 20) { if (resendMountPacketTicks++ > 20) {
@ -62,15 +62,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -79,34 +79,34 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public void e(NBTTagCompound nbttagcompound) { public void e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -137,22 +137,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Armor stand class // Methods from ArmorStand class
@Override public void setArms(boolean arms) {} @Override public void setArms(boolean arms) {}
@Override public void setBasePlate(boolean basePlate) {} @Override public void setBasePlate(boolean basePlate) {}
@Override public void setBodyPose(EulerAngle pose) {} @Override public void setBodyPose(EulerAngle pose) {}

View File

@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from Entity // Methods from Entity

View File

@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime {
super(server, entity); super(server, entity);
} }
// Disallow all the bukkit methods. // Disallow all the bukkit methods
@Override @Override
public void remove() { public void remove() {
// Cannot be removed, this is the most important to override. // Cannot be removed, this is the most important to override
} }
// Methods from LivingEntity class // Methods from LivingEntity class

View File

@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
super.setBasePlate(true); super.setBasePlate(true);
super.setMarker(true); super.setMarker(true);
super.collides = false; super.collides = false;
super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet. super.onGround = true; // Workaround to force EntityTrackerEntry to send a teleport packet
forceSetBoundingBox(new NullBoundingBox()); forceSetBoundingBox(new NullBoundingBox());
} }
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity. // Workaround to force EntityTrackerEntry to send a teleport packet immediately after spawning this entity
if (super.onGround) { if (super.onGround) {
super.onGround = false; super.onGround = false;
} }
@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@ -129,34 +129,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) { public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return EnumInteractionResult.PASS; return EnumInteractionResult.PASS;
} }
@Override @Override
public boolean c(int i, ItemStack item) { public boolean c(int i, ItemStack item) {
// Prevent stand being equipped // Prevent armor stand from being equipped
return false; return false;
} }
@Override @Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
// Prevent stand being equipped // Prevent armor stand from being equipped
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -165,7 +165,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
@ -190,7 +190,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -42,9 +42,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
if (resendMountPacketTicks++ > 20) { if (resendMountPacketTicks++ > 20) {
@ -60,57 +60,57 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
// Method called when a player is near. // Method called when a player is near
@Override @Override
public void d(EntityHuman human) { public void d(EntityHuman human) {
if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) { if (human.locY < super.locY - 1.5 || human.locY > super.locY + 1.0) {
// Too low or too high, it's a bit weird. // Too low or too high, it's a bit weird
return; return;
} }
if (human instanceof EntityPlayer) { if (human instanceof EntityPlayer) {
parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity());
// It is never added to the inventory. // It is never added to the inventory
} }
} }
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -130,13 +130,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override
public boolean isAlive() { public boolean isAlive() {
// This override prevents items from being picked up by hoppers. // This override prevents items from being picked up by hoppers (should have no side effects)
// Should have no side effects.
return false; return false;
} }

View File

@ -44,9 +44,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void m() { public void m() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
if (resendMountPacketTicks++ > 20) { if (resendMountPacketTicks++ > 20) {
@ -62,15 +62,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void inactiveTick() { public void inactiveTick() {
// Disable normal ticking for this entity. // Disable normal ticking for this entity
// So it won't get removed. // So it won't get removed
ticksLived = 0; ticksLived = 0;
} }
@Override @Override
public void a(AxisAlignedBB boundingBox) { public void a(AxisAlignedBB boundingBox) {
// Prevent bounding box from being changed // Prevent changes to bounding box
} }
public void forceSetBoundingBox(AxisAlignedBB boundingBox) { public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
@ -79,35 +79,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void b(NBTTagCompound nbttagcompound) { public void b(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
} }
@Override @Override
public boolean c(NBTTagCompound nbttagcompound) { public boolean c(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public boolean d(NBTTagCompound nbttagcompound) { public boolean d(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return false; return false;
} }
@Override @Override
public NBTTagCompound e(NBTTagCompound nbttagcompound) { public NBTTagCompound e(NBTTagCompound nbttagcompound) {
// Do not save NBT. // Do not save NBT
return nbttagcompound; return nbttagcompound;
} }
@Override @Override
public void f(NBTTagCompound nbttagcompound) { public void f(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
public void a(NBTTagCompound nbttagcompound) { public void a(NBTTagCompound nbttagcompound) {
// Do not load NBT. // Do not load NBT
} }
@Override @Override
@ -138,22 +138,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
@Override @Override
public void setCustomName(String customName) { public void setCustomName(String customName) {
// Locks the custom name. // Prevents changes to custom name
} }
@Override @Override
public void setCustomNameVisible(boolean visible) { public void setCustomNameVisible(boolean visible) {
// Locks the custom name. // Prevents changes to custom name visibility
} }
@Override @Override
public void a(SoundEffect soundeffect, float f, float f1) { public void a(SoundEffect soundeffect, float f, float f1) {
// Remove sounds. // Remove sounds
} }
@Override @Override
public void die() { public void die() {
// Prevent being killed. // Prevent entity from dying
} }
@Override @Override

View File

@ -55,7 +55,7 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke
@Override @Override
public void onCheckedEnable() throws PluginEnableException { public void onCheckedEnable() throws PluginEnableException {
// Warn about plugin reloaders and the /reload command. // Warn about plugin reloaders and the /reload command
if (instance != null || System.getProperty("HolographicDisplaysLoaded") != null) { if (instance != null || System.getProperty("HolographicDisplaysLoaded") != null) {
Bukkit.getConsoleSender().sendMessage( Bukkit.getConsoleSender().sendMessage(
ChatColor.RED + "[HolographicDisplays] Please do not use /reload or plugin reloaders." ChatColor.RED + "[HolographicDisplays] Please do not use /reload or plugin reloaders."
@ -66,7 +66,7 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke
System.setProperty("HolographicDisplaysLoaded", "true"); System.setProperty("HolographicDisplaysLoaded", "true");
instance = this; instance = this;
// The bungee chat API is required. // The bungee chat API is required
if (!FeatureSupport.CHAT_COMPONENTS) { if (!FeatureSupport.CHAT_COMPONENTS) {
throw new PluginEnableException( throw new PluginEnableException(
"Holographic Displays requires the new chat API.", "Holographic Displays requires the new chat API.",
@ -102,7 +102,7 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke
PrintableErrorCollector errorCollector = new PrintableErrorCollector(); PrintableErrorCollector errorCollector = new PrintableErrorCollector();
// Run only once at startup, before anything else. // Run only once at startup, before anything else
try { try {
LegacySymbolsUpgrader.run(configManager, errorCollector); LegacySymbolsUpgrader.run(configManager, errorCollector);
} catch (ConfigException e) { } catch (ConfigException e) {
@ -113,7 +113,6 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke
ProtocolLibHook.setup(this, nmsManager, this, errorCollector); ProtocolLibHook.setup(this, nmsManager, this, errorCollector);
// Start repeating tasks.
placeholderManager.startUpdaterTask(this); placeholderManager.startUpdaterTask(this);
HologramCommandManager commandManager = new HologramCommandManager(configManager, internalHologramManager, nmsManager); HologramCommandManager commandManager = new HologramCommandManager(configManager, internalHologramManager, nmsManager);

View File

@ -73,12 +73,12 @@ class PacketListener extends PacketAdapter {
NMSEntity nmsEntity = nmsManager.getNMSEntityBaseFromID(event.getPlayer().getWorld(), entityID); NMSEntity nmsEntity = nmsManager.getNMSEntityBaseFromID(event.getPlayer().getWorld(), entityID);
if (nmsEntity == null) { if (nmsEntity == null) {
return; // Entity not existing or not related to holograms. return; // Entity not existing or not related to holograms
} }
if (packetType == PacketType.Play.Server.REL_ENTITY_MOVE || packetType == PacketType.Play.Server.REL_ENTITY_MOVE_LOOK) { if (packetType == PacketType.Play.Server.REL_ENTITY_MOVE || packetType == PacketType.Play.Server.REL_ENTITY_MOVE_LOOK) {
if (nmsEntity instanceof NMSArmorStand && packetSettings.sendAccurateLocationPackets()) { if (nmsEntity instanceof NMSArmorStand && packetSettings.sendAccurateLocationPackets()) {
event.setCancelled(true); // Don't send relative movement packets for armor stands, only keep precise teleport packets. event.setCancelled(true); // Don't send relative movement packets for armor stands, only keep precise teleport packets
} }
return; return;
} }
@ -153,7 +153,7 @@ class PacketListener extends PacketAdapter {
} }
if (replacedCustomNameNMSObject == originalCustomNameNMSObject) { if (replacedCustomNameNMSObject == originalCustomNameNMSObject) {
// It means nothing has been replaced, since original custom name has been returned. // It means nothing has been replaced, since original custom name has been returned
return false; return false;
} }

Some files were not shown because too many files have changed in this diff Show More