Skip to content

Commit

Permalink
i'm never doing multiversion again
Browse files Browse the repository at this point in the history
i need to make changes for 1.21.4 hhhhhhhhhhhhhhhhhhh never again
  • Loading branch information
Superkat32 committed Dec 17, 2024
1 parent 65a0658 commit e337db6
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 18 deletions.
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -316,7 +316,7 @@ public static Screen makeScreen(Screen parent) {
val -> config.bigExtraPower = val
)
.available(false)
.customController(floatOption -> new <Number>FloatSliderController(floatOption, 0F, 10F, 0.1F))
.customController(floatOption -> new <Number>FloatSliderController(floatOption, -10F, 10F, 0.1F))
.build();

var smallExtraPower = Option.<Float>createBuilder()
Expand All @@ -330,7 +330,7 @@ public static Screen makeScreen(Screen parent) {
val -> config.smallExtraPower = val
)
.available(false)
.customController(floatOption -> new <Number>FloatSliderController(floatOption, 0F, 10F, 0.1F))
.customController(floatOption -> new <Number>FloatSliderController(floatOption, -10F, 10F, 0.1F))
.build();

var extraPower = Option.<Boolean>createBuilder()
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> soundEvent, CallbackInfo ci, @Local(ordinal = 2) LocalRef<ParticleEffect> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
//? if (>=1.21.2) {
"textures": [
"explosiveenhancement:blank"
]
}
//?}
}
6 changes: 3 additions & 3 deletions src/main/resources/explosiveenhancement.mixins.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions versions/1.19.2/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.19.3/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.19.4/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.20/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.21.1/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.21.3/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.21/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e337db6

Please sign in to comment.