diff --git a/gradle.properties b/gradle.properties index 64d6de4..dd7bbd1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.19.4 - yarn_mappings=1.19.4+build.2 + minecraft_version=1.20 + yarn_mappings=1.20+build.1 loader_version=0.14.21 # Mod Properties @@ -14,7 +14,7 @@ org.gradle.parallel=true archives_base_name = partial-keepinv # Dependencies - fabric_version=0.83.0+1.19.4 + fabric_version=0.83.0+1.20 crunch_version=1.1 - modmenu_version=6.1.0 + modmenu_version=7.0.0 trinkets_version=3.6.0 \ No newline at end of file diff --git a/src/main/java/me/atie/partialKeepinventory/api/pkiApi.java b/src/main/java/me/atie/partialKeepinventory/api/pkiApi.java index 112f8e7..655aa2c 100644 --- a/src/main/java/me/atie/partialKeepinventory/api/pkiApi.java +++ b/src/main/java/me/atie/partialKeepinventory/api/pkiApi.java @@ -11,7 +11,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; public abstract class pkiApi { @Nullable diff --git a/src/main/java/me/atie/partialKeepinventory/commands/pkiCommandRegistration.java b/src/main/java/me/atie/partialKeepinventory/commands/pkiCommandRegistration.java index d16d3e3..b811391 100644 --- a/src/main/java/me/atie/partialKeepinventory/commands/pkiCommandRegistration.java +++ b/src/main/java/me/atie/partialKeepinventory/commands/pkiCommandRegistration.java @@ -28,14 +28,14 @@ public class pkiCommandRegistration { private static void modeMessage(CommandContext ctx) { - ctx.getSource().sendFeedback(Text.literal( + ctx.getSource().sendFeedback(() -> Text.literal( "Keepinventory mode is set to " + CONFIG.getPartialKeepinvMode().toString() ), true); } private static void percentMessage(CommandContext ctx, String valName, int val) { - ctx.getSource().sendFeedback(Text.literal( + ctx.getSource().sendFeedback(() -> Text.literal( valName + " is set to " + val + "%" ), true); } @@ -144,7 +144,7 @@ public static void registerCommands() { ctx -> { CONFIG.setEnableMod(true); syncSettings(environment); - ctx.getSource().sendFeedback(Text.literal("Enabled partial keepinventory"), true); + ctx.getSource().sendFeedback(() -> Text.literal("Enabled partial keepinventory"), true); return 1; }) ) @@ -152,7 +152,7 @@ public static void registerCommands() { ctx -> { CONFIG.setEnableMod(false); syncSettings(environment); - ctx.getSource().sendFeedback(Text.literal("Disabled partial keepinventory"), true); + ctx.getSource().sendFeedback(() -> Text.literal("Disabled partial keepinventory"), true); return 1; }) ) @@ -348,10 +348,10 @@ public static void registerCommands() { } if( !message.isEmpty() ) { - ctx.getSource().sendFeedback(Text.literal("Added " + message + "to the saved players"), true); + ctx.getSource().sendFeedback(() -> Text.literal("Added " + message + "to the saved players"), true); } if( !notAdded.isEmpty()) { - ctx.getSource().sendFeedback(Text.literal(notAdded + " were ignored, for they are in the list already."), false); + ctx.getSource().sendFeedback(() -> Text.literal(notAdded + " were ignored, for they are in the list already."), false); } syncSettings(environment); return 1; @@ -373,7 +373,7 @@ public static void registerCommands() { } } if( !message.isEmpty() ) { - ctx.getSource().sendFeedback(Text.literal("Removed " + message + "from the saved players."), true); + ctx.getSource().sendFeedback(() -> Text.literal("Removed " + message + "from the saved players."), true); } syncSettings(environment); return 1; diff --git a/src/main/java/me/atie/partialKeepinventory/formula/XpDroprateFormula.java b/src/main/java/me/atie/partialKeepinventory/formula/XpDroprateFormula.java index 2ce73eb..2cc0d1e 100644 --- a/src/main/java/me/atie/partialKeepinventory/formula/XpDroprateFormula.java +++ b/src/main/java/me/atie/partialKeepinventory/formula/XpDroprateFormula.java @@ -1,10 +1,6 @@ package me.atie.partialKeepinventory.formula; -import me.atie.partialKeepinventory.PartialKeepInventory; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.math.BlockPos; -import redempt.crunch.Crunch; -import redempt.crunch.functional.EvaluationEnvironment; public class XpDroprateFormula extends DroprateFormula { diff --git a/src/main/java/me/atie/partialKeepinventory/gui/ErrorScreen.java b/src/main/java/me/atie/partialKeepinventory/gui/ErrorScreen.java index 91a5683..995397d 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/ErrorScreen.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/ErrorScreen.java @@ -1,12 +1,11 @@ package me.atie.partialKeepinventory.gui; -import me.atie.partialKeepinventory.PartialKeepInventory; import me.atie.partialKeepinventory.gui.Widgets.TextHeaderEntry; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; @Environment(EnvType.CLIENT) @@ -32,7 +31,7 @@ public void init() { } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { this.renderBackground(matrices); errorMessage.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/InvSettingsScreen.java b/src/main/java/me/atie/partialKeepinventory/gui/InvSettingsScreen.java index db82527..60d3b2c 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/InvSettingsScreen.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/InvSettingsScreen.java @@ -3,18 +3,18 @@ import me.atie.partialKeepinventory.KeepinvMode; import me.atie.partialKeepinventory.PartialKeepInventory; import me.atie.partialKeepinventory.formula.InventoryDroprateFormula; -import me.atie.partialKeepinventory.settings.pkiSettings; import me.atie.partialKeepinventory.gui.Widgets.*; +import me.atie.partialKeepinventory.settings.pkiSettings; import me.atie.partialKeepinventory.text.GuiText; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -53,7 +53,7 @@ public InvSettingsScreen(Screen parent, pkiSettings settings, EntryList heading) } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { this.renderBackground(matrices); heading.render(matrices, mouseX, mouseY, delta); @@ -253,7 +253,7 @@ public InvCustomSettingsScreen(Screen parent, pkiSettings settings, EntryList he } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta){ + public void render(DrawContext matrices, int mouseX, int mouseY, float delta){ this.renderBackground(matrices); heading.render(matrices, mouseX, mouseY, delta); textHeader.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/ParentSettingsScreen.java b/src/main/java/me/atie/partialKeepinventory/gui/ParentSettingsScreen.java index bdd36df..6154584 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/ParentSettingsScreen.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/ParentSettingsScreen.java @@ -9,9 +9,9 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.network.ClientPlayNetworkHandler; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -157,7 +157,7 @@ public void close() { } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { } diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonEntry.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonEntry.java index bd79843..31b8e73 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonEntry.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonEntry.java @@ -5,12 +5,12 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.TextWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.List; @@ -72,7 +72,7 @@ public int updateY(int y){ @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if( !hidden ) { nameWidget.render(matrices, mouseX, mouseY, delta); buttonWidget.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonSelectionEntry.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonSelectionEntry.java index 62517f7..12b0118 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonSelectionEntry.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/ButtonSelectionEntry.java @@ -4,10 +4,10 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.ArrayList; @@ -70,7 +70,7 @@ public ButtonSelectionEntry(int yPos, int xMargin, int buttonMargin, ArrayList supplier){ this.getScrollDistance = supplier; } - public abstract void render(MatrixStack matrices, int mouseX, int mouseY, float delta); + public abstract void render(DrawContext matrices, int mouseX, int mouseY, float delta); protected abstract void updateDimensions(int windowWidth); + public abstract List getSelectables(); } diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/EntryList.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/EntryList.java index fbe65b0..27d52d1 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/EntryList.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/EntryList.java @@ -3,9 +3,9 @@ import me.atie.partialKeepinventory.gui.ParentSettingsScreen; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; -import net.minecraft.client.util.math.MatrixStack; import java.util.ArrayList; import java.util.Collection; @@ -56,7 +56,7 @@ public int updateY(int y) { } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if( !hidden ) { for (var child : children) { child.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/PaddingEntry.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/PaddingEntry.java index bb140a3..db614fe 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/PaddingEntry.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/PaddingEntry.java @@ -2,9 +2,9 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; -import net.minecraft.client.util.math.MatrixStack; import java.util.List; @@ -17,7 +17,7 @@ public PaddingEntry(int padding) { } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { } @Override diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleButton.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleButton.java index 880c08d..24d44ce 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleButton.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleButton.java @@ -2,11 +2,11 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.List; @@ -40,7 +40,7 @@ public int updateY(int y) { return super.updateY(y); } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if (!hidden) { buttonWidget.render(matrices, mouseX, mouseY, delta); } diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleText.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleText.java index 35cda2f..db0dceb 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleText.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SimpleText.java @@ -4,10 +4,10 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.widget.TextWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.List; @@ -54,7 +54,7 @@ public int updateY(int y) { @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if( !hidden ) { for( var w: textWidgets ) { w.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SliderEntry.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SliderEntry.java index cd4ec85..3ab5632 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SliderEntry.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/SliderEntry.java @@ -5,12 +5,12 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.SliderWidget; import net.minecraft.client.gui.widget.TextWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.List; @@ -78,7 +78,7 @@ public void updateDimensions(int windowWidth) { sliderWidget.setX(windowWidth - ParentSettingsScreen.sliderWidth - ParentSettingsScreen.sideMargin); } - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if(!hidden) { this.nameWidget.render(matrices, mouseX, mouseY, delta); this.sliderWidget.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextFieldEntry.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextFieldEntry.java index 528f253..caa83de 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextFieldEntry.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextFieldEntry.java @@ -5,12 +5,12 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.gui.widget.TextWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.List; @@ -44,7 +44,7 @@ public TextFieldEntry(TextRenderer textRenderer, Text name, Text tooltip, int yP } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if( !hidden ) { nameWidget.render(matrices, mouseX, mouseY, delta); textFieldWidget.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextHeaderEntry.java b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextHeaderEntry.java index 1a50100..72da64c 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextHeaderEntry.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/Widgets/TextHeaderEntry.java @@ -5,10 +5,10 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.widget.TextWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import java.util.List; @@ -34,7 +34,7 @@ public int updateY(int y) { } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { if(!hidden) { textWidget.render(matrices, mouseX, mouseY, delta); } diff --git a/src/main/java/me/atie/partialKeepinventory/gui/XpSettingsScreen.java b/src/main/java/me/atie/partialKeepinventory/gui/XpSettingsScreen.java index 394125b..7718267 100644 --- a/src/main/java/me/atie/partialKeepinventory/gui/XpSettingsScreen.java +++ b/src/main/java/me/atie/partialKeepinventory/gui/XpSettingsScreen.java @@ -3,18 +3,18 @@ import me.atie.partialKeepinventory.KeepXPMode; import me.atie.partialKeepinventory.PartialKeepInventory; import me.atie.partialKeepinventory.formula.XpDroprateFormula; -import me.atie.partialKeepinventory.settings.pkiSettings; import me.atie.partialKeepinventory.gui.Widgets.*; +import me.atie.partialKeepinventory.settings.pkiSettings; import me.atie.partialKeepinventory.text.GuiText; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -49,7 +49,7 @@ public XpSettingsScreen(Screen parent, pkiSettings settings, EntryList heading) } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { + public void render(DrawContext matrices, int mouseX, int mouseY, float delta) { this.renderBackground(matrices); heading.render(matrices, mouseX, mouseY, delta); @@ -206,7 +206,7 @@ public XpCustomSettingScreen(Screen parent, pkiSettings settings, EntryList head } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta){ + public void render(DrawContext matrices, int mouseX, int mouseY, float delta){ this.renderBackground(matrices); heading.render(matrices, mouseX, mouseY, delta); textHeader.render(matrices, mouseX, mouseY, delta); diff --git a/src/main/java/me/atie/partialKeepinventory/mixin/PlayerEntityMixin.java b/src/main/java/me/atie/partialKeepinventory/mixin/PlayerEntityMixin.java index ac4fec8..10161a1 100644 --- a/src/main/java/me/atie/partialKeepinventory/mixin/PlayerEntityMixin.java +++ b/src/main/java/me/atie/partialKeepinventory/mixin/PlayerEntityMixin.java @@ -10,8 +10,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.Arrays; - import static me.atie.partialKeepinventory.PartialKeepInventory.CONFIG; @Mixin(PlayerEntity.class) diff --git a/src/main/java/me/atie/partialKeepinventory/mixin/PlayerInventoryMixin.java b/src/main/java/me/atie/partialKeepinventory/mixin/PlayerInventoryMixin.java index 84bff5d..531690a 100644 --- a/src/main/java/me/atie/partialKeepinventory/mixin/PlayerInventoryMixin.java +++ b/src/main/java/me/atie/partialKeepinventory/mixin/PlayerInventoryMixin.java @@ -213,7 +213,7 @@ public void dropSome(CallbackInfo ci) { catch (Exception e) { String ErrorMessage = "Failed loading custom expression: \"" + CONFIG.getInvExpression() + "\"\nResorting to percentage based drop behaviour"; PartialKeepInventory.LOGGER.error(ErrorMessage + "\n" + e.getMessage()); - this.player.getCommandSource().sendFeedback(Text.literal(ErrorMessage).setStyle(Style.EMPTY.withColor(Formatting.RED)), true); + this.player.getCommandSource().sendFeedback(() -> Text.literal(ErrorMessage).setStyle(Style.EMPTY.withColor(Formatting.RED)), true); CONFIG.setPartialKeepinvMode(KeepinvMode.STATIC); } } diff --git a/src/main/java/me/atie/partialKeepinventory/mixin/ServerPlayerEntityMixin.java b/src/main/java/me/atie/partialKeepinventory/mixin/ServerPlayerEntityMixin.java index adcd624..a977e91 100644 --- a/src/main/java/me/atie/partialKeepinventory/mixin/ServerPlayerEntityMixin.java +++ b/src/main/java/me/atie/partialKeepinventory/mixin/ServerPlayerEntityMixin.java @@ -109,7 +109,7 @@ public void setXpDropAmounts(KeepXPMode mode){ // Send error string to player and server. String errorStr = "Failed compiling drop expression: " + e.getMessage() + "\nResorting to static droprate of 0"; PartialKeepInventory.LOGGER.error(errorStr); - player.getCommandSource().sendFeedback(Text.literal(errorStr).setStyle(Style.EMPTY.withColor(Formatting.RED)), true); + player.getCommandSource().sendFeedback(() -> Text.literal(errorStr).setStyle(Style.EMPTY.withColor(Formatting.RED)), true); xpLossAmount = 0; xpDropAmount = 0; diff --git a/src/main/java/me/atie/partialKeepinventory/network/ServerListeners.java b/src/main/java/me/atie/partialKeepinventory/network/ServerListeners.java index f705848..0b9b7f5 100644 --- a/src/main/java/me/atie/partialKeepinventory/network/ServerListeners.java +++ b/src/main/java/me/atie/partialKeepinventory/network/ServerListeners.java @@ -11,8 +11,8 @@ import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; -import net.minecraft.network.packet.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.Packet; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; diff --git a/src/main/java/me/atie/partialKeepinventory/settings/BwSettingsCompat.java b/src/main/java/me/atie/partialKeepinventory/settings/BwSettingsCompat.java index c53635d..564fce3 100644 --- a/src/main/java/me/atie/partialKeepinventory/settings/BwSettingsCompat.java +++ b/src/main/java/me/atie/partialKeepinventory/settings/BwSettingsCompat.java @@ -12,7 +12,7 @@ import java.util.ArrayList; import java.util.HashMap; - import java.util.Objects; +import java.util.Objects; /** * Set of functions for reading/writing settings from older versions. diff --git a/src/main/java/me/atie/partialKeepinventory/util/ExperienceUtil.java b/src/main/java/me/atie/partialKeepinventory/util/ExperienceUtil.java index f7c11d1..b1d7d92 100644 --- a/src/main/java/me/atie/partialKeepinventory/util/ExperienceUtil.java +++ b/src/main/java/me/atie/partialKeepinventory/util/ExperienceUtil.java @@ -1,7 +1,6 @@ package me.atie.partialKeepinventory.util; import me.atie.partialKeepinventory.KeepXPMode; -import me.atie.partialKeepinventory.PartialKeepInventory; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.network.ServerPlayerEntity; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index fd26188..74ccc63 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -37,14 +37,14 @@ ], "depends": { - "fabricloader": ">=0.14.11", - "fabric-api": "*", - "minecraft": "~1.19.3", + "fabricloader": ">=0.14.21", + "fabric-api": ">=0.83.0", + "minecraft": ">=1.20.0", "java": ">=17" }, "suggests": { - "modmenu": ">=5.0.2" + "modmenu": ">=7.0.0" }, "custom": {