001/* 002 * Forge Mod Loader 003 * Copyright (c) 2012-2013 cpw. 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser Public License v2.1 006 * which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 008 * 009 * Contributors: 010 * cpw - implementation 011 */ 012 013package cpw.mods.fml.common.modloader; 014 015import java.util.concurrent.Callable; 016 017import net.minecraft.entity.Entity; 018 019import com.google.common.base.Function; 020 021import cpw.mods.fml.client.FMLClientHandler; 022import cpw.mods.fml.common.network.EntitySpawnPacket; 023import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; 024 025public class ModLoaderEntitySpawnCallback implements Function<EntitySpawnPacket, Entity> 026{ 027 028 private BaseModProxy mod; 029 private EntityRegistration registration; 030 private boolean isAnimal; 031 032 public ModLoaderEntitySpawnCallback(BaseModProxy mod, EntityRegistration er) 033 { 034 this.mod = mod; 035 this.registration = er; 036 } 037 038 @Override 039 public Entity apply(EntitySpawnPacket input) 040 { 041 return ModLoaderHelper.sidedHelper.spawnEntity(mod, input, registration); 042 } 043}