Package cpw.mods.fml.common.registry.EntityRegistry

Examples of cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration


    if(entityClass == null)
    {
      return null;
    }
   
    EntityRegistration er = EntityRegistry.instance().lookupModSpawn(entityClass, true);
    if(er != null && er.getContainer() == TwilightForest.twilightForestContainer)
    {
      return (EntityEggInfo)TwilightForest.entityEggs.get(er.getModEntityId());
    }
    return null;
  }
View Full Code Here


        embeddedChannel.writeOutbound(new FMLMessage.EntityAdjustMessage(entity, serverX, serverY, serverZ));
    }

    public static Packet getEntitySpawningPacket(Entity entity)
    {
        EntityRegistration er = EntityRegistry.instance().lookupModSpawn(entity.getClass(), false);
        if (er == null)
        {
            return null;
        }
        if (er.usesVanillaSpawning())
        {
            return null;
        }

        return channelPair.get(Side.SERVER).generatePacketFrom(new FMLMessage.EntitySpawnMessage(er, entity, er.getContainer()));
    }
View Full Code Here

    }

    private void spawnEntity(FMLMessage.EntitySpawnMessage spawnMsg)
    {
        ModContainer mc = Loader.instance().getIndexedModList().get(spawnMsg.modId);
        EntityRegistration er = EntityRegistry.instance().lookupModSpawn(mc, spawnMsg.modEntityTypeId);
        WorldClient wc = FMLClientHandler.instance().getWorldClient();
        Class<? extends Entity> cls = er.getEntityClass();
        try
        {
            Entity entity;
            if (er.hasCustomSpawning())
            {
                entity = er.doCustomSpawning(spawnMsg);
            } else
            {
                entity = (Entity) (cls.getConstructor(World.class).newInstance(wc));

                int offset = spawnMsg.entityId - entity.getEntityId();
View Full Code Here

TOP

Related Classes of cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.