Skip to content

Commit b3bdaba

Browse files
committed
change: Fix block breaking and break particles
1 parent febed5e commit b3bdaba

6 files changed

Lines changed: 37 additions & 30 deletions

File tree

build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ plugins {
33
id("fabric-loom") version ("1.11-SNAPSHOT") apply (false)
44
}
55

6-
val MINECRAFT_VERSION by extra { "1.21.9" }
7-
val NEOFORGE_VERSION by extra { "21.9.11-beta" }
8-
val FABRIC_LOADER_VERSION by extra { "0.17.2" }
9-
val FABRIC_API_VERSION by extra { "0.134.0+1.21.9" }
6+
val MINECRAFT_VERSION by extra { "1.21.10" }
7+
val NEOFORGE_VERSION by extra { "21.10.47-beta" }
8+
val FABRIC_LOADER_VERSION by extra { "0.17.3" }
9+
val FABRIC_API_VERSION by extra { "0.138.0+1.21.10" }
1010

1111
// This value can be set to null to disable Parchment.
1212
val PARCHMENT_VERSION by extra { null }
1313

1414
// https://semver.org/
1515
val MAVEN_GROUP by extra { "me.flashyreese.mods" }
1616
val ARCHIVE_NAME by extra { "sodium-extra" }
17-
val MOD_VERSION by extra { "0.7.0" }
18-
val SODIUM_VERSION by extra { "mc1.21.9-0.7.0" }
17+
val MOD_VERSION by extra { "0.7.1" }
18+
val SODIUM_VERSION by extra { "mc1.21.10-0.7.2" }
1919

2020
allprojects {
2121
apply(plugin = "java")
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package me.flashyreese.mods.sodiumextra.mixin.particle;
2+
3+
import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod;
4+
import net.minecraft.client.multiplayer.ClientLevel;
5+
import net.minecraft.core.BlockPos;
6+
import net.minecraft.core.Direction;
7+
import net.minecraft.world.level.block.state.BlockState;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12+
13+
@Mixin(ClientLevel.class)
14+
public class MixinClientLevel {
15+
@Inject(method = "addDestroyBlockEffect", at = @At(value = "HEAD"), cancellable = true)
16+
public void addBlockBreakParticles(BlockPos blockPos, BlockState blockState, CallbackInfo ci) {
17+
if (!SodiumExtraClientMod.options().particleSettings.particles || !SodiumExtraClientMod.options().particleSettings.blockBreak) {
18+
ci.cancel();
19+
}
20+
}
21+
22+
@Inject(method = "addBreakingBlockEffect", at = @At(value = "HEAD"), cancellable = true)
23+
public void addBlockBreakingParticles(BlockPos blockPos, Direction direction, CallbackInfo ci) {
24+
if (!SodiumExtraClientMod.options().particleSettings.particles || !SodiumExtraClientMod.options().particleSettings.blockBreaking) {
25+
ci.cancel();
26+
}
27+
}
28+
}

common/src/main/java/me/flashyreese/mods/sodiumextra/mixin/particle/MixinParticleEngine.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@
1717

1818
@Mixin(ParticleEngine.class)
1919
public class MixinParticleEngine {
20-
//Todo:
21-
/*@Inject(method = "destroy", at = @At(value = "HEAD"), cancellable = true)
22-
public void addBlockBreakParticles(BlockPos pos, BlockState state, CallbackInfo ci) {
23-
if (!SodiumExtraClientMod.options().particleSettings.particles || !SodiumExtraClientMod.options().particleSettings.blockBreak) {
24-
ci.cancel();
25-
}
26-
}
27-
28-
@Inject(method = "crack", at = @At(value = "HEAD"), cancellable = true)
29-
public void addBlockBreakingParticles(BlockPos pos, Direction direction, CallbackInfo ci) {
30-
if (!SodiumExtraClientMod.options().particleSettings.particles || !SodiumExtraClientMod.options().particleSettings.blockBreaking) {
31-
ci.cancel();
32-
}
33-
}*/
34-
3520
@Inject(method = "createParticle", at = @At(value = "HEAD"), cancellable = true)
3621
public void addParticle(ParticleOptions particleOptions, double d, double e, double f, double g, double h, double i, CallbackInfoReturnable<Particle> cir) {
3722
if (SodiumExtraClientMod.options().particleSettings.particles) {

common/src/main/resources/sodium-extra.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"optimizations.beacon_beam_rendering.LevelRendererAccessor",
2323
"optimizations.beacon_beam_rendering.MixinBeaconRenderer",
2424
"optimizations.beacon_beam_rendering.MixinVertexSerializerRegistryImpl",
25+
"particle.MixinClientLevel",
2526
"particle.MixinFireworkParticle",
2627
"particle.MixinLevelRenderer",
2728
"particle.MixinParticleEngine",

neoforge/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("idea")
3-
id("net.neoforged.moddev") version "2.0.110"
3+
id("net.neoforged.moddev") version "2.0.116"
44
id("java-library")
55
}
66

@@ -17,13 +17,6 @@ base {
1717
}
1818

1919
repositories {
20-
maven("https://maven.pkg.github.com/ims212/FRAPI-Testing") {
21-
credentials {
22-
username = "IMS212"
23-
// Read only token
24-
password = "ghp_" + "DEuGv0Z56vnSOYKLCXdsS9svK4nb9K39C1Hn"
25-
}
26-
}
2720
maven("https://maven.su5ed.dev/releases")
2821
maven("https://maven.neoforged.net/releases/")
2922

neoforge/src/main/java/net/caffeinemc/caffeineconfig/CaffeineConfigNeoForge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
public class CaffeineConfigNeoForge implements CaffeineConfigPlatform {
99
@Override
1010
public void applyModOverrides(CaffeineConfig config, String jsonKey) {
11-
for (ModInfo meta : FMLLoader.getLoadingModList().getMods()) {
11+
for (ModInfo meta : FMLLoader.getCurrent().getLoadingModList().getMods()) {
1212
meta.getConfigElement(jsonKey).ifPresent(override -> {
1313
if (override instanceof Map<?, ?> overrides && overrides.keySet().stream().allMatch(key -> key instanceof String)) {
1414
overrides.forEach((key, value) -> {

0 commit comments

Comments
 (0)