diff --git a/Fabric/build.gradle b/Fabric/build.gradle index e2d3afa..fd46494 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.13.9' + id 'fabric-loom' version '1.7.2' } version = "${mc_version}-${build_number}-FABRIC" @@ -31,8 +31,8 @@ dependencies { minecraft "com.mojang:minecraft:${mc_version}" mappings loom.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:0.14.21" - modImplementation "net.fabricmc.fabric-api:fabric-api:0.83.0+1.20" + modImplementation "net.fabricmc:fabric-loader:0.16.0" + modImplementation "net.fabricmc.fabric-api:fabric-api:0.100.8+1.21" compileOnly project(":Xplat") diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 3692843..4368dac 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -8,7 +8,8 @@ "authors": [ "Vazkii", "williewillus", - "Alwinfy" + "Alwinfy", + "Uraneptus" ], "contact": { "irc": "ircs://irc.esper.net:6697/vazkii", @@ -31,8 +32,8 @@ "accessWidener": "neat.accesswidener", "depends": { - "fabricloader": ">=0.14.14", - "fabric": ">=0.76", - "minecraft": ">=1.19.4" + "fabricloader": ">=0.16.0", + "fabric": ">=0.100", + "minecraft": ">=1.21" } } diff --git a/Forge/build.gradle b/Forge/build.gradle deleted file mode 100644 index c0b59cf..0000000 --- a/Forge/build.gradle +++ /dev/null @@ -1,86 +0,0 @@ -buildscript { - repositories { - maven { - url = 'https://maven.minecraftforge.net' - } - maven { - url = 'https://repo.spongepowered.org/repository/maven-public/' - content { includeGroup "org.spongepowered" } - } - mavenCentral() - } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:6.0.6' - classpath 'org.spongepowered:mixingradle:0.7.33' - } -} - -apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'eclipse' -apply plugin: 'org.spongepowered.mixin' - -version = "${project.mc_version}-${project.build_number}-FORGE" - -mixin { - add sourceSets.main, "neat.refmap.json" - config "neat.mixins.json" -} - -minecraft { - mappings channel: "official", version: "${project.mc_version}" - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - - runs { - client { - workingDirectory project.file('../run') - property 'forge.logging.console.level', 'debug' - ideaModule "${rootProject.name}.${project.name}.main" - - mods { - neat { - source sourceSets.main - source project(":Xplat").sourceSets.main - } - } - } - } -} - -dependencies { - minecraft "net.minecraftforge:forge:${project.mc_version}-${project.forge_version}" - compileOnly project(":Xplat") - annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' -} - -compileJava { - source(project(":Xplat").sourceSets.main.allSource) - options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation,-serial" << "-Werror" -} - -sourcesJar { - from project(":Xplat").sourceSets.main.allJava -} - -processResources { - from project(":Xplat").sourceSets.main.resources - inputs.property "version", project.version - - filesMatching("META-INF/mods.toml") { - expand "version": project.version - } -} - -jar { - manifest { - attributes([ - "Specification-Title": "${project.mod_id}", - "Specification-Vendor": "vazkii", - "Specification-Version": "1", // We are version 1 of ourselves - "Implementation-Title": "${project.mod_id}", - "Implementation-Version": "${project.version}", - "Implementation-Vendor" :"vazkii", - ]) - } -} - -defaultTasks 'clean', 'build' diff --git a/Forge/src/main/java/vazkii/neat/NeatForgeInitializer.java b/Forge/src/main/java/vazkii/neat/NeatForgeInitializer.java deleted file mode 100644 index d9a167d..0000000 --- a/Forge/src/main/java/vazkii/neat/NeatForgeInitializer.java +++ /dev/null @@ -1,26 +0,0 @@ -package vazkii.neat; - -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.IExtensionPoint; -import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.network.NetworkConstants; - -@Mod(NeatConfig.MOD_ID) -public class NeatForgeInitializer { - - public NeatForgeInitializer() { - ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (incoming, isNetwork) -> true)); - NeatForgeConfig.init(); - } - - @Mod.EventBusSubscriber(modid = NeatConfig.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) - public static class ClientEventHandler { - @SubscribeEvent - public static void registerKey(RegisterKeyMappingsEvent event) { - event.register(ToggleKeybind.KEY); - } - } -} diff --git a/NeoForge/build.gradle b/NeoForge/build.gradle new file mode 100644 index 0000000..64fc1ea --- /dev/null +++ b/NeoForge/build.gradle @@ -0,0 +1,66 @@ +plugins { + id 'java-library' + id 'idea' + id 'net.neoforged.gradle.userdev' + id 'eclipse' +} + +version = "${project.mc_version}-${project.build_number}-NEOFORGE" + +def accesstransformer = file('src/main/resources/META-INF/accesstransformer.cfg') +if (accesstransformer.exists()) { + minecraft.accessTransformers.file accesstransformer +} + +runs { + configureEach { + workingDirectory project.file('../run') + systemProperty 'forge.logging.console.level', 'debug' + modSource project.sourceSets.main + } + + client { + } + + server { + programArgument '--nogui' + } +} + +dependencies { + implementation "net.neoforged:neoforge:${neoforge_version}" + implementation project(":Xplat") +} + +compileJava { + source(project(":Xplat").sourceSets.main.allSource) + options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation,-serial" << "-Werror" +} + +sourcesJar { + from project(":Xplat").sourceSets.main.allJava +} + +processResources { + from project(":Xplat").sourceSets.main.resources + inputs.property "version", project.version + + filesMatching("META-INF/neoforge.mods.toml") { + expand "version": project.version + } +} + +jar { + manifest { + attributes([ + "Specification-Title": "${project.mod_id}", + "Specification-Vendor": "vazkii", + "Specification-Version": "1", // We are version 1 of ourselves + "Implementation-Title": "${project.mod_id}", + "Implementation-Version": "${project.version}", + "Implementation-Vendor" :"vazkii", + ]) + } +} + +defaultTasks 'clean', 'build' diff --git a/Forge/src/main/java/vazkii/neat/NeatForgeConfig.java b/NeoForge/src/main/java/vazkii/neat/NeatForgeConfig.java similarity index 65% rename from Forge/src/main/java/vazkii/neat/NeatForgeConfig.java rename to NeoForge/src/main/java/vazkii/neat/NeatForgeConfig.java index 6d8dafb..e63cb0a 100644 --- a/Forge/src/main/java/vazkii/neat/NeatForgeConfig.java +++ b/NeoForge/src/main/java/vazkii/neat/NeatForgeConfig.java @@ -1,47 +1,48 @@ package vazkii.neat; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; -import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.config.ModConfig; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.neoforge.common.ModConfigSpec; import org.apache.commons.lang3.tuple.Pair; import java.util.List; public class NeatForgeConfig { - public static void init() { - Pair specPair = new ForgeConfigSpec.Builder().configure(ForgeNeatConfig::new); + public static void init(ModContainer container) { + Pair specPair = new ModConfigSpec.Builder().configure(ForgeNeatConfig::new); NeatConfig.instance = specPair.getLeft(); - ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, specPair.getRight()); + container.registerConfig(ModConfig.Type.CLIENT, specPair.getRight()); + //TODO consider using the build-in config ui of neoforge } private static class ForgeNeatConfig implements NeatConfig.ConfigAccess { - private final ConfigValue maxDistance; - private final ConfigValue renderInF1; - private final ConfigValue heightAbove; - private final ConfigValue drawBackground; - private final ConfigValue backgroundPadding; - private final ConfigValue backgroundHeight; - private final ConfigValue barHeight; - private final ConfigValue plateSize; - private final ConfigValue plateSizeBoss; - private final ConfigValue showAttributes; - private final ConfigValue showArmor; - private final ConfigValue groupArmor; - private final ConfigValue colorByType; - private final ConfigValue hpTextHeight; - private final ConfigValue showMaxHP; - private final ConfigValue showCurrentHP; - private final ConfigValue showPercentage; - private final ConfigValue showOnPlayers; - private final ConfigValue showOnBosses; - private final ConfigValue showOnlyFocused; - private final ConfigValue showFullHealth; - private final ConfigValue enableDebugInfo; - private final ConfigValue> blacklist; - - public ForgeNeatConfig(ForgeConfigSpec.Builder builder) { + private final ModConfigSpec.ConfigValue maxDistance; + private final ModConfigSpec.ConfigValue renderInF1; + private final ModConfigSpec.ConfigValue heightAbove; + private final ModConfigSpec.ConfigValue drawBackground; + private final ModConfigSpec.ConfigValue backgroundPadding; + private final ModConfigSpec.ConfigValue backgroundHeight; + private final ModConfigSpec.ConfigValue barHeight; + private final ModConfigSpec.ConfigValue plateSize; + private final ModConfigSpec.ConfigValue plateSizeBoss; + private final ModConfigSpec.ConfigValue showAttributes; + private final ModConfigSpec.ConfigValue showArmor; + private final ModConfigSpec.ConfigValue groupArmor; + private final ModConfigSpec.ConfigValue colorByType; + private final ModConfigSpec.ConfigValue hpTextHeight; + private final ModConfigSpec.ConfigValue showMaxHP; + private final ModConfigSpec.ConfigValue showCurrentHP; + private final ModConfigSpec.ConfigValue showPercentage; + private final ModConfigSpec.ConfigValue showOnPlayers; + private final ModConfigSpec.ConfigValue showOnBosses; + private final ModConfigSpec.ConfigValue showOnlyFocused; + private final ModConfigSpec.ConfigValue showFullHealth; + private final ModConfigSpec.ConfigValue enableDebugInfo; + private final ModConfigSpec.ConfigValue> blacklist; + + public ForgeNeatConfig(ModConfigSpec.Builder builder) { builder.push("general"); maxDistance = builder.define("Max Distance", 24); diff --git a/NeoForge/src/main/java/vazkii/neat/NeatForgeInitializer.java b/NeoForge/src/main/java/vazkii/neat/NeatForgeInitializer.java new file mode 100644 index 0000000..10347f9 --- /dev/null +++ b/NeoForge/src/main/java/vazkii/neat/NeatForgeInitializer.java @@ -0,0 +1,27 @@ +package vazkii.neat; + +import net.neoforged.bus.api.IEventBus; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.fml.common.Mod; + +@Mod(NeatConfig.MOD_ID) +public class NeatForgeInitializer { + + public NeatForgeInitializer(IEventBus bus, ModContainer modContainer) { + //ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (incoming, isNetwork) -> true)); + NeatForgeConfig.init(modContainer); + } + + @EventBusSubscriber(modid = NeatConfig.MOD_ID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) + public static class ClientEventHandler { + @SubscribeEvent + public static void registerKey(RegisterKeyMappingsEvent event) { + event.register(ToggleKeybind.KEY); + } + } +} diff --git a/Forge/src/main/resources/META-INF/accesstransformer.cfg b/NeoForge/src/main/resources/META-INF/accesstransformer.cfg similarity index 100% rename from Forge/src/main/resources/META-INF/accesstransformer.cfg rename to NeoForge/src/main/resources/META-INF/accesstransformer.cfg diff --git a/Forge/src/main/resources/META-INF/mods.toml b/NeoForge/src/main/resources/META-INF/neoforge.mods.toml similarity index 67% rename from Forge/src/main/resources/META-INF/mods.toml rename to NeoForge/src/main/resources/META-INF/neoforge.mods.toml index bcf3eb4..b7bb526 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/NeoForge/src/main/resources/META-INF/neoforge.mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[45,)" +loaderVersion="[4,)" issueTrackerURL="https://github.com/VazkiiMods/Neat" license="MIT AND CC-BY-NC-SA-3.0" # Code is MIT, assets are CC @@ -7,10 +7,13 @@ license="MIT AND CC-BY-NC-SA-3.0" # Code is MIT, assets are CC modId="neat" displayName="Neat" version="${version}" -authors="Vazkii" +authors="Vazkii, Uraneptus" description="Minimalistic Functional Unit Plates for the modern Minecrafter" [[dependencies.neat]] -modId="forge" -mandatory=true -versionRange="[45.0.40,)" +modId="neoforge" +type="required" +versionRange="[21.0.143,)" + +[[mixins]] +config="neat.mixins.json" diff --git a/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java b/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java index a9a7370..833741a 100644 --- a/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java +++ b/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java @@ -1,23 +1,23 @@ package vazkii.neat; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; +import com.mojang.blaze3d.vertex.*; import com.mojang.math.Axis; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.EntityTypeTags; import net.minecraft.tags.TagKey; import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.MobType; import net.minecraft.world.entity.monster.Monster; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemDisplayContext; @@ -94,10 +94,10 @@ private static ItemStack getIcon(LivingEntity entity, boolean boss) { if (boss) { return new ItemStack(Items.NETHER_STAR); } - MobType type = entity.getMobType(); - if (type == MobType.ARTHROPOD) { + EntityType type = entity.getType(); + if (type.is(EntityTypeTags.ARTHROPOD)) { return new ItemStack(Items.SPIDER_EYE); - } else if (type == MobType.UNDEAD) { + } else if (type.is(EntityTypeTags.UNDEAD)) { return new ItemStack(Items.ROTTEN_FLESH); } else { return ItemStack.EMPTY; @@ -128,10 +128,10 @@ private static int getColor(LivingEntity entity, boolean colorByType, boolean bo } private static final TagKey> FORGE_BOSS_TAG = - TagKey.create(Registries.ENTITY_TYPE, new ResourceLocation("forge", "bosses")); + TagKey.create(Registries.ENTITY_TYPE, ResourceLocation.fromNamespaceAndPath("forge", "bosses")); private static final TagKey> FABRIC_BOSS_TAG = - TagKey.create(Registries.ENTITY_TYPE, new ResourceLocation("c", "bosses")); + TagKey.create(Registries.ENTITY_TYPE, ResourceLocation.fromNamespaceAndPath("c", "bosses")); private static boolean isBoss(Entity entity) { return entity.getType().is(FORGE_BOSS_TAG) || entity.getType().is(FABRIC_BOSS_TAG); @@ -225,10 +225,11 @@ public static void hookRender(Entity entity, PoseStack poseStack, MultiBufferSou float padding = NeatConfig.instance.backgroundPadding(); int bgHeight = NeatConfig.instance.backgroundHeight(); VertexConsumer builder = buffers.getBuffer(NeatRenderType.BAR_TEXTURE_TYPE); - builder.vertex(poseStack.last().pose(), -halfSize - padding, -bgHeight, 0.01F).color(0, 0, 0, 64).uv(0.0F, 0.0F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), -halfSize - padding, barHeight + padding, 0.01F).color(0, 0, 0, 64).uv(0.0F, 0.5F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), halfSize + padding, barHeight + padding, 0.01F).color(0, 0, 0, 64).uv(1.0F, 0.5F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), halfSize + padding, -bgHeight, 0.01F).color(0, 0, 0, 64).uv(1.0F, 0.0F).uv2(light).endVertex(); + //VertexConsumer builder = buffers.getBuffer(RenderType.LINES); + builder.addVertex(poseStack.last().pose(), -halfSize - padding, -bgHeight, 0.01F).setColor(0, 0, 0, 64).setUv(0.0F, 0.0F).setLight(light); + builder.addVertex(poseStack.last().pose(), -halfSize - padding, barHeight + padding, 0.01F).setColor(0, 0, 0, 64).setUv(0.0F, 0.5F).setLight(light); + builder.addVertex(poseStack.last().pose(), halfSize + padding, barHeight + padding, 0.01F).setColor(0, 0, 0, 64).setUv(1.0F, 0.5F).setLight(light); + builder.addVertex(poseStack.last().pose(), halfSize + padding, -bgHeight, 0.01F).setColor(0, 0, 0, 64).setUv(1.0F, 0.0F).setLight(light); } // Health Bar @@ -243,17 +244,18 @@ public static void hookRender(Entity entity, PoseStack poseStack, MultiBufferSou float healthHalfSize = halfSize * (living.getHealth() / maxHealth); VertexConsumer builder = buffers.getBuffer(NeatRenderType.BAR_TEXTURE_TYPE); - builder.vertex(poseStack.last().pose(), -halfSize, 0, 0.001F).color(r, g, b, 127).uv(0.0F, 0.75F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), -halfSize, barHeight, 0.001F).color(r, g, b, 127).uv(0.0F, 1.0F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, barHeight, 0.001F).color(r, g, b, 127).uv(1.0F, 1.0F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, 0, 0.001F).color(r, g, b, 127).uv(1.0F, 0.75F).uv2(light).endVertex(); + //VertexConsumer builder = buffers.getBuffer(RenderType.LINES); + builder.addVertex(poseStack.last().pose(), -halfSize, 0, 0.001F).setColor(r, g, b, 127).setUv(0.0F, 0.75F).setLight(light); + builder.addVertex(poseStack.last().pose(), -halfSize, barHeight, 0.001F).setColor(r, g, b, 127).setUv(0.0F, 1.0F).setLight(light); + builder.addVertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, barHeight, 0.001F).setColor(r, g, b, 127).setUv(1.0F, 1.0F).setLight(light); + builder.addVertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, 0, 0.001F).setColor(r, g, b, 127).setUv(1.0F, 0.75F).setLight(light); // Blank part of the bar if (healthHalfSize < halfSize) { - builder.vertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, 0, 0.001F).color(0, 0, 0, 127).uv(0.0F, 0.5F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, barHeight, 0.001F).color(0, 0, 0, 127).uv(0.0F, 0.75F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), halfSize, barHeight, 0.001F).color(0, 0, 0, 127).uv(1.0F, 0.75F).uv2(light).endVertex(); - builder.vertex(poseStack.last().pose(), halfSize, 0, 0.001F).color(0, 0, 0, 127).uv(1.0F, 0.5F).uv2(light).endVertex(); + builder.addVertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, 0, 0.001F).setColor(0, 0, 0, 127).setUv(0.0F, 0.5F).setLight(light); + builder.addVertex(poseStack.last().pose(), -halfSize + 2 * healthHalfSize, barHeight, 0.001F).setColor(0, 0, 0, 127).setUv(0.0F, 0.75F).setLight(light); + builder.addVertex(poseStack.last().pose(), halfSize, barHeight, 0.001F).setColor(0, 0, 0, 127).setUv(1.0F, 0.75F).setLight(light); + builder.addVertex(poseStack.last().pose(), halfSize, 0, 0.001F).setColor(0, 0, 0, 127).setUv(1.0F, 0.5F).setLight(light); } } @@ -292,7 +294,7 @@ public static void hookRender(Entity entity, PoseStack poseStack, MultiBufferSou String percStr = (int) (100 * living.getHealth() / living.getMaxHealth()) + "%"; mc.font.drawInBatch(percStr, (int) (halfSize / healthValueTextScale) - mc.font.width(percStr) / 2.0F, h, white, false, poseStack.last().pose(), buffers, Font.DisplayMode.NORMAL, black, light); } - if (NeatConfig.instance.enableDebugInfo() && mc.options.renderDebug) { + if (NeatConfig.instance.enableDebugInfo() && mc.getDebugOverlay().showDebugScreen()) { var id = BuiltInRegistries.ENTITY_TYPE.getKey(living.getType()); mc.font.drawInBatch("ID: \"" + id + "\"", 0, h + 16, white, false, poseStack.last().pose(), buffers, Font.DisplayMode.NORMAL, black, light); } diff --git a/Xplat/src/main/java/vazkii/neat/NeatRenderType.java b/Xplat/src/main/java/vazkii/neat/NeatRenderType.java index 589a15c..19aaac5 100644 --- a/Xplat/src/main/java/vazkii/neat/NeatRenderType.java +++ b/Xplat/src/main/java/vazkii/neat/NeatRenderType.java @@ -13,18 +13,20 @@ public class NeatRenderType extends RenderStateShard { //https://github.com/UpcraftLP/Orderly/blob/master/src/main/resources/assets/orderly/textures/ui/default_health_bar.png - public static final ResourceLocation HEALTH_BAR_TEXTURE = new ResourceLocation(NeatConfig.MOD_ID, "textures/ui/health_bar_texture.png"); + public static final ResourceLocation HEALTH_BAR_TEXTURE = ResourceLocation.fromNamespaceAndPath(NeatConfig.MOD_ID, "textures/ui/health_bar_texture.png"); public static final RenderType BAR_TEXTURE_TYPE = getHealthBarType(); private NeatRenderType(String string, Runnable r, Runnable r1) { super(string, r, r1); } + //TODO fix rendering private static RenderType getHealthBarType() { RenderType.CompositeState renderTypeState = RenderType.CompositeState.builder() .setShaderState(POSITION_COLOR_TEX_LIGHTMAP_SHADER) .setTextureState(new TextureStateShard(NeatRenderType.HEALTH_BAR_TEXTURE, false, false)) .setTransparencyState(TRANSLUCENT_TRANSPARENCY) + .setCullState(NO_CULL) .setLightmapState(LIGHTMAP) .createCompositeState(false); return AccessorRenderType.neat_create("neat_health_bar", POSITION_COLOR_TEX_LIGHTMAP, VertexFormat.Mode.QUADS, 256, true, true, renderTypeState); diff --git a/Xplat/src/main/resources/neat.mixins.json b/Xplat/src/main/resources/neat.mixins.json index 432d937..bf08bd7 100644 --- a/Xplat/src/main/resources/neat.mixins.json +++ b/Xplat/src/main/resources/neat.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "package": "vazkii.neat.mixin", "mixins": [ ], diff --git a/build.gradle b/build.gradle index 8407a04..577f512 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.diffplug.spotless' version '5.12.5' apply false + id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" } subprojects { @@ -7,7 +8,7 @@ subprojects { apply plugin: 'pmd' apply plugin: "com.diffplug.spotless" apply plugin: 'maven-publish' - java.toolchain.languageVersion = JavaLanguageVersion.of(17) + java.toolchain.languageVersion = JavaLanguageVersion.of(21) java.withSourcesJar() archivesBaseName = "${mod_name}" @@ -17,7 +18,7 @@ subprojects { tasks.withType(JavaCompile).configureEach { it.options.encoding = 'UTF-8' - it.options.release = 17 + it.options.release = 21 } tasks.withType(GenerateModuleMetadata).configureEach { diff --git a/gradle.properties b/gradle.properties index 1bbba8a..44bd199 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,8 +8,8 @@ org.gradle.jvmargs=-Xmx1G \ --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED group=vazkii.neat -forge_version=46.0.2 +neoforge_version=21.0.146 mod_id=neat build_number=36 mod_name=Neat -mc_version=1.20 +mc_version=1.21 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae0804..0d18421 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index fb06d78..b88f050 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,11 +1,24 @@ pluginManagement { + plugins { + id 'net.neoforged.gradle.userdev' version '7.0.145' apply false + } repositories { + mavenLocal() maven { name = 'Sponge Snapshots' url = 'https://repo.spongepowered.org/repository/maven-public/' } + maven { + name = 'NeoForge' + url = 'https://maven.neoforged.net/releases' + } gradlePluginPortal() } } + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + rootProject.name = 'Neat' -include("Xplat", "Fabric", "Forge") +include("Xplat", "Fabric", "NeoForge")