Keys are invincible.

This commit is contained in:
bconlon 2020-07-27 20:58:13 -07:00
parent 0373d17600
commit 7f945e9ed2

View file

@ -14,6 +14,7 @@ import com.legacy.aether.world.AetherData;
import com.legacy.aether.world.AetherWorldProvider;
import com.legacy.aether.world.TeleporterAether;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
@ -343,6 +344,19 @@ AetherEventHandler {
AetherNetwork.sendToAll(new PacketSendShouldCycle(providerAether.getShouldCycleCatchup()));
}
}
for (Object entity : event.world.loadedEntityList)
{
if (entity instanceof EntityItem)
{
EntityItem entityItem = (EntityItem) entity;
if (entityItem.getEntityItem().getItem() == ItemsAether.dungeon_key)
{
ObfuscationReflectionHelper.setPrivateValue(Entity.class, entityItem, true, "invulnerable", "field_83001_bt");
}
}
}
}
@SubscribeEvent