From dec756bfcf3de091bec7fa7a7b713719d6bc607b Mon Sep 17 00:00:00 2001 From: Goby56 <60710855+Goby56@users.noreply.github.com> Date: Sat, 24 Aug 2024 11:41:50 +0200 Subject: [PATCH] 1.20.5 --- gradle.properties | 14 +++++++------- src/main/java/com/goby56/wakes/WakesClient.java | 6 +++--- .../java/com/goby56/wakes/event/PickBoat.java | 3 ++- .../wakes/mixin/TameableTeleportMixin.java | 2 +- .../com/goby56/wakes/particle/ModParticles.java | 4 ++-- .../wakes/render/SplashPlaneRenderer.java | 8 +++----- .../com/goby56/wakes/render/WakeTexture.java | 17 ++++++----------- src/main/resources/fabric.mod.json | 6 +++--- 8 files changed, 27 insertions(+), 33 deletions(-) diff --git a/gradle.properties b/gradle.properties index f3402d8..d9c2129 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,21 +4,21 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.20.5 -yarn_mappings=1.20.5+build.1 +minecraft_version=1.21.1 +yarn_mappings=1.21.1+build.3 loader_version=0.16.2 # Fabric API -fabric_version=0.97.8+1.20.5 +fabric_version=0.102.1+1.21.1 # Mod Properties -mod_version=0.3.0+1.20.5 +mod_version=0.3.0+1.21.1 maven_group=com.goby56.wakes archives_base_name=wakes # Dependencies -yacl_version=3.4.2+1.20.5-fabric +yacl_version=3.5.0+1.21-fabric iris_version=1.7.3+1.21 -modmenu_version=10.0.0 +modmenu_version=11.0.0 jankson_version=1.2.2 -satin_version=1.18.0 \ No newline at end of file +satin_version=2.0.0 \ No newline at end of file diff --git a/src/main/java/com/goby56/wakes/WakesClient.java b/src/main/java/com/goby56/wakes/WakesClient.java index de84ca4..cceeafd 100644 --- a/src/main/java/com/goby56/wakes/WakesClient.java +++ b/src/main/java/com/goby56/wakes/WakesClient.java @@ -8,8 +8,6 @@ import com.goby56.wakes.particle.ModParticles; import com.goby56.wakes.render.SplashPlaneRenderer; import com.goby56.wakes.render.WakeRenderer; -import ladysnake.satin.api.managed.ManagedCoreShader; -import ladysnake.satin.api.managed.ShaderEffectManager; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; @@ -21,6 +19,8 @@ import net.irisshaders.iris.api.v0.IrisApi; import net.minecraft.client.render.VertexFormats; import net.minecraft.util.Identifier; +import org.ladysnake.satin.api.managed.ManagedCoreShader; +import org.ladysnake.satin.api.managed.ShaderEffectManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,7 +32,7 @@ public class WakesClient implements ClientModInitializer { public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); public static WakesConfig CONFIG_INSTANCE; public static final ManagedCoreShader TRANSLUCENT_NO_LIGHT_DIRECTION_PROGRAM = ShaderEffectManager.getInstance().manageCoreShader( - new Identifier(MOD_ID, "translucent_no_light_direction"), VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL); + Identifier.of(MOD_ID, "translucent_no_light_direction"), VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL); public static boolean areShadersEnabled = false; @Override diff --git a/src/main/java/com/goby56/wakes/event/PickBoat.java b/src/main/java/com/goby56/wakes/event/PickBoat.java index f290cd0..1bee06d 100644 --- a/src/main/java/com/goby56/wakes/event/PickBoat.java +++ b/src/main/java/com/goby56/wakes/event/PickBoat.java @@ -40,6 +40,7 @@ public ItemStack pick(PlayerEntity player, HitResult result) { private ItemStack getBoatFromType(BoatEntity.Type type) { String waterCraft = type == BoatEntity.Type.BAMBOO ? "raft" : "boat"; - return new ItemStack(Registries.ITEM.get(new Identifier(type.toString() + "_" + waterCraft))); + return new ItemStack(Registries.ITEM.get(Identifier.of(type.toString() + "_" + waterCraft))); + } } diff --git a/src/main/java/com/goby56/wakes/mixin/TameableTeleportMixin.java b/src/main/java/com/goby56/wakes/mixin/TameableTeleportMixin.java index 9ffc8e8..d23fd87 100644 --- a/src/main/java/com/goby56/wakes/mixin/TameableTeleportMixin.java +++ b/src/main/java/com/goby56/wakes/mixin/TameableTeleportMixin.java @@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -@Mixin(FollowOwnerGoal.class) +@Mixin(TameableEntity.class) public class TameableTeleportMixin { @Inject(at = @At("TAIL"), method = "tryTeleportTo") diff --git a/src/main/java/com/goby56/wakes/particle/ModParticles.java b/src/main/java/com/goby56/wakes/particle/ModParticles.java index 69ec621..c589533 100644 --- a/src/main/java/com/goby56/wakes/particle/ModParticles.java +++ b/src/main/java/com/goby56/wakes/particle/ModParticles.java @@ -13,10 +13,10 @@ public class ModParticles { public static WithOwnerParticleType SPLASH_CLOUD; public static void registerParticles() { - SPLASH_PLANE = Registry.register(Registries.PARTICLE_TYPE, new Identifier(WakesClient.MOD_ID, "splash_plane"), new WithOwnerParticleType(true)); + SPLASH_PLANE = Registry.register(Registries.PARTICLE_TYPE, Identifier.of(WakesClient.MOD_ID, "splash_plane"), new WithOwnerParticleType(true)); ParticleFactoryRegistry.getInstance().register(SPLASH_PLANE, SplashPlaneParticle.Factory::new); - SPLASH_CLOUD = Registry.register(Registries.PARTICLE_TYPE, new Identifier(WakesClient.MOD_ID, "splash_cloud"), new WithOwnerParticleType(true)); + SPLASH_CLOUD = Registry.register(Registries.PARTICLE_TYPE, Identifier.of(WakesClient.MOD_ID, "splash_cloud"), new WithOwnerParticleType(true)); ParticleFactoryRegistry.getInstance().register(SPLASH_CLOUD, SplashCloudParticle.Factory::new); } } diff --git a/src/main/java/com/goby56/wakes/render/SplashPlaneRenderer.java b/src/main/java/com/goby56/wakes/render/SplashPlaneRenderer.java index 1e7c4cd..6f24b24 100644 --- a/src/main/java/com/goby56/wakes/render/SplashPlaneRenderer.java +++ b/src/main/java/com/goby56/wakes/render/SplashPlaneRenderer.java @@ -102,8 +102,7 @@ public static void render(T entity, float yaw, float tickDelt } private static void renderSurface(Matrix4f matrix, Vector3f color, int light, boolean slightlyTransparent) { - BufferBuilder buffer = Tessellator.getInstance().getBuffer(); - buffer.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL); + BufferBuilder buffer = Tessellator.getInstance().begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL); // TODO IMPROVE ANIMATION (WATER TRAVELS IN AN OUTWARDS DIRECTION) // AND ADD A BOUNCY FEEL TO IT (BOBBING UP AND DOWN) WAIT IT IS JUST THE BOAT THAT IS DOING THAT // MAYBE ADD TO BLAZINGLY FAST BOATS? @@ -123,14 +122,13 @@ private static void renderSurface(Matrix4f matrix, Vector3f color, int light, bo .texture((float) (vertex.x / tex.width + tex.uvOffset.x), (float) (vertex.y / tex.height + tex.uvOffset.y)) .overlay(OverlayTexture.DEFAULT_UV) .light(light) - .normal((float) normal.x, (float) normal.y, (float) normal.z) - .next(); + .normal((float) normal.x, (float) normal.y, (float) normal.z); } } RenderSystem.disableCull(); RenderSystem.enableDepthTest(); - Tessellator.getInstance().draw(); + BufferRenderer.drawWithGlobalProgram(buffer.end()); RenderSystem.enableCull(); } diff --git a/src/main/java/com/goby56/wakes/render/WakeTexture.java b/src/main/java/com/goby56/wakes/render/WakeTexture.java index 15d9333..b0b9383 100644 --- a/src/main/java/com/goby56/wakes/render/WakeTexture.java +++ b/src/main/java/com/goby56/wakes/render/WakeTexture.java @@ -47,8 +47,7 @@ public void render(Matrix4f matrix, Camera camera, Brick brick) { RenderSystem.setShader(RenderType.getProgram()); RenderSystem.enableDepthTest(); // Is it THIS simple? https://github.com/Goby56/wakes/issues/46 - BufferBuilder buffer = Tessellator.getInstance().getBuffer(); - buffer.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL); + BufferBuilder buffer = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL); Vector3f pos = brick.pos.add(camera.getPos().negate()).toVector3f().add(0, WakeNode.WATER_OFFSET, 0); int light = LightmapTextureManager.MAX_LIGHT_COORDINATE; @@ -57,30 +56,26 @@ public void render(Matrix4f matrix, Camera camera, Brick brick) { .texture(0, 0) .overlay(OverlayTexture.DEFAULT_UV) .light(light) - .normal(0f, 1f, 0f) - .next(); + .normal(0f, 1f, 0f); buffer.vertex(matrix, pos.x, pos.y, pos.z + brick.dim) .color(1f, 1f, 1f, 1f) .texture(0, 1) .overlay(OverlayTexture.DEFAULT_UV) .light(light) - .normal(0f, 1f, 0f) - .next(); + .normal(0f, 1f, 0f); buffer.vertex(matrix, pos.x + brick.dim, pos.y, pos.z + brick.dim) .color(1f, 1f, 1f, 1f) .texture(1, 1) .overlay(OverlayTexture.DEFAULT_UV) .light(light) - .normal(0f, 1f, 0f) - .next(); + .normal(0f, 1f, 0f); buffer.vertex(matrix, pos.x + brick.dim, pos.y, pos.z) .color(1f, 1f, 1f, 1f) .texture(1, 0) .overlay(OverlayTexture.DEFAULT_UV) .light(light) - .normal(0f, 1f, 0f) - .next(); + .normal(0f, 1f, 0f); - Tessellator.getInstance().draw(); + BufferRenderer.drawWithGlobalProgram(buffer.end()); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index c7b0c49..1783d7b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,7 +29,7 @@ ], "depends": { "fabricloader": ">=0.14.21", - "minecraft": "~1.20.5", + "minecraft": "~1.21", "java": ">=21", "fabric-api": "*" }, @@ -37,7 +37,7 @@ "blazingly-fast-boats": "*" }, "recommends": { - "modmenu": ">=10.0.0", - "yet_another_config_lib_v3": ">=3.3.2" + "modmenu": ">=11.0.0", + "yet_another_config_lib_v3": ">=3.5.0" } }