diff --git a/.github/workflows/publish-curseforge.yml b/.github/workflows/publish-curseforge.yml index bf39f3e..a087ebe 100644 --- a/.github/workflows/publish-curseforge.yml +++ b/.github/workflows/publish-curseforge.yml @@ -11,12 +11,12 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - + - name: Set up JDK 17 uses: actions/setup-java@v1 with: java-version: 17 - + - name: Cache Brachyura directory uses: actions/cache@v2 with: @@ -28,7 +28,7 @@ jobs: - name: Build with Brachyura run: java -jar brachyura-bootstrap-0.jar build - + - name: Publish artifacts to CurseForge uses: Kir-Antipov/mc-publish@v3.2 with: @@ -42,9 +42,7 @@ jobs: fabric quilt game-versions: | - 1.19 - 1.19.1 - 1.19.2 + 1.19.3 dependencies: | fabric-api | depends | * cloth-config | depends | * diff --git a/.github/workflows/publish-modrinth.yml b/.github/workflows/publish-modrinth.yml index de4df91..333709b 100644 --- a/.github/workflows/publish-modrinth.yml +++ b/.github/workflows/publish-modrinth.yml @@ -11,12 +11,12 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - + - name: Set up JDK 17 uses: actions/setup-java@v1 with: java-version: 17 - + - name: Cache Brachyura directory uses: actions/cache@v2 with: @@ -28,7 +28,7 @@ jobs: - name: Build with Brachyura run: java -jar brachyura-bootstrap-0.jar build - + - name: Publish artifacts to Modrinth uses: Kir-Antipov/mc-publish@v3.2 with: @@ -42,9 +42,7 @@ jobs: fabric quilt game-versions: | - 1.19 - 1.19.1 - 1.19.2 + 1.19.3 dependencies: | fabric-api | depends | * cloth-config | depends | * diff --git a/buildscript/buildscript.properties b/buildscript/buildscript.properties index 2e1cc5f..28cf533 100644 --- a/buildscript/buildscript.properties +++ b/buildscript/buildscript.properties @@ -1,13 +1,13 @@ # Mod Properties name = visuality -modVersion = 0.5.5 +modVersion = 0.6.0 javaVersion = 17 # Dependencies -minecraftVersion = 1.19.2 -yarnMappings = 1.19.2+build.28 +minecraftVersion = 1.19.3 +yarnMappings = 1.19.3+build.2 fabricLoader = 0.14.11 quiltflower = 1.9.0 -fabricApi = 0.68.0+1.19.2 -clothConfig = 8.2.88 +fabricApi = 0.68.1+1.19.3 +clothConfig = 9.0.93 diff --git a/buildscript/src/main/java/Buildscript.java b/buildscript/src/main/java/Buildscript.java index 88ad02c..03a0b22 100644 --- a/buildscript/src/main/java/Buildscript.java +++ b/buildscript/src/main/java/Buildscript.java @@ -58,13 +58,13 @@ public void getModDependencies(ModDependencyCollector d) { d.addMaven("https://maven.shedaniel.me", new MavenId("me.shedaniel.cloth", "basic-math", "0.6.1"), RUNTIME, COMPILE); // Runtime Mods - d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "lazydfu", "0.1.3"), RUNTIME); - d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "ferrite-core", "5.0.0-fabric"), RUNTIME); - d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "starlight", "1.1.1+1.19"), RUNTIME); - d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "lithium", "mc1.19.2-0.10.2"), RUNTIME); + //d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "lazydfu", "0.1.3"), RUNTIME); + d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "ferrite-core", "5.1.0-fabric"), RUNTIME); + //d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "starlight", "1.1.1+1.19"), RUNTIME); + //d.addMaven("https://api.modrinth.com/maven", new MavenId("maven.modrinth", "lithium", "mc1.19.3-0.10.3"), RUNTIME); // Compatibility - d.addMaven("https://maven.terraformersmc.com", new MavenId("com.terraformersmc", "modmenu", "4.1.1"), RUNTIME, COMPILE); + d.addMaven("https://maven.terraformersmc.com", new MavenId("com.terraformersmc", "modmenu", "5.0.1"), RUNTIME, COMPILE); } public void addFabricModules(ModDependencyCollector d) { diff --git a/src/main/java/visuality/event/CirclesOnWaterEvent.java b/src/main/java/visuality/event/CirclesOnWaterEvent.java index fbd07c4..ffa5a5f 100644 --- a/src/main/java/visuality/event/CirclesOnWaterEvent.java +++ b/src/main/java/visuality/event/CirclesOnWaterEvent.java @@ -45,6 +45,7 @@ public static void onTick(ClientWorld world) { } } + @SuppressWarnings("RedundantIfStatement") private static boolean shown(ClientWorld world) { var client = MinecraftClient.getInstance(); if(!config.waterCircles.enabled) return false; diff --git a/src/main/java/visuality/mixin/BlockMixin.java b/src/main/java/visuality/mixin/BlockMixin.java index 7587b3a..33f564a 100644 --- a/src/main/java/visuality/mixin/BlockMixin.java +++ b/src/main/java/visuality/mixin/BlockMixin.java @@ -5,7 +5,7 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.item.ItemConvertible; -import net.minecraft.tag.BlockTags; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; diff --git a/src/main/java/visuality/particle/WaterCircleParticle.java b/src/main/java/visuality/particle/WaterCircleParticle.java index 0ba2f1d..1c42123 100644 --- a/src/main/java/visuality/particle/WaterCircleParticle.java +++ b/src/main/java/visuality/particle/WaterCircleParticle.java @@ -6,13 +6,13 @@ import net.minecraft.client.world.ClientWorld; import net.minecraft.particle.DefaultParticleType; import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.Quaternion; import net.minecraft.util.math.Vec3d; -import net.minecraft.util.math.Vec3f; +import org.joml.Quaternionf; +import org.joml.Vector3f; public class WaterCircleParticle extends SpriteBillboardParticle { private final SpriteProvider sprites; - private static final Quaternion QUATERNION = new Quaternion(0F, -0.7F, 0.7F, 0F); + private static final Quaternionf QUATERNION = new Quaternionf(0F, -0.7F, 0.7F, 0F); private WaterCircleParticle(ClientWorld world, double x, double y, double z, double color, SpriteProvider sprites) { super(world, x, y, z, 0, 0, 0); @@ -44,19 +44,20 @@ public void tick() { } } + @Override public void buildGeometry(VertexConsumer buffer, Camera camera, float ticks) { Vec3d vec3 = camera.getPos(); float x = (float) (MathHelper.lerp(ticks, this.prevPosX, this.x) - vec3.getX()); float y = (float) (MathHelper.lerp(ticks, this.prevPosY, this.y) - vec3.getY()); float z = (float) (MathHelper.lerp(ticks, this.prevPosZ, this.z) - vec3.getZ()); - Vec3f[] vector3fs = new Vec3f[]{new Vec3f(-1.0F, -1.0F, 0.0F), new Vec3f(-1.0F, 1.0F, 0.0F), new Vec3f(1.0F, 1.0F, 0.0F), new Vec3f(1.0F, -1.0F, 0.0F)}; + Vector3f[] vector3fs = new Vector3f[]{new Vector3f(-1.0F, -1.0F, 0.0F), new Vector3f(-1.0F, 1.0F, 0.0F), new Vector3f(1.0F, 1.0F, 0.0F), new Vector3f(1.0F, -1.0F, 0.0F)}; float f4 = this.getSize(ticks); for(int i = 0; i < 4; ++i) { - Vec3f vector3f = vector3fs[i]; + Vector3f vector3f = vector3fs[i]; vector3f.rotate(QUATERNION); - vector3f.scale(f4); + vector3f.mul(f4); vector3f.add(x, y, z); } @@ -65,10 +66,10 @@ public void buildGeometry(VertexConsumer buffer, Camera camera, float ticks) { float f5 = this.getMinV(); float f6 = this.getMaxV(); int light = this.getBrightness(ticks); - buffer.vertex(vector3fs[0].getX(), vector3fs[0].getY(), vector3fs[0].getZ()).texture(f8, f6).color(this.red, this.green, this.blue, this.alpha).light(light).next(); - buffer.vertex(vector3fs[1].getX(), vector3fs[1].getY(), vector3fs[1].getZ()).texture(f8, f5).color(this.red, this.green, this.blue, this.alpha).light(light).next(); - buffer.vertex(vector3fs[2].getX(), vector3fs[2].getY(), vector3fs[2].getZ()).texture(f7, f5).color(this.red, this.green, this.blue, this.alpha).light(light).next(); - buffer.vertex(vector3fs[3].getX(), vector3fs[3].getY(), vector3fs[3].getZ()).texture(f7, f6).color(this.red, this.green, this.blue, this.alpha).light(light).next(); + buffer.vertex(vector3fs[0].x(), vector3fs[0].y(), vector3fs[0].z()).texture(f8, f6).color(this.red, this.green, this.blue, this.alpha).light(light).next(); + buffer.vertex(vector3fs[1].x(), vector3fs[1].y(), vector3fs[1].z()).texture(f8, f5).color(this.red, this.green, this.blue, this.alpha).light(light).next(); + buffer.vertex(vector3fs[2].x(), vector3fs[2].y(), vector3fs[2].z()).texture(f7, f5).color(this.red, this.green, this.blue, this.alpha).light(light).next(); + buffer.vertex(vector3fs[3].x(), vector3fs[3].y(), vector3fs[3].z()).texture(f7, f6).color(this.red, this.green, this.blue, this.alpha).light(light).next(); } @Override diff --git a/src/main/java/visuality/registry/HitParticleRegistry.java b/src/main/java/visuality/registry/HitParticleRegistry.java index ec89895..8ad7e35 100644 --- a/src/main/java/visuality/registry/HitParticleRegistry.java +++ b/src/main/java/visuality/registry/HitParticleRegistry.java @@ -3,8 +3,8 @@ import net.minecraft.entity.EntityType; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleType; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import visuality.VisualityMod; import java.util.ArrayList; @@ -29,11 +29,11 @@ public static void reload() { } private static Optional> getEntityFromString(String id) { - return Registry.ENTITY_TYPE.getOrEmpty(new Identifier(id)); + return Registries.ENTITY_TYPE.getOrEmpty(new Identifier(id)); } private static Optional> getParticleFromString(String id) { - return Registry.PARTICLE_TYPE.getOrEmpty(new Identifier(id)); + return Registries.PARTICLE_TYPE.getOrEmpty(new Identifier(id)); } public record Entry(EntityType entity, ParticleEffect particle) { diff --git a/src/main/java/visuality/registry/ShinyArmorRegistry.java b/src/main/java/visuality/registry/ShinyArmorRegistry.java index b96c1a0..10d5f52 100644 --- a/src/main/java/visuality/registry/ShinyArmorRegistry.java +++ b/src/main/java/visuality/registry/ShinyArmorRegistry.java @@ -1,8 +1,8 @@ package visuality.registry; import net.minecraft.item.Item; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import visuality.VisualityMod; import java.util.ArrayList; @@ -19,6 +19,6 @@ public static void reload() { } private static Optional getItemFromString(String id) { - return Registry.ITEM.getOrEmpty(new Identifier(id)); + return Registries.ITEM.getOrEmpty(new Identifier(id)); } } diff --git a/src/main/java/visuality/registry/ShinyBlockRegistry.java b/src/main/java/visuality/registry/ShinyBlockRegistry.java index 02af3e5..d20d360 100644 --- a/src/main/java/visuality/registry/ShinyBlockRegistry.java +++ b/src/main/java/visuality/registry/ShinyBlockRegistry.java @@ -2,8 +2,8 @@ import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import visuality.VisualityMod; import java.util.ArrayList; @@ -20,6 +20,6 @@ public static void reload() { } private static Optional getBlockFromString(String id) { - return Registry.BLOCK.getOrEmpty(new Identifier(id)); + return Registries.BLOCK.getOrEmpty(new Identifier(id)); } } diff --git a/src/main/java/visuality/registry/VisualityParticles.java b/src/main/java/visuality/registry/VisualityParticles.java index 386c2ff..20de082 100644 --- a/src/main/java/visuality/registry/VisualityParticles.java +++ b/src/main/java/visuality/registry/VisualityParticles.java @@ -3,7 +3,8 @@ import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry; import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes; import net.minecraft.particle.DefaultParticleType; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import visuality.VisualityMod; import visuality.particle.*; @@ -32,7 +33,7 @@ public static void init() { } private static DefaultParticleType add(String name, ParticleFactoryRegistry.PendingParticleFactory constructor) { - var particle = Registry.register(Registry.PARTICLE_TYPE, VisualityMod.id(name), FabricParticleTypes.simple()); + var particle = Registry.register(Registries.PARTICLE_TYPE, VisualityMod.id(name), FabricParticleTypes.simple()); FACTORIES.put(particle, constructor); return particle; } diff --git a/src/main/resources/assets/visuality/lang/en_us.json b/src/main/resources/assets/visuality/lang/en_us.json index a924019..047bc26 100644 --- a/src/main/resources/assets/visuality/lang/en_us.json +++ b/src/main/resources/assets/visuality/lang/en_us.json @@ -1,5 +1,5 @@ { - "modmenu.descriptionTranslation.visuality": "Visual improvements by adding a bunch of new particles.", + "modmenu.descriptionTranslation.visuality": "Little visual improvements by adding a bunch of new particles.", "config.visuality.title": "Visuality Config", "config.visuality.general": "General", "config.visuality.option.slime": "Slime Blobs Enabled", @@ -16,4 +16,4 @@ "config.visuality.option.shinyArmor.entries": "Shiny Armor Entries", "config.visuality.option.shinyBlocks": "Shiny Blocks Enabled", "config.visuality.option.shinyBlocks.entries": "Shiny Blocks Entries" -} \ No newline at end of file +} diff --git a/src/main/resources/assets/visuality/particles/underwater_bubble.json b/src/main/resources/assets/visuality/particles/underwater_bubble.json deleted file mode 100644 index aa44c5d..0000000 --- a/src/main/resources/assets/visuality/particles/underwater_bubble.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "textures": [ - "visuality:underwater_bubble" - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/visuality/textures/particle/underwater_bubble.png b/src/main/resources/assets/visuality/textures/particle/underwater_bubble.png deleted file mode 100644 index c91be37..0000000 Binary files a/src/main/resources/assets/visuality/textures/particle/underwater_bubble.png and /dev/null differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index eeeb2f3..e057c63 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "visuality", - "version": "${version}", + "version": "dev", "name": "Visuality", "description": "Little visual improvements by adding a bunch of new particles.", "authors": [ @@ -37,7 +37,7 @@ "fabricloader": "*", "fabric-api": "*", "cloth-config": "*", - "minecraft": ">=1.19", + "minecraft": ">=1.19.3", "java": ">=17" } }