Skip to content

Commit

Permalink
Merge branch '1.19.3' into 1.19.4
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
Superkat32 committed Sep 1, 2023
2 parents 4e8fdff + f026bb2 commit 257e7d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.19.4+build.2
loader_version=0.14.19

# Mod Properties
mod_version = 1.2.1-SNAPSHOT10-1.19.4
mod_version = 1.2.1-SNAPSHOT11-1.19.4
maven_group = net.superkat
archives_base_name = explosive-enhancement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ public static void spawnParticles(World world, double x, double y, double z, flo
ExplosiveConfig config = ExplosiveEnhancementClient.config;
if(config.modEnabled) {
if(config.debugLogs) { LOGGER.info("ExplosiveApi has been called!"); }
power = config.dynamicSize ? power : 4;
if(isUnderWater) {
power = config.dynamicUnderwater ? power : 4;
} else {
power = config.dynamicSize ? power : 4;
}
y = config.attemptBetterSmallExplosions && power == 1 ? y + config.smallExplosionYOffset : y;
isImportant = isImportant || config.alwaysShow;
float blastwavePower = power * 1.75f;
float fireballPower = power * 1.25f;
float smokePower = power * 0.4f;
if (isUnderWater) {
power = config.dynamicUnderwater ? power : 4;
if(config.showUnderwaterBlastWave) {
world.addParticle(ExplosiveEnhancement.UNDERWATERBLASTWAVE, isImportant, x, y + 0.5, z, blastwavePower, 0, 0);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
package net.superkat.explosiveenhancement.config;

import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import net.fabricmc.loader.api.FabricLoader;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;

public class ExplosiveConfig {

public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
public static final Path CONFIG_FILE = FabricLoader.getInstance().getConfigDir().resolve("explosiveenhancement.json");
public static File file = CONFIG_FILE.toFile();
public static final Gson GSON = new GsonBuilder()
.setPrettyPrinting()
.serializeNulls()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.create();
public static final Path PATH = FabricLoader.getInstance().getConfigDir().resolve("explosiveenhancement.json");
public static File file = PATH.toFile();
public static ExplosiveConfig INSTANCE = load();

public boolean showBlastWave = true;
Expand All @@ -38,7 +45,7 @@ public class ExplosiveConfig {
public boolean alwaysShow = false;
public boolean debugLogs = false;

//The following two methods were borrowed and slightly edited
//The following two methods and the above static variables were borrowed and slightly edited
//with permission from Enjarai's absolutely amazing Do A Barrel Roll mod.
//Please check it out!
// https://github.com/enjarai/do-a-barrel-roll
Expand All @@ -64,7 +71,7 @@ public static ExplosiveConfig load() {
}

public void save() {
try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) {
try (Writer writer = Files.newBufferedWriter(PATH, StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE)) {
GSON.toJson(this, writer);
} catch (IOException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"explosiveenhancement.extras.enabled": "Mod Enabled",
"explosiveenhancement.extras.enabled.tooltip": "Should the mod be enabled?",
"explosiveenhancement.extras.alwaysshow": "Always Show Particles",
"explosiveenhancement.extras.alwaysshow.tooltip": "If enabled, the explosion particles will attempt to render from further away AND on lower particle settings. Use wisely!",
"explosiveenhancement.extras.alwaysshow.tooltip": "If enabled, the explosion particles will attempt to render from further away(roughly twice as far) AND on lower particle settings. Use wisely!",
"explosiveenhancement.extras.logs": "Debug Logs",
"explosiveenhancement.extras.logs.tooltip": "Extra console logs to help debug, if needed",
"explosiveenhancement.extras.logs.warningtooltip": "§cWarning§r: Will spam logs!"
Expand Down

0 comments on commit 257e7d8

Please sign in to comment.