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


Java DimensionManager.getNextFreeDimId方法代码示例

本文整理汇总了Java中net.minecraftforge.common.DimensionManager.getNextFreeDimId方法的典型用法代码示例。如果您正苦于以下问题:Java DimensionManager.getNextFreeDimId方法的具体用法?Java DimensionManager.getNextFreeDimId怎么用?Java DimensionManager.getNextFreeDimId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.DimensionManager的用法示例。


在下文中一共展示了DimensionManager.getNextFreeDimId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bindSpaceStationToNewDimension

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
public static SpaceStationWorldData bindSpaceStationToNewDimension(World world, EntityPlayerMP player, int homePlanetID)
{
    int dynamicProviderID = -1;
    int staticProviderID = -1;
    for (Satellite satellite : GalaxyRegistry.getRegisteredSatellites().values())
    {
        if (satellite.getParentPlanet().getDimensionID() == homePlanetID)
        {
            dynamicProviderID = satellite.getDimensionID();
            staticProviderID = satellite.getDimensionIdStatic();
        }
    }
    if (dynamicProviderID == -1 || staticProviderID == -1)
    {
        throw new RuntimeException("Space station being bound on bad provider IDs!");
    }
    int newID = DimensionManager.getNextFreeDimId();
    SpaceStationWorldData data = WorldUtil.createSpaceStation(world, newID, homePlanetID, dynamicProviderID, staticProviderID, player);
    dimNames.put(newID, "Space Station " + newID);
    GCPlayerStats stats = GCPlayerStats.get(player);
    stats.spaceStationDimensionData.put(homePlanetID, newID);
    GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_SPACESTATION_CLIENT_ID, new Object[] { WorldUtil.spaceStationDataToString(stats.spaceStationDimensionData) }), player);
    return data;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:WorldUtil.java

示例2: createDim

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
public static int createDim(DimData dimData) {
    int dimId = DimensionManager.getNextFreeDimId();
    DimensionType type = DimensionType.register("technicaldimensions", dimData.name, dimId, CustomWorldProvider.class, false);
    dimData.type = type;
    dimData.id = dimId;
    Random random = new Random();
    dimData.seed = random.nextLong();
    DimensionManager.registerDimension(dimId, type);
    dimDataHashMap.put(dimId, dimData);
    dimDataList.add(dimData);

    return dimId;
}
 
开发者ID:modmuss50,项目名称:TechnicalDimensions,代码行数:14,代码来源:ModDimensions.java

示例3: DungeonOrc

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
public static void		init()
{		
	Main.DIM_ID = DimensionManager.getNextFreeDimId();

	Main.DUNGEONS = new ArrayList<Dungeon>();
	
	Main.DUNGEONS.add(new DungeonOrc());
	Main.DUNGEONS.add(new DungeonGraveyard());

	Main.log("Initializing Dungeons...");
	Main.log("Dungeon loaded");
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:13,代码来源:Dungeon.java

示例4: onJoinWorld

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
@SubscribeEvent
public void onJoinWorld(EntityJoinWorldEvent event) {
	if (event.getEntity() instanceof EntityItem && !(event.getEntity() instanceof EntityItemMalgraTool)) {
		EntityItem entityItem = (EntityItem) event.getEntity();
		if (entityItem.getItem().getItem() == net.minecraft.init.Items.DIAMOND_PICKAXE) {
			event.setCanceled(true);
			ItemStack malgraPickaxe = new ItemStack(Items.malgraPickaxe);
			malgraPickaxe.setTagCompound(new NBTTagCompound());
			malgraPickaxe.getTagCompound().setInteger("malgra", ((MalgraTool)malgraPickaxe.getItem()).getMaxMalgra());

			EntityItemMalgraTool newEntity = new EntityItemMalgraTool(event.getWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, ((EntityItem) event.getEntity()).getItem(), malgraPickaxe);
			event.getWorld().spawnEntity(newEntity);
			NBTTagCompound nbt = new NBTTagCompound();
			event.getEntity().writeToNBTOptional(nbt);
			newEntity.readFromNBT(nbt);
		}
	}
	if (event.getEntity() instanceof EntityPlayerMP) {
		PacketDispatcher.sendTo(new SyncManaData(event.getEntity().getCapability(CapabilityMana.MANA, null)), (EntityPlayerMP) event.getEntity());
		PacketDispatcher.sendTo(new SyncResearchPoints(event.getEntity().getCapability(CapabilityResearchPoints.RESEARCHPOINTS, null)), (EntityPlayerMP) event.getEntity());
		PacketDispatcher.sendTo(new SyncResearchActivites(event.getEntity().getCapability(CapabilityResearchActivites.RESEARCHACTIVITIES,  null)), (EntityPlayerMP) event.getEntity());
           if(ResearchDimensions.get(event.getWorld()).researchDimIDs.get(event.getEntity().getUniqueID().toString()) == null) {
               int researchDimID = DimensionManager.getNextFreeDimId();

               DimensionType researchDim = DimensionType.register("research" + event.getEntity().getUniqueID().toString(), "", researchDimID, WorldProviderResearch.class, false);
               DimensionManager.registerDimension(researchDimID, researchDim);

			ResearchDimensions.get(event.getWorld()).researchDimIDs.put(event.getEntity().getUniqueID().toString(), researchDimID);
			ResearchDimensions.get(event.getWorld()).researchDimTypes.put(researchDimID, researchDim);

               Iterator it = ResearchDimensions.get(event.getWorld()).researchDimIDs.entrySet().iterator();
               while (it.hasNext()) {
                   Map.Entry pair = (Map.Entry)it.next();
                   if(FMLCommonHandler.instance().getSide() == Side.SERVER)
                   PacketDispatcher.sendTo(new SyncResearchDimensions((String)pair.getKey(), (Integer)pair.getValue()), (EntityPlayerMP) event.getEntity());
               }

			ResearchDimensions.get(event.getWorld()).markDirty();

           }
	}

}
 
开发者ID:Ohrm,项目名称:Malgra,代码行数:44,代码来源:MalgraEventHandler.java

示例5: init

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
public static void init() {
    darkVoidId = DimensionManager.getNextFreeDimId();
    darkVoidType = DimensionType.register("Dark Void", "_darkVoid", darkVoidId, WorldProviderDarkVoid.class, false);
    DimensionManager.registerDimension(darkVoidId, darkVoidType);
}
 
开发者ID:KodyJKing,项目名称:RandomToolKit,代码行数:6,代码来源:ModDimensions.java


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