diff --git a/build.gradle b/build.gradle index f17bd1f..7ea9d4b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.9-SNAPSHOT' + id 'fabric-loom' version '1.10-SNAPSHOT' id 'maven-publish' id "me.modmuss50.mod-publish-plugin" version "0.5.1" } diff --git a/gradle.properties b/gradle.properties index 2c751ac..967368e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,18 +4,18 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.21.4 -yarn_mappings=1.21.4+build.4 -loader_version=0.16.9 +minecraft_version=1.21.5 +yarn_mappings=1.21.5+build.1 +loader_version=0.16.14 # Mod Properties mod_name=Particular -mod_version=1.1.1+1.21.4 +mod_version=1.1.1+1.21.5 maven_group=com.chailotl.particular archives_base_name=particular # Dependencies -fabric_version=0.113.0+1.21.4 -owo_version=0.12.19+1.21.4 +fabric_version=0.121.0+1.21.5 +owo_version=0.12.20+1.21.5 sushi_version=0.2.1+1.21 seasons_version=2.2.1+1.20 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c8..ca025c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/chailotl/particular/Main.java b/src/main/java/com/chailotl/particular/Main.java index 1c369ad..2a84c25 100644 --- a/src/main/java/com/chailotl/particular/Main.java +++ b/src/main/java/com/chailotl/particular/Main.java @@ -258,7 +258,7 @@ public static void spawnBubble(ParticleEffect particle, World world, BlockPos po double y = pos.getY() + 0.25d + world.random.nextDouble() * 0.5d; double z = pos.getZ() + 0.25d + world.random.nextDouble() * 0.5d; - world.addParticle(particle, x, y, z, 0, 0, 0); + world.addParticleClient(particle, x, y, z, 0, 0, 0); } public static void spawnFirefly(World world, BlockPos pos, Random random) @@ -280,7 +280,7 @@ public static void spawnFirefly(World world, BlockPos pos, Random random) temp >= CONFIG.fireflySettings.minTemp() && temp <= CONFIG.fireflySettings.maxTemp()) { - world.addParticle(Particles.FIREFLY, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f, 0, 0, 0); + world.addParticleClient(Particles.FIREFLY, pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f, 0, 0, 0); } } } @@ -340,7 +340,7 @@ public static void spawnDoubleBubbles(ParticleEffect particle, World world, Bloc double y = pos.getY() + 0.25d + world.random.nextDouble() * 0.5d; double z = pos.getZ() + 0.25d + world.random.nextDouble() * (0.5d + zLen) + zOffset; - world.addParticle(particle, x, y, z, 0, 0, 0); + world.addParticleClient(particle, x, y, z, 0, 0, 0); } } @@ -407,7 +407,7 @@ public static void spawnDoubleChestBubbles(ParticleEffect particle, World world, double y = pos.getY() + 0.25d + world.random.nextDouble() * 0.5d; double z = pos.getZ() + 0.25d + world.random.nextDouble() * (0.5d + zLen) + zOffset; - world.addParticle(particle, x, y, z, 0, 0, 0); + world.addParticleClient(particle, x, y, z, 0, 0, 0); } } } \ No newline at end of file diff --git a/src/main/java/com/chailotl/particular/mixin/InjectBlock.java b/src/main/java/com/chailotl/particular/mixin/InjectBlock.java index 3fee8e1..c2afe91 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectBlock.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectBlock.java @@ -59,7 +59,7 @@ public void spawnParticles(BlockState state, World world, BlockPos pos, Random r double x = (double)pos.getX() + random.nextDouble(); double y = (double)pos.getY() + random.nextDouble(); double z = (double)pos.getZ() + random.nextDouble(); - world.addParticle(Particles.CAVE_DUST, x, y, z, 0.0, 0.0, 0.0); + world.addParticleClient(Particles.CAVE_DUST, x, y, z, 0.0, 0.0, 0.0); } } } diff --git a/src/main/java/com/chailotl/particular/mixin/InjectChestBlockEntity.java b/src/main/java/com/chailotl/particular/mixin/InjectChestBlockEntity.java index 74f55e3..afffcc5 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectChestBlockEntity.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectChestBlockEntity.java @@ -93,7 +93,7 @@ private static void randomlyOpen(World world, BlockPos pos, BlockState state, In blockEntity.ticksUntilNextSwitch = world.random.nextBetween(minOpenTime, maxOpenTime); ((AccessorChestBlockEntity) blockEntity).getLidAnimator().setOpen(true); ((InvokerViewerCountManager)manager).invokeOnContainerOpen(world, pos, blockEntity.getCachedState()); - world.playSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundCategory.AMBIENT, 1f, 1f, true); + world.playSoundAtBlockCenterClient(pos, SoundEvents.BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundCategory.AMBIENT, 1f, 1f, true); } } diff --git a/src/main/java/com/chailotl/particular/mixin/InjectContinuousFalling.java b/src/main/java/com/chailotl/particular/mixin/InjectContinuousFalling.java index 6847131..dca508a 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectContinuousFalling.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectContinuousFalling.java @@ -46,7 +46,7 @@ private void addRipples(CallbackInfo ci) float yWater = pos.getY() + fluidState.getHeight(world, pos); if (y < yWater) { - world.addParticle(Particles.WATER_RIPPLE, x, yWater, z, 0, 0, 0); + world.addParticleClient(Particles.WATER_RIPPLE, x, yWater, z, 0, 0, 0); } } } diff --git a/src/main/java/com/chailotl/particular/mixin/InjectEnderChestBlockEntity.java b/src/main/java/com/chailotl/particular/mixin/InjectEnderChestBlockEntity.java index 272f129..744c52e 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectEnderChestBlockEntity.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectEnderChestBlockEntity.java @@ -71,7 +71,7 @@ private static void randomlyOpen(World world, BlockPos pos, BlockState state, In blockEntity.ticksUntilNextSwitch = world.random.nextBetween(minOpenTime, maxOpenTime); ((AccessorEnderChestBlockEntity) blockEntity).getLidAnimator().setOpen(true); ((InvokerViewerCountManager)manager).invokeOnContainerOpen(world, pos, blockEntity.getCachedState()); - world.playSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundCategory.AMBIENT, 1f, 1f, true); + world.playSoundAtBlockCenterClient(pos, SoundEvents.BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundCategory.AMBIENT, 1f, 1f, true); } } diff --git a/src/main/java/com/chailotl/particular/mixin/InjectEntity.java b/src/main/java/com/chailotl/particular/mixin/InjectEntity.java index e3f41ad..e8c61be 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectEntity.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectEntity.java @@ -86,7 +86,9 @@ private void waterParticles(CallbackInfo ci) if (!foundSurface) { return; } + if (velocities.size() < 2) { return; } + // 3D splash - getWorld().addParticle(Particles.WATER_SPLASH_EMITTER, getX(), baseY + prevState.getHeight(), getZ(), dimensions.width(), Collections.max(velocities), 0.0); + getWorld().addParticleClient(Particles.WATER_SPLASH_EMITTER, getX(), baseY + prevState.getHeight(), getZ(), dimensions.width(), Collections.max(velocities), 0.0); } } \ No newline at end of file diff --git a/src/main/java/com/chailotl/particular/mixin/InjectWaterFluid.java b/src/main/java/com/chailotl/particular/mixin/InjectWaterFluid.java index 091e742..c609d3f 100644 --- a/src/main/java/com/chailotl/particular/mixin/InjectWaterFluid.java +++ b/src/main/java/com/chailotl/particular/mixin/InjectWaterFluid.java @@ -48,7 +48,7 @@ private void waterParticles(World world, BlockPos pos, FluidState state, Random z += random.nextDouble(); } - world.addParticle(Particles.WATERFALL_SPRAY, x, y, z, 0.0, 0.0, 0.0); + world.addParticleClient(Particles.WATERFALL_SPRAY, x, y, z, 0.0, 0.0, 0.0); } else { @@ -56,7 +56,7 @@ private void waterParticles(World world, BlockPos pos, FluidState state, Random double y = (double) pos.getY() + (random.nextDouble() * state.getHeight()); double z = (double) pos.getZ() + random.nextDouble(); Vec3d vel = state.getVelocity(world, pos).multiply(0.075); - world.addParticle(Particles.WATERFALL_SPRAY, x, y, z, vel.x, 0.0, vel.z); + world.addParticleClient(Particles.WATERFALL_SPRAY, x, y, z, vel.x, 0.0, vel.z); } } } diff --git a/src/main/java/com/chailotl/particular/particles/WaterRippleParticle.java b/src/main/java/com/chailotl/particular/particles/WaterRippleParticle.java index 8e2a928..ec1b57c 100644 --- a/src/main/java/com/chailotl/particular/particles/WaterRippleParticle.java +++ b/src/main/java/com/chailotl/particular/particles/WaterRippleParticle.java @@ -28,9 +28,9 @@ protected WaterRippleParticle(ClientWorld world, double x, double y, double z, S @Override public void tick() { - prevPosX = x; - prevPosY = y; - prevPosZ = z; + lastX = x; + lastY = y; + lastZ = z; if (age++ >= maxAge) { markDead(); @@ -51,9 +51,9 @@ public ParticleTextureSheet getType() public void render(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); - float f = (float)(MathHelper.lerp(tickDelta, prevPosX, x) - vec3d.getX()); - float g = (float)(MathHelper.lerp(tickDelta, prevPosY, y) - vec3d.getY()); - float h = (float)(MathHelper.lerp(tickDelta, prevPosZ, z) - vec3d.getZ()); + float f = (float)(MathHelper.lerp(tickDelta, lastX, x) - vec3d.getX()); + float g = (float)(MathHelper.lerp(tickDelta, lastY, y) - vec3d.getY()); + float h = (float)(MathHelper.lerp(tickDelta, lastZ, z) - vec3d.getZ()); Vector3f[] vector3fs = new Vector3f[]{new Vector3f(-1.0F, 0.0F, -1.0f), new Vector3f(-1.0F, 0.0F, 1.0F), new Vector3f(1.0F, 0.0F, 1.0F), new Vector3f(1.0F, 0.0F, -1.0F)}; float j = getSize(tickDelta); diff --git a/src/main/java/com/chailotl/particular/particles/WaterfallSprayParticle.java b/src/main/java/com/chailotl/particular/particles/WaterfallSprayParticle.java index b359d84..1b98129 100644 --- a/src/main/java/com/chailotl/particular/particles/WaterfallSprayParticle.java +++ b/src/main/java/com/chailotl/particular/particles/WaterfallSprayParticle.java @@ -34,9 +34,9 @@ protected WaterfallSprayParticle(ClientWorld clientWorld, double d, double e, do @Override public void tick() { - prevPosX = x; - prevPosY = y; - prevPosZ = z; + lastX = x; + lastY = y; + lastZ = z; if (maxAge-- <= 0) { diff --git a/src/main/java/com/chailotl/particular/particles/leaves/LeafParticle.java b/src/main/java/com/chailotl/particular/particles/leaves/LeafParticle.java index 1c8f52b..e61c49f 100644 --- a/src/main/java/com/chailotl/particular/particles/leaves/LeafParticle.java +++ b/src/main/java/com/chailotl/particular/particles/leaves/LeafParticle.java @@ -94,7 +94,7 @@ else if (!expiring && (onGround || velocityY == 0)) } } - prevAngle = angle; + lastAngle = angle; BlockPos pos = BlockPos.ofFloored(x, y, z); FluidState fluidState = world.getFluidState(pos); @@ -105,7 +105,7 @@ else if (!expiring && (onGround || velocityY == 0)) y = pos.getY() + fluidState.getHeight(world, pos); if (Main.CONFIG.fallingLeavesSettings.spawnRipples()) { - world.addParticle(Particles.WATER_RIPPLE, x, y, z, 0, 0, 0); + world.addParticleClient(Particles.WATER_RIPPLE, x, y, z, 0, 0, 0); } } @@ -134,9 +134,9 @@ public ParticleTextureSheet getType() public void render(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); - float f = (float)(MathHelper.lerp(tickDelta, prevPosX, x) - vec3d.getX()); - float g = (float)(MathHelper.lerp(tickDelta, prevPosY, y) - vec3d.getY()); - float h = (float)(MathHelper.lerp(tickDelta, prevPosZ, z) - vec3d.getZ()); + float f = (float)(MathHelper.lerp(tickDelta, lastX, x) - vec3d.getX()); + float g = (float)(MathHelper.lerp(tickDelta, lastY, y) - vec3d.getY()); + float h = (float)(MathHelper.lerp(tickDelta, lastZ, z) - vec3d.getZ()); Vector3f[] vector3fs; float j = getSize(tickDelta); @@ -153,7 +153,7 @@ public void render(VertexConsumer vertexConsumer, Camera camera, float tickDelta else { quaternionf = new Quaternionf(camera.getRotation()); - quaternionf.rotateZ(MathHelper.lerp(tickDelta, prevAngle, angle)); + quaternionf.rotateZ(MathHelper.lerp(tickDelta, lastAngle, angle)); } for (int k = 0; k < 4; ++k) @@ -203,7 +203,7 @@ else if (age > maxAge - fadeOutDuration) l = m; m = temp; } - + vertexConsumer.vertex(vector3fs[0].x(), vector3fs[0].y(), vector3fs[0].z()).texture(m, o).color(red, green, blue, alpha).light(p); vertexConsumer.vertex(vector3fs[1].x(), vector3fs[1].y(), vector3fs[1].z()).texture(m, n).color(red, green, blue, alpha).light(p); vertexConsumer.vertex(vector3fs[2].x(), vector3fs[2].y(), vector3fs[2].z()).texture(l, n).color(red, green, blue, alpha).light(p); diff --git a/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashEmitterParticle.java b/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashEmitterParticle.java index dfe88b2..f8dc487 100644 --- a/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashEmitterParticle.java +++ b/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashEmitterParticle.java @@ -29,9 +29,9 @@ public class WaterSplashEmitterParticle extends NoRenderParticle this.width = width; this.height = (speed / 2f + width / 3f); - clientWorld.addParticle(Particles.WATER_SPLASH, x, y, z, width, this.height, 0); - clientWorld.addParticle(Particles.WATER_SPLASH_FOAM, x, y, z, width, this.height, 0); - clientWorld.addParticle(Particles.WATER_SPLASH_RING, x, y, z, width, 0, 0); + clientWorld.addParticleClient(Particles.WATER_SPLASH, x, y, z, width, this.height, 0); + clientWorld.addParticleClient(Particles.WATER_SPLASH_FOAM, x, y, z, width, this.height, 0); + clientWorld.addParticleClient(Particles.WATER_SPLASH_RING, x, y, z, width, 0, 0); if (speed > 0.5) { @@ -50,9 +50,9 @@ public void tick() if (age == 8) { - world.addParticle(Particles.WATER_SPLASH, x, y, z, width * 0.66f, height * 2f, 0); - world.addParticle(Particles.WATER_SPLASH_FOAM, x, y, z, width * 0.66f, height * 2f, 0); - world.addParticle(Particles.WATER_SPLASH_RING, x, y, z, width * 0.66f, 0, 0); + world.addParticleClient(Particles.WATER_SPLASH, x, y, z, width * 0.66f, height * 2f, 0); + world.addParticleClient(Particles.WATER_SPLASH_FOAM, x, y, z, width * 0.66f, height * 2f, 0); + world.addParticleClient(Particles.WATER_SPLASH_RING, x, y, z, width * 0.66f, 0, 0); splash(width * 0.66f, (3f/8f + speed * 1/8f) + (width / 6f), 0.05f); } diff --git a/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashParticle.java b/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashParticle.java index 71ad6f7..23bd897 100644 --- a/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashParticle.java +++ b/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashParticle.java @@ -63,9 +63,9 @@ public void tick() public void render(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); - float f = (float)(MathHelper.lerp(tickDelta, prevPosX, x) - vec3d.getX()); - float g = (float)(MathHelper.lerp(tickDelta, prevPosY, y) - vec3d.getY()); - float h = (float)(MathHelper.lerp(tickDelta, prevPosZ, z) - vec3d.getZ()); + float f = (float)(MathHelper.lerp(tickDelta, lastX, x) - vec3d.getX()); + float g = (float)(MathHelper.lerp(tickDelta, lastY, y) - vec3d.getY()); + float h = (float)(MathHelper.lerp(tickDelta, lastZ, z) - vec3d.getZ()); Vector3f[] vector3fs = new Vector3f[]{new Vector3f(-1.0F, 0.0F, -1.0f), new Vector3f(-1.0F, 0.0F, 1.0F), new Vector3f(1.0F, 0.0F, 1.0F), new Vector3f(1.0F, 0.0F, -1.0F)}; float ageDelta = MathHelper.lerp(tickDelta, age - 1, (float)age); diff --git a/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashRingParticle.java b/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashRingParticle.java index 150595b..86ec943 100644 --- a/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashRingParticle.java +++ b/src/main/java/com/chailotl/particular/particles/splashes/WaterSplashRingParticle.java @@ -51,9 +51,9 @@ public void tick() public void render(VertexConsumer vertexConsumer, Camera camera, float tickDelta) { Vec3d vec3d = camera.getPos(); - float f = (float) (MathHelper.lerp(tickDelta, prevPosX, x) - vec3d.getX()); - float g = (float) (MathHelper.lerp(tickDelta, prevPosY, y) - vec3d.getY()); - float h = (float) (MathHelper.lerp(tickDelta, prevPosZ, z) - vec3d.getZ()); + float f = (float) (MathHelper.lerp(tickDelta, lastX, x) - vec3d.getX()); + float g = (float) (MathHelper.lerp(tickDelta, lastY, y) - vec3d.getY()); + float h = (float) (MathHelper.lerp(tickDelta, lastZ, z) - vec3d.getZ()); Vector3f[] vector3fs = new Vector3f[]{new Vector3f(-1.0F, 0.0F, -1.0f), new Vector3f(-1.0F, 0.0F, 1.0F), new Vector3f(1.0F, 0.0F, 1.0F), new Vector3f(1.0F, 0.0F, -1.0F)}; float ageDelta = MathHelper.lerp(tickDelta, age - 1, (float)age);