当前位置: 首页>>代码示例>>Java>>正文


Java GalacticraftRegistry.getTeleportTypeForDimension方法代码示例

本文整理汇总了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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:30,代码来源:WorldUtil.java

示例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;
}
 
开发者ID:katzenpapst,项目名称:amunra,代码行数:32,代码来源:ShuttleTeleportHelper.java

示例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;
/*     */   }
 
开发者ID:Nathor40000,项目名称:Connection,代码行数:41,代码来源:WorldUtil.java


注:本文中的micdoodle8.mods.galacticraft.api.GalacticraftRegistry.getTeleportTypeForDimension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。