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 90f2e097..3575efca 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/nms/NMSHandler.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/nms/NMSHandler.java @@ -19,12 +19,14 @@ public interface NMSHandler { Entity getEntity(int entityId); - Entity getInvisibleArmorstand(Location loc); + Entity getHMCArmorStand(Location loc); ArmorStand getMEGEntity(Location loc); Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType); + Entity spawnHMCParticleCloud(Location location); + UserBalloonManager spawnBalloon(CosmeticUser user, CosmeticBalloonType cosmeticBalloonType); void equipmentSlotUpdate( diff --git a/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/InvisibleArmorstand.java b/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/HMCArmorStand.java similarity index 77% rename from v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/InvisibleArmorstand.java rename to v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/HMCArmorStand.java index f97ea244..378476e4 100644 --- a/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/InvisibleArmorstand.java +++ b/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/HMCArmorStand.java @@ -5,13 +5,13 @@ import net.minecraft.world.level.Level; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_17_R1.CraftWorld; -public class InvisibleArmorstand extends ArmorStand { +public class HMCArmorStand extends ArmorStand { - public InvisibleArmorstand(Level world, double x, double y, double z) { + public HMCArmorStand(Level world, double x, double y, double z) { super(world, x, y, z); } - public InvisibleArmorstand(Location loc) { + public HMCArmorStand(Location loc) { super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); this.setPos(loc.getX(), loc.getY(), loc.getZ()); setInvisible(true); diff --git a/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/HMCParticleCloud.java b/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/HMCParticleCloud.java new file mode 100644 index 00000000..cd04749b --- /dev/null +++ b/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/HMCParticleCloud.java @@ -0,0 +1,24 @@ +package com.hibiscusmc.hmccosmetics.nms.v1_17_R1; + + +import net.minecraft.world.entity.AreaEffectCloud; +import net.minecraft.world.level.Level; +import org.bukkit.Location; +import org.bukkit.craftbukkit.v1_17_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_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/NMSHandler.java b/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/NMSHandler.java index fd25fe47..9e6d8444 100644 --- a/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/NMSHandler.java +++ b/v1_17_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_17_R1/NMSHandler.java @@ -64,9 +64,15 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { } @Override - public org.bukkit.entity.Entity getInvisibleArmorstand(Location loc) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(loc); - return invisibleArmorstand.getBukkitEntity(); + public org.bukkit.entity.Entity getHMCArmorStand(Location loc) { + HMCArmorStand hmcArmorStand = new HMCArmorStand(loc); + return hmcArmorStand.getBukkitEntity(); + } + + @Override + public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { + HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); + return hmcParticleCloud.getBukkitEntity(); } @Override @@ -76,7 +82,7 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { @Override public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(user.getPlayer().getLocation()); + HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getPlayer().getLocation()); ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType); diff --git a/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/InvisibleArmorstand.java b/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCArmorStand.java similarity index 77% rename from v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/InvisibleArmorstand.java rename to v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCArmorStand.java index e7146b87..51739f17 100644 --- a/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/InvisibleArmorstand.java +++ b/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCArmorStand.java @@ -5,13 +5,13 @@ import net.minecraft.world.level.Level; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_18_R2.CraftWorld; -public class InvisibleArmorstand extends ArmorStand { +public class HMCArmorStand extends ArmorStand { - public InvisibleArmorstand(Level world, double x, double y, double z) { + public HMCArmorStand(Level world, double x, double y, double z) { super(world, x, y, z); } - public InvisibleArmorstand(Location loc) { + public HMCArmorStand(Location loc) { super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); this.setPos(loc.getX(), loc.getY(), loc.getZ()); setInvisible(true); 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 new file mode 100644 index 00000000..997a4844 --- /dev/null +++ b/v1_18_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_18_R2/HMCParticleCloud.java @@ -0,0 +1,24 @@ +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 b7ebee8e..0f525bfb 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 @@ -66,9 +66,15 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { } @Override - public org.bukkit.entity.Entity getInvisibleArmorstand(Location loc) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(loc); - return invisibleArmorstand.getBukkitEntity(); + public org.bukkit.entity.Entity getHMCArmorStand(Location loc) { + HMCArmorStand hmcArmorStand = new HMCArmorStand(loc); + return hmcArmorStand.getBukkitEntity(); + } + + @Override + public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { + HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); + return hmcParticleCloud.getBukkitEntity(); } @Override @@ -78,7 +84,7 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { @Override public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(user.getPlayer().getLocation()); + HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getPlayer().getLocation()); ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType); diff --git a/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/InvisibleArmorstand.java b/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCArmorStand.java similarity index 77% rename from v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/InvisibleArmorstand.java rename to v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCArmorStand.java index 58e7f751..1970f62e 100644 --- a/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/InvisibleArmorstand.java +++ b/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCArmorStand.java @@ -5,13 +5,13 @@ import net.minecraft.world.level.Level; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_19_R1.CraftWorld; -public class InvisibleArmorstand extends ArmorStand { +public class HMCArmorStand extends ArmorStand { - public InvisibleArmorstand(Level world, double x, double y, double z) { + public HMCArmorStand(Level world, double x, double y, double z) { super(world, x, y, z); } - public InvisibleArmorstand(Location loc) { + public HMCArmorStand(Location loc) { super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); this.setPos(loc.getX(), loc.getY(), loc.getZ()); setInvisible(true); 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 new file mode 100644 index 00000000..6dd04986 --- /dev/null +++ b/v1_19_R1/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R1/HMCParticleCloud.java @@ -0,0 +1,24 @@ +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 37dae16c..ea23e4a9 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 @@ -66,9 +66,15 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { } @Override - public org.bukkit.entity.Entity getInvisibleArmorstand(Location loc) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(loc); - return invisibleArmorstand.getBukkitEntity(); + public org.bukkit.entity.Entity getHMCArmorStand(Location loc) { + HMCArmorStand hmcArmorStand = new HMCArmorStand(loc); + return hmcArmorStand.getBukkitEntity(); + } + + @Override + public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { + HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); + return hmcParticleCloud.getBukkitEntity(); } @Override @@ -78,16 +84,16 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { @Override public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(user.getPlayer().getLocation()); + HMCArmorStand HMCArmorStand = new HMCArmorStand(user.getPlayer().getLocation()); ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType); - invisibleArmorstand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item)); - ((CraftWorld) user.getPlayer().getWorld()).getHandle().addFreshEntity(invisibleArmorstand, CreatureSpawnEvent.SpawnReason.CUSTOM); + HMCArmorStand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item)); + ((CraftWorld) user.getPlayer().getWorld()).getHandle().addFreshEntity(HMCArmorStand, CreatureSpawnEvent.SpawnReason.CUSTOM); MessagesUtil.sendDebugMessages("spawnBackpack NMS"); - return invisibleArmorstand.getBukkitLivingEntity(); + return HMCArmorStand.getBukkitLivingEntity(); //PacketManager.armorStandMetaPacket(invisibleArmorstand.getBukkitEntity(), sentTo); //PacketManager.ridingMountPacket(player.getEntityId(), invisibleArmorstand.getId(), sentTo); diff --git a/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/InvisibleArmorstand.java b/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCArmorStand.java similarity index 77% rename from v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/InvisibleArmorstand.java rename to v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCArmorStand.java index 1ec8e4ba..eea88292 100644 --- a/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/InvisibleArmorstand.java +++ b/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCArmorStand.java @@ -5,13 +5,13 @@ import net.minecraft.world.level.Level; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_19_R2.CraftWorld; -public class InvisibleArmorstand extends ArmorStand { +public class HMCArmorStand extends ArmorStand { - public InvisibleArmorstand(Level world, double x, double y, double z) { + public HMCArmorStand(Level world, double x, double y, double z) { super(world, x, y, z); } - public InvisibleArmorstand(Location loc) { + public HMCArmorStand(Location loc) { super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ()); this.setPos(loc.getX(), loc.getY(), loc.getZ()); setInvisible(true); 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 new file mode 100644 index 00000000..26693401 --- /dev/null +++ b/v1_19_R2/src/main/java/com/hibiscusmc/hmccosmetics/nms/v1_19_R2/HMCParticleCloud.java @@ -0,0 +1,24 @@ +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 6564f6f5..ecc79d1c 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 @@ -66,9 +66,15 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { } @Override - public org.bukkit.entity.Entity getInvisibleArmorstand(Location loc) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(loc); - return invisibleArmorstand.getBukkitEntity(); + public org.bukkit.entity.Entity getHMCArmorStand(Location loc) { + HMCArmorStand hmcArmorStand = new HMCArmorStand(loc); + return hmcArmorStand.getBukkitEntity(); + } + + @Override + public org.bukkit.entity.Entity spawnHMCParticleCloud(Location location) { + HMCParticleCloud hmcParticleCloud = new HMCParticleCloud(location); + return hmcParticleCloud.getBukkitEntity(); } @Override @@ -78,7 +84,7 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler { @Override public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) { - InvisibleArmorstand invisibleArmorstand = new InvisibleArmorstand(user.getPlayer().getLocation()); + HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getPlayer().getLocation()); ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType);