Skip to content

Commit

Permalink
Updated to 1.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
atiedebee committed Jun 9, 2023
1 parent 7165748 commit dafca51
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 65 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
1 change: 0 additions & 1 deletion src/main/java/me/atie/partialKeepinventory/api/pkiApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;

public abstract class pkiApi {
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
public class pkiCommandRegistration {

private static void modeMessage(CommandContext<ServerCommandSource> 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<ServerCommandSource> ctx, String valName, int val) {
ctx.getSource().sendFeedback(Text.literal(
ctx.getSource().sendFeedback(() -> Text.literal(
valName + " is set to " + val + "%"
), true);
}
Expand Down Expand Up @@ -144,15 +144,15 @@ 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;
})
)
.then(literal("disable").executes(
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;
})
)
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,7 +70,7 @@ public ButtonSelectionEntry(int yPos, int xMargin, int buttonMargin, ArrayList<T


@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
public void render(DrawContext matrices, int mouseX, int mouseY, float delta) {
for(var e: buttonWidgets){
e.render(matrices, mouseX, mouseY, delta);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package me.atie.partialKeepinventory.gui.Widgets;

import me.atie.partialKeepinventory.PartialKeepInventory;
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.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;

import java.util.List;
Expand Down Expand Up @@ -52,7 +51,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) {
if( !collapsed ){
super.render(matrices, mouseX, mouseY, delta);
Expand Down Expand Up @@ -97,7 +96,7 @@ public ButtonWidgetEntry(int yPos, ButtonWidget buttonWidget) {
public ButtonWidget getButtonWidget(){ return this.buttonWidget; }

@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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +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 net.minecraft.util.math.Box;

import java.util.List;
import java.util.function.Supplier;
Expand Down Expand Up @@ -48,10 +47,11 @@ public void setScrollDistanceGetter(Supplier<Integer> 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 <T extends Element & Selectable> List<T> getSelectables();

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Loading

0 comments on commit dafca51

Please sign in to comment.