Skip to content

Commit

Permalink
Final touch ups. Update gradle stuff and deps. Ready for 10.1.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
iChun committed Apr 9, 2021
1 parent 23ca1e0 commit a09d49a
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 36 deletions.
27 changes: 17 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,31 @@ 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'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
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'
Expand All @@ -37,21 +44,21 @@ 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
}

server {
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
}
}
Expand All @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -163,5 +165,7 @@ public static void renderHeadInfoPreview(@Nonnull MatrixStack stack, @Nonnull He
stack.pop();
}
}

stack.pop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project)
}

infoInstance = HeadHandler.GSON.fromJson(HeadHandler.GSON.toJson(clone), HeadInfo.class);
infoInstance.forClass = forClass;
}
}
}
Expand Down Expand Up @@ -102,6 +103,10 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project)
int spacing = 3;
Element<?> last;

Consumer<String> 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);
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -146,10 +153,6 @@ public ViewExportHeadInfo(@Nonnull WindowExportHeadInfo parent, Project project)
elements.add(toggle);
last = toggle;

Consumer<String> 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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a09d49a

Please sign in to comment.