aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-17 11:47:43 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-17 11:47:43 +0200
commitf880c0d5ac35be17703581fa0dc847e0de053424 (patch)
treeca28b585439316cdfcf47cb73c49f52310e1830b /src/main
parent68cb08a1042d9f5e0c3315fc5755a6e8db3941aa (diff)
downloadLibGui-f880c0d5ac35be17703581fa0dc847e0de053424.tar.gz
LibGui-f880c0d5ac35be17703581fa0dc847e0de053424.tar.bz2
LibGui-f880c0d5ac35be17703581fa0dc847e0de053424.zip
Update to 20w51a
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/impl/access/ScreenAccessor.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/TooltipBuilder.java6
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java4
4 files changed, 7 insertions, 7 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 6f81346..ec779a6 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/SyncedGuiDescription.java
@@ -158,7 +158,7 @@ public class SyncedGuiDescription extends ScreenHandler implements GuiDescriptio
/** WILL MODIFY toInsert! Returns true if anything was inserted. */
private boolean insertIntoExisting(ItemStack toInsert, Slot slot, PlayerEntity player) {
ItemStack curSlotStack = slot.getStack();
- if (!curSlotStack.isEmpty() && ItemStack.method_31577(toInsert, curSlotStack) && slot.canInsert(toInsert)) {
+ if (!curSlotStack.isEmpty() && ItemStack.canCombine(toInsert, curSlotStack) && slot.canInsert(toInsert)) {
int combinedAmount = curSlotStack.getCount() + toInsert.getCount();
int maxAmount = Math.min(toInsert.getMaxCount(), slot.getMaxItemCount());
if (combinedAmount <= maxAmount) {
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/impl/access/ScreenAccessor.java b/src/main/java/io/github/cottonmc/cotton/gui/impl/access/ScreenAccessor.java
index 0d97e7c..33add9f 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/impl/access/ScreenAccessor.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/impl/access/ScreenAccessor.java
@@ -11,6 +11,6 @@ import java.util.List;
@Mixin(Screen.class)
public interface ScreenAccessor {
- @Invoker("method_32633")
+ @Invoker
void callRenderTooltipFromComponents(MatrixStack matrices, List<TooltipComponent> components, int x, int y);
}
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/TooltipBuilder.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/TooltipBuilder.java
index 05c5c02..86b8016 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/TooltipBuilder.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/TooltipBuilder.java
@@ -39,7 +39,7 @@ public final class TooltipBuilder {
public TooltipBuilder add(Text... lines) {
Objects.requireNonNull(lines, "lines");
for (Text line : lines) {
- components.add(TooltipComponent.createOrderedTextTooltipComponent(line.asOrderedText()));
+ components.add(TooltipComponent.of(line.asOrderedText()));
}
return this;
@@ -55,7 +55,7 @@ public final class TooltipBuilder {
public TooltipBuilder add(OrderedText... lines) {
Objects.requireNonNull(lines, "lines");
for (OrderedText line : lines) {
- components.add(TooltipComponent.createOrderedTextTooltipComponent(line));
+ components.add(TooltipComponent.of(line));
}
return this;
@@ -86,7 +86,7 @@ public final class TooltipBuilder {
*/
public TooltipBuilder add(TooltipData tooltipData) {
Objects.requireNonNull(tooltipData, "tooltipData");
- components.add(TooltipComponent.createTooltipComponent(tooltipData));
+ components.add(TooltipComponent.of(tooltipData));
return this;
}
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java
index ba5edd4..57cc8e6 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabeledSlider.java
@@ -4,8 +4,8 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.client.util.math.Vector3f;
import net.minecraft.text.Text;
+import net.minecraft.util.math.Vec3f;
import io.github.cottonmc.cotton.gui.client.ScreenDrawing;
import io.github.cottonmc.cotton.gui.widget.data.Axis;
@@ -169,7 +169,7 @@ public class WLabeledSlider extends WAbstractSlider {
matrices.translate(x, y, 0);
if (axis == Axis.VERTICAL) {
matrices.translate(0, height, 0);
- matrices.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(270));
+ matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(270));
}
drawButton(matrices, 0, 0, 0, aWidth);