From b6f8e3f942604eb8ec9595ef55bdc7a13dad959a Mon Sep 17 00:00:00 2001 From: Maxx <53229958+MBatt1@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:22:50 -0500 Subject: [PATCH] clouds and tag fix --- .../client/render/CloudRendererMixin.java | 36 +++++++++---------- .../blocks/{bricks.json => bookshelves.json} | 2 +- .../resources/data/c/tags/blocks/chains.json | 6 ++++ .../data/c/tags/blocks/cobblestones.json | 6 ++++ .../data/c/tags/blocks/dressed_bark.json | 9 ----- .../data/c/tags/blocks/dressed_logs.json | 9 ----- .../blocks/{glass_panes.json => stones.json} | 1 + .../data/c/tags/blocks/stripped_bark.json | 9 ----- .../data/c/tags/blocks/stripped_logs.json | 9 ----- .../data/c/tags/item/foods/cooked_meat.json | 6 ++++ .../foods/raw_meat.json} | 1 + .../data/fabric/tags/items/axes.json | 8 ----- .../data/fabric/tags/items/cooked_meat.json | 13 ------- .../data/fabric/tags/items/hoes.json | 8 ----- .../data/fabric/tags/items/pickaxes.json | 8 ----- .../data/fabric/tags/items/raw_meat.json | 13 ------- .../data/fabric/tags/items/shovels.json | 8 ----- .../data/fabric/tags/items/swords.json | 8 ----- 18 files changed, 38 insertions(+), 122 deletions(-) rename src/main/resources/data/c/tags/blocks/{bricks.json => bookshelves.json} (53%) create mode 100644 src/main/resources/data/c/tags/blocks/chains.json create mode 100644 src/main/resources/data/c/tags/blocks/cobblestones.json delete mode 100644 src/main/resources/data/c/tags/blocks/dressed_bark.json delete mode 100644 src/main/resources/data/c/tags/blocks/dressed_logs.json rename src/main/resources/data/c/tags/blocks/{glass_panes.json => stones.json} (58%) delete mode 100644 src/main/resources/data/c/tags/blocks/stripped_bark.json delete mode 100644 src/main/resources/data/c/tags/blocks/stripped_logs.json create mode 100644 src/main/resources/data/c/tags/item/foods/cooked_meat.json rename src/main/resources/data/c/tags/{blocks/glass_blocks.json => item/foods/raw_meat.json} (58%) delete mode 100644 src/main/resources/data/fabric/tags/items/axes.json delete mode 100644 src/main/resources/data/fabric/tags/items/cooked_meat.json delete mode 100644 src/main/resources/data/fabric/tags/items/hoes.json delete mode 100644 src/main/resources/data/fabric/tags/items/pickaxes.json delete mode 100644 src/main/resources/data/fabric/tags/items/raw_meat.json delete mode 100644 src/main/resources/data/fabric/tags/items/shovels.json delete mode 100644 src/main/resources/data/fabric/tags/items/swords.json diff --git a/src/main/java/net/id/paradiselost/mixin/client/render/CloudRendererMixin.java b/src/main/java/net/id/paradiselost/mixin/client/render/CloudRendererMixin.java index 686170057..d88a05b8d 100644 --- a/src/main/java/net/id/paradiselost/mixin/client/render/CloudRendererMixin.java +++ b/src/main/java/net/id/paradiselost/mixin/client/render/CloudRendererMixin.java @@ -62,7 +62,7 @@ public CloudRendererMixin() { throw new NullPointerException("null cannot be cast to non-null type net.minecraft.client.world.ClientWorld"); } - @Inject(method = "renderClouds(Lnet/minecraft/client/util/math/MatrixStack;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;FDDD)V", at = @At("HEAD"), cancellable = true) + @Inject(method = "renderClouds", at = @At("HEAD"), cancellable = true) public void renderClouds(MatrixStack matrices, Matrix4f matrix4f, Matrix4f matrix4f2, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) { if (world.getRegistryKey() == ParadiseLostDimension.PARADISE_LOST_WORLD_KEY) { internalCloudRender(matrices, matrix4f, matrix4f2, tickDelta, cameraX, cameraY, cameraZ, 160, 1f, 1f); @@ -74,24 +74,21 @@ public void renderClouds(MatrixStack matrices, Matrix4f matrix4f, Matrix4f matri // TODO: Replace this mostly copy-pasted code with some redirects or injections (PL-1.7) private void internalCloudRender(MatrixStack matrices, Matrix4f matrix4f, Matrix4f matrix4f2, float tickDelta, double cameraX, double cameraY, double cameraZ, float cloudOffset, float cloudScale, float speedMod) { - float f = this.world.getDimensionEffects().getCloudsHeight(); - if (!Float.isNaN(f)) { - float g = 12.0F; - float h = 4.0F; - double d = 2.0E-4; - double e = (((float)this.ticks + tickDelta) * 0.03F); - double i = (cameraX + e) / 12.0; - double j = (f - (float)cameraY + 0.33F); - double k = cameraZ / 12.0 + 0.33000001311302185; - i -= (MathHelper.floor(i / 2048.0) * 2048); - k -= (MathHelper.floor(k / 2048.0) * 2048); - float l = (float)(i - (double)MathHelper.floor(i)); - float m = (float)(j / 4.0 - (double)MathHelper.floor(j / 4.0)) * 4.0F; - float n = (float)(k - (double)MathHelper.floor(k)); + float cloudHeight = this.world.getDimensionEffects().getCloudsHeight(); + if (!Float.isNaN(cloudHeight)) { + double speed = ((this.ticks + tickDelta) * (0.03F * speedMod)); + double posX = (cameraX + speed) / 12.0D / cloudScale; + double posY = (cloudHeight - cameraY + cloudOffset) / cloudScale + 0.33F; + double posZ = cameraZ / 12.0D / cloudScale + 0.33000001311302185D; + posX -= (MathHelper.floor(posX / 2048.0) * 2048); + posZ -= (MathHelper.floor(posZ / 2048.0) * 2048); + float l = (float)(posX - (double)MathHelper.floor(posX)); + float m = (float)(posY / 4.0 - (double)MathHelper.floor(posY / 4.0)) * 4.0F; + float n = (float)(posZ - (double)MathHelper.floor(posZ)); Vec3d vec3d = this.world.getCloudsColor(tickDelta); - int o = (int)Math.floor(i); - int p = (int)Math.floor(j / 4.0); - int q = (int)Math.floor(k); + int o = (int)Math.floor(posX); + int p = (int)Math.floor(posY / 4.0); + int q = (int)Math.floor(posZ); if (o != this.lastCloudsBlockX || p != this.lastCloudsBlockY || q != this.lastCloudsBlockZ || this.client.options.getCloudRenderModeValue() != this.lastCloudRenderMode || this.lastCloudsColor.squaredDistanceTo(vec3d) > 2.0E-4) { this.lastCloudsBlockX = o; this.lastCloudsBlockY = p; @@ -109,7 +106,7 @@ private void internalCloudRender(MatrixStack matrices, Matrix4f matrix4f, Matrix } this.cloudsBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - BufferBuilder.BuiltBuffer builtBuffer = this.renderClouds(bufferBuilder, i, j, k, vec3d); + BufferBuilder.BuiltBuffer builtBuffer = this.renderClouds(bufferBuilder, posX, posY, posZ, vec3d); this.cloudsBuffer.bind(); this.cloudsBuffer.upload(builtBuffer); VertexBuffer.unbind(); @@ -119,6 +116,7 @@ private void internalCloudRender(MatrixStack matrices, Matrix4f matrix4f, Matrix matrices.push(); matrices.multiplyPositionMatrix(matrix4f); matrices.scale(12.0F, 1.0F, 12.0F); + matrices.scale(cloudScale, cloudScale, cloudScale); matrices.translate(-l, m, -n); if (this.cloudsBuffer != null) { this.cloudsBuffer.bind(); diff --git a/src/main/resources/data/c/tags/blocks/bricks.json b/src/main/resources/data/c/tags/blocks/bookshelves.json similarity index 53% rename from src/main/resources/data/c/tags/blocks/bricks.json rename to src/main/resources/data/c/tags/blocks/bookshelves.json index f090399be..ac8f1aca1 100644 --- a/src/main/resources/data/c/tags/blocks/bricks.json +++ b/src/main/resources/data/c/tags/blocks/bookshelves.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "paradise_lost:floestone_brick" + "paradise_lost:aurel_bookshelf" ] } diff --git a/src/main/resources/data/c/tags/blocks/chains.json b/src/main/resources/data/c/tags/blocks/chains.json new file mode 100644 index 000000000..34020e51c --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/chains.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "paradise_lost:olvite_chain" + ] +} diff --git a/src/main/resources/data/c/tags/blocks/cobblestones.json b/src/main/resources/data/c/tags/blocks/cobblestones.json new file mode 100644 index 000000000..09ae79143 --- /dev/null +++ b/src/main/resources/data/c/tags/blocks/cobblestones.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "paradise_lost:cobbled_floestone" + ] +} diff --git a/src/main/resources/data/c/tags/blocks/dressed_bark.json b/src/main/resources/data/c/tags/blocks/dressed_bark.json deleted file mode 100644 index bae17f3bd..000000000 --- a/src/main/resources/data/c/tags/blocks/dressed_bark.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:aurel_wood", - "paradise_lost:orange_wood", - "paradise_lost:mother_aurel_wood", - "paradise_lost:wisteria_wood" - ] -} diff --git a/src/main/resources/data/c/tags/blocks/dressed_logs.json b/src/main/resources/data/c/tags/blocks/dressed_logs.json deleted file mode 100644 index 6861f6e1d..000000000 --- a/src/main/resources/data/c/tags/blocks/dressed_logs.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:aurel_log", - "paradise_lost:mother_aurel_log", - "paradise_lost:orange_log", - "paradise_lost:wisteria_log" - ] -} diff --git a/src/main/resources/data/c/tags/blocks/glass_panes.json b/src/main/resources/data/c/tags/blocks/stones.json similarity index 58% rename from src/main/resources/data/c/tags/blocks/glass_panes.json rename to src/main/resources/data/c/tags/blocks/stones.json index d275da3f4..1348f2fc3 100644 --- a/src/main/resources/data/c/tags/blocks/glass_panes.json +++ b/src/main/resources/data/c/tags/blocks/stones.json @@ -1,5 +1,6 @@ { "replace": false, "values": [ + "paradise_lost:floestone" ] } diff --git a/src/main/resources/data/c/tags/blocks/stripped_bark.json b/src/main/resources/data/c/tags/blocks/stripped_bark.json deleted file mode 100644 index 9f6745514..000000000 --- a/src/main/resources/data/c/tags/blocks/stripped_bark.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:stripped_aurel_wood", - "paradise_lost:stripped_orange_wood", - "paradise_lost:stripped_mother_aurel_wood", - "paradise_lost:stripped_wisteria_wood" - ] -} diff --git a/src/main/resources/data/c/tags/blocks/stripped_logs.json b/src/main/resources/data/c/tags/blocks/stripped_logs.json deleted file mode 100644 index a807d8893..000000000 --- a/src/main/resources/data/c/tags/blocks/stripped_logs.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:stripped_aurel_log", - "paradise_lost:stripped_mother_aurel_log", - "paradise_lost:stripped_orange_log", - "paradise_lost:stripped_wisteria_log" - ] -} diff --git a/src/main/resources/data/c/tags/item/foods/cooked_meat.json b/src/main/resources/data/c/tags/item/foods/cooked_meat.json new file mode 100644 index 000000000..ca5ff012e --- /dev/null +++ b/src/main/resources/data/c/tags/item/foods/cooked_meat.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "#paradise_lost:cooked_meat" + ] +} diff --git a/src/main/resources/data/c/tags/blocks/glass_blocks.json b/src/main/resources/data/c/tags/item/foods/raw_meat.json similarity index 58% rename from src/main/resources/data/c/tags/blocks/glass_blocks.json rename to src/main/resources/data/c/tags/item/foods/raw_meat.json index d275da3f4..48ec94bdc 100644 --- a/src/main/resources/data/c/tags/blocks/glass_blocks.json +++ b/src/main/resources/data/c/tags/item/foods/raw_meat.json @@ -1,5 +1,6 @@ { "replace": false, "values": [ + "#paradise_lost:raw_meat" ] } diff --git a/src/main/resources/data/fabric/tags/items/axes.json b/src/main/resources/data/fabric/tags/items/axes.json deleted file mode 100644 index f7893f82d..000000000 --- a/src/main/resources/data/fabric/tags/items/axes.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:olvite_axe", - "paradise_lost:glazed_gold_axe", - "paradise_lost:surtrum_axe" - ] -} diff --git a/src/main/resources/data/fabric/tags/items/cooked_meat.json b/src/main/resources/data/fabric/tags/items/cooked_meat.json deleted file mode 100644 index f6ecb9e28..000000000 --- a/src/main/resources/data/fabric/tags/items/cooked_meat.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:cooked_beef", - "minecraft:cooked_porkchop", - "minecraft:cooked_chicken", - "minecraft:cooked_rabbit", - "minecraft:cooked_cod", - "minecraft:cooked_salmon", - "minecraft:cooked_mutton", - "#paradise_lost:cooked_meat" - ] -} diff --git a/src/main/resources/data/fabric/tags/items/hoes.json b/src/main/resources/data/fabric/tags/items/hoes.json deleted file mode 100644 index 727cc6bc7..000000000 --- a/src/main/resources/data/fabric/tags/items/hoes.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:olvite_hoe", - "paradise_lost:glazed_gold_hoe", - "paradise_lost:surtrum_hoe" - ] -} diff --git a/src/main/resources/data/fabric/tags/items/pickaxes.json b/src/main/resources/data/fabric/tags/items/pickaxes.json deleted file mode 100644 index 5c2ecabdb..000000000 --- a/src/main/resources/data/fabric/tags/items/pickaxes.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:olvite_pickaxe", - "paradise_lost:glazed_gold_pickaxe", - "paradise_lost:surtrum_pickaxe" - ] -} diff --git a/src/main/resources/data/fabric/tags/items/raw_meat.json b/src/main/resources/data/fabric/tags/items/raw_meat.json deleted file mode 100644 index 2d4c01309..000000000 --- a/src/main/resources/data/fabric/tags/items/raw_meat.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "replace": false, - "values": [ - "minecraft:beef", - "minecraft:porkchop", - "minecraft:chicken", - "minecraft:rabbit", - "minecraft:cod", - "minecraft:salmon", - "minecraft:mutton", - "#paradise_lost:raw_meat" - ] -} diff --git a/src/main/resources/data/fabric/tags/items/shovels.json b/src/main/resources/data/fabric/tags/items/shovels.json deleted file mode 100644 index aa830f7f4..000000000 --- a/src/main/resources/data/fabric/tags/items/shovels.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:olvite_shovel", - "paradise_lost:glazed_gold_shovel", - "paradise_lost:surtrum_shovel" - ] -} diff --git a/src/main/resources/data/fabric/tags/items/swords.json b/src/main/resources/data/fabric/tags/items/swords.json deleted file mode 100644 index 5f29f3b8d..000000000 --- a/src/main/resources/data/fabric/tags/items/swords.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "replace": false, - "values": [ - "paradise_lost:olvite_sword", - "paradise_lost:glazed_gold_sword", - "paradise_lost:surtrum_sword" - ] -}