diff --git a/build.gradle b/build.gradle index c55e9b9..9536b77 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' @@ -13,16 +13,23 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '10.1.0-beta1' +version = '10.1.0' group = 'tabula' archivesBaseName = 'Tabula-1.16.5' -sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. +java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8. +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { // The mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD Snapshot are built nightly. - // stable_# Stables are built at the discretion of the MCP team. + // Channel: Version: + // snapshot YYYYMMDD Snapshot are built nightly. + // stable # Stables are built at the discretion of the MCP team. + // official MCVersion Official field/method names from Mojang mapping files + // + // You must be aware of the Mojang license when using the 'official' mappings. + // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md + // // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20210309-1.16.5' @@ -37,10 +44,10 @@ minecraft { workingDirectory project.file('run') // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' + property 'forge.logging.console.level', 'info' source sourceSets.main } @@ -48,10 +55,10 @@ minecraft { workingDirectory project.file('run') // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' + property 'forge.logging.console.level', 'info' source sourceSets.main } } @@ -62,7 +69,7 @@ dependencies { // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.16.5-36.0.55' - implementation fg.deobf("ichunutil:iChunUtil:10.1.0-beta1") + implementation fg.deobf("ichunutil:iChunUtil:10.1.0") // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..878bf1f --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs=-Xmx3G +org.gradle.daemon=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7a3265e..0d4a951 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 949819d..1c4bcc2 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-6.8.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip diff --git a/src/main/java/me/ichun/mods/tabula/client/core/EventHandlerClient.java b/src/main/java/me/ichun/mods/tabula/client/core/EventHandlerClient.java index dedfcff..4c926fd 100644 --- a/src/main/java/me/ichun/mods/tabula/client/core/EventHandlerClient.java +++ b/src/main/java/me/ichun/mods/tabula/client/core/EventHandlerClient.java @@ -35,6 +35,7 @@ public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event) Widget button = event.getWidgetList().get(i); if(button instanceof Button && button.getMessage() instanceof TranslationTextComponent && ((TranslationTextComponent)button.getMessage()).getKey().equals("fml.menu.mods")) { + btnX = button.x - 24; btnY = button.y; break; } diff --git a/src/main/java/me/ichun/mods/tabula/client/export/types/headInfo/PreviewRenderHandler.java b/src/main/java/me/ichun/mods/tabula/client/export/types/headInfo/PreviewRenderHandler.java index 5cb12e2..f513778 100644 --- a/src/main/java/me/ichun/mods/tabula/client/export/types/headInfo/PreviewRenderHandler.java +++ b/src/main/java/me/ichun/mods/tabula/client/export/types/headInfo/PreviewRenderHandler.java @@ -48,6 +48,8 @@ public static void renderHeadInfoPreview(@Nonnull MatrixStack stack, @Nonnull He return; } + stack.push(); + LivingEntity living = null; float partialTicks = 1F; int packedLightIn = 0xf000f0; @@ -163,5 +165,7 @@ public static void renderHeadInfoPreview(@Nonnull MatrixStack stack, @Nonnull He stack.pop(); } } + + stack.pop(); } } diff --git a/src/main/java/me/ichun/mods/tabula/client/gui/WorkspaceTabula.java b/src/main/java/me/ichun/mods/tabula/client/gui/WorkspaceTabula.java index ba5e189..b5106fe 100644 --- a/src/main/java/me/ichun/mods/tabula/client/gui/WorkspaceTabula.java +++ b/src/main/java/me/ichun/mods/tabula/client/gui/WorkspaceTabula.java @@ -626,13 +626,13 @@ public void renderModel(boolean selection) } else { - info.project.getModel().render(stack, info.getSelectedPart(), info.getSelectedBox(), info.hideTexture, 1F); - if(headInfoRender != null && info.getSelectedPart() != null) { PreviewRenderHandler.renderHeadInfoPreview(stack, headInfoRender, info.project.getModel(), info.getSelectedPart()); } + info.project.getModel().render(stack, info.getSelectedPart(), info.getSelectedBox(), info.hideTexture, 1F); + stack.pop(); if(info.ghostProject != null) diff --git a/src/main/java/me/ichun/mods/tabula/client/gui/window/popup/WindowExportHeadInfo.java b/src/main/java/me/ichun/mods/tabula/client/gui/window/popup/WindowExportHeadInfo.java index bd43bd9..19dd2d3 100644 --- a/src/main/java/me/ichun/mods/tabula/client/gui/window/popup/WindowExportHeadInfo.java +++ b/src/main/java/me/ichun/mods/tabula/client/gui/window/popup/WindowExportHeadInfo.java @@ -72,6 +72,7 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) } infoInstance = HeadHandler.GSON.fromJson(HeadHandler.GSON.toJson(clone), HeadInfo.class); + infoInstance.forClass = forClass; } } } @@ -102,6 +103,10 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) int spacing = 3; Element last; + Consumer responder = s -> { + updateHeadInfo(); + }; + ElementTextWrapper text = new ElementTextWrapper(this); text.setNoWrap().setText(I18n.format("tabula.export.headInfo.forClass")); text.constraints().left(this, Constraint.Property.Type.LEFT, 10).top(this, Constraint.Property.Type.TOP, 10); @@ -111,6 +116,7 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) ElementTextField textField = new ElementTextField(this); textField.setTooltip(I18n.format("tabula.export.headInfo.forClass.tooltip")).setId("forClass"); textField.setDefaultText(infoInstance.forClass); + textField.setResponder(responder).setEnterResponder(responder); textField.constraints().left(text, Constraint.Property.Type.RIGHT, 5).right(this, Constraint.Property.Type.RIGHT, 10).top(text, Constraint.Property.Type.TOP, 2); elements.add(textField); @@ -123,6 +129,7 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) textField = new ElementTextField(this); textField.setTooltip(I18n.format("tabula.export.headInfo.modelFieldName.tooltip")).setId("modelFieldName"); textField.setDefaultText(infoInstance.modelFieldName); + textField.setResponder(responder).setEnterResponder(responder); textField.constraints().left(text, Constraint.Property.Type.RIGHT, 5).right(this, Constraint.Property.Type.RIGHT, 10).top(text, Constraint.Property.Type.TOP, 2); elements.add(textField); @@ -146,10 +153,6 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) elements.add(toggle); last = toggle; - Consumer responder = s -> { - updateHeadInfo(); - }; - text = new ElementTextWrapper(this); text.setNoWrap().setText(I18n.format("tabula.export.headInfo.eyeOffset")); text.constraints().left(last, Constraint.Property.Type.LEFT, 0).top(last, Constraint.Property.Type.BOTTOM, spacing); @@ -185,25 +188,25 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) text.constraints().left(last, Constraint.Property.Type.LEFT, 0).top(last, Constraint.Property.Type.BOTTOM, spacing); elements.add(text); - numberInput = new ElementNumberInput(this, true); + numberInput = new ElementNumberInput(this, false); numberInput.setTooltip(I18n.format("tabula.export.headInfo.irisColour.tooltip")).setId("irisColour0"); - numberInput.setMin(0).setMax(1).setMaxDec(Tabula.configClient.guiMaxDecimals).setDefaultText(String.format(Locale.ENGLISH, "%." + Tabula.configClient.guiMaxDecimals + "f", infoInstance.irisColour[0])); + numberInput.setMin(0).setMax(255).setMaxDec(0).setDefaultText(Integer.toString((int)Math.floor(infoInstance.irisColour[0] * 255F))); numberInput.setResponder(responder).setEnterResponder(responder); numberInput.setWidth(50); numberInput.constraints().left(text, Constraint.Property.Type.RIGHT, 5).top(text, Constraint.Property.Type.TOP, 2); elements.add(numberInput); - numberInput1 = new ElementNumberInput(this, true); + numberInput1 = new ElementNumberInput(this, false); numberInput1.setTooltip(I18n.format("tabula.export.headInfo.irisColour.tooltip")).setId("irisColour1"); - numberInput1.setMin(0).setMax(1).setMaxDec(Tabula.configClient.guiMaxDecimals).setDefaultText(String.format(Locale.ENGLISH, "%." + Tabula.configClient.guiMaxDecimals + "f", infoInstance.irisColour[1])); + numberInput1.setMin(0).setMax(255).setMaxDec(0).setDefaultText(Integer.toString((int)Math.floor(infoInstance.irisColour[1] * 255F))); numberInput1.setResponder(responder).setEnterResponder(responder); numberInput1.setWidth(50); numberInput1.constraints().left(numberInput, Constraint.Property.Type.RIGHT, 5); elements.add(numberInput1); - numberInput2 = new ElementNumberInput(this, true); + numberInput2 = new ElementNumberInput(this, false); numberInput2.setTooltip(I18n.format("tabula.export.headInfo.irisColour.tooltip")).setId("irisColour2"); - numberInput2.setMin(0).setMax(1).setMaxDec(Tabula.configClient.guiMaxDecimals).setDefaultText(String.format(Locale.ENGLISH, "%." + Tabula.configClient.guiMaxDecimals + "f", infoInstance.irisColour[2])); + numberInput2.setMin(0).setMax(255).setMaxDec(0).setDefaultText(Integer.toString((int)Math.floor(infoInstance.irisColour[2] * 255F))); numberInput2.setResponder(responder).setEnterResponder(responder); numberInput2.setWidth(50); numberInput2.constraints().left(numberInput1, Constraint.Property.Type.RIGHT, 5); @@ -215,25 +218,25 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project) text.constraints().left(last, Constraint.Property.Type.LEFT, 0).top(last, Constraint.Property.Type.BOTTOM, spacing); elements.add(text); - numberInput = new ElementNumberInput(this, true); + numberInput = new ElementNumberInput(this, false); numberInput.setTooltip(I18n.format("tabula.export.headInfo.pupilColour.tooltip")).setId("pupilColour0"); - numberInput.setMin(0).setMax(1).setMaxDec(Tabula.configClient.guiMaxDecimals).setDefaultText(String.format(Locale.ENGLISH, "%." + Tabula.configClient.guiMaxDecimals + "f", infoInstance.pupilColour[0])); + numberInput.setMin(0).setMax(255).setMaxDec(0).setDefaultText(Integer.toString((int)Math.floor(infoInstance.pupilColour[0] * 255F))); numberInput.setResponder(responder).setEnterResponder(responder); numberInput.setWidth(50); numberInput.constraints().left(text, Constraint.Property.Type.RIGHT, 5).top(text, Constraint.Property.Type.TOP, 2); elements.add(numberInput); - numberInput1 = new ElementNumberInput(this, true); + numberInput1 = new ElementNumberInput(this, false); numberInput1.setTooltip(I18n.format("tabula.export.headInfo.pupilColour.tooltip")).setId("pupilColour1"); - numberInput1.setMin(0).setMax(1).setMaxDec(Tabula.configClient.guiMaxDecimals).setDefaultText(String.format(Locale.ENGLISH, "%." + Tabula.configClient.guiMaxDecimals + "f", infoInstance.pupilColour[1])); + numberInput1.setMin(0).setMax(255).setMaxDec(0).setDefaultText(Integer.toString((int)Math.floor(infoInstance.pupilColour[1] * 255F))); numberInput1.setResponder(responder).setEnterResponder(responder); numberInput1.setWidth(50); numberInput1.constraints().left(numberInput, Constraint.Property.Type.RIGHT, 5); elements.add(numberInput1); - numberInput2 = new ElementNumberInput(this, true); + numberInput2 = new ElementNumberInput(this, false); numberInput2.setTooltip(I18n.format("tabula.export.headInfo.pupilColour.tooltip")).setId("pupilColour2"); - numberInput2.setMin(0).setMax(1).setMaxDec(Tabula.configClient.guiMaxDecimals).setDefaultText(String.format(Locale.ENGLISH, "%." + Tabula.configClient.guiMaxDecimals + "f", infoInstance.pupilColour[2])); + numberInput2.setMin(0).setMax(255).setMaxDec(0).setDefaultText(Integer.toString((int)Math.floor(infoInstance.pupilColour[2] * 255F))); numberInput2.setResponder(responder).setEnterResponder(responder); numberInput2.setWidth(50); numberInput2.constraints().left(numberInput1, Constraint.Property.Type.RIGHT, 5); @@ -486,12 +489,12 @@ public void updateHeadInfo() infoInstance.eyeOffset[0] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("eyeOffset0")).getDouble() / 16D)); infoInstance.eyeOffset[1] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("eyeOffset1")).getDouble() / 16D)); infoInstance.eyeOffset[2] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("eyeOffset2")).getDouble() / 16D)); - infoInstance.irisColour[0] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("irisColour0")).getDouble())); - infoInstance.irisColour[1] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("irisColour1")).getDouble())); - infoInstance.irisColour[2] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("irisColour2")).getDouble())); - infoInstance.pupilColour[0] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("pupilColour0")).getDouble())); - infoInstance.pupilColour[1] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("pupilColour1")).getDouble())); - infoInstance.pupilColour[2] = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("pupilColour2")).getDouble())); + infoInstance.irisColour[0] = ((ElementNumberInput)getById("irisColour0")).getInt() / 255F; + infoInstance.irisColour[1] = ((ElementNumberInput)getById("irisColour1")).getInt() / 255F; + infoInstance.irisColour[2] = ((ElementNumberInput)getById("irisColour2")).getInt() / 255F; + infoInstance.pupilColour[0] = ((ElementNumberInput)getById("pupilColour0")).getInt() / 255F; + infoInstance.pupilColour[1] = ((ElementNumberInput)getById("pupilColour1")).getInt() / 255F; + infoInstance.pupilColour[2] = ((ElementNumberInput)getById("pupilColour2")).getInt() / 255F; infoInstance.halfInterpupillaryDistance = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("halfInterpupillaryDistance")).getDouble() / 16D)); infoInstance.eyeScale = Float.parseFloat(String.format(Locale.ENGLISH, "%.7f", ((ElementNumberInput)getById("eyeScale")).getDouble())); infoInstance.sideEyed = ((ElementToggle)getById("sideEyed")).toggleState; diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index df52108..4297b1c 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -16,6 +16,6 @@ issueTrackerURL="https://github.com/iChun/Tabula/issues" [[dependencies.tabula]] modId="ichunutil" mandatory=true - versionRange="[10.0.0,11)" + versionRange="[10.1.0,11)" ordering="NONE" side="BOTH"