diff --git a/build.gradle b/build.gradle index 492ea3b..07036ab 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,8 @@ def mcVersion = stonecutter.current.version //def mcDep = property("mod.supported_mc_versions").toString() def mcDep = project.supported_mc_versions.toString() +version = "${property('mod_version')}-${property('jarname_target')}" + base { archivesName = project.archives_base_name } @@ -24,11 +26,11 @@ loom { ideConfigGenerated true // Run configurations are not created for subprojects by default runDir "../../run" // Use a shared run folder and create separate worlds } -// configurations.all { -// resolutionStrategy { -// force("net.fabricmc:fabric-loader:$loader_version") -// } -// } + configurations.all { + resolutionStrategy { + force("net.fabricmc:fabric-loader:$loader_version") + } + } } repositories { diff --git a/gradle.properties b/gradle.properties index cd27c30..71d2536 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,7 @@ org.gradle.parallel=true minecraft_version=[VERSIONED] yarn_mappings=[VERSIONED] supported_mc_versions=[VERSIONED] +jarname_target=[VERSIONED] loader_version=0.16.9 # Mod Properties diff --git a/src/main/java/net/superkat/explosiveenhancement/ExplosiveEnhancementClient.java b/src/main/java/net/superkat/explosiveenhancement/ExplosiveEnhancementClient.java index 07d7f99..38df4b6 100644 --- a/src/main/java/net/superkat/explosiveenhancement/ExplosiveEnhancementClient.java +++ b/src/main/java/net/superkat/explosiveenhancement/ExplosiveEnhancementClient.java @@ -56,7 +56,11 @@ public void onInitializeClient() { double y = payload.y(); double z = payload.z(); ExplosionParticleType explosionParticleType = ExplosiveApi.determineParticleType(world, new Vec3d(x, y, z), payload.initParticle()); - ExplosiveApi.spawnParticles(world, x, y, z, payload.power(), explosionParticleType); + float power = payload.power(); + if(CONFIG.extraPower) { + power += ExplosiveHandler.particlesAreEmitter(payload.initParticle()) ? CONFIG.bigExtraPower : CONFIG.smallExtraPower; + } + ExplosiveApi.spawnParticles(world, x, y, z, power, explosionParticleType); boolean showVanillaParticles = (CONFIG.showDefaultExplosion && explosionParticleType == ExplosionParticleType.NORMAL) diff --git a/src/main/java/net/superkat/explosiveenhancement/ExplosiveHandler.java b/src/main/java/net/superkat/explosiveenhancement/ExplosiveHandler.java index dd3143b..943cbb2 100644 --- a/src/main/java/net/superkat/explosiveenhancement/ExplosiveHandler.java +++ b/src/main/java/net/superkat/explosiveenhancement/ExplosiveHandler.java @@ -1,7 +1,7 @@ package net.superkat.explosiveenhancement; import net.minecraft.client.MinecraftClient; -//? if (<=1.20) { +//? if (<1.21.2) { /*import net.minecraft.client.option.ParticlesMode; *///?} else { import net.minecraft.client.particle.Particle; diff --git a/src/main/java/net/superkat/explosiveenhancement/config/YaclIntegration.java b/src/main/java/net/superkat/explosiveenhancement/config/YaclIntegration.java index afa2050..f402de3 100644 --- a/src/main/java/net/superkat/explosiveenhancement/config/YaclIntegration.java +++ b/src/main/java/net/superkat/explosiveenhancement/config/YaclIntegration.java @@ -14,7 +14,7 @@ import java.util.Arrays; //?} -//? if (<=1.20) { +//? if (<1.21.2) { /*import net.minecraft.client.option.ParticlesMode; *///?} else { import net.minecraft.particle.ParticlesMode; @@ -316,7 +316,7 @@ public static Screen makeScreen(Screen parent) { val -> config.bigExtraPower = val ) .available(false) - .customController(floatOption -> new FloatSliderController(floatOption, 0F, 10F, 0.1F)) + .customController(floatOption -> new FloatSliderController(floatOption, -10F, 10F, 0.1F)) .build(); var smallExtraPower = Option.createBuilder() @@ -330,7 +330,7 @@ public static Screen makeScreen(Screen parent) { val -> config.smallExtraPower = val ) .available(false) - .customController(floatOption -> new FloatSliderController(floatOption, 0F, 10F, 0.1F)) + .customController(floatOption -> new FloatSliderController(floatOption, -10F, 10F, 0.1F)) .build(); var extraPower = Option.createBuilder() @@ -415,9 +415,13 @@ public static Screen makeScreen(Screen parent) { dynamicExplosionGroup.option(dynamicExplosions); dynamicExplosionGroup.option(dynamicUnderwater); + //taking the easy way out for now + //may figure out how to add this to older versions later + //? if(>=1.21.2) { dynamicExplosionGroup.option(extraPower); dynamicExplosionGroup.option(bigExtraPower); dynamicExplosionGroup.option(smallExtraPower); + //?} dynamicExplosionGroup.option(attemptBetterSmallExplosions); dynamicExplosionGroup.option(smallExplosionYOffset); //? if (>=1.21.2) { diff --git a/src/main/java/net/superkat/explosiveenhancement/mixin/ExplosionMixin.java b/src/main/java/net/superkat/explosiveenhancement/mixin/ExplosionMixin.java index b7724d2..3466717 100644 --- a/src/main/java/net/superkat/explosiveenhancement/mixin/ExplosionMixin.java +++ b/src/main/java/net/superkat/explosiveenhancement/mixin/ExplosionMixin.java @@ -18,12 +18,12 @@ import static net.superkat.explosiveenhancement.ExplosiveEnhancement.LOGGER; import static net.superkat.explosiveenhancement.ExplosiveEnhancementClient.CONFIG; -*///?} import net.minecraft.world.explosion.Explosion; import org.spongepowered.asm.mixin.Mixin; @Mixin(Explosion.class) +*///?} public abstract class ExplosionMixin { //The client-side explosion handling changed in 1.21.2/3, requiring a new mixin diff --git a/src/main/java/net/superkat/explosiveenhancement/mixin/ServerWorldMixin.java b/src/main/java/net/superkat/explosiveenhancement/mixin/ServerWorldMixin.java index b3f5a71..9135c6f 100644 --- a/src/main/java/net/superkat/explosiveenhancement/mixin/ServerWorldMixin.java +++ b/src/main/java/net/superkat/explosiveenhancement/mixin/ServerWorldMixin.java @@ -38,7 +38,7 @@ public class ServerWorldMixin { public void explosiveenhancement$scaleParticlesForSingleplayer(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionBehavior behavior, double x, double y, double z, float power, boolean createFire, World.ExplosionSourceType explosionSourceType, ParticleEffect smallParticle, ParticleEffect largeParticle, RegistryEntry soundEvent, CallbackInfo ci, @Local(ordinal = 2) LocalRef effect) { ServerWorld world = (ServerWorld)(Object)this; if (world.getServer().isSingleplayer() && this.players.size() == 1) { - if(ExplosiveEnhancementClient.CONFIG.bypassPowerForSingleplayer) { + if(ExplosiveEnhancementClient.CONFIG.modEnabled && ExplosiveEnhancementClient.CONFIG.bypassPowerForSingleplayer) { ServerPlayNetworking.send(this.players.getFirst(), new S2CExplosiveEnhancementParticles(x, y, z, power, effect.get())); effect.set(ExplosiveEnhancement.NO_RENDER_PARTICLE); } diff --git a/src/main/resources/assets/explosiveenhancement/lang/en_us.json b/src/main/resources/assets/explosiveenhancement/lang/en_us.json index 78d1e7b..2b49471 100644 --- a/src/main/resources/assets/explosiveenhancement/lang/en_us.json +++ b/src/main/resources/assets/explosiveenhancement/lang/en_us.json @@ -3,8 +3,8 @@ "explosiveenhancement.category.default": "Particles", - "explosiveenhancement.particlenotice": "§6Notice§r: Explosive Enhancement uses particles! Setting your particle visibility to a lower value may hide the enhanced explosion effect!", - "explosiveenhancement.particlenoticeparttwoelectricboogaloo": "Current particle visibility: %1$s. Setting it to %2$s is recommended!", + "explosiveenhancement.particlenotice": "§c§lNotice§r: Explosive Enhancement uses particles! Setting your particle visibility to a lower value may hide the enhanced explosion effect!", + "explosiveenhancement.particlenoticeparttwoelectricboogaloo": "Current particle visibility: %1$s.\nSetting it to %2$s is recommended!", "explosiveenhancement.explosion.group": "Explosions", "explosiveenhancement.explosion.group.tooltip": "Explosion particle options", diff --git a/src/main/resources/assets/explosiveenhancement/particles/norenderparticle.json b/src/main/resources/assets/explosiveenhancement/particles/norenderparticle.json5 similarity index 67% rename from src/main/resources/assets/explosiveenhancement/particles/norenderparticle.json rename to src/main/resources/assets/explosiveenhancement/particles/norenderparticle.json5 index 4904e32..7b13ccf 100644 --- a/src/main/resources/assets/explosiveenhancement/particles/norenderparticle.json +++ b/src/main/resources/assets/explosiveenhancement/particles/norenderparticle.json5 @@ -1,5 +1,7 @@ { +//? if (>=1.21.2) { "textures": [ "explosiveenhancement:blank" ] -} \ No newline at end of file +//?} +} diff --git a/src/main/resources/explosiveenhancement.mixins.json5 b/src/main/resources/explosiveenhancement.mixins.json5 index 311e959..08d7114 100644 --- a/src/main/resources/explosiveenhancement.mixins.json5 +++ b/src/main/resources/explosiveenhancement.mixins.json5 @@ -2,12 +2,12 @@ "required": true, "minVersion": "0.8", "package": "net.superkat.explosiveenhancement.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_17", + //? if (>=1.21.2) { "mixins": [ - //? if (>=1.21.2) { "ServerWorldMixin" - //?} ], + //?} "client": [ //? if (>=1.21.2) { "ClientPlayNetworkHandlerMixin" diff --git a/versions/1.19.2/gradle.properties b/versions/1.19.2/gradle.properties index acba3c0..bc07572 100644 --- a/versions/1.19.2/gradle.properties +++ b/versions/1.19.2/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.19.2 supported_mc_versions=1.19.2 +jarname_target=1.19.2 yarn_mappings=1.19.2+build.28 fabric_version=0.67.0+1.19.2 diff --git a/versions/1.19.3/gradle.properties b/versions/1.19.3/gradle.properties index 27f2212..05f844e 100644 --- a/versions/1.19.3/gradle.properties +++ b/versions/1.19.3/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.19.3 supported_mc_versions=1.19.3 +jarname_target=1.19.3 yarn_mappings=1.19.3+build.1 fabric_version=0.70.0+1.19.3 diff --git a/versions/1.19.4/gradle.properties b/versions/1.19.4/gradle.properties index 037fbc5..125f329 100644 --- a/versions/1.19.4/gradle.properties +++ b/versions/1.19.4/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.19.4 supported_mc_versions=1.19.4 +jarname_target=1.19.4 yarn_mappings=1.19.4+build.2 fabric_version=0.80.0+1.19.4 diff --git a/versions/1.20/gradle.properties b/versions/1.20/gradle.properties index 814e2b5..b77c8f5 100644 --- a/versions/1.20/gradle.properties +++ b/versions/1.20/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.20.6 supported_mc_versions=>=1.20.0 <=1.20.6 +jarname_target=1.20.x yarn_mappings=1.20.6+build.3 fabric_version=0.99.0+1.20.6 diff --git a/versions/1.21.1/gradle.properties b/versions/1.21.1/gradle.properties index 723282e..f011c31 100644 --- a/versions/1.21.1/gradle.properties +++ b/versions/1.21.1/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.21 supported_mc_versions=>=1.21.0 <=1.21.1 +jarname_target=1.21-1.21.1 yarn_mappings=1.21+build.1 fabric_version=0.100.1+1.21 diff --git a/versions/1.21.3/gradle.properties b/versions/1.21.3/gradle.properties index 0645905..202324f 100644 --- a/versions/1.21.3/gradle.properties +++ b/versions/1.21.3/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.21.3 supported_mc_versions=>=1.21.2 +jarname_target=1.21.2-3 yarn_mappings=1.21.3+build.2 fabric_version=0.107.3+1.21.3 diff --git a/versions/1.21/gradle.properties b/versions/1.21/gradle.properties index 81999aa..4098706 100644 --- a/versions/1.21/gradle.properties +++ b/versions/1.21/gradle.properties @@ -1,5 +1,6 @@ minecraft_version=1.21.3 supported_mc_versions=1.19.2 +jarname_target=1.19.2 yarn_mappings=1.21.3+build.2 fabric_version=0.107.3+1.21.3