diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-10-28 19:07:51 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-10-28 19:07:51 +0100 |
commit | 457e1fe35a3a370a2b50662a10d705a309ff6c4c (patch) | |
tree | dbc8cd761f8c4759b61041fa18b5c50f4ab41eaf /src/main/java/re/jag | |
parent | 5199c9876f42dcd2bf9818ccdaa072bc2b4426fd (diff) | |
download | parquet-457e1fe35a3a370a2b50662a10d705a309ff6c4c.tar.gz |
Better no fire tick
Diffstat (limited to 'src/main/java/re/jag')
-rw-r--r-- | src/main/java/re/jag/parquet/ParquetSettings.java | 4 | ||||
-rw-r--r-- | src/main/java/re/jag/parquet/mixin/FireBlockMixin.java | 18 |
2 files changed, 22 insertions, 0 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(); + } +} |