From 712aab7c57e8fe5fbc5a8317bb7319c8b63f71f2 Mon Sep 17 00:00:00 2001 From: Prototik Date: Sun, 28 Jun 2015 00:29:43 +0700 Subject: [PATCH] Add option to allow nether portals in non overworld (close #58) --- patches/net/minecraft/block/BlockFire.java.patch | 7 +++++-- src/main/java/kcauldron/KCauldron.java | 3 ++- src/main/java/kcauldron/KCauldronConfig.java | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/patches/net/minecraft/block/BlockFire.java.patch b/patches/net/minecraft/block/BlockFire.java.patch index a25bf69..028c84f 100644 --- a/patches/net/minecraft/block/BlockFire.java.patch +++ b/patches/net/minecraft/block/BlockFire.java.patch @@ -92,7 +92,7 @@ if (p_149841_6_.nextInt(p_149841_7_ + 10) < 5 && !p_149841_1_.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) { int k1 = p_149841_7_ + p_149841_6_.nextInt(5) / 4; -@@ -297,7 +335,7 @@ +@@ -297,17 +335,17 @@ { if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && !this.canNeighborBurn(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { @@ -101,7 +101,10 @@ } } -@@ -307,7 +345,7 @@ + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) + { +- if (p_149726_1_.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_)) ++ if (!net.minecraft.server.MinecraftServer.kcauldronConfig.commonAllowNetherPortal.getValue() && p_149726_1_.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_)) { if (!World.doesBlockHaveSolidTopSurface(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_) && !this.canNeighborBurn(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_)) { diff --git a/src/main/java/kcauldron/KCauldron.java b/src/main/java/kcauldron/KCauldron.java index 3d4462a..afc443e 100644 --- a/src/main/java/kcauldron/KCauldron.java +++ b/src/main/java/kcauldron/KCauldron.java @@ -10,6 +10,7 @@ import java.util.Properties; import org.spigotmc.RestartCommand; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; public class KCauldron { private static boolean sManifestParsed = false; @@ -109,7 +110,7 @@ public class KCauldron { public static int lookupForgeRevision() { if (sForgeRevision != 0) return sForgeRevision; - int revision = 0; + int revision = Integer.parseInt(System.getProperty("kcauldron.forgeRevision", "0")); try { Properties p = new Properties(); p.load(KCauldron.class diff --git a/src/main/java/kcauldron/KCauldronConfig.java b/src/main/java/kcauldron/KCauldronConfig.java index 264b277..43a4cc0 100644 --- a/src/main/java/kcauldron/KCauldronConfig.java +++ b/src/main/java/kcauldron/KCauldronConfig.java @@ -25,6 +25,9 @@ public class KCauldronConfig extends ConfigBase { public BoolSetting loggingMaterialInjection = new BoolSetting(this, "logging.materialInjection", false, "Log material injection event"); + public BoolSetting commonAllowNetherPortal = new BoolSetting(this, + "common.allowNetherPortalBesidesOverworld", false, "Allow nether portals in dimensions besides overworld"); + public KCauldronConfig() { super("kcauldron.yml", "kc"); register(commandEnable); @@ -34,6 +37,7 @@ public class KCauldronConfig extends ConfigBase { register(updatecheckerAutorestart); register(updatecheckerQuite); register(loggingMaterialInjection); + register(commonAllowNetherPortal); load(); }