aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-10-28 19:07:51 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-10-28 19:07:51 +0100
commit457e1fe35a3a370a2b50662a10d705a309ff6c4c (patch)
treedbc8cd761f8c4759b61041fa18b5c50f4ab41eaf /src/main
parent5199c9876f42dcd2bf9818ccdaa072bc2b4426fd (diff)
downloadparquet-457e1fe35a3a370a2b50662a10d705a309ff6c4c.tar.gz
Better no fire tick
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/re/jag/parquet/ParquetSettings.java4
-rw-r--r--src/main/java/re/jag/parquet/mixin/FireBlockMixin.java18
-rw-r--r--src/main/resources/parquet.mixins.json3
3 files changed, 24 insertions, 1 deletions
diff --git a/src/main/java/re/jag/parquet/ParquetSettings.java b/src/main/java/re/jag/parquet/ParquetSettings.java
index 203c648..243beb8 100644
--- a/src/main/java/re/jag/parquet/ParquetSettings.java
+++ b/src/main/java/re/jag/parquet/ParquetSettings.java
@@ -22,6 +22,8 @@ public class ParquetSettings {
public final boolean command_rename;
public final boolean command_timediff;
+ public final boolean better_no_fire_tick;
+
private boolean changed_config = false;
public ParquetSettings(String _properties_file) {
@@ -39,6 +41,8 @@ public class ParquetSettings {
this.command_rename = get_boolean("command-rename", true);
this.command_timediff = get_boolean("command-timediff", true);
+ this.better_no_fire_tick = get_boolean("better-no-fire-tick", false);
+
if(changed_config)
save(path);
}
diff --git a/src/main/java/re/jag/parquet/mixin/FireBlockMixin.java b/src/main/java/re/jag/parquet/mixin/FireBlockMixin.java
new file mode 100644
index 0000000..ffcf646
--- /dev/null
+++ b/src/main/java/re/jag/parquet/mixin/FireBlockMixin.java
@@ -0,0 +1,18 @@
+package re.jag.parquet.mixin;
+
+import net.minecraft.block.FireBlock;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import re.jag.parquet.Parquet;
+
+@Mixin(FireBlock.class)
+public class FireBlockMixin {
+
+ @Inject(method="registerDefaultFlammables", at=@At("HEAD"), cancellable = true)
+ private static void onRegisterDefaultFlammables(CallbackInfo ci) {
+ if (Parquet.settings.better_no_fire_tick)
+ ci.cancel();
+ }
+}
diff --git a/src/main/resources/parquet.mixins.json b/src/main/resources/parquet.mixins.json
index 2feca40..7b489e6 100644
--- a/src/main/resources/parquet.mixins.json
+++ b/src/main/resources/parquet.mixins.json
@@ -11,7 +11,8 @@
"FireWorkItemMixin",
"AbstractTraderEntityMixin",
"SellMapFactoryMixin",
- "StatisticsS2CPacketMixin"
+ "StatisticsS2CPacketMixin",
+ "FireBlockMixin"
],
"server": [
],