diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-08-11 14:11:46 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-08-11 14:11:46 +0300 |
commit | 97e554414d3304c544d2245597b3f19297e204ca (patch) | |
tree | f6a988ca5baa76064360d1c38a50808b147c4c9a /src | |
parent | af537d5e082641f1214cbe35fb7ed31dd4a7cb3d (diff) | |
download | LibGui-97e554414d3304c544d2245597b3f19297e204ca.tar.gz LibGui-97e554414d3304c544d2245597b3f19297e204ca.tar.bz2 LibGui-97e554414d3304c544d2245597b3f19297e204ca.zip |
Update to rc2
Diffstat (limited to 'src')
6 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java index 2215d4b..fee04f1 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java @@ -152,7 +152,7 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio ItemStack curSlotStack = slot.getStack(); if (!curSlotStack.isEmpty() && canStacksCombine(toInsert, curSlotStack) && slot.canTakeItems(player)) { int combinedAmount = curSlotStack.getCount() + toInsert.getCount(); - int maxAmount = Math.min(toInsert.getMaxCount(), slot.getMaxStackAmount()); + int maxAmount = Math.min(toInsert.getMaxCount(), slot.getMaxItemCount()); if (combinedAmount <= maxAmount) { toInsert.setCount(0); curSlotStack.setCount(combinedAmount); @@ -172,8 +172,8 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio private boolean insertIntoEmpty(ItemStack toInsert, Slot slot) { ItemStack curSlotStack = slot.getStack(); if (curSlotStack.isEmpty() && slot.canInsert(toInsert)) { - if (toInsert.getCount() > slot.getMaxStackAmount()) { - slot.setStack(toInsert.split(slot.getMaxStackAmount())); + if (toInsert.getCount() > slot.getMaxItemCount()) { + slot.setStack(toInsert.split(slot.getMaxItemCount())); } else { slot.setStack(toInsert.split(toInsert.getCount())); } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java index 6adf34e..01b0c70 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java @@ -50,7 +50,7 @@ public class CottonClientScreen extends Screen implements TextHoverRendererScree @Override public void init(MinecraftClient client, int screenWidth, int screenHeight) { super.init(client, screenWidth, screenHeight); - client.keyboard.enableRepeatEvents(true); + client.keyboard.setRepeatEvents(true); description.addPainters(); reposition(screenWidth, screenHeight); @@ -59,7 +59,7 @@ public class CottonClientScreen extends Screen implements TextHoverRendererScree @Override public void removed() { super.removed(); - this.client.keyboard.enableRepeatEvents(false); + this.client.keyboard.setRepeatEvents(false); } /** diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index e69755d..210470d 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -63,7 +63,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl @Override public void init(MinecraftClient client, int screenWidth, int screenHeight) { super.init(client, screenWidth, screenHeight); - client.keyboard.enableRepeatEvents(true); + client.keyboard.setRepeatEvents(true); description.addPainters(); @@ -73,7 +73,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl @Override public void removed() { super.removed(); - this.client.keyboard.enableRepeatEvents(false); + this.client.keyboard.setRepeatEvents(false); } /** diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java index 7cc76e9..5c85c1a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java @@ -133,7 +133,7 @@ public class WLabel extends WWidget { @Nullable public Style getTextStyleAt(int x, int y) { if (isWithinBounds(x, y)) { - return MinecraftClient.getInstance().textRenderer.getTextHandler().trimToWidth(text, x); + return MinecraftClient.getInstance().textRenderer.getTextHandler().getStyleAt(text, x); } return null; } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java index ec66a03..8cd9871 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WText.java @@ -77,7 +77,7 @@ public class WText extends WWidget { if (lineIndex >= 0 && lineIndex < wrappedLines.size()) { OrderedText line = wrappedLines.get(lineIndex); - return font.getTextHandler().method_30876(line, x); + return font.getTextHandler().getStyleAt(line, x); } return null; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java index faa0355..789560a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java @@ -362,7 +362,7 @@ public class WWidget { return; Screen screen = MinecraftClient.getInstance().currentScreen; - screen.renderTooltip(matrices, builder.lines, tX+x, tY+y); + screen.renderOrderedTooltip(matrices, builder.lines, tX+x, tY+y); } /** |