Codota Logo
DimensionManager
Code IndexAdd Codota to your IDE (free)

How to use
DimensionManager
in
net.minecraftforge.common

Best Java code snippets using net.minecraftforge.common.DimensionManager (Showing top 20 results out of 369)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: AppliedEnergistics/Applied-Energistics-2

@SubscribeEvent
public void attachSpatialDimensionManager( AttachCapabilitiesEvent<World> event )
{
  if( AEConfig.instance()
      .isFeatureEnabled( AEFeature.SPATIAL_IO ) && event.getObject() == DimensionManager.getWorld( AEConfig.instance().getStorageDimensionID() ) )
  {
    event.addCapability( new ResourceLocation( "appliedenergistics2:spatial_dimension_manager" ), new SpatialDimensionManager( event.getObject() ) );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

/**
 * Requires to start up from external from here
 *
 * drawback of the singleton build style
 *
 * @param server
 */
public static void onServerAboutToStart( MinecraftServer server )
{
  File worldDirectory = DimensionManager.getCurrentSaveRootDirectory();
  if( worldDirectory == null )
  {
    worldDirectory = server.getActiveAnvilConverter().getSaveLoader( server.getFolderName(), false ).getWorldDirectory();
  }
  final WorldData newInstance = new WorldData( worldDirectory );
  instance = newInstance;
  newInstance.onServerStarting();
}
origin: jabelar/ExampleMod-1.12

/**
 * Register dimensions.
 */
public static final void registerDimensions()
{
  DimensionManager.registerDimension(CLOUD_DIM_ID, CLOUD_DIM_TYPE);
}

origin: AppliedEnergistics/Applied-Energistics-2

@Override
public ISpatialDimension getSpatialDimension()
{
  final int id = AppEng.instance().getStorageDimensionID();
  World w = DimensionManager.getWorld( id );
  if( w == null )
  {
    DimensionManager.initDimension( id );
    w = DimensionManager.getWorld( id );
  }
  if( w != null && w.hasCapability( Capabilities.SPATIAL_DIMENSION, null ) )
  {
    return w.getCapability( Capabilities.SPATIAL_DIMENSION, null );
  }
  return null;
}
origin: AppliedEnergistics/Applied-Energistics-2

  config.setStorageDimensionID( DimensionManager.getNextFreeDimId() );
  config.save();
DimensionManager.registerDimension( this.storageDimensionID, this.storageDimensionType );
origin: SleepyTrousers/EnderIO

public static @Nonnull String getDimenionName(int dim) {
 if (!DimensionManager.isDimensionRegistered(dim)) {
  return Integer.toString(dim);
 }
 DimensionType type = DimensionManager.getProviderType(dim);
 if (type == null) {
  return Integer.toString(dim);
 }
 String name = type.getName();
 int[] dims = DimensionManager.getDimensions(type);
 if (dims != null && dims.length > 1) {
  name += " " + dim;
 }
 return name;
}
origin: RS485/LogisticsPipes

public static void connectToPipe(ItemStack stack, PipeItemsRemoteOrdererLogistics pipe) {
  stack.setTagCompound(new NBTTagCompound());
  stack.getTagCompound().setInteger("connectedPipe-x", pipe.getX());
  stack.getTagCompound().setInteger("connectedPipe-y", pipe.getY());
  stack.getTagCompound().setInteger("connectedPipe-z", pipe.getZ());
  int dimension = 0;
  for (Integer dim : DimensionManager.getIDs()) {
    if (pipe.getWorld().equals(DimensionManager.getWorld(dim.intValue()))) {
      dimension = dim.intValue();
      break;
    }
  }
  stack.getTagCompound().setInteger("connectedPipe-world-dim", dimension);
}
origin: jabelar/ExampleMod-1.12

@Nullable
private static Integer findFreeDimensionID()
{
  for (int i=2; i<Integer.MAX_VALUE; i++)
  {
    if (!DimensionManager.isDimensionRegistered(i))
    {
      // DEBUG
      System.out.println("Found free dimension ID = "+i);
      return i;
    }
  }
  
  // DEBUG
  System.out.println("ERROR: Could not find free dimension ID");
  return null;
}
origin: PenguinSquad/Harvest-Festival

public static void preInit() {
  DimensionType seasons = DimensionType.register("seasons", "seasons", OVERWORLD_ID, HFWorldProvider.class, true);
  DimensionManager.unregisterDimension(0);
  DimensionManager.registerDimension(0, seasons);
  HFApi.calendar.registerSeasonProvider(1, HIDDEN);
  HFApi.calendar.registerSeasonProvider(-1, HIDDEN);
}
origin: AntiqueAtlasTeam/AntiqueAtlas

public StructureWatcherGeneric(String datFileName, int dimension, MarkerType marker, String label) {
  this(datFileName, DimensionManager.getProviderType(dimension), marker, label);
}
origin: SquidDev-CC/plethora

@Nullable
public World getWorld(MinecraftServer server) {
  World world = this.world.get();
  if (world == null && DimensionManager.isDimensionRegistered(dimension)) {
    this.world = new WeakReference<>(world = server.getWorld(dimension));
  }
  return world;
}
origin: WayofTime/BloodMagic

@Nonnull
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
  if (!config.getConfig(Constants.Compat.WAILA_CONFIG_TELEPOSER))
    return currenttip;
  if (accessor.getNBTData().hasKey("focus")) {
    NBTTagCompound focusData = accessor.getNBTData().getCompoundTag("focus");
    BlockPos boundPos = NBTUtil.getPosFromTag(focusData.getCompoundTag("pos"));
    int boundDim = focusData.getInteger("dim");
    String dimName = WordUtils.capitalizeFully(DimensionManager.getProviderType(boundDim).getName().replace("_", " "));
    currenttip.add(TextHelper.localizeEffect("tooltip.bloodmagic.telepositionFocus.bound", dimName, boundPos.getX(), boundPos.getY(), boundPos.getZ()));
  }
  return currenttip;
}
origin: OpenMods/OpenModsLib

@Override
public World getServerWorld(int id) {
  return DimensionManager.getWorld(id);
}
origin: RS485/LogisticsPipes

public static File getLPFolder() {
  return new File(DimensionManager.getCurrentSaveRootDirectory(), "LogisticsPipes");
}
origin: McJtyMods/ModTutorials

private static void registerDimensions() {
  DimensionManager.registerDimension(Config.dimensionId, testDimensionType);
}
origin: FTBTeam/FTB-Utilities

@Nullable
public ForgeChunkManager.Ticket requestTicket(MinecraftServer server, TicketKey key)
{
  ForgeChunkManager.Ticket ticket = ticketMap.get(key);
  if (ticket == null && DimensionManager.isDimensionRegistered(key.dimension))
  {
    WorldServer worldServer = server.getWorld(key.dimension);
    ticket = ForgeChunkManager.requestTicket(FTBUtilities.INST, worldServer, ForgeChunkManager.Type.NORMAL);
    if (ticket != null)
    {
      ticketMap.put(key, ticket);
      ticket.getModData().setString("Team", key.teamId);
    }
  }
  return ticket;
}
origin: OpenMods/OpenModsLib

@Override
public World getServerWorld(int id) {
  return DimensionManager.getWorld(id);
}
origin: SleepyTrousers/EnderCore

protected @Nonnull File getSaveFile() {
 return new File(DimensionManager.getCurrentSaveRootDirectory(), ident + ".json");
}
origin: McJtyMods/LostCities

public static void init() {
  worldType = new LostWorldType();
  if (LostCities.biomesoplenty) {
    worldTypeBOP = new LostWorldTypeBOP();
  }
  for (String worldtype : LostCityConfiguration.ADAPTING_WORLDTYPES) {
    worldTypeAdapterList.add(new LostWorldTypeAdapter(worldtype));
  }
  if (LostCityConfiguration.DIMENSION_ID != -1) {
    lostDimensionType = DimensionType.register(LostCities.MODID, "_lost", LostCityConfiguration.DIMENSION_ID, LostWorldProvider.class, false);
    DimensionManager.registerDimension(LostCityConfiguration.DIMENSION_ID, lostDimensionType);
    dimensionProfileMap.put(LostCityConfiguration.DIMENSION_ID, LostCityConfiguration.DIMENSION_PROFILE);
  }
  for (String dimInfo : LostCityConfiguration.ADDITIONAL_DIMENSIONS) {
    String[] split = StringUtils.split(dimInfo, ':');
    int id = Integer.parseInt(split[0]);
    String profile = split[1];
    if (lostDimensionType == null) {
      lostDimensionType = DimensionType.register(LostCities.MODID, "_lost", id, LostWorldProvider.class, false);
    }
    DimensionManager.registerDimension(id, lostDimensionType);
    dimensionProfileMap.put(id, profile);
  }
  MapGenStructureIO.registerStructure(LostWoodlandMansion.Start.class, "LostMansion");
}
origin: CyclopsMC/IntegratedDynamics

  @Override
  public void fromNBT(NBTTagCompound tag) {
    NBTTagList list = tag.getTagList("list", MinecraftHelpers.NBTTag_Types.NBTTagCompound.ordinal());

    for(int i = 0; i < list.tagCount(); i++) {
      NBTTagCompound elementTag = list.getCompoundTagAt(i);
      int dimensionId = elementTag.getInteger("dimension");
      BlockPos pos = BlockPos.fromLong(elementTag.getLong("pos"));
      EnumFacing side = null;
      if (elementTag.hasKey("side", Constants.NBT.TAG_INT)) {
        side = EnumFacing.VALUES[elementTag.getInteger("side")];
      }

      if(!net.minecraftforge.common.DimensionManager.isDimensionRegistered(dimensionId)) {
        IntegratedDynamics.clog(Level.WARN, String.format("Skipped loading part from a network at the " +
            "invalid dimension id %s.", dimensionId));
      } else {
        World world = FMLCommonHandler.instance().getMinecraftServerInstance().getWorld(dimensionId);
        IPathElement pathElement = TileHelpers.getCapability(world, pos, side, PathElementConfig.CAPABILITY);
        if(pathElement == null) {
          IntegratedDynamics.clog(Level.WARN, String.format("Skipped loading part from a network at " +
              "position %s in world %s because it has no valid path element.", pos, dimensionId));
        } else {
          elements.add(SidedPathElement.of(pathElement, side));
        }
      }
    }
  }
}
net.minecraftforge.commonDimensionManager

Most used methods

  • getWorld
  • getCurrentSaveRootDirectory
  • registerDimension
  • isDimensionRegistered
  • getProviderType
  • getIDs
  • getWorlds
  • getDimensions
  • getNextFreeDimId
  • getProvider
  • initDimension
  • setWorld
  • initDimension,
  • setWorld,
  • unregisterDimension

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now