mirror of
https://github.com/TeamMidnightDust/Puddles.git
synced 2025-12-15 11:35:09 +01:00
Puddles 1.2.1 - Update to 1.18.2
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.9-SNAPSHOT'
|
||||
id 'fabric-loom' version '0.10-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
@@ -44,7 +44,7 @@ tasks.withType(JavaCompile).configureEach {
|
||||
it.options.encoding = "UTF-8"
|
||||
|
||||
// Minecraft 1.17 (21w19a) upwards uses Java 16.
|
||||
it.options.release = 16
|
||||
it.options.release = 17
|
||||
}
|
||||
|
||||
java {
|
||||
|
||||
@@ -3,16 +3,17 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.17.1
|
||||
yarn_mappings=1.17.1+build.63
|
||||
loader_version=0.12.3
|
||||
minecraft_version=1.18.2
|
||||
yarn_mappings=1.18.2+build.2
|
||||
loader_version=0.13.3
|
||||
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.2.0
|
||||
mod_version = 1.2.1
|
||||
maven_group = eu.midnightdust
|
||||
archives_base_name = puddles
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.41.0+1.17
|
||||
midnightlib_version=0.2.9
|
||||
fabric_version=0.48.0+1.18.2
|
||||
midnightlib_version=0.4.0
|
||||
|
||||
@@ -20,9 +20,9 @@ public class PuddlesClient implements ClientModInitializer {
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
int waterColor;
|
||||
if (client.world != null && client.player != null) {
|
||||
Biome biome = client.world.getBiome(client.player.getBlockPos());
|
||||
Biome biome = client.world.getBiome(client.player.getBlockPos()).value();
|
||||
waterColor = biome.getWaterColor();
|
||||
} else waterColor = BuiltinBiomes.PLAINS.getWaterColor();
|
||||
} else waterColor = 4159204;
|
||||
|
||||
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> waterColor, Puddles.Puddle);
|
||||
});
|
||||
|
||||
@@ -3,10 +3,10 @@ package eu.midnightdust.puddles.config;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
|
||||
public class PuddlesConfig extends MidnightConfig {
|
||||
@Entry // Enable or disable hats for contributors, friends and donors.
|
||||
@Entry(max = 10000) // Enable or disable hats for contributors, friends and donors.
|
||||
public static int puddleSpawnRate = 1;
|
||||
@Entry
|
||||
@Entry(max = 10000)
|
||||
public static int snowStackChance = 1;
|
||||
@Entry
|
||||
@Entry(max = 10000)
|
||||
public static int evaporationChance = 5;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
@@ -24,11 +25,10 @@ import java.util.function.Supplier;
|
||||
@SuppressWarnings("deprecation")
|
||||
@Mixin(ServerWorld.class)
|
||||
public abstract class MixinServerWorld extends World {
|
||||
protected MixinServerWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, DimensionType dimensionType, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
|
||||
super(properties, registryRef, dimensionType, profiler, isClient, debugWorld, seed);
|
||||
}
|
||||
|
||||
@Shadow protected abstract BlockPos getSurface(BlockPos pos);
|
||||
protected MixinServerWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, RegistryEntry<DimensionType> registryEntry, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
|
||||
super(properties, registryRef, registryEntry, profiler, isClient, debugWorld, seed);
|
||||
}
|
||||
|
||||
@Inject(at = @At("TAIL"),method = "tickChunk")
|
||||
public void puddles$tickChunk(WorldChunk chunk, int randomTickSpeed, CallbackInfo ci) {
|
||||
@@ -42,7 +42,7 @@ public abstract class MixinServerWorld extends World {
|
||||
if (PuddlesConfig.puddleSpawnRate != 0) {
|
||||
profiler.push("puddles");
|
||||
if (bl && random.nextInt(10000 / PuddlesConfig.puddleSpawnRate) == 0) {
|
||||
pos = this.getSurface(getRandomPosInChunk(x, 0, z, 15));
|
||||
pos = this.getTopPosition(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, getRandomPosInChunk(x, 0, z, 15));
|
||||
if (this.hasRain(pos) && getBlockState(pos.down()).isSideSolidFullSquare(this, pos, Direction.UP) && Puddles.Puddle.canPlaceAt(null,this,pos)) {
|
||||
setBlockState(pos, Puddles.Puddle.getDefaultState());
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public abstract class MixinServerWorld extends World {
|
||||
if (PuddlesConfig.snowStackChance != 0) {
|
||||
profiler.push("extra_snow");
|
||||
if (bl && random.nextInt(10000 / PuddlesConfig.snowStackChance) == 0) {
|
||||
pos = this.getSurface(getRandomPosInChunk(x, 0, z, 15));
|
||||
pos = this.getTopPosition(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, getRandomPosInChunk(x, 0, z, 15));
|
||||
if (this.getBlockState(pos).getBlock() == Blocks.SNOW && getBlockState(pos.down()).isSideSolidFullSquare(this, pos, Direction.UP)) {
|
||||
int layer = getBlockState(pos).get(Properties.LAYERS);
|
||||
if (layer < 5) {
|
||||
|
||||
Reference in New Issue
Block a user