Skip to content

Commit

Permalink
Deduplicate terraforming options
Browse files Browse the repository at this point in the history
  • Loading branch information
voidsong-dragonfly committed Mar 29, 2021
1 parent 1b96ad8 commit 2e68c84
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ public static void loadPreInit()
arConfig.laserDrillPlanet = config.get(Configuration.CATEGORY_GENERAL, "laserDrillPlanet", false, "If true the orbital laser will actually mine blocks on the planet below").getBoolean();
String str[] = config.getStringList("spaceLaserDimIdBlackList", Configuration.CATEGORY_GENERAL, new String[] {}, "Laser drill will not mine these dimension");
arConfig.enableTerraforming = config.get(Configuration.CATEGORY_GENERAL, "EnableTerraforming", true,"Enables terraforming items and blocks").getBoolean();
arConfig.allowTerraforming = config.get(Configuration.CATEGORY_GENERAL, "allowTerraforming", false, "EXPERIMENTAL: If set to true allows contruction and usage of the terraformer. This is known to cause strange world generation after successful terraform").getBoolean();
arConfig.terraformingBlockSpeed = config.get(Configuration.CATEGORY_GENERAL, "biomeUpdateSpeed", 1, "How many blocks have the biome changed per tick. Large numbers can slow the server down", Integer.MAX_VALUE, 1).getInt();
arConfig.terraformSpeed = config.get(Configuration.CATEGORY_GENERAL, "terraformMult", 1f, "Multplier for atmosphere change speed").getDouble();
arConfig.terraformPlanetSpeed = config.get(Configuration.CATEGORY_GENERAL, "terraformBlockPerTick", 1, "Max number of blocks allowed to be changed per tick").getInt();
Expand Down Expand Up @@ -991,9 +990,6 @@ public static void loadPostInit()
@ConfigProperty
public double gasCollectionMult;

@ConfigProperty
public boolean allowTerraforming;

@ConfigProperty
public int terraformingBlockSpeed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public void fogColor(FogColors event) {

@SubscribeEvent
public void serverTickEvent(TickEvent.WorldTickEvent event) {
if(zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().allowTerraforming && event.world.provider.getClass() == WorldProviderPlanet.class) {
if(ARConfiguration.getCurrentConfig().enableTerraforming && event.world.provider.getClass() == WorldProviderPlanet.class) {

if(DimensionManager.getInstance().getDimensionProperties(event.world.provider.getDimension()).isTerraformed()) {
Collection<Chunk> list = ((WorldServer)event.world).getChunkProvider().getLoadedChunks();
Expand Down Expand Up @@ -500,7 +500,7 @@ public void serverTickEvent(TickEvent.WorldTickEvent event) {

@SubscribeEvent
public void chunkLoadEvent(PopulateChunkEvent.Post event) {
if(zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().allowTerraforming && event.getWorld().provider.getClass() == WorldProviderPlanet.class) {
if(zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().enableTerraforming && event.getWorld().provider.getClass() == WorldProviderPlanet.class) {

if(DimensionManager.getInstance().getDimensionProperties(event.getWorld().provider.getDimension()).isTerraformed()) {
Chunk chunk = event.getWorld().getChunkFromChunkCoords(event.getChunkX(), event.getChunkZ());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ protected void playMachineSound(SoundEvent event) {

@Override
public boolean isRunning() {
boolean bool = getMachineEnabled() && super.isRunning() && zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().allowTerraforming;
boolean bool = getMachineEnabled() && super.isRunning() && zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().enableTerraforming;

if(!bool)
currentTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public void populate(int x, int z)


//If a planet is terraformed chenge upper blocks
if(zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().allowTerraforming && worldObj.provider.getClass() == WorldProviderPlanet.class) {
if(zmaster587.advancedRocketry.api.ARConfiguration.getCurrentConfig().enableTerraforming && worldObj.provider.getClass() == WorldProviderPlanet.class) {

if(DimensionManager.getInstance().getDimensionProperties(worldObj.provider.getDimension()).isTerraformed()) {
Chunk chunk = worldObj.getChunkFromChunkCoords(x, z);
Expand Down

0 comments on commit 2e68c84

Please sign in to comment.