9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-19 15:09:19 +00:00

clean: remove now unused NMS methods relating to backpacks

This commit is contained in:
LoJoSho
2023-08-29 21:37:43 -05:00
parent 8b0fcc5da9
commit f6cd73f436
11 changed files with 0 additions and 211 deletions

View File

@@ -20,8 +20,6 @@ public interface NMSHandler {
ArmorStand getMEGEntity(Location loc);
Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType);
Entity spawnDisplayEntity(Location location, String text);
UserBalloonManager spawnBalloon(CosmeticUser user, CosmeticBalloonType cosmeticBalloonType);

View File

@@ -1,24 +0,0 @@
package com.hibiscusmc.hmccosmetics.nms.v1_18_R2;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.Level;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
public class HMCArmorStand extends ArmorStand {
public HMCArmorStand(Level world, double x, double y, double z) {
super(world, x, y, z);
}
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);
setInvulnerable(true);
setMarker(true);
setSilent(true);
getBukkitLivingEntity().setCollidable(false);
persist = false;
}
}

View File

@@ -1,10 +1,8 @@
package com.hibiscusmc.hmccosmetics.nms.v1_18_R2;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBackpackType;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBalloonType;
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
import com.hibiscusmc.hmccosmetics.user.manager.UserBalloonManager;
import com.hibiscusmc.hmccosmetics.util.MessagesUtil;
import com.mojang.datafixers.util.Pair;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
@@ -21,13 +19,11 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_18_R2.CraftEquipmentSlot;
import org.bukkit.craftbukkit.v1_18_R2.CraftServer;
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_18_R2.scoreboard.CraftScoreboard;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
@@ -61,20 +57,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler {
return (ArmorStand) new MEGEntity(loc).getBukkitEntity();
}
@Override
public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) {
HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getEntity().getLocation());
ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType);
invisibleArmorstand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item));
((CraftWorld) user.getEntity().getWorld()).getHandle().addFreshEntity(invisibleArmorstand, CreatureSpawnEvent.SpawnReason.CUSTOM);
MessagesUtil.sendDebugMessages("spawnBackpack NMS");
return invisibleArmorstand.getBukkitLivingEntity();
}
@Override
public org.bukkit.entity.Entity spawnDisplayEntity(Location location, String text) {
return null;

View File

@@ -1,24 +0,0 @@
package com.hibiscusmc.hmccosmetics.nms.v1_19_R1;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.Level;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
public class HMCArmorStand extends ArmorStand {
public HMCArmorStand(Level world, double x, double y, double z) {
super(world, x, y, z);
}
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);
setInvulnerable(true);
setMarker(true);
setSilent(true);
getBukkitLivingEntity().setCollidable(false);
persist = false;
}
}

View File

@@ -1,10 +1,8 @@
package com.hibiscusmc.hmccosmetics.nms.v1_19_R1;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBackpackType;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBalloonType;
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
import com.hibiscusmc.hmccosmetics.user.manager.UserBalloonManager;
import com.hibiscusmc.hmccosmetics.util.MessagesUtil;
import com.mojang.datafixers.util.Pair;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
@@ -21,13 +19,11 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R1.CraftEquipmentSlot;
import org.bukkit.craftbukkit.v1_19_R1.CraftServer;
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_19_R1.scoreboard.CraftScoreboard;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
@@ -61,28 +57,11 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler {
return (ArmorStand) new MEGEntity(loc).getBukkitEntity();
}
@Override
public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) {
HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getEntity().getLocation());
ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType);
invisibleArmorstand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item));
((CraftWorld) user.getEntity().getWorld()).getHandle().addFreshEntity(invisibleArmorstand, CreatureSpawnEvent.SpawnReason.CUSTOM);
MessagesUtil.sendDebugMessages("spawnBackpack NMS");
return invisibleArmorstand.getBukkitLivingEntity();
}
@Override
public org.bukkit.entity.Entity spawnDisplayEntity(Location location, String text) {
return null;
}
@Override
public UserBalloonManager spawnBalloon(CosmeticUser user, CosmeticBalloonType cosmeticBalloonType) {
org.bukkit.entity.Entity entity = user.getEntity();

View File

@@ -1,24 +0,0 @@
package com.hibiscusmc.hmccosmetics.nms.v1_19_R2;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.Level;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
public class HMCArmorStand extends ArmorStand {
public HMCArmorStand(Level world, double x, double y, double z) {
super(world, x, y, z);
}
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);
setInvulnerable(true);
setMarker(true);
setSilent(true);
getBukkitLivingEntity().setCollidable(false);
persist = false;
}
}

View File

@@ -1,10 +1,8 @@
package com.hibiscusmc.hmccosmetics.nms.v1_19_R2;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBackpackType;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBalloonType;
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
import com.hibiscusmc.hmccosmetics.user.manager.UserBalloonManager;
import com.hibiscusmc.hmccosmetics.util.MessagesUtil;
import com.mojang.datafixers.util.Pair;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
@@ -21,13 +19,11 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R2.CraftEquipmentSlot;
import org.bukkit.craftbukkit.v1_19_R2.CraftServer;
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_19_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_19_R2.scoreboard.CraftScoreboard;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
@@ -61,20 +57,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler {
return (ArmorStand) new MEGEntity(loc).getBukkitEntity();
}
@Override
public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) {
HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getEntity().getLocation());
ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType);
invisibleArmorstand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item));
((CraftWorld) user.getEntity().getWorld()).getHandle().addFreshEntity(invisibleArmorstand, CreatureSpawnEvent.SpawnReason.CUSTOM);
MessagesUtil.sendDebugMessages("spawnBackpack NMS");
return invisibleArmorstand.getBukkitLivingEntity();
}
@Override
public org.bukkit.entity.Entity spawnDisplayEntity(Location location, String text) {
return null;

View File

@@ -1,24 +0,0 @@
package com.hibiscusmc.hmccosmetics.nms.v1_19_R3;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.Level;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_19_R3.CraftWorld;
public class HMCArmorStand extends ArmorStand {
public HMCArmorStand(Level world, double x, double y, double z) {
super(world, x, y, z);
}
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);
setInvulnerable(true);
setMarker(true);
setSilent(true);
getBukkitLivingEntity().setCollidable(false);
persist = false;
}
}

View File

@@ -1,6 +1,5 @@
package com.hibiscusmc.hmccosmetics.nms.v1_19_R3;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBackpackType;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBalloonType;
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
import com.hibiscusmc.hmccosmetics.user.manager.UserBalloonManager;
@@ -64,20 +63,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler {
return (ArmorStand) new MEGEntity(loc).getBukkitEntity();
}
@Override
public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) {
HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getEntity().getLocation());
ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType);
invisibleArmorstand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item));
((CraftWorld) user.getEntity().getWorld()).getHandle().addFreshEntity(invisibleArmorstand, CreatureSpawnEvent.SpawnReason.CUSTOM);
MessagesUtil.sendDebugMessages("spawnBackpack NMS");
return invisibleArmorstand.getBukkitLivingEntity();
}
@Override
public org.bukkit.entity.Entity spawnDisplayEntity(Location location, String text) {
Display.TextDisplay entity = new Display.TextDisplay(net.minecraft.world.entity.EntityType.TEXT_DISPLAY, ((CraftWorld) location.getWorld()).getHandle());

View File

@@ -1,24 +0,0 @@
package com.hibiscusmc.hmccosmetics.nms.v1_20_R1;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.Level;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
public class HMCArmorStand extends ArmorStand {
public HMCArmorStand(Level world, double x, double y, double z) {
super(world, x, y, z);
}
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);
setInvulnerable(true);
setMarker(true);
setSilent(true);
getBukkitLivingEntity().setCollidable(false);
persist = false;
}
}

View File

@@ -1,6 +1,5 @@
package com.hibiscusmc.hmccosmetics.nms.v1_20_R1;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBackpackType;
import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBalloonType;
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
import com.hibiscusmc.hmccosmetics.user.manager.UserBalloonManager;
@@ -63,22 +62,6 @@ public class NMSHandler implements com.hibiscusmc.hmccosmetics.nms.NMSHandler {
return (ArmorStand) new MEGEntity(loc).getBukkitEntity();
}
@Override
public org.bukkit.entity.Entity spawnBackpack(CosmeticUser user, CosmeticBackpackType cosmeticBackpackType) {
HMCArmorStand invisibleArmorstand = new HMCArmorStand(user.getEntity().getLocation());
ItemStack item = user.getUserCosmeticItem(cosmeticBackpackType);
invisibleArmorstand.setItemSlot(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(item));
((CraftWorld) user.getEntity().getWorld()).getHandle().addFreshEntity(invisibleArmorstand, CreatureSpawnEvent.SpawnReason.CUSTOM);
MessagesUtil.sendDebugMessages("spawnBackpack NMS");
return invisibleArmorstand.getBukkitLivingEntity();
//PacketManager.armorStandMetaPacket(invisibleArmorstand.getBukkitEntity(), sentTo);
//PacketManager.ridingMountPacket(player.getEntityId(), invisibleArmorstand.getId(), sentTo);
}
@Override
public org.bukkit.entity.Entity spawnDisplayEntity(Location location, String text) {
Display.TextDisplay entity = new Display.TextDisplay(net.minecraft.world.entity.EntityType.TEXT_DISPLAY, ((CraftWorld) location.getWorld()).getHandle());