本文整理汇总了Java中micdoodle8.mods.galacticraft.api.GalacticraftRegistry.getTeleportTypeForDimension方法的典型用法代码示例。如果您正苦于以下问题:Java GalacticraftRegistry.getTeleportTypeForDimension方法的具体用法?Java GalacticraftRegistry.getTeleportTypeForDimension怎么用?Java GalacticraftRegistry.getTeleportTypeForDimension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类micdoodle8.mods.galacticraft.api.GalacticraftRegistry
的用法示例。
在下文中一共展示了GalacticraftRegistry.getTeleportTypeForDimension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transferEntityToDimension
import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; //导入方法依赖的package包/类
public static Entity transferEntityToDimension(Entity entity, int dimensionID, WorldServer world, boolean transferInv, EntityAutoRocket ridingRocket)
{
if (!world.isRemote)
{
//GalacticraftCore.packetPipeline.sendToAll(new PacketSimple(EnumSimplePacket.C_UPDATE_PLANETS_LIST, WorldUtil.getPlanetList()));
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer != null)
{
final WorldServer var6 = mcServer.worldServerForDimension(dimensionID);
if (var6 == null)
{
System.err.println("Cannot Transfer Entity to Dimension: Could not get World for Dimension " + dimensionID);
return null;
}
final ITeleportType type = GalacticraftRegistry.getTeleportTypeForDimension(var6.provider.getClass());
if (type != null)
{
return WorldUtil.teleportEntity(var6, entity, dimensionID, type, transferInv, ridingRocket);
}
}
}
return null;
}
示例2: transferEntityToDimension
import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; //导入方法依赖的package包/类
public static Entity transferEntityToDimension(Entity entity, int dimensionID, WorldServer world)
{
//boolean transferInv = true;
//EntityAutoRocket ridingRocket = null;
if (!world.isRemote)
{
//GalacticraftCore.packetPipeline.sendToAll(new PacketSimple(EnumSimplePacket.C_UPDATE_PLANETS_LIST, WorldUtil.getPlanetList()));
MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
if (mcServer != null)
{
final WorldServer targetWorld = world.provider.dimensionId==dimensionID ? world : mcServer.worldServerForDimension(dimensionID);
if (targetWorld == null)
{
System.err.println("Cannot Transfer Entity to Dimension: Could not get World for Dimension " + dimensionID);
return null;
}
final ITeleportType type = GalacticraftRegistry.getTeleportTypeForDimension(targetWorld.provider.getClass());
if (type != null)
{
return teleportEntity(targetWorld, entity, dimensionID, type);
}
}
}
return null;
}
示例3: transferEntityToDimension
import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; //导入方法依赖的package包/类
public static Entity transferEntityToDimension(Entity entity, int dimensionID, WorldServer world, boolean transferInv, EntityAutoRocket ridingRocket)
/* */ {
/* 523 */ if (!world.field_72995_K)
/* */ {
/* 525 */ MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
/* */
/* 527 */ if (server != null)
/* */ {
/* 529 */ ArrayList array = new ArrayList();
/* */
/* 531 */ for (Iterator i$ = registeredPlanets.iterator(); i$.hasNext(); ) { int i = ((Integer)i$.next()).intValue();
/* */
/* 533 */ array.add(Integer.valueOf(i));
/* */ }
/* */
/* 536 */ server.func_71203_ab().func_72384_a(GCCorePacketDimensionListPlanets.buildDimensionListPacket(array));
/* */ }
/* */
/* 539 */ MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();
/* */
/* 541 */ if (mcServer != null)
/* */ {
/* 543 */ WorldServer var6 = mcServer.func_71218_a(dimensionID);
/* */
/* 545 */ if (var6 == null)
/* */ {
/* 547 */ System.err.println("Cannot Transfer Entity to Dimension: Could not get World for Dimension " + dimensionID);
/* */ }
/* */
/* 550 */ ITeleportType type = GalacticraftRegistry.getTeleportTypeForDimension(var6.field_73011_w.getClass());
/* */
/* 552 */ if (type != null)
/* */ {
/* 554 */ return teleportEntity(var6, entity, dimensionID, type, transferInv, ridingRocket);
/* */ }
/* */ }
/* */ }
/* */
/* 559 */ return null;
/* */ }