From 7ba4e51a22bf31dc544a51500d7fe50356dc7ace Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 8 Aug 2017 22:25:22 +1000 Subject: [PATCH] Various minor fix parallel threads for sponge remove static modifier for some fields --- .../main/java/com/boydti/fawe/config/Settings.java | 14 ++++++++------ .../main/java/com/boydti/fawe/forge/ForgeMain.java | 5 +++++ .../main/java/com/boydti/fawe/forge/ForgeMain.java | 5 +++++ .../main/java/com/boydti/fawe/forge/ForgeMain.java | 5 +++++ .../main/java/com/boydti/fawe/forge/ForgeMain.java | 5 +++++ .../main/java/com/boydti/fawe/forge/ForgeMain.java | 5 +++++ .../main/java/com/boydti/fawe/forge/ForgeMain.java | 5 +++++ 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/config/Settings.java b/core/src/main/java/com/boydti/fawe/config/Settings.java index 97553bef..7e825f84 100644 --- a/core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/core/src/main/java/com/boydti/fawe/config/Settings.java @@ -123,6 +123,12 @@ public class Settings extends Config { " - Having an artificial delay will use more CPU/Memory", }) public int SPEED_REDUCTION = 0; + @Comment({ + "Place chunks instead of individual blocks:", + " - Disabling this will negatively impact performance", + " - Only disable this for compatibility or cinematic placement", + }) + public boolean FAST_PLACEMENT = true; @Comment({ "Should WorldEdit use inventory?", "0 = No inventory usage (creative)", @@ -130,10 +136,6 @@ public class Settings extends Config { "2 = Inventory for placing (survival)", }) public int INVENTORY_MODE = 0; - @Comment({ - "Place chunks instead of individual blocks" - }) - public boolean FAST_PLACEMENT = true; @Comment({ "Should large edits require confirmation (>16384 chunks)", }) @@ -271,7 +273,7 @@ public class Settings extends Config { " - E.g. A plugin creates an EditSession but never does anything with it", " - This only applies to plugins improperly using WorldEdit's legacy API" }) - public static int DISCARD_AFTER_MS = 60000; + public int DISCARD_AFTER_MS = 60000; public static class PROGRESS { @Comment({"Display constant titles about the progress of a user's edit", @@ -377,7 +379,7 @@ public class Settings extends Config { " - 1 = Optimal (Relight changed light sources and changed blocks)", " - 2 = All (Slowly relight every blocks)" }) - public static int MODE = 1; + public int MODE = 1; } public void reload(File file) { diff --git a/forge110/src/main/java/com/boydti/fawe/forge/ForgeMain.java b/forge110/src/main/java/com/boydti/fawe/forge/ForgeMain.java index 8333bf72..7f1d4b2a 100644 --- a/forge110/src/main/java/com/boydti/fawe/forge/ForgeMain.java +++ b/forge110/src/main/java/com/boydti/fawe/forge/ForgeMain.java @@ -1,6 +1,7 @@ package com.boydti.fawe.forge; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweCommand; import com.boydti.fawe.object.FawePlayer; import java.io.File; @@ -32,6 +33,10 @@ public class ForgeMain { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory); + try { + Class.forName("org.spongepowered.api.Sponge"); + Settings.IMP.QUEUE.PARALLEL_THREADS = 1; + } catch (Throwable ignore) {} } @Mod.EventHandler diff --git a/forge111/src/main/java/com/boydti/fawe/forge/ForgeMain.java b/forge111/src/main/java/com/boydti/fawe/forge/ForgeMain.java index a7eba924..a89d1ca7 100644 --- a/forge111/src/main/java/com/boydti/fawe/forge/ForgeMain.java +++ b/forge111/src/main/java/com/boydti/fawe/forge/ForgeMain.java @@ -1,6 +1,7 @@ package com.boydti.fawe.forge; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweCommand; import com.boydti.fawe.object.FawePlayer; import java.io.File; @@ -31,6 +32,10 @@ public class ForgeMain { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory); + try { + Class.forName("org.spongepowered.api.Sponge"); + Settings.IMP.QUEUE.PARALLEL_THREADS = 1; + } catch (Throwable ignore) {} } @Mod.EventHandler diff --git a/forge112/src/main/java/com/boydti/fawe/forge/ForgeMain.java b/forge112/src/main/java/com/boydti/fawe/forge/ForgeMain.java index a7eba924..a89d1ca7 100644 --- a/forge112/src/main/java/com/boydti/fawe/forge/ForgeMain.java +++ b/forge112/src/main/java/com/boydti/fawe/forge/ForgeMain.java @@ -1,6 +1,7 @@ package com.boydti.fawe.forge; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweCommand; import com.boydti.fawe.object.FawePlayer; import java.io.File; @@ -31,6 +32,10 @@ public class ForgeMain { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory); + try { + Class.forName("org.spongepowered.api.Sponge"); + Settings.IMP.QUEUE.PARALLEL_THREADS = 1; + } catch (Throwable ignore) {} } @Mod.EventHandler diff --git a/forge1710/src/main/java/com/boydti/fawe/forge/ForgeMain.java b/forge1710/src/main/java/com/boydti/fawe/forge/ForgeMain.java index 5feaf539..4ae7d7a9 100644 --- a/forge1710/src/main/java/com/boydti/fawe/forge/ForgeMain.java +++ b/forge1710/src/main/java/com/boydti/fawe/forge/ForgeMain.java @@ -1,6 +1,7 @@ package com.boydti.fawe.forge; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FawePlayer; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; @@ -31,6 +32,10 @@ public class ForgeMain { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory); + try { + Class.forName("org.spongepowered.api.Sponge"); + Settings.IMP.QUEUE.PARALLEL_THREADS = 1; + } catch (Throwable ignore) {} } @Mod.EventHandler diff --git a/forge189/src/main/java/com/boydti/fawe/forge/ForgeMain.java b/forge189/src/main/java/com/boydti/fawe/forge/ForgeMain.java index 8add5c57..91fff188 100644 --- a/forge189/src/main/java/com/boydti/fawe/forge/ForgeMain.java +++ b/forge189/src/main/java/com/boydti/fawe/forge/ForgeMain.java @@ -1,6 +1,7 @@ package com.boydti.fawe.forge; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FawePlayer; import java.io.File; import java.util.List; @@ -31,6 +32,10 @@ public class ForgeMain { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory); + try { + Class.forName("org.spongepowered.api.Sponge"); + Settings.IMP.QUEUE.PARALLEL_THREADS = 1; + } catch (Throwable ignore) {} } @Mod.EventHandler diff --git a/forge194/src/main/java/com/boydti/fawe/forge/ForgeMain.java b/forge194/src/main/java/com/boydti/fawe/forge/ForgeMain.java index 64d1353a..51968a9c 100644 --- a/forge194/src/main/java/com/boydti/fawe/forge/ForgeMain.java +++ b/forge194/src/main/java/com/boydti/fawe/forge/ForgeMain.java @@ -1,6 +1,7 @@ package com.boydti.fawe.forge; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FawePlayer; import java.io.File; import java.util.List; @@ -30,6 +31,10 @@ public class ForgeMain { MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory); + try { + Class.forName("org.spongepowered.api.Sponge"); + Settings.IMP.QUEUE.PARALLEL_THREADS = 1; + } catch (Throwable ignore) {} } @Mod.EventHandler