aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle28
-rw-r--r--gradle.properties4
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin54708 -> 59536 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--gradlew282
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/IcebergServer.java6
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/Loader.java6
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java4
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/events/EntityFluidEvent.java4
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/events/NewItemPickupEvent.java6
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java32
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java10
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java16
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java6
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/network/IcebergNetworkProtocol.java6
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java10
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/registry/AutoRegistry.java33
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/registry/RendererRegistrar.java27
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/renderer/CustomItemRenderer.java136
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/util/Easing.java8
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/util/GuiHelper.java19
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/util/ItemColor.java16
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/util/Tooltips.java83
-rw-r--r--src/main/resources/META-INF/mods.toml6
-rw-r--r--src/main/resources/iceberg.mixins.json2
25 files changed, 397 insertions, 355 deletions
diff --git a/build.gradle b/build.gradle
index 0d0e82f..a3ff7bb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
+ classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
@@ -16,7 +16,7 @@ apply plugin: 'eclipse'
archivesBaseName = name + '-' + mcVersion
-sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
+java.toolchain.languageVersion = JavaLanguageVersion.of(16)
mixin {
add sourceSets.main, "${project.name.toLowerCase()}.refmap.json"
@@ -40,26 +40,6 @@ minecraft {
}
}
-// Process resources on build
-processResources {
- // This will ensure that this task is redone when the versions change.
- inputs.property 'version', project.version
-
- // Replace stuff in mods.toml, nothing else
- from(sourceSets.main.resources.srcDirs) {
- include 'META-INF/mods.toml'
-
- // Replace version
- expand 'version':project.version
- }
-
- // Copy everything else except the mods.toml
- from(sourceSets.main.resources.srcDirs) {
- exclude 'META-INF/mods.toml'
- }
-}
-
-
sourceSets {
main {
resources {
@@ -69,8 +49,8 @@ sourceSets {
}
dependencies {
- minecraft 'net.minecraftforge:forge:' + project.properties.mcVersion + '-' + forgeVersion
- annotationProcessor 'org.spongepowered:mixin:0.8:processor'
+ minecraft "net.minecraftforge:forge:${project.mcVersion}-${project.forgeVersion}"
+ annotationProcessor 'org.spongepowered:mixin:0.8.4:processor'
}
jar {
diff --git a/gradle.properties b/gradle.properties
index 2534db5..cf5e124 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,5 +7,5 @@ name=Iceberg
group=com.anthonyhilyard.iceberg
author=anthonyhilyard
version=1.0.12
-mcVersion=1.16.5
-forgeVersion=36.2.2 \ No newline at end of file
+mcVersion=1.17.1
+forgeVersion=37.0.90
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 7a3265e..7454180 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1d5b29f..ffed3a2 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-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
diff --git a/gradlew b/gradlew
index cccdd3d..c53aefa 100644
--- a/gradlew
+++ b/gradlew
@@ -1,78 +1,129 @@
-#!/usr/bin/env sh
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
##############################################################################
-##
-## Gradle start up script for UN*X
-##
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
##############################################################################
# Attempt to set APP_HOME
+
# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
+APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
+MAX_FD=maximum
warn () {
echo "$*"
-}
+} >&2
die () {
echo
echo "$*"
echo
exit 1
-}
+} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
+ JAVACMD=$JAVA_HOME/jre/sh/java
else
- JAVACMD="$JAVA_HOME/bin/java"
+ JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
- JAVACMD="java"
+ JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -89,84 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
fi
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
fi
- i=$((i+1))
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
fi
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=$(save "$@")
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
+# 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
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
exec "$JAVACMD" "$@"
diff --git a/src/main/java/com/anthonyhilyard/iceberg/IcebergServer.java b/src/main/java/com/anthonyhilyard/iceberg/IcebergServer.java
index c5baa64..4ad4e48 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/IcebergServer.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/IcebergServer.java
@@ -3,7 +3,6 @@ package com.anthonyhilyard.iceberg;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
-import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
@Mod.EventBusSubscriber(modid = Loader.MODID, bus = Bus.MOD, value = Dist.DEDICATED_SERVER)
public class IcebergServer
@@ -11,9 +10,4 @@ public class IcebergServer
public IcebergServer()
{
}
-
- public void onServerStarting(FMLServerStartingEvent event)
- {
-
- }
}
diff --git a/src/main/java/com/anthonyhilyard/iceberg/Loader.java b/src/main/java/com/anthonyhilyard/iceberg/Loader.java
index 38aa9c1..49e9d9c 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/Loader.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/Loader.java
@@ -2,19 +2,17 @@ package com.anthonyhilyard.iceberg;
import com.anthonyhilyard.iceberg.network.IcebergNetworkProtocol;
-import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.ExtensionPoint;
+import net.minecraftforge.fml.IExtensionPoint;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLEnvironment;
-import net.minecraftforge.fml.network.FMLNetworkConstants;
@Mod(Loader.MODID)
public class Loader
@@ -37,7 +35,7 @@ public class Loader
// Register the network protocol.
IcebergNetworkProtocol.register();
- ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true));
+ ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> "ANY", (remote, isServer) -> true));
}
@SubscribeEvent
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
index fe20cec..fed7ec2 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/events/CriterionEvent.java
@@ -2,7 +2,7 @@ package com.anthonyhilyard.iceberg.events;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraft.advancements.Advancement;
-import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.MinecraftForge;
/**
@@ -19,7 +19,7 @@ public class CriterionEvent extends PlayerEvent
private final Advancement advancement;
private final String criterionKey;
- public CriterionEvent(PlayerEntity player, Advancement advancement, String criterionKey)
+ public CriterionEvent(Player player, Advancement advancement, String criterionKey)
{
super(player);
this.advancement = advancement;
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/EntityFluidEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/EntityFluidEvent.java
index aa91fa5..d2abcb2 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/events/EntityFluidEvent.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/events/EntityFluidEvent.java
@@ -1,7 +1,7 @@
package com.anthonyhilyard.iceberg.events;
-import net.minecraft.entity.Entity;
-import net.minecraft.fluid.Fluid;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.event.entity.EntityEvent;
public class EntityFluidEvent extends EntityEvent
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/NewItemPickupEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/NewItemPickupEvent.java
index a758769..48f2faf 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/events/NewItemPickupEvent.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/events/NewItemPickupEvent.java
@@ -5,8 +5,8 @@ import net.minecraftforge.event.entity.player.PlayerEvent;
import java.util.UUID;
import net.minecraft.client.Minecraft;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.item.ItemStack;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
/**
@@ -22,7 +22,7 @@ public class NewItemPickupEvent extends PlayerEvent
{
private final ItemStack itemStack;
- public NewItemPickupEvent(PlayerEntity player, ItemStack itemStack)
+ public NewItemPickupEvent(Player player, ItemStack itemStack)
{
super(player);
this.itemStack = itemStack;
diff --git a/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java b/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java
index dfb1364..3ca2d37 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/events/RenderTooltipExtEvent.java
@@ -2,11 +2,11 @@ package com.anthonyhilyard.iceberg.events;
import java.util.List;
-import com.mojang.blaze3d.matrix.MatrixStack;
+import com.mojang.blaze3d.vertex.PoseStack;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.text.ITextProperties;
+import net.minecraft.client.gui.Font;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.network.chat.FormattedText;
import net.minecraftforge.client.event.RenderTooltipEvent;
public class RenderTooltipExtEvent
@@ -14,31 +14,37 @@ public class RenderTooltipExtEvent
public static class Pre extends RenderTooltipEvent.Pre
{
private boolean comparisonTooltip = false;
- public Pre(ItemStack stack, List<? extends ITextProperties> lines, MatrixStack matrixStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, FontRenderer font, boolean comparison)
+
+ @SuppressWarnings("removal")
+ public Pre(ItemStack stack, List<? extends FormattedText> lines, PoseStack PoseStack, int x, int y, int screenWidth, int screenHeight, int maxWidth, Font font, boolean comparison)
{
- super(stack, lines, matrixStack, x, y, screenWidth, screenHeight, maxWidth, font);
+ super(stack, lines, PoseStack, x, y, screenWidth, screenHeight, maxWidth, font);
comparisonTooltip = comparison;
}
public boolean isComparison() { return comparisonTooltip; }
}
+ @SuppressWarnings("removal")
public static class PostBackground extends RenderTooltipEvent.PostBackground
{
private boolean comparisonTooltip = false;
- public PostBackground(ItemStack stack, List<? extends ITextProperties> textLines, MatrixStack matrixStack, int x, int y, FontRenderer font, int width, int height, boolean comparison)
+
+ public PostBackground(ItemStack stack, List<? extends FormattedText> textLines, PoseStack PoseStack, int x, int y, Font font, int width, int height, boolean comparison)
{
- super(stack, textLines, matrixStack, x, y, font, width, height);
+ super(stack, textLines, PoseStack, x, y, font, width, height);
comparisonTooltip = comparison;
}
public boolean isComparison() { return comparisonTooltip; }
}
+ @SuppressWarnings("removal")
public static class PostText extends RenderTooltipEvent.PostText
{
private boolean comparisonTooltip = false;
- public PostText(ItemStack stack, List<? extends ITextProperties> textLines, MatrixStack matrixStack, int x, int y, FontRenderer font, int width, int height, boolean comparison)
+
+ public PostText(ItemStack stack, List<? extends FormattedText> textLines, PoseStack PoseStack, int x, int y, Font font, int width, int height, boolean comparison)
{
- super(stack, textLines, matrixStack, x, y, font, width, height);
+ super(stack, textLines, PoseStack, x, y, font, width, height);
comparisonTooltip = comparison;
}
public boolean isComparison() { return comparisonTooltip; }
@@ -47,9 +53,11 @@ public class RenderTooltipExtEvent
public static class Color extends RenderTooltipEvent.Color
{
private boolean comparisonTooltip = false;
- public Color(ItemStack stack, List<? extends ITextProperties> textLines, MatrixStack matrixStack, int x, int y, FontRenderer font, int background, int borderStart, int borderEnd, boolean comparison)
+
+ @SuppressWarnings("removal")
+ public Color(ItemStack stack, List<? extends FormattedText> textLines, PoseStack PoseStack, int x, int y, Font font, int background, int borderStart, int borderEnd, boolean comparison)
{
- super(stack, textLines, matrixStack, x, y, font, background, borderStart, borderEnd);
+ super(stack, textLines, PoseStack, x, y, font, background, borderStart, borderEnd);
comparisonTooltip = comparison;
}
public boolean isComparison() { return comparisonTooltip; }
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java
index f4ca091..ba3a69e 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java
@@ -11,9 +11,9 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At.Shift;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import net.minecraft.entity.Entity;
-import net.minecraft.fluid.Fluid;
-import net.minecraft.tags.ITag;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.level.material.Fluid;
+import net.minecraft.tags.Tag;
import net.minecraftforge.common.MinecraftForge;
@Mixin(Entity.class)
@@ -22,7 +22,7 @@ public class EntityMixin extends net.minecraftforge.common.capabilities.Capabili
private Fluid previousFluidOnEyes = null;
@Shadow
- protected ITag<Fluid> fluidOnEyes;
+ protected Tag<Fluid> fluidOnEyes;
protected EntityMixin(Class<Entity> baseClass) { super(baseClass); }
@@ -45,7 +45,7 @@ public class EntityMixin extends net.minecraftforge.common.capabilities.Capabili
}
@Inject(method = "updateFluidOnEyes",
- at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;fluidOnEyes:Lnet/minecraft/tags/ITag;", ordinal = 1, shift = Shift.AFTER))
+ at = @At(value = "FIELD", target = "Lnet/minecraft/world/entity/Entity;fluidOnEyes:Lnet/minecraft/tags/Tag;", ordinal = 1, shift = Shift.AFTER))
public void onUpdateFluidOnEyeAssign(CallbackInfo callbackInfo)
{
Fluid currentFluid = null;
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java
index a530465..2dbc247 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/ForgeEventFactoryMixin.java
@@ -3,12 +3,12 @@ package com.anthonyhilyard.iceberg.mixin;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-import net.minecraft.entity.item.ItemEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fml.loading.FMLEnvironment;
-import net.minecraftforge.fml.network.PacketDistributor;
+import net.minecraftforge.fmllegacy.network.PacketDistributor;
import com.anthonyhilyard.iceberg.network.IcebergNetworkProtocol;
import com.anthonyhilyard.iceberg.network.NewItemPickupEventPacket;
@@ -19,13 +19,13 @@ import org.spongepowered.asm.mixin.injection.At;
@Mixin(ForgeEventFactory.class)
public class ForgeEventFactoryMixin
{
- @Inject(method = { "onItemPickup(Lnet/minecraft/entity/item/ItemEntity;Lnet/minecraft/entity/player/PlayerEntity;)I" },
+ @Inject(method = { "onItemPickup(Lnet/minecraft/world/entity/item/ItemEntity;Lnet/minecraft/world/entity/player/Player;)I" },
at = { @At("HEAD") }, remap = false)
- private static void onItemPickup(ItemEntity entityItem, PlayerEntity player, CallbackInfoReturnable<Integer> info)
+ private static void onItemPickup(ItemEntity entityItem, Player player, CallbackInfoReturnable<Integer> info)
{
- if (player instanceof ServerPlayerEntity && FMLEnvironment.dist.isDedicatedServer())
+ if (player instanceof ServerPlayer && FMLEnvironment.dist.isDedicatedServer())
{
- IcebergNetworkProtocol.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity)player), new NewItemPickupEventPacket(player.getUUID(), entityItem.getItem()));
+ IcebergNetworkProtocol.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer)player), new NewItemPickupEventPacket(player.getUUID(), entityItem.getItem()));
}
}
}
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java
index b27b219..ad52b94 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java
+++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/PlayerAdvancementsMixin.java
@@ -10,15 +10,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.advancements.Advancement;
-import net.minecraft.advancements.PlayerAdvancements;
-import net.minecraft.entity.player.ServerPlayerEntity;
+import net.minecraft.server.PlayerAdvancements;
+import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.common.MinecraftForge;
@Mixin(PlayerAdvancements.class)
public class PlayerAdvancementsMixin
{
@Shadow
- private ServerPlayerEntity player;
+ private ServerPlayer player;
@Inject(method = "award", at = @At(value = "TAIL"), locals = LocalCapture.CAPTURE_FAILEXCEPTION)
public void onAward(Advancement advancement, String criterionKey, CallbackInfoReturnable<Boolean> callbackInfo, boolean success)
diff --git a/src/main/java/com/anthonyhilyard/iceberg/network/IcebergNetworkProtocol.java b/src/main/java/com/anthonyhilyard/iceberg/network/IcebergNetworkProtocol.java
index d0dd1c8..4b5db06 100644
--- a/src/main/java/com/anthonyhilyard/iceberg/netw