Skip to content

Commit fa146ce

Browse files
committed
Port to OmniCore V1 + 1.21.8 + cut versions
1 parent 83acc09 commit fa146ce

12 files changed

Lines changed: 112 additions & 161 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616

1717
toolkitLoomHelper {
1818
useOneConfig {
19-
version = "1.0.0-alpha.148"
19+
version = "1.0.0-alpha.151"
2020
loaderVersion = "1.1.0-alpha.49"
2121

2222
usePolyMixin = true
@@ -56,4 +56,4 @@ dependencies {
5656
modImplementation("net.fabricmc.fabric-api:fabric-api:${mcData.dependencies.fabric.fabricApiVersion}")
5757
}
5858
}
59-
}
59+
}

root.gradle.kts

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,25 @@ preprocess {
1010
// "1.8.9-forge"(10809, "srg")
1111
// }
1212

13-
"1.21.5-fabric"(1_21_05, "yarn") {
14-
"1.21.5-neoforge"(1_21_05, "srg") {
15-
"1.21.4-neoforge"(1_21_04, "srg") {
16-
"1.21.4-fabric"(1_21_04, "yarn") {
17-
"1.21.3-fabric"(1_21_04, "yarn") {
18-
"1.21.3-neoforge"(1_21_03, "srg") {
19-
"1.21.2-neoforge"(1_21_02, "srg") {
20-
"1.21.2-fabric"(1_21_02, "yarn") {
21-
"1.21.1-fabric"(1_21_01, "yarn") {
22-
"1.21.1-neoforge"(1_21_01, "srg") {
23-
"1.20.6-neoforge"(1_20_06, "srg") {
24-
"1.20.6-fabric"(1_20_06, "yarn") {
25-
"1.20.4-fabric"(1_20_04, "yarn") {
26-
"1.20.4-neoforge"(1_20_04, "srg") {
27-
"1.20.4-forge"(1_20_04, "srg") {
28-
"1.20.1-forge"(1_20_01, "srg") {
29-
"1.20.1-fabric"(1_20_01, "yarn") {
30-
"1.19.4-fabric"(1_19_04, "yarn") {
31-
"1.19.4-forge"(1_19_04, "srg") {
32-
"1.19.2-forge"(1_19_02, "srg") {
33-
"1.19.2-fabric"(1_19_02, "yarn") {
34-
"1.18.2-fabric"(1_18_02, "yarn") {
35-
"1.18.2-forge"(1_18_02, "srg") {
36-
"1.17.1-forge"(1_17_01, "srg") {
37-
"1.17.1-fabric"(1_17_01, "yarn") {
38-
"1.16.5-fabric"(1_16_05, "yarn"){
39-
"1.16.5-forge"(1_16_05, "srg") {
40-
"1.12.2-forge"(1_12_02, "srg") {
41-
"1.12.2-fabric"(1_12_02, "yarn") {
42-
"1.8.9-fabric"(1_08_09, "yarn"){
43-
"1.8.9-forge"(1_08_09, "srg")
44-
}
45-
}
46-
}
47-
}
48-
}
49-
}
50-
}
51-
}
52-
}
53-
}
54-
}
55-
}
13+
"1.21.8-fabric"(1_21_08, "yarn") {
14+
"1.21.8-neoforge"(1_21_08, "srg") {
15+
"1.21.5-neoforge"(1_21_05, "srg") {
16+
"1.21.5-fabric"(1_21_05, "yarn") {
17+
"1.21.4-fabric"(1_21_04, "yarn") {
18+
"1.21.4-neoforge"(1_21_04, "srg") {
19+
"1.21.1-neoforge"(1_21_01, "srg") {
20+
"1.21.1-fabric"(1_21_01, "yarn") {
21+
"1.20.4-fabric"(1_20_04, "yarn") {
22+
"1.20.4-neoforge"(1_20_04, "srg") {
23+
"1.20.4-forge"(1_20_04, "srg") {
24+
"1.20.1-forge"(1_20_01, "srg") {
25+
"1.20.1-fabric"(1_20_01, "yarn") {
26+
"1.16.5-fabric"(1_16_05, "yarn") {
27+
"1.16.5-forge"(1_16_05, "srg") {
28+
"1.12.2-forge"(1_12_02, "srg") {
29+
"1.12.2-fabric"(1_12_02, "yarn") {
30+
"1.8.9-fabric"(1_08_09, "yarn") {
31+
"1.8.9-forge"(1_08_09, "srg")
5632
}
5733
}
5834
}

settings.gradle.kts

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,24 @@ listOf(
4949
"1.16.5-forge",
5050
"1.16.5-fabric",
5151

52-
"1.17.1-forge",
53-
"1.17.1-fabric",
54-
55-
"1.18.2-forge",
56-
"1.18.2-fabric",
57-
58-
"1.19.2-forge",
59-
"1.19.2-fabric",
60-
61-
"1.19.4-forge",
62-
"1.19.4-fabric",
63-
6452
"1.20.1-forge",
6553
"1.20.1-fabric",
6654

6755
"1.20.4-forge",
6856
"1.20.4-neoforge",
6957
"1.20.4-fabric",
7058

71-
"1.20.6-neoforge",
72-
"1.20.6-fabric",
73-
7459
"1.21.1-neoforge",
7560
"1.21.1-fabric",
7661

77-
"1.21.2-neoforge",
78-
"1.21.2-fabric",
79-
80-
"1.21.3-neoforge",
81-
"1.21.3-fabric",
82-
8362
"1.21.4-neoforge",
8463
"1.21.4-fabric",
8564

8665
"1.21.5-neoforge",
87-
"1.21.5-fabric"
66+
"1.21.5-fabric",
67+
68+
"1.21.8-neoforge",
69+
"1.21.8-fabric",
8870
).forEach { version ->
8971
include(":$version")
9072
project(":$version").apply {

versions/1.18.2-forge/src/main/java/org/polyfrost/polyweather/mixin/Mixin_FixRainAndThunderStrength.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

versions/1.19.2-fabric/src/main/java/org/polyfrost/polyweather/mixin/Mixin_FixRainAndThunderStrength.java

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.polyfrost.polyweather.mixin;
2+
3+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
4+
import net.minecraft.client.render.WorldRenderer;
5+
import org.polyfrost.polyweather.client.PolyWeatherClient;
6+
import org.polyfrost.polyweather.client.PolyWeatherConfig;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
10+
@Mixin(WorldRenderer.class)
11+
public class Mixin_FixLowTempsWhenSnowing {
12+
@ModifyExpressionValue(
13+
method = "renderWeather",
14+
at = @At(
15+
value = "INVOKE",
16+
target = "Lnet/minecraft/world/biome/Biome;getTemperature(Lnet/minecraft/util/math/BlockPos;)F"
17+
)
18+
)
19+
private float polyweather$updateTemperatures(float original) {
20+
if (PolyWeatherConfig.INSTANCE.enabled && PolyWeatherClient.isSnowing()) {
21+
return 0f;
22+
}
23+
24+
return original;
25+
}
26+
}

versions/1.21.2-fabric/src/main/java/org/polyfrost/polyweather/mixin/Mixin_FixRainAndThunderStrength.java renamed to versions/1.20.1-fabric/src/main/java/org/polyfrost/polyweather/mixin/Mixin_FixRainAndThunderStrength.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
import net.minecraft.registry.entry.RegistryEntry;
55
import net.minecraft.registry.DynamicRegistryManager;
66
import net.minecraft.registry.RegistryKey;
7+
import net.minecraft.util.profiler.Profiler;
78
import net.minecraft.world.World;
89
import net.minecraft.world.dimension.DimensionType;
910
import net.minecraft.world.MutableWorldProperties;
1011
import org.polyfrost.polyweather.client.PolyWeatherClient;
1112
import org.polyfrost.polyweather.client.PolyWeatherConfig;
1213
import org.spongepowered.asm.mixin.Mixin;
1314

15+
import java.util.function.Supplier;
16+
1417
@Mixin(ClientWorld.class)
1518
public abstract class Mixin_FixRainAndThunderStrength extends World {
16-
protected Mixin_FixRainAndThunderStrength(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey, DynamicRegistryManager dynamicRegistryManager, RegistryEntry<DimensionType> registryEntry, boolean bl, boolean bl2, long l, int i) {
17-
super(mutableWorldProperties, registryKey, dynamicRegistryManager, registryEntry, bl, bl2, l, i);
19+
protected Mixin_FixRainAndThunderStrength(MutableWorldProperties arg, RegistryKey<World> arg2, DynamicRegistryManager arg3, RegistryEntry<DimensionType> arg4, Supplier<Profiler> supplier, boolean bl, boolean bl2, long l, int i) {
20+
super(arg, arg2, arg3, arg4, supplier, bl, bl2, l, i);
1821
}
1922

2023
@Override

versions/1.21.2-fabric/src/main/java/org/polyfrost/polyweather/mixin/Mixin_ForceRainAndSnowParticles.java renamed to versions/1.20.1-fabric/src/main/java/org/polyfrost/polyweather/mixin/Mixin_ForceRainAndSnowParticles.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.polyfrost.polyweather.mixin;
22

3-
import net.minecraft.client.render.WeatherRendering;
43
import net.minecraft.client.render.WorldRenderer;
54
import org.polyfrost.polyweather.client.PolyWeatherClient;
65
import org.polyfrost.polyweather.client.PolyWeatherConfig;
@@ -9,9 +8,9 @@
98
import org.spongepowered.asm.mixin.injection.Inject;
109
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
1110

12-
@Mixin(WeatherRendering.class)
11+
@Mixin(WorldRenderer.class)
1312
public class Mixin_ForceRainAndSnowParticles {
14-
@Inject(method = "addParticlesAndSound", at = @At("HEAD"), cancellable = true)
13+
@Inject(method = "tickRainSplashing", at = @At("HEAD"), cancellable = true)
1514
private void addRainParticles(CallbackInfo ci) {
1615
if (PolyWeatherConfig.INSTANCE.enabled && (!PolyWeatherClient.isRaining() || PolyWeatherClient.isSnowing())) {
1716
ci.cancel();
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.polyfrost.polyweather.mixin;
2+
3+
import net.minecraft.client.world.ClientWorld;
4+
import net.minecraft.world.WorldProperties;
5+
import org.polyfrost.polyweather.client.PolyWeatherClient;
6+
import org.polyfrost.polyweather.client.PolyWeatherConfig;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Inject;
10+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11+
12+
@Mixin(ClientWorld.Properties.class)
13+
public class Mixin_ForceRainAndThunderChecks {
14+
@Inject(method = "isRaining", at = @At("HEAD"), cancellable = true)
15+
private void isRaining(CallbackInfoReturnable<Boolean> cir) {
16+
if (PolyWeatherConfig.INSTANCE.enabled) {
17+
cir.setReturnValue(PolyWeatherClient.isRaining());
18+
}
19+
}
20+
21+
@Inject(method = "isThundering", at = @At("HEAD"), cancellable = true)
22+
private void isThundering(CallbackInfoReturnable<Boolean> cir) {
23+
if (PolyWeatherConfig.INSTANCE.enabled) {
24+
cir.setReturnValue(PolyWeatherClient.isThundering());
25+
}
26+
}
27+
}

versions/1.21.2-fabric/src/main/java/org/polyfrost/polyweather/mixin/Mixin_FixLowTempsWhenSnowing.java renamed to versions/1.21.4-neoforge/src/main/java/org/polyfrost/polyweather/mixin/Mixin_FixLowTempsWhenSnowing.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package org.polyfrost.polyweather.mixin;
22

3-
import net.minecraft.client.render.WeatherRendering;
4-
import net.minecraft.util.math.BlockPos;
5-
import net.minecraft.world.World;
6-
import net.minecraft.world.biome.Biome;
3+
import net.minecraft.client.renderer.WeatherEffectRenderer;
4+
import net.minecraft.core.BlockPos;
5+
import net.minecraft.world.level.Level;
6+
import net.minecraft.world.level.biome.Biome;
77
import org.polyfrost.polyweather.client.PolyWeatherClient;
88
import org.polyfrost.polyweather.client.PolyWeatherConfig;
99
import org.spongepowered.asm.mixin.Mixin;
1010
import org.spongepowered.asm.mixin.injection.At;
1111
import org.spongepowered.asm.mixin.injection.Inject;
1212
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1313

14-
@Mixin(WeatherRendering.class)
14+
@Mixin(WeatherEffectRenderer.class)
1515
public class Mixin_FixLowTempsWhenSnowing {
1616
@Inject(method = "getPrecipitationAt", at = @At("HEAD"), cancellable = true)
17-
private void polyweather$updateTemperatures(World world, BlockPos pos, CallbackInfoReturnable<Biome.Precipitation> cir) {
17+
private void polyweather$updateTemperatures(Level world, BlockPos pos, CallbackInfoReturnable<Biome.Precipitation> cir) {
1818
if (!PolyWeatherConfig.INSTANCE.enabled || !PolyWeatherClient.isSnowing()) {
1919
return;
2020
}

0 commit comments

Comments
 (0)