Difference between revisions of "Tutorials/Space Station for Server Admins"

From Galacticraft Wiki
Jump to: navigation, search
Line 54: Line 54:
 
===Keeping individual dimensions loaded===
 
===Keeping individual dimensions loaded===
  
Using the [[/gckeeploaded command|https://wiki.micdoodle8.com/wiki/Commands#gckeeploaded]], you can set Galacticraft to keep specific dimensions statically loaded, even if other Galacticraft dimensions are not statically loaded.  For example, you might configure your bukkit.yml to have dynamically loaded space stations, but there is one special space station which you want all of your players to be able to access all the time (maybe you have a teleport set up to take any player there from spawn?).
+
Using the [[https://wiki.micdoodle8.com/wiki/Commands#gckeeploaded|/gckeeploaded command]], you can set Galacticraft to keep specific dimensions statically loaded, even if other Galacticraft dimensions are not statically loaded.  For example, you might configure your bukkit.yml to have dynamically loaded space stations, but there is one special space station which you want all of your players to be able to access all the time (maybe you have a teleport set up to take any player there from spawn?).
  
 
===Making dimensions available to other mods using core.conf===
 
===Making dimensions available to other mods using core.conf===

Revision as of 14:24, 26 February 2017

For Linux servers running OpenJDK

Several Linux distributions include OpenJDK for running Java code, instead of the Java Runtime (JRE) from Sun / Oracle. Unfortunately OpenJDK currently has a bug in its JPEG library. Galacticraft makes use of the standard JPEG library to encode map images sent from the server to the client (e.g. when you fly in a rocket or uses a Display Screen). So on a server running on Linux using OpenJDK, early versions of Galacticraft 3 will crash at that point, like this:

cpw.mods.fml.common.LoaderException: java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageWriter.initWriterIDs(Ljava/lang/Class;Ljava/lang/Class;)V

Currently the only workaround is for the server to use the Sun / Oracle JRE instead. [Further discussion of this issue]

Newer versions of Galacticraft (since 3.0.12.352) do not crash but instead disable the map image transmission functionality on the server, with a message in the startup log highlighting the OpenJDK issue.

Guide to Galacticraft dimensions and commands

Originally from: http://forum.micdoodle8.com/index.php?threads/galacticraft-space-station-dimensions-a-thread-for-server-admins.4044

Recent Galacticraft versions (since Galacticraft 2 version 1001, and all versions of Galacticraft 3) offer server admins the option to set some "static dimensions" in the config. This is intended to help with some of the tougher-to-solve dimension issues with other mods and Bukkit plugins.

It does not harm your server to have the Galacticraft dimensions "loaded" all the time - this does not make a server lag. Just because a dimension is loaded, doesn't mean the map chunks in that dimension are loaded (the map chunks should not be loaded if there are no players there). Large numbers of loaded chunks can make a server slow down or lag, especially if those are busy chunks with lots of machinery or other TileEntities, or lots of animals or other moving Entities. But usually, chunks will only load around the locations where your players are at. (Chunk loaders are obviously an exception!)

By default on Galacticraft, space stations are dynamically loaded dimensions - the dimension only exists on the server when a player is actually in the space station. This is because if you have a lot of players making space stations, you will have many space station dimensions, maybe 100 or more on a large server. Some other mods, and Bukkit plugins can't figure out how to access the unloaded dimensions (including basic Bukkit plugins like Factions /f home and Essentials /home or /tpa commands ... but strangely /back seems to be ok with it).

There is a Bukkit / MCPC+ config option to control which of the Galacticraft dimensions are kept loaded all the time, so that teleports etc will always work. Your bukkit.yml should contain something like this: Older versions (1.5.2):

world-settings:
  default:
  keeploaded-environment-normal: true
  keeploaded-environment-nether: true
  keeploaded-environment-the_end: true
  keeploaded-environment-twilightforest: false
  keeploaded-environment-gccorespacestation: true
  keeploaded-environment-gcmoon: true

Newer versions (1.6.4 and later):

world-environment-settings:
  normal:
    keep-world-loaded: true
  nether:
    keep-world-loaded: true
  the_end:
    keep-world-loaded: false
  gccorespacestation:
    keep-world-loaded: false
  gcmoon:
    keep-world-loaded: false
    enabled: true
  gcmars:
    keep-world-loaded: false
    enabled: true

Note, like every .yml file, you must be super careful to use spaces and not TAB characters for your indents. But I guess all server admins know that.

Note also that if "keep-world-loaded" is set to false, then it doesn't keep the dimension in memory all the time, but you can still set "enabled" to true which should allow the dimension at least to be registered so that teleportation works. (See more notes on teleportation in my post below - there is a Galacticraft respawn setting which is also relevant.)

Keeping individual dimensions loaded

Using the [command], you can set Galacticraft to keep specific dimensions statically loaded, even if other Galacticraft dimensions are not statically loaded. For example, you might configure your bukkit.yml to have dynamically loaded space stations, but there is one special space station which you want all of your players to be able to access all the time (maybe you have a teleport set up to take any player there from spawn?).

Making dimensions available to other mods using core.conf

If it's mods not plugins which are the issue, or your server doesn't use Bukkit or you don't want to keep all the space stations loaded but only some of them, another option is to register the space stations as "static dimensions" in Galacticraft's config. Either edit the core.conf file, or the Galacticraft command /gckeeploaded lets admins specify a dimension number which you want to add to the static list, from within the game.

By default the core.conf should contain this:

####################
# dimensions
####################
dimensions {
# IDs to load at startup, and keep loaded until server stops. Can be added via /gckeeploaded
I:"Static Loaded Dimensions" <
>
I:idDimensionOverworldOrbit=-27
# Static Space Station ID
I:idDimensionOverworldOrbitStatic=-26
}

You can add static dimensions to the list between < and >, each dimension number on its own line. This is useful if you have other mods or server plugins which need to "know" about the Galacticraft dimensions at server start. For example, if using Galacticraft with Multiverse, you should add the dimensions -28, -29, -30 in there (each on its own line), and maybe also any permanent space stations.

Disabling space stations

Galacticraft 3, and versions of Galacticraft 2 since 2.0.13.1068, also offer the option for server owners to disable space station creation completely.

To keep some space station fun but with maximum dimension stability, one idea could be to whitelist the server, have your server staff create one or two "public" space stations, set those as static dimensions, then disable space station creation.

(Players who want to make their own space station can, I guess, build out to another spot in the "public" space station dimension and start a space station there, same as they would if they want to build far out in The End. Or if the player can't be bothered to build out, admins can create a building spot for them anywhere in space using the /up 1 trick.)

Get your admins into space

A useful command to know: admins can use /dimensiontp MYNAME as a quick way to get to the space stations or other planets.

The command can also be used to help out players, for example if they made a rocket then they lost it somehow on a server rollback. The command takes the player to the relevant dimension and gives them a parachest / lander with a Tier 1 rocket inside it.

(In Galacticraft 3, the name can be omitted in which case /dimensiontp will teleport the command user.)

See also: Commands#Permission_nodes

Bungeecord

In Galacticraft 2 if you have multiple Galacticraft servers linked with BungeeCord, you may want to take a look at this thread: http://forum.micdoodle8.com/index.php?threads/possible-to-stop-space-station-creation.4017/ The issues described there should be fixed in Galacticraft 2 builds 2.0.13.1067 and later, though note that those must be installed client-side so you may need to ensure that all players on your server have that build. It would definitely be wise for 1.6.4 modpacks to be based on that build or later.

In Galacticraft 3 early builds operation of a Galacticraft server with BungeeCord was not possible, players were unable to login correctly if they were in a space station or any other Galacticraft dimension. This is due to BungeeCord apparently having decided to block Forge Custom packets at the login stage. This issue is fixed as from GC 3.0.10.298 and all later builds. [Further discussion for any network coders interested in the details]

Space station numeric limit

Galacticraft creates space stations with dimension IDs starting at 2, 3, 4 ... skipping any dimension ID which is in use by another mod.

For Forge versions prior to 1.7.10-1340, there was a bug / unimplemented feature in Forge so that the Minecraft client could crash if a player attempted to log in to a dimension number higher than 127. The crash looked like this, where XXX can be any number probably between -128 and -1:

java.lang.IllegalArgumentException: Could not get provider type for dimension XXX, does not exist
        at net.minecraftforge.common.DimensionManager.getProviderType(DimensionManager.java:148)
        at net.minecraftforge.common.DimensionManager.createProviderFor(DimensionManager.java:302)

In theory it's also possible a player logging in to space station with an even higher ID would have no crash but would log in to the wrong dimension - basically, subtract 256 from the intended dimension ID and see what you get, for example 226 would take you to the Asteroids dimension.

Two ways to fix this:

  • update your Forge to version 1340 or later - note client and server both need to update
  • if that's not possible for some reason, then delete any space stations with IDs higher than 127 - see next section

Deleting a space station

To delete a space station from the server, you need the dimension number, and then you need to do three things:

1. As from GC build 3.0.12.411 and later' use the /ssnewowner command in-game to set any random name (not a real player) as the new owner of this dimension. This will free up the existing owner so he can build a new station in future.

2. While the server is offline, delete the DIMSPACESTATION_# folder from the /world folder

3. While the server is offline, remove the corresponding spacestation_#.dat from the main /world/data folder

(Before GC build 3.0.12.411, in place of the /ssnewowner command, you had to edit an NBT file like this: for the player who owned the space station (name is in the spacestation_#.dat file), edit the player .dat file and set "spaceStationDimensionID" to -1. NBTExplorer is the tool you should most likely use to edit the player .dat file.)

After deleting a space station, you must not renumber the dimensions of the other space stations, it is OK if there are gaps in the numbering.

(Note: not tested with other mods which do inter-dimensional teleports, for example, Waypoints, Enhanced Portals 2, or Mekanism. If those mods store teleport data some other place than in the DIMSPACESTATION_# folder then you might need to edit that mod data also, to delete teleports in the deleted dimension.)

Teleporting using Essentials

Another relevant config setting:

# By default, you will respawn on galacticraft dimensions if you die. If you set this to true, you will respawn back on earth.
  B:"Force Overworld Spawn"=false

If this is set to true, you will likely find that Bukkit teleportation (for example, /home /tp /warp - and even /back) does not work to take players to Galacticraft dimensions. The reason for the issue is that Essentials, which operates all those commands, makes use of the vanilla respawn code to do its teleporting. It's possible that different Bukkit plugins, or different teleport methods (for example mods like Enhanced Portals 2) will still work ok even if that respawn setting is set to true.

The intended effect is that setting this to true will prevent players from setting their bed home on Galacticraft dimensions - or more accurately, they can put a bed down and sleep in it, but it won't be the place they respawn at. It also prevents spawning at the default world spawn location in Galacticraft dimensions. It's there to help out players in single player who get "stuck" in a Galacticraft dimension, for example a player who flies to the Moon but doesn't have enough fuel to make it back again, or he forgot to bring a fuel loader. Set this config to true, and the player will be brought back to the Overworld next time he dies.

This setting is "false" by default. I'm not sure why you would ever want it "true" on a server unless you specifically want to prevent players from teleporting to space dimensions on your server (maybe you want to make it hard-mode for players so each one has to make his own rocket?)

Listing the space stations

Galacticraft does not currently offer any way for admins to list all the space station names and their dimension numbers, the only way is to make a list manually by looking in the /world/data folder and opening up each spacestation#.dat file using a tool like NBTExplorer, to see its name and which player created it. (A command for server admins to do this is added in the to-do list.)

Impt.png
Unless stated otherwise, all information contained on this wiki should be considered outdated and might not reflect in-game experiences