Further refactoring to hologram objects

This commit is contained in:
filoghost 2021-03-02 20:47:23 +01:00
parent dbfabc0e83
commit a96e9e516f
109 changed files with 622 additions and 497 deletions

View File

@ -20,11 +20,6 @@
</repositories>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>holographicdisplays-api</artifactId>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.core;
import me.filoghost.fcommons.logging.Log;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
public class DebugLogger {
@ -47,8 +47,8 @@ public class DebugLogger {
}
}
public static void handleSpawnFail(BaseHologramLine parentPiece) {
warning("Couldn't spawn entity for this hologram: " + parentPiece.getBaseParent().toString());
public static void handleSpawnFail(StandardHologramLine parentPiece) {
warning("Couldn't spawn entity for this hologram: " + parentPiece.getHologram());
}
public static void cannotSetPassenger(Throwable t) {

View File

@ -0,0 +1,48 @@
/*
* Copyright (C) filoghost and contributors
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.hologram;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.util.List;
public interface StandardHologram {
Location getLocation();
boolean isInChunk(Chunk chunk);
Plugin getOwnerPlugin();
List<? extends StandardHologramLine> getLinesUnsafe();
boolean isVisibleTo(Player player);
String toFormattedString();
void refresh();
void refresh(boolean forceRespawn);
void refresh(boolean forceRespawn, boolean isChunkLoaded);
void despawnEntities();
void removeLine(StandardHologramLine line);
int size();
boolean isDeleted();
void setDeleted();
NMSManager getNMSManager();
}

View File

@ -3,13 +3,15 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.object.base;
package me.filoghost.holographicdisplays.core.hologram;
import org.bukkit.World;
import java.util.Collection;
public interface SpawnableHologramLine {
public interface StandardHologramLine {
StandardHologram getHologram();
void respawn(World world, double x, double y, double z);

View File

@ -0,0 +1,20 @@
/*
* Copyright (C) filoghost and contributors
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.hologram;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import org.bukkit.entity.Player;
public interface StandardItemLine extends StandardTouchableLine {
void onPickup(Player player);
NMSItem getNMSItem();
NMSArmorStand getNMSItemVehicle();
}

View File

@ -0,0 +1,21 @@
/*
* Copyright (C) filoghost and contributors
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.hologram;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.placeholder.RelativePlaceholder;
import java.util.Collection;
public interface StandardTextLine extends StandardTouchableLine {
String getText();
Collection<RelativePlaceholder> getRelativePlaceholders();
NMSArmorStand getNMSArmorStand();
}

View File

@ -0,0 +1,20 @@
/*
* Copyright (C) filoghost and contributors
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.hologram;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import org.bukkit.entity.Player;
public interface StandardTouchableLine extends StandardHologramLine {
void onTouch(Player player);
NMSSlime getNMSSlime();
NMSArmorStand getNMSSlimeVehicle();
}

View File

@ -9,8 +9,8 @@ import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import org.bukkit.inventory.ItemStack;
public interface NMSManager {
@ -18,11 +18,11 @@ public interface NMSManager {
// A method to register all the custom entities of the plugin, it may fail.
void setup() throws Exception;
NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece);
NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece);
NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack);
NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack);
NMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z,BaseHologramLine parentPiece);
NMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece);
boolean isNMSEntityBase(org.bukkit.entity.Entity bukkitEntity);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.core.nms.entity;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
/**
* An interface to represent a custom NMS entity being part of a hologram.
@ -13,7 +13,7 @@ import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
public interface NMSEntityBase {
// Returns the linked line, all the entities are part of a piece. Should never be null.
BaseHologramLine getHologramLine();
StandardHologramLine getHologramLine();
// Sets the location through NMS.
void setLocationNMS(double x, double y, double z);

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.placeholder;
package me.filoghost.holographicdisplays.core.placeholder;
import org.bukkit.entity.Player;

View File

@ -24,11 +24,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>holographicdisplays-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>holographicdisplays-core</artifactId>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>

View File

@ -8,7 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_10_R1;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityArmorStand;
@ -27,11 +27,11 @@ import org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -225,7 +225,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -11,8 +11,8 @@ import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_10_R1.Blocks;
import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.Entity;
@ -32,11 +32,11 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "au");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private int resendMountPacketTicks;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
@ -206,7 +206,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,7 +10,7 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.Entity;
@ -29,11 +29,11 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "au");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private int resendMountPacketTicks;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
super.collides = false;
@ -198,7 +198,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityTypes;
import net.minecraft.server.v1_10_R1.MathHelper;
@ -56,7 +56,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -68,7 +68,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -79,7 +79,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,10 +5,10 @@
*/
package me.filoghost.holographicdisplays.nms.v1_11_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.DamageSource;
import net.minecraft.server.v1_11_R1.EntityArmorStand;
@ -27,11 +27,11 @@ import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -225,7 +225,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_11_R1.Blocks;
import net.minecraft.server.v1_11_R1.DamageSource;
import net.minecraft.server.v1_11_R1.Entity;
@ -30,9 +30,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "au");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -180,7 +180,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_11_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -27,9 +27,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "au");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
super.collides = false;
@ -173,7 +173,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityTypes;
import net.minecraft.server.v1_11_R1.MathHelper;
@ -64,7 +64,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -76,7 +76,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -87,7 +87,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -8,7 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_12_R1;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_12_R1.AxisAlignedBB;
import net.minecraft.server.v1_12_R1.DamageSource;
import net.minecraft.server.v1_12_R1.EntityArmorStand;
@ -27,11 +27,11 @@ import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -225,7 +225,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_12_R1.Blocks;
import net.minecraft.server.v1_12_R1.DamageSource;
import net.minecraft.server.v1_12_R1.Entity;
@ -30,9 +30,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "au");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -180,7 +180,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_12_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -27,9 +27,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "au");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
super.collides = false;
@ -173,7 +173,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_12_R1.Entity;
import net.minecraft.server.v1_12_R1.EntityTypes;
import net.minecraft.server.v1_12_R1.MathHelper;
@ -64,7 +64,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -76,7 +76,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -87,7 +87,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_13_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
@ -29,11 +29,11 @@ import org.bukkit.craftbukkit.v1_13_R1.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -227,7 +227,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_13_R1.Blocks;
import net.minecraft.server.v1_13_R1.DamageSource;
import net.minecraft.server.v1_13_R1.Entity;
@ -30,9 +30,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "ax");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -180,7 +180,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_13_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -28,9 +28,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "ax");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
super.collides = false;
@ -174,7 +174,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -18,8 +18,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_13_R1.ChatComponentText;
import net.minecraft.server.v1_13_R1.Entity;
import net.minecraft.server.v1_13_R1.EntityTypes;
@ -71,7 +71,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -83,7 +83,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -94,7 +94,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -8,7 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_13_R2;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_13_R2.AxisAlignedBB;
import net.minecraft.server.v1_13_R2.DamageSource;
import net.minecraft.server.v1_13_R2.EntityArmorStand;
@ -29,11 +29,11 @@ import org.bukkit.craftbukkit.v1_13_R2.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -227,7 +227,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_13_R2.Blocks;
import net.minecraft.server.v1_13_R2.DamageSource;
import net.minecraft.server.v1_13_R2.Entity;
@ -30,9 +30,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -180,7 +180,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_13_R2;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -28,9 +28,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
super.collides = false;
@ -174,7 +174,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -18,8 +18,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_13_R2.ChatComponentText;
import net.minecraft.server.v1_13_R2.Entity;
import net.minecraft.server.v1_13_R2.EntityTypes;
@ -72,7 +72,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -84,7 +84,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -95,7 +95,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_14_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
@ -30,12 +30,12 @@ import org.bukkit.craftbukkit.v1_14_R1.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private CraftEntity customBukkitEntity;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(EntityTypes.ARMOR_STAND, world);
super.setInvisible(true);
super.setSmall(true);
@ -229,7 +229,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_14_R1.Blocks;
import net.minecraft.server.v1_14_R1.DamageSource;
import net.minecraft.server.v1_14_R1.Entity;
@ -31,10 +31,10 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(EntityTypes.ITEM, world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -182,7 +182,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_14_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -29,10 +29,10 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(EntityTypes.SLIME, world);
super.persistent = true;
super.collides = false;
@ -176,7 +176,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -17,8 +17,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_14_R1.ChatBaseComponent;
import net.minecraft.server.v1_14_R1.ChatComponentText;
import net.minecraft.server.v1_14_R1.Entity;
@ -71,7 +71,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -83,7 +83,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -94,7 +94,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_15_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
@ -30,12 +30,12 @@ import org.bukkit.craftbukkit.v1_15_R1.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private CraftEntity customBukkitEntity;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(EntityTypes.ARMOR_STAND, world);
super.setInvisible(true);
super.setSmall(true);
@ -229,7 +229,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_15_R1.Blocks;
import net.minecraft.server.v1_15_R1.DamageSource;
import net.minecraft.server.v1_15_R1.Entity;
@ -31,10 +31,10 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(EntityTypes.ITEM, world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -182,7 +182,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_15_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -29,10 +29,10 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(EntityTypes.SLIME, world);
super.persistent = true;
super.collides = false;
@ -176,7 +176,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -17,8 +17,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_15_R1.ChatComponentText;
import net.minecraft.server.v1_15_R1.Entity;
import net.minecraft.server.v1_15_R1.EntityTypes;
@ -70,7 +70,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -82,7 +82,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -93,7 +93,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_16_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
@ -30,12 +30,12 @@ import org.bukkit.craftbukkit.v1_16_R1.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private CraftEntity customBukkitEntity;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(EntityTypes.ARMOR_STAND, world);
super.setInvisible(true);
super.setSmall(true);
@ -229,7 +229,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_16_R1.Blocks;
import net.minecraft.server.v1_16_R1.DamageSource;
import net.minecraft.server.v1_16_R1.Entity;
@ -31,10 +31,10 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(EntityTypes.ITEM, world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -182,7 +182,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_16_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -29,10 +29,10 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(EntityTypes.SLIME, world);
super.persistent = true;
super.collides = false;
@ -176,7 +176,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -17,8 +17,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_16_R1.ChatComponentText;
import net.minecraft.server.v1_16_R1.Entity;
import net.minecraft.server.v1_16_R1.EntityTypes;
@ -70,7 +70,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -82,7 +82,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -93,7 +93,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_16_R2;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.Utils;
@ -30,12 +30,12 @@ import org.bukkit.craftbukkit.v1_16_R2.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private CraftEntity customBukkitEntity;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(EntityTypes.ARMOR_STAND, world);
super.setInvisible(true);
super.setSmall(true);
@ -229,7 +229,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_16_R2.Blocks;
import net.minecraft.server.v1_16_R2.DamageSource;
import net.minecraft.server.v1_16_R2.Entity;
@ -31,10 +31,10 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(EntityTypes.ITEM, world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -182,7 +182,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_16_R2;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -29,10 +29,10 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(EntityTypes.SLIME, world);
super.persistent = true;
super.collides = false;
@ -176,7 +176,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -17,8 +17,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_16_R2.ChatComponentText;
import net.minecraft.server.v1_16_R2.Entity;
import net.minecraft.server.v1_16_R2.EntityTypes;
@ -61,7 +61,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -73,7 +73,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -84,7 +84,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -8,7 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_16_R3;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_16_R3.AxisAlignedBB;
import net.minecraft.server.v1_16_R3.DamageSource;
import net.minecraft.server.v1_16_R3.EntityArmorStand;
@ -30,12 +30,12 @@ import org.bukkit.craftbukkit.v1_16_R3.util.CraftChatMessage;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private CraftEntity customBukkitEntity;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(EntityTypes.ARMOR_STAND, world);
super.setInvisible(true);
super.setSmall(true);
@ -229,7 +229,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_16_R3.Blocks;
import net.minecraft.server.v1_16_R3.DamageSource;
import net.minecraft.server.v1_16_R3.Entity;
@ -31,10 +31,10 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(EntityTypes.ITEM, world);
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
@ -182,7 +182,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -9,7 +9,7 @@ import me.filoghost.fcommons.reflection.ReflectField;
import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_16_R3.AxisAlignedBB;
import net.minecraft.server.v1_16_R3.DamageSource;
import net.minecraft.server.v1_16_R3.Entity;
@ -29,10 +29,10 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "vehicle");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private CraftEntity customBukkitEntity;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(EntityTypes.SLIME, world);
super.persistent = true;
super.collides = false;
@ -176,7 +176,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -17,8 +17,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_16_R3.ChatComponentText;
import net.minecraft.server.v1_16_R3.Entity;
import net.minecraft.server.v1_16_R3.EntityTypes;
@ -61,7 +61,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -73,7 +73,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -84,7 +84,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -11,7 +11,7 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_8_R2.AxisAlignedBB;
import net.minecraft.server.v1_8_R2.DamageSource;
import net.minecraft.server.v1_8_R2.EntityArmorStand;
@ -29,11 +29,11 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
private static final ReflectField<Integer> DISABLED_SLOTS_FIELD = ReflectField.lookup(int.class, EntityArmorStand.class, "bi");
private static final ReflectMethod<Void> SET_MARKER_METHOD = ReflectMethod.lookup(void.class, EntityArmorStand.class, "n", boolean.class);
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -221,7 +221,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_8_R2.Blocks;
import net.minecraft.server.v1_8_R2.DamageSource;
import net.minecraft.server.v1_8_R2.Entity;
@ -31,9 +31,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Double> RIDER_PITCH_DELTA = ReflectField.lookup(double.class, Entity.class, "ar");
private static final ReflectField<Double> RIDER_YAW_DELTA = ReflectField.lookup(double.class, Entity.class, "as");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
@ -166,7 +166,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.nms.v1_8_R2;
import me.filoghost.fcommons.reflection.ReflectField;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
@ -27,9 +27,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Double> RIDER_PITCH_DELTA = ReflectField.lookup(double.class, Entity.class, "ar");
private static final ReflectField<Double> RIDER_YAW_DELTA = ReflectField.lookup(double.class, Entity.class, "as");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
a(0.0F, 0.0F);
@ -161,7 +161,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityTypes;
import net.minecraft.server.v1_8_R2.MathHelper;
@ -57,7 +57,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -69,7 +69,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -80,7 +80,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -11,7 +11,7 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_8_R3.AxisAlignedBB;
import net.minecraft.server.v1_8_R3.DamageSource;
import net.minecraft.server.v1_8_R3.EntityArmorStand;
@ -29,11 +29,11 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
private static final ReflectField<Integer> DISABLED_SLOTS_FIELD = ReflectField.lookup(int.class, EntityArmorStand.class, "bi");
private static final ReflectMethod<Void> SET_MARKER_METHOD = ReflectMethod.lookup(void.class, EntityArmorStand.class, "n", boolean.class);
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -221,7 +221,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -10,8 +10,8 @@ import me.filoghost.holographicdisplays.core.DebugLogger;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_8_R3.Blocks;
import net.minecraft.server.v1_8_R3.DamageSource;
import net.minecraft.server.v1_8_R3.Entity;
@ -31,9 +31,9 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Double> RIDER_PITCH_DELTA = ReflectField.lookup(double.class, Entity.class, "ar");
private static final ReflectField<Double> RIDER_YAW_DELTA = ReflectField.lookup(double.class, Entity.class, "as");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
@ -166,7 +166,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_8_R3;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -27,9 +27,9 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Double> RIDER_PITCH_DELTA = ReflectField.lookup(double.class, Entity.class, "ar");
private static final ReflectField<Double> RIDER_YAW_DELTA = ReflectField.lookup(double.class, Entity.class, "as");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
a(0.0F, 0.0F);
@ -161,7 +161,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_8_R3.Entity;
import net.minecraft.server.v1_8_R3.EntityTypes;
import net.minecraft.server.v1_8_R3.MathHelper;
@ -57,7 +57,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -69,7 +69,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -80,7 +80,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -6,7 +6,7 @@
package me.filoghost.holographicdisplays.nms.v1_9_R1;
import me.filoghost.fcommons.reflection.ReflectField;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
@ -30,12 +30,12 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
private static final ReflectField<Integer> DISABLED_SLOTS_FIELD = ReflectField.lookup(int.class, EntityArmorStand.class, "bz");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -233,7 +233,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -11,8 +11,8 @@ import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_9_R1.Blocks;
import net.minecraft.server.v1_9_R1.DamageSource;
import net.minecraft.server.v1_9_R1.Entity;
@ -32,11 +32,11 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "as");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private int resendMountPacketTicks;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
@ -204,7 +204,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_9_R1;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -29,11 +29,11 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "as");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private int resendMountPacketTicks;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
a(0.0F, 0.0F);
@ -195,7 +195,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_9_R1.Entity;
import net.minecraft.server.v1_9_R1.EntityTypes;
import net.minecraft.server.v1_9_R1.MathHelper;
@ -56,7 +56,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -68,7 +68,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -79,7 +79,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_9_R2;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
@ -27,11 +27,11 @@ import org.bukkit.craftbukkit.v1_9_R2.entity.CraftEntity;
public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorStand {
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private final PacketController packetController;
private String customName;
public EntityNMSArmorStand(World world, BaseHologramLine parentPiece, PacketController packetController) {
public EntityNMSArmorStand(World world, StandardHologramLine parentPiece, PacketController packetController) {
super(world);
super.setInvisible(true);
super.setSmall(true);
@ -225,7 +225,7 @@ public class EntityNMSArmorStand extends EntityArmorStand implements NMSArmorSta
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -11,8 +11,8 @@ import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.NMSCommons;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import net.minecraft.server.v1_9_R2.Blocks;
import net.minecraft.server.v1_9_R2.DamageSource;
import net.minecraft.server.v1_9_R2.Entity;
@ -32,11 +32,11 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "at");
private final BaseItemLine parentPiece;
private final StandardItemLine parentPiece;
private int resendMountPacketTicks;
public EntityNMSItem(World world, BaseItemLine piece) {
public EntityNMSItem(World world, StandardItemLine piece) {
super(world);
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
@ -206,7 +206,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -5,7 +5,7 @@
*/
package me.filoghost.holographicdisplays.nms.v1_9_R2;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.DebugLogger;
@ -29,11 +29,11 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
private static final ReflectField<Entity> VEHICLE_FIELD = ReflectField.lookup(Entity.class, Entity.class, "at");
private final BaseHologramLine parentPiece;
private final StandardHologramLine parentPiece;
private int resendMountPacketTicks;
public EntityNMSSlime(World world, BaseHologramLine parentPiece) {
public EntityNMSSlime(World world, StandardHologramLine parentPiece) {
super(world);
super.persistent = true;
a(0.0F, 0.0F);
@ -197,7 +197,7 @@ public class EntityNMSSlime extends EntitySlime implements NMSSlime {
}
@Override
public BaseHologramLine getHologramLine() {
public StandardHologramLine getHologramLine() {
return parentPiece;
}

View File

@ -16,8 +16,8 @@ import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import net.minecraft.server.v1_9_R2.Entity;
import net.minecraft.server.v1_9_R2.EntityTypes;
import net.minecraft.server.v1_9_R2.MathHelper;
@ -56,7 +56,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, BaseItemLine parentPiece, ItemStack stack) {
public NMSItem spawnNMSItem(org.bukkit.World bukkitWorld, double x, double y, double z, StandardItemLine parentPiece, ItemStack stack) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSItem customItem = new EntityNMSItem(nmsWorld, parentPiece);
customItem.setLocationNMS(x, y, z);
@ -68,7 +68,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, BaseHologramLine parentPiece) {
public EntityNMSSlime spawnNMSSlime(org.bukkit.World bukkitWorld, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) bukkitWorld).getHandle();
EntityNMSSlime touchSlime = new EntityNMSSlime(nmsWorld, parentPiece);
touchSlime.setLocationNMS(x, y, z);
@ -79,7 +79,7 @@ public class VersionNMSManager implements NMSManager {
}
@Override
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, BaseHologramLine parentPiece) {
public NMSArmorStand spawnNMSArmorStand(org.bukkit.World world, double x, double y, double z, StandardHologramLine parentPiece) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
EntityNMSArmorStand invisibleArmorStand = new EntityNMSArmorStand(nmsWorld, parentPiece, packetController);
invisibleArmorStand.setLocationNMS(x, y, z);

View File

@ -17,14 +17,13 @@ import me.filoghost.holographicdisplays.commands.Messages;
import me.filoghost.holographicdisplays.core.Utils;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.nms.PacketController;
import me.filoghost.holographicdisplays.core.object.base.BaseHologram;
import me.filoghost.holographicdisplays.disk.ConfigManager;
import me.filoghost.holographicdisplays.disk.Configuration;
import me.filoghost.holographicdisplays.disk.HologramConfig;
import me.filoghost.holographicdisplays.disk.HologramLoadException;
import me.filoghost.holographicdisplays.disk.upgrade.LegacySymbolsUpgrader;
import me.filoghost.holographicdisplays.listener.ChunkListener;
import me.filoghost.holographicdisplays.listener.MainListener;
import me.filoghost.holographicdisplays.listener.InteractListener;
import me.filoghost.holographicdisplays.listener.SpawnListener;
import me.filoghost.holographicdisplays.listener.UpdateNotificationListener;
import me.filoghost.holographicdisplays.object.api.APIHologram;
@ -112,7 +111,7 @@ public class HolographicDisplays extends FCommonsPlugin implements PacketControl
HologramCommandManager commandManager = new HologramCommandManager(configManager, internalHologramManager, nmsManager);
commandManager.register(this);
registerListener(new MainListener(nmsManager));
registerListener(new InteractListener(nmsManager));
registerListener(new SpawnListener(nmsManager));
registerListener(new ChunkListener(nmsManager, internalHologramManager, apiHologramManager));
UpdateNotificationListener updateNotificationListener = new UpdateNotificationListener();
@ -169,7 +168,7 @@ public class HolographicDisplays extends FCommonsPlugin implements PacketControl
}
// Then trigger a refresh for all of them
for (BaseHologram hologram : internalHologramManager.getHolograms()) {
for (InternalHologram hologram : internalHologramManager.getHolograms()) {
hologram.refresh();
}
}

View File

@ -17,12 +17,12 @@ import me.filoghost.holographicdisplays.bridge.protocollib.packet.EntityRelatedP
import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlayServerEntityMetadata;
import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlayServerSpawnEntity;
import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlayServerSpawnEntityLiving;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardTextLine;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.object.base.BaseTextLine;
import me.filoghost.holographicdisplays.placeholder.RelativePlaceholder;
import me.filoghost.holographicdisplays.core.placeholder.RelativePlaceholder;
import me.filoghost.holographicdisplays.util.NMSVersion;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ -67,13 +67,13 @@ class PacketListener extends PacketAdapter {
// Spawn entity packet
if (packet.getType() == PacketType.Play.Server.SPAWN_ENTITY_LIVING) {
WrapperPlayServerSpawnEntityLiving spawnEntityPacket = new WrapperPlayServerSpawnEntityLiving(packet);
BaseHologramLine hologramLine = getHologramLine(event, spawnEntityPacket);
StandardHologramLine hologramLine = getHologramLine(event, spawnEntityPacket);
if (hologramLine == null) {
return;
}
if (!hologramLine.getBaseParent().isVisibleTo(player)) {
if (!hologramLine.getHologram().isVisibleTo(player)) {
event.setCancelled(true);
return;
}
@ -83,12 +83,14 @@ class PacketListener extends PacketAdapter {
return;
}
if (!(hologramLine instanceof BaseTextLine)) {
if (!(hologramLine instanceof StandardTextLine)) {
return;
}
BaseTextLine textLine = (BaseTextLine) hologramLine;
if (!hologramLine.getBaseParent().isAllowPlaceholders() || !textLine.hasRelativePlaceholders()) {
StandardTextLine textLine = (StandardTextLine) hologramLine;
Collection<RelativePlaceholder> relativePlaceholders = textLine.getRelativePlaceholders();
if (relativePlaceholders == null || relativePlaceholders.isEmpty()) {
return;
}
@ -99,41 +101,42 @@ class PacketListener extends PacketAdapter {
return;
}
replaceRelativePlaceholders(customNameWatchableObject, player, textLine.getRelativePlaceholders());
replaceRelativePlaceholders(customNameWatchableObject, player, relativePlaceholders);
event.setPacket(spawnEntityPacket.getHandle());
} else if (packet.getType() == PacketType.Play.Server.SPAWN_ENTITY) {
WrapperPlayServerSpawnEntity spawnEntityPacket = new WrapperPlayServerSpawnEntity(packet);
BaseHologramLine hologramLine = getHologramLine(event, spawnEntityPacket);
StandardHologramLine hologramLine = getHologramLine(event, spawnEntityPacket);
if (hologramLine == null) {
return;
}
if (!hologramLine.getBaseParent().isVisibleTo(player)) {
if (!hologramLine.getHologram().isVisibleTo(player)) {
event.setCancelled(true);
return;
}
} else if (packet.getType() == PacketType.Play.Server.ENTITY_METADATA) {
WrapperPlayServerEntityMetadata entityMetadataPacket = new WrapperPlayServerEntityMetadata(packet);
BaseHologramLine hologramLine = getHologramLine(event, entityMetadataPacket);
StandardHologramLine hologramLine = getHologramLine(event, entityMetadataPacket);
if (hologramLine == null) {
return;
}
if (!hologramLine.getBaseParent().isVisibleTo(player)) {
if (!hologramLine.getHologram().isVisibleTo(player)) {
event.setCancelled(true);
return;
}
if (!(hologramLine instanceof BaseTextLine)) {
if (!(hologramLine instanceof StandardTextLine)) {
return;
}
BaseTextLine textLine = (BaseTextLine) hologramLine;
StandardTextLine textLine = (StandardTextLine) hologramLine;
Collection<RelativePlaceholder> relativePlaceholders = textLine.getRelativePlaceholders();
if (!hologramLine.getBaseParent().isAllowPlaceholders() || !textLine.hasRelativePlaceholders()) {
if (relativePlaceholders == null || relativePlaceholders.isEmpty()) {
return;
}
@ -144,7 +147,7 @@ class PacketListener extends PacketAdapter {
return;
}
boolean modified = replaceRelativePlaceholders(customNameWatchableObject, player, textLine.getRelativePlaceholders());
boolean modified = replaceRelativePlaceholders(customNameWatchableObject, player, relativePlaceholders);
if (modified) {
event.setPacket(entityMetadataPacket.getHandle());
}
@ -183,11 +186,11 @@ class PacketListener extends PacketAdapter {
return true;
}
private BaseHologramLine getHologramLine(PacketEvent packetEvent, EntityRelatedPacketWrapper packetWrapper) {
private StandardHologramLine getHologramLine(PacketEvent packetEvent, EntityRelatedPacketWrapper packetWrapper) {
return getHologramLine(packetEvent.getPlayer().getWorld(), packetWrapper.getEntityID());
}
private BaseHologramLine getHologramLine(World world, int entityID) {
private StandardHologramLine getHologramLine(World world, int entityID) {
if (entityID < 0) {
return null;
}

View File

@ -14,15 +14,15 @@ import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlaySer
import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlayServerSpawnEntity;
import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlayServerSpawnEntity.ObjectTypes;
import me.filoghost.holographicdisplays.bridge.protocollib.packet.WrapperPlayServerSpawnEntityLiving;
import me.filoghost.holographicdisplays.core.hologram.StandardHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardItemLine;
import me.filoghost.holographicdisplays.core.hologram.StandardTextLine;
import me.filoghost.holographicdisplays.core.hologram.StandardTouchableLine;
import me.filoghost.holographicdisplays.core.nms.entity.NMSArmorStand;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.nms.entity.NMSItem;
import me.filoghost.holographicdisplays.core.nms.entity.NMSSlime;
import me.filoghost.holographicdisplays.core.object.base.BaseHologram;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.core.object.base.BaseTouchableLine;
import me.filoghost.holographicdisplays.core.object.base.SpawnableHologramLine;
import me.filoghost.holographicdisplays.object.base.BaseTextLine;
import me.filoghost.holographicdisplays.util.NMSVersion;
import org.bukkit.entity.Player;
@ -37,9 +37,9 @@ class PacketSender {
this.metadataHelper = metadataHelper;
}
public void sendDestroyEntitiesPacket(Player player, BaseHologram hologram) {
public void sendDestroyEntitiesPacket(Player player, StandardHologram hologram) {
List<Integer> ids = new ArrayList<>();
for (SpawnableHologramLine line : hologram.getLinesUnsafe()) {
for (StandardHologramLine line : hologram.getLinesUnsafe()) {
line.collectEntityIDs(ids);
}
@ -48,27 +48,27 @@ class PacketSender {
}
}
public void sendCreateEntitiesPacket(Player player, BaseHologram hologram) {
for (SpawnableHologramLine line : hologram.getLinesUnsafe()) {
public void sendCreateEntitiesPacket(Player player, StandardHologram hologram) {
for (StandardHologramLine line : hologram.getLinesUnsafe()) {
sendCreateEntitiesPacket(player, line);
}
}
private void sendCreateEntitiesPacket(Player player, SpawnableHologramLine line) {
if (line instanceof BaseTextLine) {
BaseTextLine textLine = (BaseTextLine) line;
private void sendCreateEntitiesPacket(Player player, StandardHologramLine line) {
if (line instanceof StandardTextLine) {
StandardTextLine textLine = (StandardTextLine) line;
if (textLine.getNMSNameable() != null) {
sendSpawnArmorStandPacket(player, textLine.getNMSNameable());
if (textLine.getNMSArmorStand() != null) {
sendSpawnArmorStandPacket(player, textLine.getNMSArmorStand());
}
} else if (line instanceof BaseItemLine) {
BaseItemLine itemLine = (BaseItemLine) line;
} else if (line instanceof StandardItemLine) {
StandardItemLine itemLine = (StandardItemLine) line;
if (itemLine.getNMSItem() != null && itemLine.getNMSVehicle() != null) {
sendSpawnArmorStandPacket(player, itemLine.getNMSVehicle());
if (itemLine.getNMSItem() != null && itemLine.getNMSItemVehicle() != null) {
sendSpawnArmorStandPacket(player, itemLine.getNMSItemVehicle());
sendSpawnItemPacket(player, itemLine.getNMSItem());
sendVehicleAttachPacket(player, itemLine.getNMSVehicle(), itemLine.getNMSItem());
sendVehicleAttachPacket(player, itemLine.getNMSItemVehicle(), itemLine.getNMSItem());
sendItemMetadataPacket(player, itemLine.getNMSItem());
}
} else {
@ -76,12 +76,12 @@ class PacketSender {
}
// All sub-types of lines are touchable, no need to check instance type
BaseTouchableLine touchableLine = (BaseTouchableLine) line;
StandardTouchableLine touchableLine = (StandardTouchableLine) line;
if (touchableLine.getNMSSlime() != null && touchableLine.getNMSVehicle() != null) {
sendSpawnArmorStandPacket(player, touchableLine.getNMSVehicle());
if (touchableLine.getNMSSlime() != null && touchableLine.getNMSSlimeVehicle() != null) {
sendSpawnArmorStandPacket(player, touchableLine.getNMSSlimeVehicle());
sendSpawnSlimePacket(player, touchableLine.getNMSSlime());
sendVehicleAttachPacket(player, touchableLine.getNMSVehicle(), touchableLine.getNMSSlime());
sendVehicleAttachPacket(player, touchableLine.getNMSSlimeVehicle(), touchableLine.getNMSSlime());
}
}

View File

@ -8,7 +8,7 @@ package me.filoghost.holographicdisplays.bridge.protocollib;
import com.google.common.base.Preconditions;
import me.filoghost.fcommons.logging.Log;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.object.base.BaseHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologram;
import me.filoghost.holographicdisplays.util.VersionUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -60,12 +60,12 @@ public class ProtocolLibHook {
enabled = true;
}
public static void sendDestroyEntitiesPacket(Player player, BaseHologram hologram) {
public static void sendDestroyEntitiesPacket(Player player, StandardHologram hologram) {
checkState();
packetSender.sendDestroyEntitiesPacket(player, hologram);
}
public static void sendCreateEntitiesPacket(Player player, BaseHologram hologram) {
public static void sendCreateEntitiesPacket(Player player, StandardHologram hologram) {
checkState();
packetSender.sendCreateEntitiesPacket(player, hologram);
}

View File

@ -28,7 +28,7 @@ public class HologramCommandValidate {
}
}
public static InternalHologram getNamedHologram(InternalHologramManager internalHologramManager, String hologramName) throws CommandException {
public static InternalHologram getInternalHologram(InternalHologramManager internalHologramManager, String hologramName) throws CommandException {
InternalHologram hologram = internalHologramManager.getHologramByName(hologramName);
CommandValidate.notNull(hologram, "Cannot find a hologram named \"" + hologramName + "\".");
return hologram;

View File

@ -38,7 +38,7 @@ public class AddlineCommand extends LineEditingCommand implements QuickEditComma
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
String serializedLine = Utils.join(args, " ", 1, args.length);
InternalHologramLine line = HologramCommandValidate.parseHologramLine(hologram, serializedLine, true);

View File

@ -34,8 +34,8 @@ public class AlignCommand extends HologramSubCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[1]);
InternalHologram referenceHologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[2]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[1]);
InternalHologram referenceHologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[2]);
CommandValidate.check(hologram != referenceHologram, "The holograms must not be the same.");

View File

@ -33,8 +33,8 @@ public class CopyCommand extends HologramSubCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram fromHologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram toHologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[1]);
InternalHologram fromHologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
InternalHologram toHologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[1]);
toHologram.clearLines();
for (InternalHologramLine line : fromHologram.getLinesUnsafe()) {

View File

@ -10,7 +10,7 @@ import me.filoghost.holographicdisplays.Colors;
import me.filoghost.holographicdisplays.commands.HologramSubCommand;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.object.base.BaseHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologram;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.World;
@ -38,7 +38,7 @@ public class DebugCommand extends HologramSubCommand {
boolean foundAnyHologram = false;
for (World world : Bukkit.getWorlds()) {
Map<BaseHologram, HologramDebugInfo> hologramsDebugInfo = new HashMap<>();
Map<StandardHologram, HologramDebugInfo> hologramsDebugInfo = new HashMap<>();
for (Chunk chunk : world.getLoadedChunks()) {
for (Entity entity : chunk.getEntities()) {
@ -48,7 +48,7 @@ public class DebugCommand extends HologramSubCommand {
continue;
}
BaseHologram ownerHologram = nmsEntity.getHologramLine().getBaseParent();
StandardHologram ownerHologram = nmsEntity.getHologramLine().getHologram();
HologramDebugInfo hologramDebugInfo = hologramsDebugInfo.computeIfAbsent(ownerHologram, mapKey -> new HologramDebugInfo());
if (nmsEntity.isDeadNMS()) {
@ -63,8 +63,8 @@ public class DebugCommand extends HologramSubCommand {
foundAnyHologram = true;
sender.sendMessage(Colors.PRIMARY + "Holograms in world '" + world.getName() + "':");
for (Entry<BaseHologram, HologramDebugInfo> entry : hologramsDebugInfo.entrySet()) {
BaseHologram hologram = entry.getKey();
for (Entry<StandardHologram, HologramDebugInfo> entry : hologramsDebugInfo.entrySet()) {
StandardHologram hologram = entry.getKey();
HologramDebugInfo debugInfo = entry.getValue();
sender.sendMessage(Colors.PRIMARY_SHADOW + "- '" + hologram.toFormattedString() + "': " + hologram.size() + " lines, "
+ debugInfo.getTotalEntities() + " entities (" + debugInfo.aliveEntities + " alive, " + debugInfo.deadEntities + " dead)");

View File

@ -32,7 +32,7 @@ public class DeleteCommand extends HologramSubCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
internalHologramManager.deleteHologram(hologram);

View File

@ -42,7 +42,7 @@ public class EditCommand extends HologramSubCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
sender.sendMessage("");
Messages.sendTitle(sender, "How to edit the hologram '" + hologram.getName() + "'");

View File

@ -33,7 +33,7 @@ public class InfoCommand extends LineEditingCommand implements QuickEditCommand
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
sender.sendMessage("");
Messages.sendTitle(sender, "Lines of the hologram '" + hologram.getName() + "'");

View File

@ -43,7 +43,7 @@ public class InsertlineCommand extends LineEditingCommand implements QuickEditCo
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
int insertAfter = CommandValidate.parseInteger(args[1]);
String serializedLine = Utils.join(args, " ", 2, args.length);

View File

@ -37,7 +37,7 @@ public class MovehereCommand extends HologramSubCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
Player player = CommandValidate.getPlayerSender(sender);
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
hologram.teleport(player.getLocation());

View File

@ -83,7 +83,7 @@ public class ReadimageCommand extends LineEditingCommand {
args = newArgs.toArray(new String[0]);
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
int width = CommandValidate.parseInteger(args[2]);
CommandValidate.check(width >= 2, "The width of the image must be 2 or greater.");

View File

@ -60,7 +60,7 @@ public class ReadtextCommand extends LineEditingCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
String fileName = args[1];
try {

View File

@ -37,7 +37,7 @@ public class RemovelineCommand extends LineEditingCommand implements QuickEditCo
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
int lineNumber = CommandValidate.parseInteger(args[1]);

View File

@ -39,7 +39,7 @@ public class SetlineCommand extends LineEditingCommand implements QuickEditComma
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
String serializedLine = Utils.join(args, " ", 2, args.length);
int lineNumber = CommandValidate.parseInteger(args[1]);

View File

@ -35,7 +35,7 @@ public class TeleportCommand extends HologramSubCommand {
@Override
public void execute(CommandSender sender, String[] args, SubCommandContext context) throws CommandException {
Player player = CommandValidate.getPlayerSender(sender);
InternalHologram hologram = HologramCommandValidate.getNamedHologram(internalHologramManager, args[0]);
InternalHologram hologram = HologramCommandValidate.getInternalHologram(internalHologramManager, args[0]);
Location loc = hologram.getLocation();
loc.setPitch(90);

View File

@ -20,6 +20,7 @@ import org.bukkit.inventory.ItemStack;
public class HologramLineParser {
private static final String ICON_PREFIX = "icon:";
private static final String EMPTY_LINE_PLACEHOLDER = "{empty}";
public static InternalHologramLine parseLine(InternalHologram hologram, String serializedLine, boolean checkMaterialValidity) throws HologramLoadException {
InternalHologramLine hologramLine;
@ -30,11 +31,14 @@ public class HologramLineParser {
hologramLine = new InternalItemLine(hologram, icon, serializedLine);
} else {
if (serializedLine.trim().equalsIgnoreCase("{empty}")) {
hologramLine = new InternalTextLine(hologram, "", serializedLine);
String displayText;
if (serializedLine.trim().equalsIgnoreCase(EMPTY_LINE_PLACEHOLDER)) {
displayText = "";
} else {
hologramLine = new InternalTextLine(hologram, StringConverter.toReadableFormat(serializedLine), serializedLine);
displayText = StringConverter.toReadableFormat(serializedLine);
}
hologramLine = new InternalTextLine(hologram, displayText, serializedLine);
}
return hologramLine;

View File

@ -20,4 +20,5 @@ public class HolographicDisplaysReloadEvent extends Event {
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@ -13,14 +13,14 @@ public class InternalHologramEditEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final InternalHologram internalHologram;
private final InternalHologram hologram;
public InternalHologramEditEvent(InternalHologram internalHologram) {
this.internalHologram = internalHologram;
public InternalHologramEditEvent(InternalHologram hologram) {
this.hologram = hologram;
}
public InternalHologram getInternalHologram() {
return internalHologram;
public InternalHologram getHologram() {
return hologram;
}
@Override
@ -31,4 +31,5 @@ public class InternalHologramEditEvent extends Event {
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@ -32,7 +32,7 @@ public class ChunkListener implements Listener {
NMSEntityBase entityBase = nmsManager.getNMSEntityBase(entity);
if (entityBase != null) {
entityBase.getHologramLine().getBaseParent().despawnEntities();
entityBase.getHologramLine().getHologram().despawnEntities();
}
}
}

View File

@ -5,12 +5,10 @@
*/
package me.filoghost.holographicdisplays.listener;
import me.filoghost.fcommons.logging.Log;
import me.filoghost.holographicdisplays.HolographicDisplays;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.nms.entity.NMSEntityBase;
import me.filoghost.holographicdisplays.core.object.base.BaseTouchableLine;
import me.filoghost.holographicdisplays.object.api.APIHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardTouchableLine;
import org.bukkit.GameMode;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -18,13 +16,12 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.plugin.Plugin;
public class MainListener implements Listener {
public class InteractListener implements Listener {
private final NMSManager nmsManager;
public MainListener(NMSManager nmsManager) {
public InteractListener(NMSManager nmsManager) {
this.nmsManager = nmsManager;
}
@ -40,18 +37,16 @@ public class MainListener implements Listener {
}
NMSEntityBase entityBase = nmsManager.getNMSEntityBase(event.getRightClicked());
if (entityBase == null || !(entityBase.getHologramLine() instanceof BaseTouchableLine)) {
if (entityBase == null) {
return;
}
BaseTouchableLine touchableLine = (BaseTouchableLine) entityBase.getHologramLine();
try {
touchableLine.onTouch(event.getPlayer());
} catch (Throwable t) {
Plugin plugin = touchableLine.getBaseParent() instanceof APIHologram ? ((APIHologram) touchableLine.getBaseParent()).getOwner() : HolographicDisplays.getInstance();
Log.warning("The plugin " + plugin.getName() + " generated an exception when the player " + event.getPlayer().getName() + " touched a hologram.", t);
StandardHologramLine line = entityBase.getHologramLine();
if (!(line instanceof StandardTouchableLine)) {
return;
}
((StandardTouchableLine) line).onTouch(clicker);
}
}

View File

@ -12,10 +12,8 @@ import me.filoghost.holographicdisplays.api.line.HologramLine;
import me.filoghost.holographicdisplays.api.line.ItemLine;
import me.filoghost.holographicdisplays.api.line.TextLine;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.object.base.BaseHologram;
import me.filoghost.holographicdisplays.core.object.base.BaseHologramLine;
import me.filoghost.holographicdisplays.object.base.BaseHologram;
import me.filoghost.holographicdisplays.disk.Configuration;
import me.filoghost.holographicdisplays.object.base.DefaultVisibilityManager;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -46,7 +44,7 @@ public class APIHologram extends BaseHologram implements Hologram {
}
@Override
public Plugin getOwner() {
public Plugin getOwnerPlugin() {
return plugin;
}
@ -121,12 +119,7 @@ public class APIHologram extends BaseHologram implements Hologram {
public boolean isVisibleTo(Player player) {
return visibilityManager.isVisibleTo(player);
}
@Override
protected double getSpaceBetweenLines() {
return Configuration.spaceBetweenLines;
}
@Override
public double getHeight() {
if (lines.isEmpty()) {

View File

@ -6,8 +6,13 @@
package me.filoghost.holographicdisplays.object.api;
import me.filoghost.holographicdisplays.api.line.HologramLine;
import me.filoghost.holographicdisplays.core.object.base.SpawnableHologramLine;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
public interface APIHologramLine extends HologramLine, SpawnableHologramLine {
public interface APIHologramLine extends HologramLine, StandardHologramLine {
@Override
default void removeLine() {
getHologram().removeLine(this);
}
}

View File

@ -34,7 +34,7 @@ public class APIHologramManager extends BaseHologramManager<APIHologram> {
List<Hologram> ownedHolograms = new LinkedList<>();
for (APIHologram hologram : getHolograms()) {
if (hologram.getOwner().equals(plugin)) {
if (hologram.getOwnerPlugin().equals(plugin)) {
ownedHolograms.add(hologram);
}
}

View File

@ -2,7 +2,7 @@ package me.filoghost.holographicdisplays.object.api;
import me.filoghost.holographicdisplays.api.Hologram;
import me.filoghost.holographicdisplays.api.line.ItemLine;
import me.filoghost.holographicdisplays.core.object.base.BaseItemLine;
import me.filoghost.holographicdisplays.object.base.BaseItemLine;
import org.bukkit.inventory.ItemStack;
public class APIItemLine extends BaseItemLine implements ItemLine, APIHologramLine {

View File

@ -18,4 +18,14 @@ public class APITextLine extends BaseTextLine implements TextLine, APIHologramLi
return parent;
}
@Override
public void setText(String text) {
super.setText(text);
}
@Override
protected boolean isAllowPlaceholders() {
return parent.isAllowPlaceholders();
}
}

View File

@ -3,13 +3,14 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.object.base;
package me.filoghost.holographicdisplays.object.api;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.api.VisibilityManager;
import me.filoghost.holographicdisplays.bridge.protocollib.ProtocolLibHook;
import me.filoghost.holographicdisplays.core.object.base.BaseHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologram;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.util.HashSet;
@ -21,11 +22,11 @@ public class DefaultVisibilityManager implements VisibilityManager {
private static final int VISIBILITY_DISTANCE_SQUARED = 64 * 64;
private final BaseHologram hologram;
private final StandardHologram hologram;
private Map<String, Boolean> playersVisibilityMap;
private boolean visibleByDefault;
public DefaultVisibilityManager(BaseHologram hologram) {
public DefaultVisibilityManager(StandardHologram hologram) {
Preconditions.notNull(hologram, "hologram");
this.hologram = hologram;
this.visibleByDefault = true;
@ -149,22 +150,25 @@ public class DefaultVisibilityManager implements VisibilityManager {
}
}
private void sendCreatePacketIfNear(Player player, BaseHologram hologram) {
private void sendCreatePacketIfNear(Player player, StandardHologram hologram) {
if (ProtocolLibHook.isEnabled() && isNear(player, hologram)) {
ProtocolLibHook.sendCreateEntitiesPacket(player, hologram);
}
}
private void sendDestroyPacketIfNear(Player player, BaseHologram hologram) {
private void sendDestroyPacketIfNear(Player player, StandardHologram hologram) {
if (ProtocolLibHook.isEnabled() && isNear(player, hologram)) {
ProtocolLibHook.sendDestroyEntitiesPacket(player, hologram);
}
}
private boolean isNear(Player player, BaseHologram hologram) {
private boolean isNear(Player player, StandardHologram hologram) {
Location playerLocation = player.getLocation();
Location hologramLocation = hologram.getLocation();
return player.isOnline()
&& player.getWorld().equals(hologram.getWorld())
&& player.getLocation().distanceSquared(hologram.getLocation()) < VISIBILITY_DISTANCE_SQUARED;
&& playerLocation.getWorld().equals(hologramLocation.getWorld())
&& playerLocation.distanceSquared(hologramLocation) < VISIBILITY_DISTANCE_SQUARED;
}
@Override

View File

@ -3,18 +3,19 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.object.base;
package me.filoghost.holographicdisplays.object.base;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import me.filoghost.holographicdisplays.core.hologram.StandardHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.disk.Configuration;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.util.List;
import java.util.Iterator;
public abstract class BaseHologram extends HologramComponent {
public abstract class BaseHologram extends BaseHologramComponent implements StandardHologram {
private final NMSManager nmsManager;
@ -26,22 +27,12 @@ public abstract class BaseHologram extends HologramComponent {
this.nmsManager = nmsManager;
}
public abstract Plugin getOwner();
public abstract List<? extends SpawnableHologramLine> getLinesUnsafe();
public abstract boolean isAllowPlaceholders();
public abstract boolean isVisibleTo(Player player);
protected abstract double getSpaceBetweenLines();
public abstract String toFormattedString();
@Override
public boolean isDeleted() {
return deleted;
}
@Override
public void setDeleted() {
if (!deleted) {
deleted = true;
@ -49,6 +40,7 @@ public abstract class BaseHologram extends HologramComponent {
}
}
@Override
public NMSManager getNMSManager() {
return nmsManager;
}
@ -60,7 +52,8 @@ public abstract class BaseHologram extends HologramComponent {
refresh();
}
public void removeLine(BaseHologramLine line) {
@Override
public void removeLine(StandardHologramLine line) {
checkState();
getLinesUnsafe().remove(line);
@ -69,19 +62,23 @@ public abstract class BaseHologram extends HologramComponent {
}
public void clearLines() {
for (SpawnableHologramLine line : getLinesUnsafe()) {
Iterator<? extends StandardHologramLine> iterator = getLinesUnsafe().iterator();
while (iterator.hasNext()) {
StandardHologramLine line = iterator.next();
iterator.remove();
line.despawn();
}
getLinesUnsafe().clear();
}
@Override
public int size() {
return getLinesUnsafe().size();
}
public void teleport(Location location) {
checkState();
Preconditions.notNull(location, "location");
teleport(location.getWorld(), location.getX(), location.getY(), location.getZ());
}
@ -93,14 +90,17 @@ public abstract class BaseHologram extends HologramComponent {
refresh();
}
@Override
public void refresh() {
refresh(false);
}
@Override
public void refresh(boolean forceRespawn) {
refresh(forceRespawn, isInLoadedChunk());
}
@Override
public void refresh(boolean forceRespawn, boolean isChunkLoaded) {
checkState();
@ -119,11 +119,11 @@ public abstract class BaseHologram extends HologramComponent {
double currentLineY = getY();
for (int i = 0; i < getLinesUnsafe().size(); i++) {
SpawnableHologramLine line = getLinesUnsafe().get(i);
StandardHologramLine line = getLinesUnsafe().get(i);
currentLineY -= line.getHeight();
if (i > 0) {
currentLineY -= getSpaceBetweenLines();
currentLineY -= Configuration.spaceBetweenLines;
}
if (forceRespawn) {
@ -133,8 +133,9 @@ public abstract class BaseHologram extends HologramComponent {
}
}
@Override
public void despawnEntities() {
for (SpawnableHologramLine line : getLinesUnsafe()) {
for (StandardHologramLine line : getLinesUnsafe()) {
line.despawn();
}
}

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.object.base;
package me.filoghost.holographicdisplays.object.base;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.core.Utils;
@ -11,7 +11,7 @@ import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
public abstract class HologramComponent {
public abstract class BaseHologramComponent {
private World world;
private double x, y, z;

View File

@ -3,34 +3,33 @@
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package me.filoghost.holographicdisplays.core.object.base;
package me.filoghost.holographicdisplays.object.base;
import me.filoghost.fcommons.Preconditions;
import me.filoghost.holographicdisplays.core.hologram.StandardHologram;
import me.filoghost.holographicdisplays.core.hologram.StandardHologramLine;
import me.filoghost.holographicdisplays.core.nms.NMSManager;
import org.bukkit.World;
public abstract class BaseHologramLine extends HologramComponent implements SpawnableHologramLine {
public abstract class BaseHologramLine extends BaseHologramComponent implements StandardHologramLine {
private final BaseHologram parent;
private final StandardHologram parent;
private boolean isSpawned;
protected BaseHologramLine(BaseHologram parent) {
protected BaseHologramLine(StandardHologram parent) {
Preconditions.notNull(parent, "parent hologram");
this.parent = parent;
}
public final BaseHologram getBaseParent() {
@Override
public final StandardHologram getHologram() {
return parent;
}
protected final NMSManager getNMSManager() {
return parent.getNMSManager();
}
public final void removeLine() {
parent.removeLine(this);
}
@Override
public final void respawn(World world, double x, double y, double z) {

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