diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBackpackType.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBackpackType.java index 13e10880..32adc172 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBackpackType.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBackpackType.java @@ -1,6 +1,7 @@ package com.hibiscusmc.hmccosmetics.cosmetic.types; import com.hibiscusmc.hmccosmetics.cosmetic.Cosmetic; +import com.hibiscusmc.hmccosmetics.nms.NMSHandlers; import com.hibiscusmc.hmccosmetics.user.CosmeticUser; import com.hibiscusmc.hmccosmetics.user.manager.UserBackpackManager; import com.hibiscusmc.hmccosmetics.util.MessagesUtil; @@ -9,22 +10,30 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.AreaEffectCloud; import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import org.spongepowered.configurate.ConfigurationNode; import java.util.ArrayList; +import java.util.List; import java.util.logging.Level; public class CosmeticBackpackType extends Cosmetic { private final String modelName; - private UserBackpackManager.BackpackType backpackType; + private ItemStack firstPersonBackpack; public CosmeticBackpackType(String id, ConfigurationNode config) { super(id, config); modelName = config.node("model").getString(); - backpackType = UserBackpackManager.BackpackType.valueOf(config.node("type").getString("NORMAL").toUpperCase()); + + if (!config.node("firstperson-item").virtual()) { + this.firstPersonBackpack = generateItemStack(config.node("firstperson-item")); + } + //backpackType = UserBackpackManager.BackpackType.valueOf(config.node("type").getString("NORMAL").toUpperCase()); } @Override @@ -45,26 +54,27 @@ public class CosmeticBackpackType extends Cosmetic { } user.getUserBackpackManager().getArmorStand().teleport(loc); + user.getUserBackpackManager().getArmorStand().setRotation(loc.getYaw(), loc.getPitch()); + + List outsideViewers = user.getUserBackpackManager().getCloudManager().refreshViewers(loc); + if (isFirstPersonCompadible()) { + List owner = List.of(user.getPlayer()); - if (user.getUserBackpackManager().getBackpackType().equals(UserBackpackManager.BackpackType.FIRST_PERSON)) { ArrayList particleCloud = user.getUserBackpackManager().getAreaEffectEntityId(); for (int i = 0; i < particleCloud.size(); i++) { - //particleCloud.get(i).teleport(loc); if (i == 0) { - PacketManager.sendRidingPacket(entity.getEntityId(), particleCloud.get(i), loc); + PacketManager.sendRidingPacket(entity.getEntityId(), particleCloud.get(i), owner); } else { - PacketManager.sendRidingPacket(particleCloud.get(i - 1), particleCloud.get(i) , loc); + PacketManager.sendRidingPacket(particleCloud.get(i - 1), particleCloud.get(i) , owner); } MessagesUtil.sendDebugMessages("num: " + i + " / valid? "); } - //PacketManager.sendRidingPacket(entity.getEntityId(), user.getUserBackpackManager().getAreaEffectEntityId(), loc); - PacketManager.sendRidingPacket(particleCloud.get(particleCloud.size() - 1), user.getUserBackpackManager().getFirstArmorStandId(), loc); + PacketManager.sendRidingPacket(particleCloud.get(particleCloud.size() - 1), user.getUserBackpackManager().getFirstArmorStandId(), owner); + NMSHandlers.getHandler().equipmentSlotUpdate(user.getUserBackpackManager().getFirstArmorStandId(), EquipmentSlot.HEAD, firstPersonBackpack, owner); MessagesUtil.sendDebugMessages("ParticleCloud: " + particleCloud.toString()); - } else { - PacketManager.sendRidingPacket(entity.getEntityId(), user.getUserBackpackManager().getFirstArmorStandId(), loc); } + PacketManager.sendRidingPacket(entity.getEntityId(), user.getUserBackpackManager().getFirstArmorStandId(), outsideViewers); - user.getUserBackpackManager().getArmorStand().setRotation(loc.getYaw(), loc.getPitch()); user.getUserBackpackManager().showBackpack(); } @@ -72,7 +82,7 @@ public class CosmeticBackpackType extends Cosmetic { return modelName; } - public UserBackpackManager.BackpackType getBackpackType() { - return backpackType; + public boolean isFirstPersonCompadible() { + return firstPersonBackpack != null; } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/nms/NMSHandler.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/nms/NMSHandler.java index 0b496eed..8fe8a628 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/nms/NMSHandler.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/nms/NMSHandler.java @@ -25,8 +25,6 @@ public interface NMSHandler { Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType); - Entity spawnHMCParticleCloud(Location location); - Entity spawnDisplayEntity(Location location, String text); UserBalloonManager spawnBalloon(CosmeticUser user, CosmeticBalloonType cosmeticBalloonType); diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java index a7d41a8d..2409dcbd 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/CosmeticUser.java @@ -350,7 +350,7 @@ public class CosmeticUser { public void spawnBackpack(CosmeticBackpackType cosmeticBackpackType) { if (this.userBackpackManager != null) return; - this.userBackpackManager = new UserBackpackManager(this, cosmeticBackpackType.getBackpackType()); + this.userBackpackManager = new UserBackpackManager(this, cosmeticBackpackType.isFirstPersonCompadible()); userBackpackManager.spawnBackpack(cosmeticBackpackType); } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackCloudManager.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackCloudManager.java new file mode 100644 index 00000000..b117b2c3 --- /dev/null +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackCloudManager.java @@ -0,0 +1,64 @@ +package com.hibiscusmc.hmccosmetics.user.manager; + +import com.hibiscusmc.hmccosmetics.util.PlayerUtils; +import com.hibiscusmc.hmccosmetics.util.packets.PacketManager; +import org.bukkit.Location; +import org.bukkit.entity.Player; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class UserBackpackCloudManager { + + private ArrayList ids; + private UUID owner; + private List viewers = new ArrayList<>(); + private Long lastUpdate; + + public UserBackpackCloudManager(UUID owner) { + this.ids = new ArrayList<>(); + this.owner = owner; + this.lastUpdate = 0L; + } + + public ArrayList getId() { + return ids; + } + + public UUID getOwner() { + return owner; + } + + public List refreshViewers(Location location) { + if (System.currentTimeMillis() - lastUpdate <= 1000) return List.of(); //Prevents mass refreshes + ArrayList newPlayers = new ArrayList<>(); + ArrayList removePlayers = new ArrayList<>(); + List players = PlayerUtils.getNearbyPlayers(location); + + for (Player player : players) { + //if (player.getUniqueId().toString().equalsIgnoreCase(owner.toString())) continue; + if (!viewers.contains(player)) { + viewers.add(player); + newPlayers.add(player); + continue; + } + // bad loopdy loops + for (Player viewerPlayer : viewers) { + if (!players.contains(viewerPlayer)) { + removePlayers.add(viewerPlayer); + PacketManager.sendEntityDestroyPacket(ids, List.of(viewerPlayer)); // prevents random leashes + } + } + } + viewers.removeAll(removePlayers); + lastUpdate = System.currentTimeMillis(); + return newPlayers; + } + + public void hideEffects() { + PacketManager.sendEntityDestroyPacket(ids, viewers); + viewers.clear(); + } + +} diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackManager.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackManager.java index 487a7354..4572b859 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackManager.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/manager/UserBackpackManager.java @@ -28,12 +28,14 @@ public class UserBackpackManager { private ArmorStand invisibleArmorStand; private ArrayList particleCloud = new ArrayList<>(); private final CosmeticUser user; - private BackpackType backpackType; + private boolean firstPerson; + private UserBackpackCloudManager cloudManager; - public UserBackpackManager(CosmeticUser user, BackpackType backpackType) { + public UserBackpackManager(CosmeticUser user, boolean firstPersonView) { this.user = user; this.hideBackpack = false; - this.backpackType = backpackType; + this.firstPerson = firstPersonView; + this.cloudManager = new UserBackpackCloudManager(user.getUniqueId()); } public int getFirstArmorStandId() { @@ -55,16 +57,14 @@ public class UserBackpackManager { public void spawnBackpack(CosmeticBackpackType cosmeticBackpackType) { MessagesUtil.sendDebugMessages("spawnBackpack Bukkit - Start"); - if (getBackpackType().equals(BackpackType.NORMAL)) { + if (!firstPerson) { spawnNormalBackpack(cosmeticBackpackType); - } - if (getBackpackType().equals(BackpackType.FIRST_PERSON)) { + } else { spawnFirstPersonBackpack(cosmeticBackpackType); } } private void spawnNormalBackpack(CosmeticBackpackType cosmeticBackpackType) { - if (this.invisibleArmorStand != null) return; this.invisibleArmorStand = (ArmorStand) NMSHandlers.getHandler().spawnBackpack(user, cosmeticBackpackType); @@ -87,27 +87,13 @@ public class UserBackpackManager { if (this.invisibleArmorStand != null) return; this.invisibleArmorStand = (ArmorStand) NMSHandlers.getHandler().spawnBackpack(user, cosmeticBackpackType); + for (int i = particleCloud.size(); i < 5; i++) { int entityId = NMSHandlers.getHandler().getNextEntityId(); PacketManager.sendEntitySpawnPacket(user.getPlayer().getLocation(), entityId, EntityType.AREA_EFFECT_CLOUD, UUID.randomUUID()); PacketManager.sendCloudEffect(entityId, PacketManager.getViewers(user.getPlayer().getLocation())); this.particleCloud.add(entityId); - //this.particleCloud.add((AreaEffectCloud) NMSHandlers.getHandler().spawnHMCParticleCloud(user.getPlayer().getLocation())); } - //this.particleCloud = (AreaEffectCloud) NMSHandlers.getHandler().spawnHMCParticleCloud(user.getPlayer().getLocation()); - - /* - if (cosmeticBackpackType.getModelName() != null && Hooks.isActiveHook("ModelEngine")) { - if (ModelEngineAPI.api.getModelRegistry().getBlueprint(cosmeticBackpackType.getModelName()) == null) { - MessagesUtil.sendDebugMessages("Invalid Model Engine Blueprint " + cosmeticBackpackType.getModelName(), Level.SEVERE); - return; - } - ModeledEntity modeledEntity = ModelEngineAPI.getOrCreateModeledEntity(invisibleArmorStand); - ActiveModel model = ModelEngineAPI.createActiveModel(ModelEngineAPI.getBlueprint(cosmeticBackpackType.getModelName())); - model.setCanHurt(false); - modeledEntity.addModel(model, false); - } - */ MessagesUtil.sendDebugMessages("spawnBackpackFirstPerson Bukkit - Finish"); } @@ -144,10 +130,6 @@ public class UserBackpackManager { hideBackpack = shown; } - public BackpackType getBackpackType() { - return backpackType; - } - public ArrayList getAreaEffectEntityId() { return particleCloud; } @@ -161,6 +143,10 @@ public class UserBackpackManager { getArmorStand().getEquipment().setHelmet(item); } + public UserBackpackCloudManager getCloudManager() { + return cloudManager; + } + public enum BackpackType { NORMAL, FIRST_PERSON // First person not yet implemented diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java index e4deece0..9638cc15 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java @@ -280,6 +280,18 @@ public class PacketManager extends BasePacket { for (final Player p : sendTo) sendPacket(p, packet); } + /** + * Destroys an entity from a player + * @param sendTo The players the packet should be sent to + */ + public static void sendEntityDestroyPacket(final List ids, @NotNull List sendTo) { + PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_DESTROY); + IntArrayList entities = new IntArrayList(new int[]{}); + for (int id : ids) entities.add(id); + packet.getModifier().write(0, entities); + for (final Player p : sendTo) sendPacket(p, packet); + } + /** * Sends a camera packet * @param entityId The Entity ID that camera will go towards diff --git a/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCParticleCloud.java b/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCParticleCloud.java deleted file mode 100644 index 997a4844..00000000 --- a/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCParticleCloud.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hibiscusmc.hmccosmetics.nms.v1_18_R2; - - -import net.minecraft.world.entity.AreaEffectCloud; -import net.minecraft.world.level.Level; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_18_R2.CraftWorld; - -public class HMCParticleCloud extends AreaEffectCloud { - - public HMCParticleCloud(Level world, double x, double y, double z) { - super(world, x, y, z); - } - - public HMCParticleCloud(Location loc) { - super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); - this.setPos(loc.getX(), loc.getY(), loc.getZ()); - setInvisible(true); - setInvulnerable(true); - setSilent(true); - setNoGravity(true); - persist = false; - } -} diff --git a/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/NMSHandler.java b/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/NMSHandler.java index ee0288ff..eb7e5400 100644 --- a/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/NMSHandler.java +++ b/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/NMSHandler.java @@ -67,12 +67,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { return hmcArmorStand.getBukkitEntity(); } - @Override - public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { - HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); - return hmcParticleCloud.getBukkitEntity(); - } - @Override public ArmorStand getMEGEntity(Location loc) { return (ArmorStand) new MEGEntity(loc).getBukkitEntity(); diff --git a/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCParticleCloud.java b/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCParticleCloud.java deleted file mode 100644 index 6dd04986..00000000 --- a/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCParticleCloud.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hibiscusmc.hmccosmetics.nms.v1_19_R1; - - -import net.minecraft.world.entity.AreaEffectCloud; -import net.minecraft.world.level.Level; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_19_R1.CraftWorld; - -public class HMCParticleCloud extends AreaEffectCloud { - - public HMCParticleCloud(Level world, double x, double y, double z) { - super(world, x, y, z); - } - - public HMCParticleCloud(Location loc) { - super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); - this.setPos(loc.getX(), loc.getY(), loc.getZ()); - setInvisible(true); - setInvulnerable(true); - setSilent(true); - setNoGravity(true); - persist = false; - } -} diff --git a/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/NMSHandler.java b/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/NMSHandler.java index 1683f45f..50d94359 100644 --- a/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/NMSHandler.java +++ b/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/NMSHandler.java @@ -67,12 +67,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { return hmcArmorStand.getBukkitEntity(); } - @Override - public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { - HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); - return hmcParticleCloud.getBukkitEntity(); - } - @Override public ArmorStand getMEGEntity(Location loc) { return (ArmorStand) new MEGEntity(loc).getBukkitEntity(); diff --git a/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCParticleCloud.java b/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCParticleCloud.java deleted file mode 100644 index 26693401..00000000 --- a/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCParticleCloud.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hibiscusmc.hmccosmetics.nms.v1_19_R2; - - -import net.minecraft.world.entity.AreaEffectCloud; -import net.minecraft.world.level.Level; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_19_R2.CraftWorld; - -public class HMCParticleCloud extends AreaEffectCloud { - - public HMCParticleCloud(Level world, double x, double y, double z) { - super(world, x, y, z); - } - - public HMCParticleCloud(Location loc) { - super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); - this.setPos(loc.getX(), loc.getY(), loc.getZ()); - setInvisible(true); - setInvulnerable(true); - setSilent(true); - setNoGravity(true); - persist = false; - } -} diff --git a/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/NMSHandler.java b/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/NMSHandler.java index 3f64c466..7d0abe27 100644 --- a/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/NMSHandler.java +++ b/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/NMSHandler.java @@ -67,12 +67,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { return hmcArmorStand.getBukkitEntity(); } - @Override - public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { - HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); - return hmcParticleCloud.getBukkitEntity(); - } - @Override public ArmorStand getMEGEntity(Location loc) { return (ArmorStand) new MEGEntity(loc).getBukkitEntity(); diff --git a/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/HMCParticleCloud.java b/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/HMCParticleCloud.java deleted file mode 100644 index 7a0d4d7d..00000000 --- a/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/HMCParticleCloud.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hibiscusmc.hmccosmetics.nms.v1_19_R3; - - -import net.minecraft.world.entity.AreaEffectCloud; -import net.minecraft.world.level.Level; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_19_R3.CraftWorld; - -public class HMCParticleCloud extends AreaEffectCloud { - - public HMCParticleCloud(Level world, double x, double y, double z) { - super(world, x, y, z); - } - - public HMCParticleCloud(Location loc) { - super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); - this.setPos(loc.getX(), loc.getY(), loc.getZ()); - setInvisible(true); - setInvulnerable(true); - setSilent(true); - setNoGravity(true); - persist = false; - } -} diff --git a/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/NMSHandler.java b/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/NMSHandler.java index d1bbd51f..8547cdd5 100644 --- a/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/NMSHandler.java +++ b/v1_19_R3/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R3/NMSHandler.java @@ -70,12 +70,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { return hmcArmorStand.getBukkitEntity(); } - @Override - public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { - HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); - return hmcParticleCloud.getBukkitEntity(); - } - @Override public ArmorStand getMEGEntity(Location loc) { return (ArmorStand) new MEGEntity(loc).getBukkitEntity(); diff --git a/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/HMCParticleCloud.java b/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/HMCParticleCloud.java deleted file mode 100644 index 6d8004b6..00000000 --- a/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/HMCParticleCloud.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.hibiscusmc.hmccosmetics.nms.v1_20_R1; - - -import net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket; -import net.minecraft.world.entity.AreaEffectCloud; -import net.minecraft.world.level.Level; -import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_20_R1.CraftWorld; - -public class HMCParticleCloud extends AreaEffectCloud { - - public HMCParticleCloud(Level world, double x, double y, double z) { - super(world, x, y, z); - } - - public HMCParticleCloud(Location loc) { - super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); - this.setPos(loc.getX(), loc.getY(), loc.getZ()); - //setInvisible(true); - setInvulnerable(true); - setSilent(true); - setNoGravity(true); - persist = false; - } -} diff --git a/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/NMSHandler.java b/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/NMSHandler.java index 16a5719f..129ebb94 100644 --- a/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/NMSHandler.java +++ b/v1_20_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_20_R1/NMSHandler.java @@ -69,12 +69,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { return hmcArmorStand.getBukkitEntity(); } - @Override - public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { - HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); - return hmcParticleCloud.getBukkitEntity(); - } - @Override public ArmorStand getMEGEntity(Location loc) { return (ArmorStand) new MEGEntity(loc).getBukkitEntity();