Refactor teleposers. Fix bug where the player entity duplicates when teleporting between dimensions, which caused same-dimension teleportation to make players teleport to the wrong place. Fix misplaced bounding box for searching for entities and simplified bounding box creation. Fix problem with the cooldown for teleporting between dimensions. Prevent players from teleposing to the Spirit World from Witchery because it softlocks the player until relogged.

This commit is contained in:
koolkrafter5 committed 2025-06-28 19:29:10 -04:00
1 parent 8a4711b383
commit 333fad3536
6 files changed
+346 -447

No files matched your search

@@ -133,25 +133,26 @@ public class EnergyItems extends Item implements IBindable {
}
public static boolean canSyphonInContainer(ItemStack ist, int damageToBeDone) {
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) {
String ownerName = ist.getTagCompound().getString("ownerName");
if (MinecraftServer.getServer() == null) {
return false;
}
World world = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
return data.currentEssence >= damageToBeDone;
if (!(ist.getItem() instanceof IBindable)) {
return false;
}
return false;
String ownerName = IBindable.getOwnerName(ist);
MinecraftServer server = MinecraftServer.getServer();
if (ownerName.isEmpty() || server == null) {
return false;
}
World world = server.worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
if (data == null) {
data = new LifeEssenceNetwork(ownerName);
world.setItemData(ownerName, data);
}
return data.currentEssence >= damageToBeDone;
}
public static void hurtPlayer(EntityPlayer user, int energySyphoned) {