Skip to content

Commit

Permalink
update to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vacla committed Jun 20, 2023
1 parent 83ef8da commit ff7c3fe
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 78 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.15.0+1.20.1] - 2023-06-18

### Added

- Support Minecraft 1.20.1
- Added Modulus divide to calc command

## [1.14.6+1.19.4] - 2023-04-15

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ The various controls are described in the table below:

### Built-In Calculator

Watson contains a simple calculator that understands +, -, *, / and parentheses (). Currently, the calculator considers '-' to bind to any digits that immediately follow (making a negative number), so when subtracting, use spaces. Example:
Watson contains a simple calculator that understands +, -, *, /, % and parentheses (). Currently, the calculator considers '-' to bind to any digits that immediately follow (making a negative number), so when subtracting, use spaces. Example:

/calc 800/(57 - 32)

Expand Down
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import groovy.json.JsonSlurper

plugins {
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'maven-publish'
id 'com.modrinth.minotaur' version '2.+'
}
Expand All @@ -13,9 +13,6 @@ if (ENV.LOADERS) {
loadersResult = jsonSlurper.parseText(ENV.LOADERS)
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
maven { url 'https://masa.dy.fi/maven' }
Expand All @@ -33,8 +30,12 @@ dependencies {
}

group = project.group + "." + project.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = project.mod_file_name
version = project.mod_version + '+' + project.minecraft_version_mod

base {
archivesName = project.mod_file_name
}

def CHANGELOG = ENV.CHANGELOG ?: "No changelog provided"
def VERSION = project.mod_name + " " + project.version
def mainFile = null
Expand All @@ -53,13 +54,17 @@ processResources {
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

jar {
from "LICENSE.md"
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}

Expand Down
20 changes: 10 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ project_slug = watson
modrinth_debug = false

#Current and version
mod_version = 1.14.6
mod_version = 1.15.0

#Required malilib version
malilib_version = 0.15.3
malilib_mod_version = >=0.15.3
malilib_version = 0.16.0
malilib_mod_version = >=0.16.0

# Minecraft, Fabric and mappings versions
minecraft_version_malilib = 1.19.4
minecraft_version_mod = 1.19.4
minecraft_version = 1.19.4
minecraft_version_dependency = 1.19.4
mappings_version = 1.19.4+build.1
minecraft_version_malilib = 1.20.1
minecraft_version_mod = 1.20.1
minecraft_version = 1.20.1
minecraft_version_dependency = 1.20.1
mappings_version = 1.20.1+build.2

fabric_loader_version = 0.14.17
mod_menu_version = 6.1.0-rc.4
fabric_loader_version = 0.14.21
mod_menu_version = 7.0.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ private static StreamTokenizer makeTokenizer(String args)
// introducers. >.<
tokenizer.ordinaryChar('*');
tokenizer.ordinaryChar('/');
tokenizer.ordinaryChar('%');
return tokenizer;
}

Expand Down Expand Up @@ -132,6 +133,10 @@ else if (token == '/')
{
result /= factor(tokenizer);
}
else if (token == '%')
{
result %= factor(tokenizer);
}
else
{
break;
Expand Down
42 changes: 22 additions & 20 deletions src/main/java/eu/minemania/watson/db/data/WidgetBlockeditEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fi.dy.masa.malilib.gui.widgets.WidgetListEntrySortable;
import fi.dy.masa.malilib.render.RenderUtils;
import fi.dy.masa.malilib.util.StringUtils;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;

public class WidgetBlockeditEntry extends WidgetListEntrySortable<BlockeditEntry>
Expand Down Expand Up @@ -116,7 +117,7 @@ public boolean canSelectAt(int mouseX, int mouseY, int mouseButton)
}

@Override
public void render(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack)
public void render(int mouseX, int mouseY, boolean selected, DrawContext drawContext)
{
RenderUtils.color(1f, 1f, 1f, 1f);

Expand Down Expand Up @@ -144,12 +145,12 @@ else if (this.isOdd)

if (this.header1 != null)
{
this.drawString(x1, y, color, this.header1, matrixStack);
this.drawString(x2, y, color, this.header2, matrixStack);
this.drawString(x3, y, color, this.header3, matrixStack);
this.drawString(x4, y, color, this.header4, matrixStack);
this.drawString(x5, y, color, this.header5, matrixStack);
this.drawString(x6, y, color, this.header6, matrixStack);
this.drawString(x1, y, color, this.header1, drawContext);
this.drawString(x2, y, color, this.header2, drawContext);
this.drawString(x3, y, color, this.header3, drawContext);
this.drawString(x4, y, color, this.header4, drawContext);
this.drawString(x5, y, color, this.header5, drawContext);
this.drawString(x6, y, color, this.header6, drawContext);
}
else if (this.entry != null)
{
Expand All @@ -163,20 +164,21 @@ else if (this.entry != null)
{
description = this.textRenderer.trimToWidth(description, width - x6 - this.entry.getButton().getWidth() + 5).concat("...");
}
this.drawString(x1, y, 0xFFFFFFFF, action, matrixStack);
this.drawString(x2, y, 0xFFFFFFFF, time, matrixStack);
this.drawString(x3, y, 0xFFFFFFFF, coords, matrixStack);
this.drawString(x4, y, 0xFFFFFFFF, world, matrixStack);
this.drawString(x5, y, 0xFFFFFFFF, amount, matrixStack);
this.drawString(x6, y, 0xFFFFFFFF, description, matrixStack);

super.render(mouseX, mouseY, selected, matrixStack);
this.drawString(x1, y, 0xFFFFFFFF, action, drawContext);
this.drawString(x2, y, 0xFFFFFFFF, time, drawContext);
this.drawString(x3, y, 0xFFFFFFFF, coords, drawContext);
this.drawString(x4, y, 0xFFFFFFFF, world, drawContext);
this.drawString(x5, y, 0xFFFFFFFF, amount, drawContext);
this.drawString(x6, y, 0xFFFFFFFF, description, drawContext);

super.render(mouseX, mouseY, selected, drawContext);
}
}

@Override
public void postRenderHovered(int mouseX, int mouseY, boolean selected, MatrixStack matrixStack)
public void postRenderHovered(int mouseX, int mouseY, boolean selected, DrawContext drawContext)
{
MatrixStack matrixStack = drawContext.getMatrices();
if (this.entry != null)
{
String descriptionText = PlayereditUtils.blockString(this.entry.getEdit(), PlayereditUtils.Edit.DESCRIPTION);
Expand Down Expand Up @@ -208,12 +210,12 @@ public void postRenderHovered(int mouseX, int mouseY, boolean selected, MatrixSt
y += 6;
y += 4;

this.drawString(x1, y, 0xFFFFFFFF, header, matrixStack);
this.drawString(x1, y, 0xFFFFFFFF, header, drawContext);
y += 16;

for (int i = 0; i < descriptions.size(); i++)
{
this.drawString(x1, y + (i * 8) - 7, 0xFFFFFFFF, descriptions.get(i), matrixStack);
this.drawString(x1, y + (i * 8) - 7, 0xFFFFFFFF, descriptions.get(i), drawContext);
}
matrixStack.pop();
}
Expand Down Expand Up @@ -250,8 +252,8 @@ public void postRenderHovered(int mouseX, int mouseY, boolean selected, MatrixSt

for (Map.Entry<?,?> entry : this.entry.getEdit().getAdditional().entrySet())
{
this.drawString(x1, y, 0xFFFFFFFF, String.valueOf(entry.getKey()), matrixStack);
this.drawString(x2, y, 0xFFFFFFFF, String.valueOf(entry.getValue()), matrixStack);
this.drawString(x1, y, 0xFFFFFFFF, String.valueOf(entry.getKey()), drawContext);
this.drawString(x2, y, 0xFFFFFFFF, String.valueOf(entry.getValue()), drawContext);
y += 16;
}
matrixStack.pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import eu.minemania.watson.gui.GuiBlockeditData;
import eu.minemania.watson.selection.PlayereditUtils;
import fi.dy.masa.malilib.gui.widgets.WidgetListBase;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.DrawContext;

public class WidgetListBlockedit extends WidgetListBase<BlockeditEntry, WidgetBlockeditEntry>
{
Expand All @@ -26,9 +26,9 @@ public WidgetListBlockedit(int x, int y, int width, int height, GuiBlockeditData
}

@Override
public void drawContents(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks)
public void drawContents(DrawContext drawContext, int mouseX, int mouseY, float partialTicks)
{
super.drawContents(matrixStack, mouseX, mouseY, partialTicks);
super.drawContents(drawContext, mouseX, mouseY, partialTicks);
lastScrollbarPosition = this.scrollBar.getValue();
}

Expand Down
Loading

0 comments on commit ff7c3fe

Please sign in to comment.