From 523b866f8ef69b7d63d86a3a900bbfe8d086c803 Mon Sep 17 00:00:00 2001 From: filoghost Date: Mon, 17 May 2021 18:19:09 +0200 Subject: [PATCH] Improve comments --- .../nms/ChatComponentCustomNameEditor.java | 9 +++-- .../core/nms/NMSManager.java | 6 ++- .../core/nms/entity/NMSArmorStand.java | 11 ++++-- .../core/nms/entity/NMSEntity.java | 10 +---- .../core/nms/entity/NMSItem.java | 5 ++- .../core/placeholder/RelativePlaceholder.java | 2 +- .../filoghost/example/powerups/PowerUps.java | 10 ++--- .../nms/v1_10_R1/CraftNMSArmorStand.java | 6 +-- .../nms/v1_10_R1/CraftNMSItem.java | 4 +- .../nms/v1_10_R1/CraftNMSSlime.java | 4 +- .../nms/v1_10_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_10_R1/EntityNMSItem.java | 31 ++++++++------- .../nms/v1_10_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_11_R1/CraftNMSArmorStand.java | 6 +-- .../nms/v1_11_R1/CraftNMSItem.java | 4 +- .../nms/v1_11_R1/CraftNMSSlime.java | 4 +- .../nms/v1_11_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_11_R1/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_11_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_11_R1/VersionNMSManager.java | 8 ++-- .../nms/v1_12_R1/CraftNMSArmorStand.java | 6 +-- .../nms/v1_12_R1/CraftNMSItem.java | 4 +- .../nms/v1_12_R1/CraftNMSSlime.java | 4 +- .../nms/v1_12_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_12_R1/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_12_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_12_R1/VersionNMSManager.java | 8 ++-- .../nms/v1_13_R1/CraftNMSArmorStand.java | 6 +-- .../nms/v1_13_R1/CraftNMSItem.java | 4 +- .../nms/v1_13_R1/CraftNMSSlime.java | 4 +- .../nms/v1_13_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_13_R1/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_13_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_13_R1/VersionNMSManager.java | 10 ++--- .../nms/v1_13_R2/CraftNMSArmorStand.java | 6 +-- .../nms/v1_13_R2/CraftNMSItem.java | 4 +- .../nms/v1_13_R2/CraftNMSSlime.java | 4 +- .../nms/v1_13_R2/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_13_R2/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_13_R2/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_13_R2/VersionNMSManager.java | 10 ++--- .../nms/v1_14_R1/CraftNMSArmorStand.java | 4 +- .../nms/v1_14_R1/CraftNMSItem.java | 4 +- .../nms/v1_14_R1/CraftNMSSlime.java | 4 +- .../nms/v1_14_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_14_R1/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_14_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_14_R1/VersionNMSManager.java | 12 +++--- .../nms/v1_15_R1/CraftNMSArmorStand.java | 4 +- .../nms/v1_15_R1/CraftNMSItem.java | 4 +- .../nms/v1_15_R1/CraftNMSSlime.java | 4 +- .../nms/v1_15_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_15_R1/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_15_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_15_R1/VersionNMSManager.java | 8 ++-- .../nms/v1_16_R1/CraftNMSArmorStand.java | 4 +- .../nms/v1_16_R1/CraftNMSItem.java | 4 +- .../nms/v1_16_R1/CraftNMSSlime.java | 4 +- .../nms/v1_16_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_16_R1/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_16_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_16_R1/VersionNMSManager.java | 8 ++-- .../nms/v1_16_R2/CraftNMSArmorStand.java | 4 +- .../nms/v1_16_R2/CraftNMSItem.java | 4 +- .../nms/v1_16_R2/CraftNMSSlime.java | 4 +- .../nms/v1_16_R2/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_16_R2/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_16_R2/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_16_R3/CraftNMSArmorStand.java | 4 +- .../nms/v1_16_R3/CraftNMSItem.java | 4 +- .../nms/v1_16_R3/CraftNMSSlime.java | 4 +- .../nms/v1_16_R3/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_16_R3/EntityNMSItem.java | 35 +++++++++-------- .../nms/v1_16_R3/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_8_R2/CraftNMSArmorStand.java | 6 +-- .../nms/v1_8_R2/CraftNMSItem.java | 4 +- .../nms/v1_8_R2/CraftNMSSlime.java | 4 +- .../nms/v1_8_R2/EntityNMSArmorStand.java | 36 +++++++++--------- .../nms/v1_8_R2/EntityNMSItem.java | 27 +++++++------ .../nms/v1_8_R2/EntityNMSSlime.java | 28 +++++++------- .../nms/v1_8_R3/CraftNMSArmorStand.java | 6 +-- .../nms/v1_8_R3/CraftNMSItem.java | 4 +- .../nms/v1_8_R3/CraftNMSSlime.java | 4 +- .../nms/v1_8_R3/EntityNMSArmorStand.java | 36 +++++++++--------- .../nms/v1_8_R3/EntityNMSItem.java | 27 +++++++------ .../nms/v1_8_R3/EntityNMSSlime.java | 28 +++++++------- .../nms/v1_9_R1/CraftNMSArmorStand.java | 6 +-- .../nms/v1_9_R1/CraftNMSItem.java | 4 +- .../nms/v1_9_R1/CraftNMSSlime.java | 4 +- .../nms/v1_9_R1/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_9_R1/EntityNMSItem.java | 31 ++++++++------- .../nms/v1_9_R1/EntityNMSSlime.java | 30 +++++++-------- .../nms/v1_9_R2/CraftNMSArmorStand.java | 6 +-- .../nms/v1_9_R2/CraftNMSItem.java | 4 +- .../nms/v1_9_R2/CraftNMSSlime.java | 4 +- .../nms/v1_9_R2/EntityNMSArmorStand.java | 38 +++++++++---------- .../nms/v1_9_R2/EntityNMSItem.java | 31 ++++++++------- .../nms/v1_9_R2/EntityNMSSlime.java | 30 +++++++-------- .../HolographicDisplays.java | 7 ++-- .../bridge/protocollib/PacketListener.java | 6 +-- .../bridge/protocollib/ProtocolLibHook.java | 5 ++- .../disk/Configuration.java | 2 +- .../disk/HologramLineParser.java | 2 +- .../image/ImageMessage.java | 11 +++--- .../listener/ChunkListener.java | 4 +- .../listener/UpdateNotificationListener.java | 2 +- .../object/base/BaseHologramManager.java | 2 +- .../object/base/BaseTouchableLine.java | 4 +- .../internal/AnimationRegistry.java | 4 +- 109 files changed, 874 insertions(+), 884 deletions(-) diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/ChatComponentCustomNameEditor.java b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/ChatComponentCustomNameEditor.java index 6f5f0e56..efb4bb23 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/ChatComponentCustomNameEditor.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/ChatComponentCustomNameEditor.java @@ -11,7 +11,8 @@ public interface ChatComponentCustomNameEditor extends CustomNameEditor { @Override 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") T rootComponent = (T) customNameObject; @@ -31,7 +32,7 @@ public interface ChatComponentCustomNameEditor extends CustomNameEditor { } 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) { childrenContainingTarget = new boolean[childrenSize]; } @@ -40,11 +41,11 @@ public interface ChatComponentCustomNameEditor extends CustomNameEditor { } if (childrenContainingTarget == null) { - // No match found, return original unmodified object. + // No match found, return original unmodified object return rootComponent; } - // Clone all the objects and apply replacements where needed. + // Clone all the objects and apply replacements where needed T clonedRoot = cloneComponent(rootComponent); for (int i = 0; i < childrenSize; i++) { T childComponent = children.get(i); diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/NMSManager.java b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/NMSManager.java index 12cbc08a..edd12a8e 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/NMSManager.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/NMSManager.java @@ -15,7 +15,11 @@ import org.bukkit.inventory.ItemStack; 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; NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentHologramLine) throws SpawnFailedException; diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSArmorStand.java b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSArmorStand.java index 6b959fb0..83c9e67f 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSArmorStand.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSArmorStand.java @@ -7,13 +7,18 @@ package me.filoghost.holographicdisplays.core.nms.entity; public interface NMSArmorStand extends NMSVehicle { - // Sets a custom name as a String. void setCustomNameNMS(String customName); - // Returns the last custom name set. + /** + * Returns the last custom name set. + */ 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(); } diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSEntity.java b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSEntity.java index 41cbdb2d..18895baa 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSEntity.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSEntity.java @@ -9,26 +9,20 @@ import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine; 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 { - // Returns the linked line, all the entities are part of a line. Should never be null. StandardHologramLine getHologramLine(); - - // Sets the location through NMS. + void setLocationNMS(double x, double y, double z); - // Returns if the entity is dead through NMS. boolean isDeadNMS(); - // Kills the entity through NMS. void killEntityNMS(); - // The entity ID. int getIdNMS(); - // Returns the bukkit entity. org.bukkit.entity.Entity getBukkitEntityNMS(); boolean isTrackedBy(Player bukkitPlayer); diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSItem.java b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSItem.java index 7dd5fc0e..f0b59256 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSItem.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/nms/entity/NMSItem.java @@ -9,10 +9,11 @@ import org.bukkit.inventory.ItemStack; public interface NMSItem extends NMSEntity { - // Sets the bukkit ItemStack for this item. void setItemStackNMS(ItemStack stack); - // The raw NMS ItemStack object. + /** + * Returns the item stack NMS object. + */ Object getRawItemStack(); } diff --git a/core/src/main/java/me/filoghost/holographicdisplays/core/placeholder/RelativePlaceholder.java b/core/src/main/java/me/filoghost/holographicdisplays/core/placeholder/RelativePlaceholder.java index 76c67656..03a87eed 100644 --- a/core/src/main/java/me/filoghost/holographicdisplays/core/placeholder/RelativePlaceholder.java +++ b/core/src/main/java/me/filoghost/holographicdisplays/core/placeholder/RelativePlaceholder.java @@ -14,7 +14,7 @@ public class RelativePlaceholder implements RelativePlaceholderReplacer { private static final Collection registry = new HashSet<>(); - // The placeholder itself, something like {player}. + // The placeholder itself, something like {player} private final String textPlaceholder; private final RelativePlaceholderReplacer replacer; diff --git a/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java b/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java index 4fe3439c..8fb69907 100644 --- a/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java +++ b/example/power-ups/src/main/java/me/filoghost/example/powerups/PowerUps.java @@ -43,23 +43,23 @@ public class PowerUps extends JavaPlugin implements Listener { @EventHandler public void onEntityDeath(EntityDeathEvent event) { if (event.getEntityType() == EntityType.ZOMBIE) { - // Remove normal drops and exp. + // Remove normal drops and exp event.getDrops().clear(); 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.appendTextLine(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp"); ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR)); icon.setPickupHandler((Player player) -> { - // Play an effect. + // Play an effect 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); - // Delete the hologram. + // Delete the hologram hologram.delete(); }); } diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java index 374b0ada..a0c55790 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} @Override public void setBodyPose(EulerAngle pose) {} diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java index f04e17f2..a2c6917d 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java index 3da21fad..2b906c28 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java index da056e9e..e7df009a 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSArmorStand.java @@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -128,34 +128,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -164,7 +164,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -189,7 +189,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java index 712a2006..a921c250 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSItem.java @@ -42,9 +42,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; if (resendMountPacketTicks++ > 20) { @@ -60,57 +60,57 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -130,13 +130,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java index 47fea633..b9afdcf8 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/EntityNMSSlime.java @@ -44,9 +44,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; if (resendMountPacketTicks++ > 20) { @@ -62,15 +62,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -79,35 +79,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -138,22 +138,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSArmorStand.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSArmorStand.java index 2b9b1a76..ac0446dc 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSArmorStand.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} @Override public void setBodyPose(EulerAngle pose) {} diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSItem.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSItem.java index 7944ff89..9fff80fa 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSItem.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSSlime.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSSlime.java index 1e68342d..77d9f244 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSSlime.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSArmorStand.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSArmorStand.java index f6956772..d435886d 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSArmorStand.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSArmorStand.java @@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -128,34 +128,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -164,7 +164,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -189,7 +189,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java index 8335cc68..8e7815c4 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSItem.java @@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSSlime.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSSlime.java index a143560b..2b120ab6 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSSlime.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/EntityNMSSlime.java @@ -40,23 +40,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -65,35 +65,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -124,22 +124,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java index 6637e914..284a3978 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionNMSManager.java @@ -50,17 +50,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class entityClass, int id) throws Exception { - // Use reflection to get the RegistryID of entities. + // Use reflection to get the RegistryID of entities RegistryID> registryID = REGISTRY_ID_FIELD.get(EntityTypes.b); 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]; - // Register the entity class. + // Register the entity class registryID.a(entityClass, id); - // Restore the ID -> entity class mapping. + // Restore the ID -> entity class mapping idToClassMap[id] = oldValue; } diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSArmorStand.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSArmorStand.java index bc586ac7..ce9a80d3 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSArmorStand.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSItem.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSItem.java index 0dc8ece8..77d6405d 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSItem.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSSlime.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSSlime.java index f689d48e..8c4efc83 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSSlime.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSArmorStand.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSArmorStand.java index 358cc584..9b6862ce 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSArmorStand.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSArmorStand.java @@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -128,34 +128,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -164,7 +164,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -189,7 +189,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java index aaaa8955..56902ade 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSItem.java @@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSSlime.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSSlime.java index 1b2bc7fb..7d5b4cb2 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSSlime.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/EntityNMSSlime.java @@ -40,23 +40,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -65,35 +65,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -124,22 +124,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java index acbe3588..9e2641b9 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionNMSManager.java @@ -50,17 +50,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class entityClass, int id) throws Exception { - // Use reflection to get the RegistryID of entities. + // Use reflection to get the RegistryID of entities RegistryID> registryID = REGISTRY_ID_FIELD.get(EntityTypes.b); 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]; - // Register the entity class. + // Register the entity class registryID.a(entityClass, id); - // Restore the ID -> entity class mapping. + // Restore the ID -> entity class mapping idToClassMap[id] = oldValue; } diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSArmorStand.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSArmorStand.java index 3d8350ed..2a3a9386 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSArmorStand.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSItem.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSItem.java index 0d086bbc..e8a1f719 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSItem.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSSlime.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSSlime.java index 57fc313f..d5fbb281 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSSlime.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/CraftNMSSlime.java @@ -23,11 +23,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSArmorStand.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSArmorStand.java index 4c93e3ef..b90a6e95 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSArmorStand.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSArmorStand.java @@ -56,15 +56,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -72,9 +72,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -82,35 +82,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -130,34 +130,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -166,7 +166,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -191,7 +191,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java index 6ec50094..ccede1f4 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSItem.java @@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSSlime.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSSlime.java index 7494898c..57bdecc3 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSSlime.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/EntityNMSSlime.java @@ -41,23 +41,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -66,35 +66,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -125,22 +125,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/VersionNMSManager.java b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/VersionNMSManager.java index 231a960f..a80e4c80 100644 --- a/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/VersionNMSManager.java +++ b/nms/v1_13_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R1/VersionNMSManager.java @@ -56,17 +56,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class entityClass, int id) throws Exception { - // Use reflection to get the RegistryID of entities. + // Use reflection to get the RegistryID of entities RegistryID> registryID = REGISTRY_ID_FIELD.get(EntityTypes.REGISTRY); 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]; - // Register the EntityTypes object. + // Register the EntityTypes object registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id); - // Restore the ID -> EntityTypes mapping. + // Restore the ID -> EntityTypes mapping idToClassMap[id] = oldValue; } @@ -113,7 +113,7 @@ public class VersionNMSManager implements NMSManager { nmsWorld.getChunkAt(chunkX, chunkZ).a(nmsEntity); if (NMSCommons.IS_PAPER_SERVER) { 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); } catch (ReflectiveOperationException e) { e.printStackTrace(); diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSArmorStand.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSArmorStand.java index a9490aea..2820484a 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSArmorStand.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSItem.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSItem.java index d7f66975..c7c54b44 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSItem.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSSlime.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSSlime.java index eb271062..162c53be 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSSlime.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/CraftNMSSlime.java @@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSArmorStand.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSArmorStand.java index 6d255f66..0805565e 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSArmorStand.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSArmorStand.java @@ -56,15 +56,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -72,9 +72,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -82,35 +82,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -130,34 +130,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -166,7 +166,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -191,7 +191,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSItem.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSItem.java index 62a61944..0f190a69 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSItem.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSItem.java @@ -38,65 +38,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -116,13 +116,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -151,9 +150,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSSlime.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSSlime.java index 64b06a8e..330521dc 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSSlime.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/EntityNMSSlime.java @@ -41,23 +41,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -66,35 +66,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -125,22 +125,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java index 503eef83..914045a0 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionNMSManager.java @@ -57,17 +57,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class entityClass, int id) throws Exception { - // Use reflection to get the RegistryID of entities. + // Use reflection to get the RegistryID of entities RegistryID> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); 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]; - // Register the EntityTypes object. + // Register the EntityTypes object registryID.a(new EntityTypes<>(entityClass, world -> null, true, true, null), id); - // Restore the ID -> EntityTypes mapping. + // Restore the ID -> EntityTypes mapping idToClassMap[id] = oldValue; } @@ -114,7 +114,7 @@ public class VersionNMSManager implements NMSManager { nmsWorld.getChunkAt(chunkX, chunkZ).a(nmsEntity); if (NMSCommons.IS_PAPER_SERVER) { 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); } catch (ReflectiveOperationException e) { e.printStackTrace(); diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSArmorStand.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSArmorStand.java index f230ac11..3e075fd9 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSArmorStand.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSArmorStand.java @@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSItem.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSItem.java index 1058e2ce..e515b858 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSItem.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSSlime.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSSlime.java index fd07fb77..6a9c5638 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSSlime.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/CraftNMSSlime.java @@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSArmorStand.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSArmorStand.java index f1c6c79c..9cd1d248 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSArmorStand.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSArmorStand.java @@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean a_(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSItem.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSItem.java index aa29d2df..49065141 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSItem.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSItem.java @@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void pickup(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSSlime.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSSlime.java index abda2d5e..444fd463 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSSlime.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/EntityNMSSlime.java @@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java index 54137233..a8e52ee4 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionNMSManager.java @@ -56,17 +56,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class 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> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); 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]; - // Register the EntityTypes object. + // Register the EntityTypes object 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; } @@ -170,12 +170,12 @@ public class VersionNMSManager implements NMSManager { try { return chatComponent.getSiblings(); } 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; } } - // Access siblings field directly in older 1.14 versions. + // Access siblings field directly in older 1.14 versions try { return OLD_SIBLINGS_FIELD.get(chatComponent); } catch (ReflectiveOperationException e) { diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSArmorStand.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSArmorStand.java index 6e8ab6e6..65571a3c 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSArmorStand.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSArmorStand.java @@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSItem.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSItem.java index 5749b268..9e440f1c 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSItem.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSSlime.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSSlime.java index eef7f351..340fa5b9 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSSlime.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/CraftNMSSlime.java @@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSArmorStand.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSArmorStand.java index 02527efc..ca8c026f 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSArmorStand.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSArmorStand.java @@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean a_(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSItem.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSItem.java index bce61804..39e1f26f 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSItem.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSItem.java @@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void pickup(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSSlime.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSSlime.java index 67222cd1..42750e08 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSSlime.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/EntityNMSSlime.java @@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java index f2d06f2f..a03e4dcf 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionNMSManager.java @@ -55,17 +55,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class 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> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); 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]; - // Register the EntityTypes object. + // Register the EntityTypes object 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; } diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSArmorStand.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSArmorStand.java index a50edadd..651d4023 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSArmorStand.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSArmorStand.java @@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSItem.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSItem.java index 2c67ebd4..d5784841 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSItem.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSSlime.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSSlime.java index eb32d775..2c8a5251 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSSlime.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/CraftNMSSlime.java @@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSArmorStand.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSArmorStand.java index 5d333bde..2daecc07 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSArmorStand.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSArmorStand.java @@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean a_(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void playSound(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSItem.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSItem.java index 5bd22a92..4561e681 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSItem.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSItem.java @@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void pickup(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSSlime.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSSlime.java index fa2724e3..d60c8308 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSSlime.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/EntityNMSSlime.java @@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void playSound(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java index 18bd5076..a9f3ef1c 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionNMSManager.java @@ -55,17 +55,17 @@ public class VersionNMSManager implements NMSManager { } public void registerCustomEntity(Class 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> registryID = REGISTRY_ID_FIELD.get(IRegistry.ENTITY_TYPE); 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]; - // Register the EntityTypes object. + // Register the EntityTypes object 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; } diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSArmorStand.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSArmorStand.java index 24fd60bc..e665628a 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSArmorStand.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSArmorStand.java @@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSItem.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSItem.java index 23dfef9f..0e1c2cee 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSItem.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSSlime.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSSlime.java index 1de9b6d5..c261cf4b 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSSlime.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/CraftNMSSlime.java @@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSArmorStand.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSArmorStand.java index c918d970..d4803206 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSArmorStand.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSArmorStand.java @@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean a_(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void playSound(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSItem.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSItem.java index 057b92eb..50fbbb42 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSItem.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSItem.java @@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void pickup(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSSlime.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSSlime.java index dab2419e..e27b7887 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSSlime.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/EntityNMSSlime.java @@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void playSound(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSArmorStand.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSArmorStand.java index 3bce08ec..44926476 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSArmorStand.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSArmorStand.java @@ -24,11 +24,11 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSItem.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSItem.java index 90fd17d2..aeef9573 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSItem.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSSlime.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSSlime.java index c318f9d2..b8a70ed6 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSSlime.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/CraftNMSSlime.java @@ -24,11 +24,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSArmorStand.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSArmorStand.java index 49aa2798..78e82be9 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSArmorStand.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSArmorStand.java @@ -58,15 +58,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,35 +84,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -132,34 +132,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean a_(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -168,7 +168,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void playSound(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -193,7 +193,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSItem.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSItem.java index ef1be4b9..191368c3 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSItem.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSItem.java @@ -40,65 +40,65 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void pickup(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -118,13 +118,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } @@ -153,9 +152,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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); } diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSSlime.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSSlime.java index 1b67c24f..541b9dc8 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSSlime.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/EntityNMSSlime.java @@ -43,23 +43,23 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -68,35 +68,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void saveData(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean a_(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound save(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void load(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void loadData(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -127,22 +127,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(IChatBaseComponent ichatbasecomponent) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void playSound(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSArmorStand.java b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSArmorStand.java index 1dc5a0be..c48535d7 100644 --- a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSArmorStand.java +++ b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} @Override public void setBodyPose(EulerAngle pose) {} diff --git a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSItem.java b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSItem.java index 70bf207f..c39c4f3c 100644 --- a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSItem.java +++ b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSSlime.java b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSSlime.java index 7686105e..d3bb9027 100644 --- a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSSlime.java +++ b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSArmorStand.java b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSArmorStand.java index 983aec02..c82a8e44 100644 --- a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSArmorStand.java +++ b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSArmorStand.java @@ -55,18 +55,18 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta SET_MARKER_METHOD.invoke(this, true); } catch (ReflectiveOperationException 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.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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,24 +84,24 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override 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 public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public boolean a(EntityHuman human, Vec3D vec3d) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return true; } @Override public boolean d(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setEquipment(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -153,7 +153,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void makeSound(String sound, float f1, float f2) { - // Remove sounds. + // Remove sounds } @Override @@ -178,7 +178,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSItem.java b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSItem.java index 035894a3..e889e166 100644 --- a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSItem.java +++ b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSItem.java @@ -38,54 +38,54 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override @@ -100,13 +100,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } diff --git a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSSlime.java b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSSlime.java index 4872d984..8fc17f47 100644 --- a/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSSlime.java +++ b/nms/v1_8_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R2/EntityNMSSlime.java @@ -39,12 +39,12 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; - // The slime dies without a vehicle. + // The slime dies without a vehicle if (super.vehicle == null) { killEntityNMS(); } @@ -52,15 +52,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -69,24 +69,24 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override @@ -112,22 +112,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void makeSound(String sound, float volume, float pitch) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSArmorStand.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSArmorStand.java index b0c1c204..0222f131 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSArmorStand.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} @Override public void setBodyPose(EulerAngle pose) {} diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSItem.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSItem.java index 94c2f68c..d31ce42a 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSItem.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSSlime.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSSlime.java index bb47f2f8..8d4487c1 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSSlime.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSArmorStand.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSArmorStand.java index 4e2d0db0..a620cc92 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSArmorStand.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSArmorStand.java @@ -55,18 +55,18 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta SET_MARKER_METHOD.invoke(this, true); } catch (ReflectiveOperationException 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.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()); } @Override 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) { super.onGround = false; } @@ -74,9 +74,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -84,24 +84,24 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override 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 public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public boolean a(EntityHuman human, Vec3D vec3d) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return true; } @Override public boolean d(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setEquipment(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -153,7 +153,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void makeSound(String sound, float f1, float f2) { - // Remove sounds. + // Remove sounds } @Override @@ -178,7 +178,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSItem.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSItem.java index fdd4f9c1..1b518aa4 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSItem.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSItem.java @@ -38,54 +38,54 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override @@ -100,13 +100,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSSlime.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSSlime.java index 40800b25..d2ad70ba 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSSlime.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/EntityNMSSlime.java @@ -39,12 +39,12 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; - // The slime dies without a vehicle. + // The slime dies without a vehicle if (super.vehicle == null) { killEntityNMS(); } @@ -52,15 +52,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -69,24 +69,24 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override @@ -112,22 +112,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void makeSound(String sound, float volume, float pitch) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSArmorStand.java b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSArmorStand.java index 4f829d2d..b17a05d8 100644 --- a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSArmorStand.java +++ b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} @Override public void setBodyPose(EulerAngle pose) {} diff --git a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSItem.java b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSItem.java index f309923d..cff87a20 100644 --- a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSItem.java +++ b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSSlime.java b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSSlime.java index 7ef5bdbb..1891c0b0 100644 --- a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSSlime.java +++ b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSArmorStand.java b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSArmorStand.java index 18c7b7f9..57909a45 100644 --- a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSArmorStand.java +++ b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSArmorStand.java @@ -55,15 +55,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -71,9 +71,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -81,34 +81,34 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override 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 public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -165,7 +165,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -190,7 +190,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSItem.java b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSItem.java index 85023e6a..74a3f651 100644 --- a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSItem.java +++ b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSItem.java @@ -42,9 +42,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; if (resendMountPacketTicks++ > 20) { @@ -60,56 +60,56 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -129,13 +129,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } diff --git a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSSlime.java b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSSlime.java index df15104f..67a86583 100644 --- a/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSSlime.java +++ b/nms/v1_9_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R1/EntityNMSSlime.java @@ -44,9 +44,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; if (resendMountPacketTicks++ > 20) { @@ -62,15 +62,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -79,34 +79,34 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public void e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -137,22 +137,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSArmorStand.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSArmorStand.java index fcf53594..5eacce6e 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSArmorStand.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSArmorStand.java @@ -24,14 +24,14 @@ public class CraftNMSArmorStand extends CraftArmorStand { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 setBasePlate(boolean basePlate) {} @Override public void setBodyPose(EulerAngle pose) {} diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSItem.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSItem.java index 4d3da488..874fa88f 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSItem.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSItem.java @@ -20,11 +20,11 @@ public class CraftNMSItem extends CraftItem { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSSlime.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSSlime.java index 85f1d4ad..06fd0e08 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSSlime.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/CraftNMSSlime.java @@ -22,11 +22,11 @@ public class CraftNMSSlime extends CraftSlime { super(server, entity); } - // Disallow all the bukkit methods. + // Disallow all the bukkit methods @Override 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 diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSArmorStand.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSArmorStand.java index b8733fd6..710ae354 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSArmorStand.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSArmorStand.java @@ -54,15 +54,15 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta super.setBasePlate(true); super.setMarker(true); 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()); } @Override 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) { super.onGround = false; } @@ -70,9 +70,9 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override 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) { super.onGround = false; } @@ -80,35 +80,35 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override 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 public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public EnumInteractionResult a(EntityHuman human, Vec3D vec3d, ItemStack itemstack, EnumHand enumhand) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return EnumInteractionResult.PASS; } @Override public boolean c(int i, ItemStack item) { - // Prevent stand being equipped + // Prevent armor stand from being equipped return false; } @Override public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) { - // Prevent stand being equipped + // Prevent armor stand from being equipped } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -165,7 +165,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override @@ -190,7 +190,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSItem.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSItem.java index 4b06dd2a..fcafc51d 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSItem.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSItem.java @@ -42,9 +42,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; if (resendMountPacketTicks++ > 20) { @@ -60,57 +60,57 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override 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; } - // Method called when a player is near. + // Method called when a player is near @Override public void d(EntityHuman human) { 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; } if (human instanceof EntityPlayer) { parentHologramLine.onPickup(((EntityPlayer) human).getBukkitEntity()); - // It is never added to the inventory. + // It is never added to the inventory } } @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -130,13 +130,12 @@ public class EntityNMSItem extends EntityItem implements NMSItem { @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override public boolean isAlive() { - // This override prevents items from being picked up by hoppers. - // Should have no side effects. + // This override prevents items from being picked up by hoppers (should have no side effects) return false; } diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSSlime.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSSlime.java index d86b4035..157b936a 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSSlime.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/EntityNMSSlime.java @@ -44,9 +44,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; if (resendMountPacketTicks++ > 20) { @@ -62,15 +62,15 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override 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; } @Override public void a(AxisAlignedBB boundingBox) { - // Prevent bounding box from being changed + // Prevent changes to bounding box } public void forceSetBoundingBox(AxisAlignedBB boundingBox) { @@ -79,35 +79,35 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void b(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT } @Override public boolean c(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public boolean d(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return false; } @Override public NBTTagCompound e(NBTTagCompound nbttagcompound) { - // Do not save NBT. + // Do not save NBT return nbttagcompound; } @Override public void f(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override public void a(NBTTagCompound nbttagcompound) { - // Do not load NBT. + // Do not load NBT } @Override @@ -138,22 +138,22 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime { @Override public void setCustomName(String customName) { - // Locks the custom name. + // Prevents changes to custom name } @Override public void setCustomNameVisible(boolean visible) { - // Locks the custom name. + // Prevents changes to custom name visibility } @Override public void a(SoundEffect soundeffect, float f, float f1) { - // Remove sounds. + // Remove sounds } @Override public void die() { - // Prevent being killed. + // Prevent entity from dying } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/HolographicDisplays.java b/plugin/src/main/java/me/filoghost/holographicdisplays/HolographicDisplays.java index 54b7a15a..e0c0943f 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/HolographicDisplays.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/HolographicDisplays.java @@ -55,7 +55,7 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke @Override 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) { Bukkit.getConsoleSender().sendMessage( 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"); instance = this; - // The bungee chat API is required. + // The bungee chat API is required if (!FeatureSupport.CHAT_COMPONENTS) { throw new PluginEnableException( "Holographic Displays requires the new chat API.", @@ -102,7 +102,7 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke PrintableErrorCollector errorCollector = new PrintableErrorCollector(); - // Run only once at startup, before anything else. + // Run only once at startup, before anything else try { LegacySymbolsUpgrader.run(configManager, errorCollector); } catch (ConfigException e) { @@ -113,7 +113,6 @@ public class HolographicDisplays extends FCommonsPlugin implements ProtocolPacke ProtocolLibHook.setup(this, nmsManager, this, errorCollector); - // Start repeating tasks. placeholderManager.startUpdaterTask(this); HologramCommandManager commandManager = new HologramCommandManager(configManager, internalHologramManager, nmsManager); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/PacketListener.java b/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/PacketListener.java index 70459da3..3c223af6 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/PacketListener.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/PacketListener.java @@ -73,12 +73,12 @@ class PacketListener extends PacketAdapter { NMSEntity nmsEntity = nmsManager.getNMSEntityBaseFromID(event.getPlayer().getWorld(), entityID); 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 (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; } @@ -153,7 +153,7 @@ class PacketListener extends PacketAdapter { } 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; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/ProtocolLibHook.java b/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/ProtocolLibHook.java index 8de58c3b..8ae4dc86 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/ProtocolLibHook.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/bridge/protocollib/ProtocolLibHook.java @@ -90,8 +90,9 @@ public class ProtocolLibHook { Location playerLocation = player.getLocation(); double distanceSquared = Utils.distanceSquared(playerLocation.getX(), hologram.getX(), playerLocation.getZ(), hologram.getZ()); - - return distanceSquared < 128 * 128; // Approximate, more checks are done for single entities + + // Approximate, more checks are done for single entities + return distanceSquared < 128 * 128; } public static boolean isEnabled() { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java b/plugin/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java index 11dd261d..731e6463 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/disk/Configuration.java @@ -155,7 +155,7 @@ public class Configuration { } } else { ip = address; - port = 25565; // The default Minecraft port. + port = 25565; // Default Minecraft server port } return new ServerAddress(name, ip, port); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/disk/HologramLineParser.java b/plugin/src/main/java/me/filoghost/holographicdisplays/disk/HologramLineParser.java index 076e5bac..55108941 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/disk/HologramLineParser.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/disk/HologramLineParser.java @@ -87,7 +87,7 @@ public class HologramLineParser { if (nbtString != null) { try { - // Check NBT syntax validity before applying it. + // Check NBT syntax validity before applying it MojangsonParser.parse(nbtString); Bukkit.getUnsafe().modifyItemStack(itemStack, nbtString); } catch (MojangsonParseException e) { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/image/ImageMessage.java b/plugin/src/main/java/me/filoghost/holographicdisplays/image/ImageMessage.java index ccf190be..3f615ab5 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/image/ImageMessage.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/image/ImageMessage.java @@ -14,9 +14,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -/** - * Huge thanks to bobacadodl for this awesome library! - * Bukkit thread: https://forums.bukkit.org/threads/lib-imagemessage-v2-1-send-images-to-players-via-the-chat.204902 +/* + * Credits: https://forums.bukkit.org/threads/lib-imagemessage-v2-1-send-images-to-players-via-the-chat.204902 */ public class ImageMessage { @@ -119,15 +118,15 @@ public class ImageMessage { } private BufferedImage toBufferedImage(Image img) { - // Creates a buffered image with transparency. + // Creates a buffered image with transparency BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB); - // Draws the image on to the buffered image. + // Draws the image on to the buffered image Graphics2D graphics = bimage.createGraphics(); graphics.drawImage(img, 0, 0, null); graphics.dispose(); - // Returns the buffered image. + // Returns the buffered image return bimage; } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/listener/ChunkListener.java b/plugin/src/main/java/me/filoghost/holographicdisplays/listener/ChunkListener.java index f48fd69b..c1afd890 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/listener/ChunkListener.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/listener/ChunkListener.java @@ -42,12 +42,12 @@ public class ChunkListener implements Listener { public void onChunkLoad(ChunkLoadEvent event) { Chunk chunk = event.getChunk(); - // Other plugins could call this event wrongly, check if the chunk is actually loaded. + // Other plugins could call this event wrongly, check if the chunk is actually loaded if (!chunk.isLoaded()) { return; } - // In case another plugin loads the chunk asynchronously, always make sure to load the holograms on the main thread. + // In case another plugin loads the chunk asynchronously, always make sure to load the holograms on the main thread SchedulerUtils.runOnMainThread(() -> { internalHologramManager.onChunkLoad(chunk); apiHologramManager.onChunkLoad(chunk); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/listener/UpdateNotificationListener.java b/plugin/src/main/java/me/filoghost/holographicdisplays/listener/UpdateNotificationListener.java index bc911c1c..f4d76052 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/listener/UpdateNotificationListener.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/listener/UpdateNotificationListener.java @@ -13,7 +13,7 @@ import org.bukkit.event.player.PlayerJoinEvent; public class UpdateNotificationListener implements Listener { - // The new version found by the updater, null if there is no new version. + // The new version found by the updater, null if there is no new version private String newVersion; public void runAsyncUpdateCheck() { diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramManager.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramManager.java index e19ed87b..217a0758 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramManager.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseHologramManager.java @@ -43,7 +43,7 @@ public abstract class BaseHologramManager { } public void onChunkLoad(Chunk chunk) { - // Load the holograms in that chunk. + // Load the holograms in that chunk for (H hologram : holograms) { if (hologram.isInChunk(chunk)) { hologram.refresh(false, true); diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java index 61da32d4..ac5bbc02 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/object/base/BaseTouchableLine.java @@ -66,10 +66,10 @@ public abstract class BaseTouchableLine extends BaseHologramLine implements Stan this.touchHandler = touchHandler; if (touchHandler != null && slimeEntity == null && super.isSpawned()) { - // If the touch handler was null before and no entity has been spawned, spawn it now. + // If the touch handler was null before and no entity has been spawned, spawn it now spawnSlime(getWorld(), getX(), getY(), getZ()); } else if (touchHandler == null) { - // Opposite case, the touch handler was not null and an entity was spawned, but now it's useless. + // Opposite case, the touch handler was not null and an entity was spawned, but now it's useless despawnSlime(); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/placeholder/internal/AnimationRegistry.java b/plugin/src/main/java/me/filoghost/holographicdisplays/placeholder/internal/AnimationRegistry.java index 0267f772..02646fa6 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/placeholder/internal/AnimationRegistry.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/placeholder/internal/AnimationRegistry.java @@ -56,7 +56,7 @@ public class AnimationRegistry implements PlaceholderFactory { String firstLine = lines.get(0).trim(); if (firstLine.toLowerCase().startsWith(SPEED_PREFIX)) { - // Do not consider it. + // Do not consider it lines.remove(0); firstLine = firstLine.substring(SPEED_PREFIX.length()).trim(); @@ -76,7 +76,7 @@ public class AnimationRegistry implements PlaceholderFactory { errorCollector.add("could not find any line in \"" + fileName + "\" (excluding the speed), you should add at least one more line"); } - // Replace placeholders. + // Replace placeholders for (int i = 0; i < lines.size(); i++) { lines.set(i, StringConverter.toReadableFormat(lines.get(i))); }