delete NBTTagCompound hallucination

This commit is contained in:
Alexdoru committed 2025-06-04 17:01:15 +02:00
1 parent 25ee628e7f
commit cc3ed57790
1 file changed
+4 -13
@@ -46,8 +46,6 @@ public class WirelessMagnet {
z + distance)); z + distance));
} }
@SuppressWarnings("unchecked")
public static boolean isConfigured(ItemStack wirelessTerm) { public static boolean isConfigured(ItemStack wirelessTerm) {
NBTTagCompound data = Platform.openNbtData(wirelessTerm); NBTTagCompound data = Platform.openNbtData(wirelessTerm);
return data.hasKey(modeKey); return data.hasKey(modeKey);
@@ -74,21 +72,14 @@ public class WirelessMagnet {
if (closestPlayer == null || closestPlayer != player) continue; if (closestPlayer == null || closestPlayer != player) continue;
} }
NBTTagCompound itemNBT = new NBTTagCompound(); if (itemToGet.func_145800_j() == null || !itemToGet.func_145800_j().equals(player.getCommandSenderName())) {
itemToGet.writeEntityToNBT(itemNBT);
if (itemToGet.func_145800_j() == null
|| !itemToGet.func_145800_j().equals(player.getCommandSenderName())) {
itemToGet.delayBeforeCanPickup = 0; itemToGet.delayBeforeCanPickup = 0;
} }
if (itemToGet.delayBeforeCanPickup <= 0) { if (itemToGet.delayBeforeCanPickup <= 0) {
itemNBT.setBoolean("attractable", true); itemToGet.motionX = 0;
itemToGet.readEntityFromNBT(itemNBT); itemToGet.motionY = 0;
} itemToGet.motionZ = 0;
if (itemNBT.getBoolean("attractable")) {
itemToGet.motionX = itemToGet.motionY = itemToGet.motionZ = 0;
itemToGet.setPosition( itemToGet.setPosition(
player.posX - 0.2 + (world.rand.nextDouble() * 0.4), player.posX - 0.2 + (world.rand.nextDouble() * 0.4),
player.posY - 0.6, player.posY - 0.6,