Danielshe 5 years ago
parent
commit
6a140fd9da

+ 1 - 1
build.gradle

@@ -147,7 +147,7 @@ curseforge {
                 requiredDependency 'fabric-api'
             }
             mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
-                displayName = "[Fabric 19w39a] ClothConfig2-$project.version"
+                displayName = "[Fabric 19w41a] ClothConfig2-$project.version"
             }
             addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar"))
             afterEvaluate {

+ 4 - 4
gradle.properties

@@ -1,6 +1,6 @@
-minecraft_version=19w39a
-yarn_version=19w39a+build.2
-fabric_loader_version=0.6.2+build.166
-fabric_version=0.4.0+build.239-1.15
+minecraft_version=19w41a
+yarn_version=19w41a+build.3
+fabric_loader_version=0.6.3+build.167
+fabric_version=0.4.4+build.248-1.15
 mod_version=2.0.0-unstable
 modmenu_version=1.7.6+build.115

+ 12 - 12
src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigScreen.java

@@ -389,16 +389,16 @@ public abstract class ClothConfigScreen extends Screen {
         Tessellator tessellator = Tessellator.getInstance();
         BufferBuilder buffer = tessellator.getBufferBuilder();
         buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-        buffer.method_22912(tabsBounds.getMinX() + 20, tabsBounds.getMinY() + 4, 0.0D).method_22913(0, 1).color(0, 0, 0, 0).next();
-        buffer.method_22912(tabsBounds.getMaxX() - 20, tabsBounds.getMinY() + 4, 0.0D).method_22913(1, 1).color(0, 0, 0, 0).next();
-        buffer.method_22912(tabsBounds.getMaxX() - 20, tabsBounds.getMinY(), 0.0D).method_22913(1, 0).color(0, 0, 0, 255).next();
-        buffer.method_22912(tabsBounds.getMinX() + 20, tabsBounds.getMinY(), 0.0D).method_22913(0, 0).color(0, 0, 0, 255).next();
+        buffer.vertex(tabsBounds.getMinX() + 20, tabsBounds.getMinY() + 4, 0.0D).texture(0, 1).color(0, 0, 0, 0).next();
+        buffer.vertex(tabsBounds.getMaxX() - 20, tabsBounds.getMinY() + 4, 0.0D).texture(1, 1).color(0, 0, 0, 0).next();
+        buffer.vertex(tabsBounds.getMaxX() - 20, tabsBounds.getMinY(), 0.0D).texture(1, 0).color(0, 0, 0, 255).next();
+        buffer.vertex(tabsBounds.getMinX() + 20, tabsBounds.getMinY(), 0.0D).texture(0, 0).color(0, 0, 0, 255).next();
         tessellator.draw();
         buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-        buffer.method_22912(tabsBounds.getMinX() + 20, tabsBounds.getMaxY(), 0.0D).method_22913(0, 1).color(0, 0, 0, 255).next();
-        buffer.method_22912(tabsBounds.getMaxX() - 20, tabsBounds.getMaxY(), 0.0D).method_22913(1, 1).color(0, 0, 0, 255).next();
-        buffer.method_22912(tabsBounds.getMaxX() - 20, tabsBounds.getMaxY() - 4, 0.0D).method_22913(1, 0).color(0, 0, 0, 0).next();
-        buffer.method_22912(tabsBounds.getMinX() + 20, tabsBounds.getMaxY() - 4, 0.0D).method_22913(0, 0).color(0, 0, 0, 0).next();
+        buffer.vertex(tabsBounds.getMinX() + 20, tabsBounds.getMaxY(), 0.0D).texture(0, 1).color(0, 0, 0, 255).next();
+        buffer.vertex(tabsBounds.getMaxX() - 20, tabsBounds.getMaxY(), 0.0D).texture(1, 1).color(0, 0, 0, 255).next();
+        buffer.vertex(tabsBounds.getMaxX() - 20, tabsBounds.getMaxY() - 4, 0.0D).texture(1, 0).color(0, 0, 0, 0).next();
+        buffer.vertex(tabsBounds.getMinX() + 20, tabsBounds.getMaxY() - 4, 0.0D).texture(0, 0).color(0, 0, 0, 0).next();
         tessellator.draw();
         RenderSystem.enableTexture();
         RenderSystem.shadeModel(7424);
@@ -414,10 +414,10 @@ public abstract class ClothConfigScreen extends Screen {
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         float f = 32.0F;
         buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-        buffer.method_22912(rect.getMinX(), rect.getMaxY(), 0.0D).method_22913(rect.getMinX() / 32.0F, rect.getMaxY() / 32.0F).color(red, green, blue, endAlpha).next();
-        buffer.method_22912(rect.getMaxX(), rect.getMaxY(), 0.0D).method_22913(rect.getMaxX() / 32.0F, rect.getMaxY() / 32.0F).color(red, green, blue, endAlpha).next();
-        buffer.method_22912(rect.getMaxX(), rect.getMinY(), 0.0D).method_22913(rect.getMaxX() / 32.0F, rect.getMinY() / 32.0F).color(red, green, blue, startAlpha).next();
-        buffer.method_22912(rect.getMinX(), rect.getMinY(), 0.0D).method_22913(rect.getMinX() / 32.0F, rect.getMinY() / 32.0F).color(red, green, blue, startAlpha).next();
+        buffer.vertex(rect.getMinX(), rect.getMaxY(), 0.0D).texture(rect.getMinX() / 32.0F, rect.getMaxY() / 32.0F).color(red, green, blue, endAlpha).next();
+        buffer.vertex(rect.getMaxX(), rect.getMaxY(), 0.0D).texture(rect.getMaxX() / 32.0F, rect.getMaxY() / 32.0F).color(red, green, blue, endAlpha).next();
+        buffer.vertex(rect.getMaxX(), rect.getMinY(), 0.0D).texture(rect.getMaxX() / 32.0F, rect.getMinY() / 32.0F).color(red, green, blue, startAlpha).next();
+        buffer.vertex(rect.getMinX(), rect.getMinY(), 0.0D).texture(rect.getMinX() / 32.0F, rect.getMinY() / 32.0F).color(red, green, blue, startAlpha).next();
         tessellator.draw();
     }
     

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/BooleanListEntry.java

@@ -72,7 +72,7 @@ public class BooleanListEntry extends TooltipListEntry<Boolean> {
     @Override
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
-        Window window = MinecraftClient.getInstance().method_22683();
+        Window window = MinecraftClient.getInstance().getWindow();
         this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get().booleanValue() != bool.get();
         this.resetButton.y = y;
         this.buttonWidget.active = isEditable();

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/EnumListEntry.java

@@ -90,7 +90,7 @@ public class EnumListEntry<T extends Enum<?>> extends TooltipListEntry<T> {
     @Override
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
-        Window window = MinecraftClient.getInstance().method_22683();
+        Window window = MinecraftClient.getInstance().getWindow();
         this.resetButton.active = isEditable() && getDefaultValue().isPresent() && getDefaultIndex() != this.index.get();
         this.resetButton.y = y;
         this.buttonWidget.active = isEditable();

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerSliderEntry.java

@@ -105,7 +105,7 @@ public class IntegerSliderEntry extends TooltipListEntry<Integer> {
     @Override
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
-        Window window = MinecraftClient.getInstance().method_22683();
+        Window window = MinecraftClient.getInstance().getWindow();
         this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get().intValue() != value.get();
         this.resetButton.y = y;
         this.sliderWidget.active = isEditable();

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/LongSliderEntry.java

@@ -105,7 +105,7 @@ public class LongSliderEntry extends TooltipListEntry<Long> {
     @Override
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
-        Window window = MinecraftClient.getInstance().method_22683();
+        Window window = MinecraftClient.getInstance().getWindow();
         this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get().longValue() != value.get();
         this.resetButton.y = y;
         this.sliderWidget.active = isEditable();

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/TextFieldListEntry.java

@@ -75,7 +75,7 @@ public abstract class TextFieldListEntry<T> extends TooltipListEntry<T> {
     @Override
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
-        Window window = MinecraftClient.getInstance().method_22683();
+        Window window = MinecraftClient.getInstance().getWindow();
         this.resetButton.active = isEditable() && getDefaultValue().isPresent() && !isMatchDefault(textFieldWidget.getText());
         this.resetButton.y = y;
         this.textFieldWidget.setEditable(isEditable());

+ 36 - 36
src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java

@@ -169,10 +169,10 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         float float_2 = 32.0F;
         buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-        buffer.method_22912(this.left, this.bottom, 0.0D).method_22913(this.left / 32.0F, ((this.bottom + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
-        buffer.method_22912(this.right, this.bottom, 0.0D).method_22913(this.right / 32.0F, ((this.bottom + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
-        buffer.method_22912(this.right, this.top, 0.0D).method_22913(this.right / 32.0F, ((this.top + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
-        buffer.method_22912(this.left, this.top, 0.0D).method_22913(this.left / 32.0F, ((this.top + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
+        buffer.vertex(this.left, this.bottom, 0.0D).texture(this.left / 32.0F, ((this.bottom + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
+        buffer.vertex(this.right, this.bottom, 0.0D).texture(this.right / 32.0F, ((this.bottom + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
+        buffer.vertex(this.right, this.top, 0.0D).texture(this.right / 32.0F, ((this.top + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
+        buffer.vertex(this.left, this.top, 0.0D).texture(this.left / 32.0F, ((this.top + (int) this.getScroll()) / 32.0F)).color(32, 32, 32, 255).next();
         tessellator.draw();
         int rowLeft = this.getRowLeft();
         int startY = this.top + 4 - (int) this.getScroll();
@@ -189,16 +189,16 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         RenderSystem.shadeModel(7425);
         RenderSystem.disableTexture();
         buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-        buffer.method_22912(this.left, this.top + 4, 0.0D).method_22913(0, 1).color(0, 0, 0, 0).next();
-        buffer.method_22912(this.right, this.top + 4, 0.0D).method_22913(1, 1).color(0, 0, 0, 0).next();
-        buffer.method_22912(this.right, this.top, 0.0D).method_22913(1, 0).color(0, 0, 0, 255).next();
-        buffer.method_22912(this.left, this.top, 0.0D).method_22913(0, 0).color(0, 0, 0, 255).next();
+        buffer.vertex(this.left, this.top + 4, 0.0D).texture(0, 1).color(0, 0, 0, 0).next();
+        buffer.vertex(this.right, this.top + 4, 0.0D).texture(1, 1).color(0, 0, 0, 0).next();
+        buffer.vertex(this.right, this.top, 0.0D).texture(1, 0).color(0, 0, 0, 255).next();
+        buffer.vertex(this.left, this.top, 0.0D).texture(0, 0).color(0, 0, 0, 255).next();
         tessellator.draw();
         buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-        buffer.method_22912(this.left, this.bottom, 0.0D).method_22913(0, 1).color(0, 0, 0, 255).next();
-        buffer.method_22912(this.right, this.bottom, 0.0D).method_22913(1, 1).color(0, 0, 0, 255).next();
-        buffer.method_22912(this.right, this.bottom - 4, 0.0D).method_22913(1, 0).color(0, 0, 0, 0).next();
-        buffer.method_22912(this.left, this.bottom - 4, 0.0D).method_22913(0, 0).color(0, 0, 0, 0).next();
+        buffer.vertex(this.left, this.bottom, 0.0D).texture(0, 1).color(0, 0, 0, 255).next();
+        buffer.vertex(this.right, this.bottom, 0.0D).texture(1, 1).color(0, 0, 0, 255).next();
+        buffer.vertex(this.right, this.bottom - 4, 0.0D).texture(1, 0).color(0, 0, 0, 0).next();
+        buffer.vertex(this.left, this.bottom - 4, 0.0D).texture(0, 0).color(0, 0, 0, 0).next();
         tessellator.draw();
         int maxScroll = this.getMaxScroll();
         renderScrollBar(tessellator, buffer, maxScroll, scrollbarPosition, int_4);
@@ -220,22 +220,22 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
             }
             
             buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-            buffer.method_22912(scrollbarPositionMinX, this.bottom, 0.0D).method_22913(0, 1).color(0, 0, 0, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, this.bottom, 0.0D).method_22913(1, 1).color(0, 0, 0, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, this.top, 0.0D).method_22913(1, 0).color(0, 0, 0, 255).next();
-            buffer.method_22912(scrollbarPositionMinX, this.top, 0.0D).method_22913(0, 0).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMinX, this.bottom, 0.0D).texture(0, 1).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, this.bottom, 0.0D).texture(1, 1).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, this.top, 0.0D).texture(1, 0).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMinX, this.top, 0.0D).texture(0, 0).color(0, 0, 0, 255).next();
             tessellator.draw();
             buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-            buffer.method_22912(scrollbarPositionMinX, int_10 + int_9, 0.0D).method_22913(0, 1).color(128, 128, 128, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, int_10 + int_9, 0.0D).method_22913(1, 1).color(128, 128, 128, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, int_10, 0.0D).method_22913(1, 0).color(128, 128, 128, 255).next();
-            buffer.method_22912(scrollbarPositionMinX, int_10, 0.0D).method_22913(0, 0).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMinX, int_10 + int_9, 0.0D).texture(0, 1).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, int_10 + int_9, 0.0D).texture(1, 1).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, int_10, 0.0D).texture(1, 0).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMinX, int_10, 0.0D).texture(0, 0).color(128, 128, 128, 255).next();
             tessellator.draw();
             buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-            buffer.method_22912(scrollbarPositionMinX, (int_10 + int_9 - 1), 0.0D).method_22913(0, 1).color(192, 192, 192, 255).next();
-            buffer.method_22912((scrollbarPositionMaxX - 1), (int_10 + int_9 - 1), 0.0D).method_22913(1, 1).color(192, 192, 192, 255).next();
-            buffer.method_22912((scrollbarPositionMaxX - 1), int_10, 0.0D).method_22913(1, 0).color(192, 192, 192, 255).next();
-            buffer.method_22912(scrollbarPositionMinX, int_10, 0.0D).method_22913(0, 0).color(192, 192, 192, 255).next();
+            buffer.vertex(scrollbarPositionMinX, (int_10 + int_9 - 1), 0.0D).texture(0, 1).color(192, 192, 192, 255).next();
+            buffer.vertex((scrollbarPositionMaxX - 1), (int_10 + int_9 - 1), 0.0D).texture(1, 1).color(192, 192, 192, 255).next();
+            buffer.vertex((scrollbarPositionMaxX - 1), int_10, 0.0D).texture(1, 0).color(192, 192, 192, 255).next();
+            buffer.vertex(scrollbarPositionMinX, int_10, 0.0D).texture(0, 0).color(192, 192, 192, 255).next();
             tessellator.draw();
         }
     }
@@ -391,17 +391,17 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
                 float float_2 = this.isFocused() ? 1.0F : 0.5F;
                 RenderSystem.color4f(float_2, float_2, float_2, 1.0F);
                 buffer.begin(7, VertexFormats.POSITION);
-                buffer.method_22912((double) itemMinX, (double) (itemY + itemHeight + 2), 0.0D).next();
-                buffer.method_22912((double) itemMaxX, (double) (itemY + itemHeight + 2), 0.0D).next();
-                buffer.method_22912((double) itemMaxX, (double) (itemY - 2), 0.0D).next();
-                buffer.method_22912((double) itemMinX, (double) (itemY - 2), 0.0D).next();
+                buffer.vertex((double) itemMinX, (double) (itemY + itemHeight + 2), 0.0D).next();
+                buffer.vertex((double) itemMaxX, (double) (itemY + itemHeight + 2), 0.0D).next();
+                buffer.vertex((double) itemMaxX, (double) (itemY - 2), 0.0D).next();
+                buffer.vertex((double) itemMinX, (double) (itemY - 2), 0.0D).next();
                 tessellator.draw();
                 RenderSystem.color4f(0.0F, 0.0F, 0.0F, 1.0F);
                 buffer.begin(7, VertexFormats.POSITION);
-                buffer.method_22912((double) (itemMinX + 1), (double) (itemY + itemHeight + 1), 0.0D).next();
-                buffer.method_22912((double) (itemMaxX - 1), (double) (itemY + itemHeight + 1), 0.0D).next();
-                buffer.method_22912((double) (itemMaxX - 1), (double) (itemY - 1), 0.0D).next();
-                buffer.method_22912((double) (itemMinX + 1), (double) (itemY - 1), 0.0D).next();
+                buffer.vertex((double) (itemMinX + 1), (double) (itemY + itemHeight + 1), 0.0D).next();
+                buffer.vertex((double) (itemMaxX - 1), (double) (itemY + itemHeight + 1), 0.0D).next();
+                buffer.vertex((double) (itemMaxX - 1), (double) (itemY - 1), 0.0D).next();
+                buffer.vertex((double) (itemMinX + 1), (double) (itemY - 1), 0.0D).next();
                 tessellator.draw();
                 RenderSystem.enableTexture();
             }
@@ -436,10 +436,10 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         float float_1 = 32.0F;
         bufferBuilder_1.begin(7, VertexFormats.POSITION_UV_COLOR);
-        bufferBuilder_1.method_22912((double) this.left, (double) int_2, 0.0D).method_22913(0, ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
-        bufferBuilder_1.method_22912((double) (this.left + this.width), (double) int_2, 0.0D).method_22913(((float) this.width / 32.0F), ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
-        bufferBuilder_1.method_22912((double) (this.left + this.width), (double) int_1, 0.0D).method_22913(((float) this.width / 32.0F), ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
-        bufferBuilder_1.method_22912((double) this.left, (double) int_1, 0.0D).method_22913(0, ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
+        bufferBuilder_1.vertex((double) this.left, (double) int_2, 0.0D).texture(0, ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
+        bufferBuilder_1.vertex((double) (this.left + this.width), (double) int_2, 0.0D).texture(((float) this.width / 32.0F), ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
+        bufferBuilder_1.vertex((double) (this.left + this.width), (double) int_1, 0.0D).texture(((float) this.width / 32.0F), ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
+        bufferBuilder_1.vertex((double) this.left, (double) int_1, 0.0D).texture(0, ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
         tessellator_1.draw();
     }
     

+ 12 - 12
src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicSmoothScrollingEntryListWidget.java

@@ -132,26 +132,26 @@ public abstract class DynamicSmoothScrollingEntryListWidget<E extends DynamicEnt
             
             // Black Bar
             buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-            buffer.method_22912(scrollbarPositionMinX, this.bottom, 0.0D).method_22913(0, 1).color(0, 0, 0, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, this.bottom, 0.0D).method_22913(1, 1).color(0, 0, 0, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, this.top, 0.0D).method_22913(1, 0).color(0, 0, 0, 255).next();
-            buffer.method_22912(scrollbarPositionMinX, this.top, 0.0D).method_22913(0, 0).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMinX, this.bottom, 0.0D).texture(0, 1).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, this.bottom, 0.0D).texture(1, 1).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, this.top, 0.0D).texture(1, 0).color(0, 0, 0, 255).next();
+            buffer.vertex(scrollbarPositionMinX, this.top, 0.0D).texture(0, 0).color(0, 0, 0, 255).next();
             tessellator.draw();
             
             // Top
             buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-            buffer.method_22912(scrollbarPositionMinX, minY + height, 0.0D).method_22913(0, 1).color(128, 128, 128, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, minY + height, 0.0D).method_22913(1, 1).color(128, 128, 128, 255).next();
-            buffer.method_22912(scrollbarPositionMaxX, minY, 0.0D).method_22913(1, 0).color(128, 128, 128, 255).next();
-            buffer.method_22912(scrollbarPositionMinX, minY, 0.0D).method_22913(0, 0).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMinX, minY + height, 0.0D).texture(0, 1).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, minY + height, 0.0D).texture(1, 1).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMaxX, minY, 0.0D).texture(1, 0).color(128, 128, 128, 255).next();
+            buffer.vertex(scrollbarPositionMinX, minY, 0.0D).texture(0, 0).color(128, 128, 128, 255).next();
             tessellator.draw();
             
             // Bottom
             buffer.begin(7, VertexFormats.POSITION_UV_COLOR);
-            buffer.method_22912(scrollbarPositionMinX, (minY + height - 1), 0.0D).method_22913(0, 1).color(192, 192, 192, 255).next();
-            buffer.method_22912((scrollbarPositionMaxX - 1), (minY + height - 1), 0.0D).method_22913(1, 1).color(192, 192, 192, 255).next();
-            buffer.method_22912((scrollbarPositionMaxX - 1), minY, 0.0D).method_22913(1, 0).color(192, 192, 192, 255).next();
-            buffer.method_22912(scrollbarPositionMinX, minY, 0.0D).method_22913(0, 0).color(192, 192, 192, 255).next();
+            buffer.vertex(scrollbarPositionMinX, (minY + height - 1), 0.0D).texture(0, 1).color(192, 192, 192, 255).next();
+            buffer.vertex((scrollbarPositionMaxX - 1), (minY + height - 1), 0.0D).texture(1, 1).color(192, 192, 192, 255).next();
+            buffer.vertex((scrollbarPositionMaxX - 1), minY, 0.0D).texture(1, 0).color(192, 192, 192, 255).next();
+            buffer.vertex(scrollbarPositionMinX, minY, 0.0D).texture(0, 0).color(192, 192, 192, 255).next();
             tessellator.draw();
         }
     }

+ 87 - 52
src/main/java/me/shedaniel/math/api/Rectangle.java

@@ -179,19 +179,23 @@ public class Rectangle implements Cloneable {
             // either original w or W was zero or
             // x+w did not overflow or
             // the overflowed x+w is smaller than the overflowed X+W
-            if (w >= x || W > w) return false;
+            if (w >= x || W > w)
+                return false;
         } else {
             // X+W did not overflow and W was not zero, return false if...
             // original w was zero or
             // x+w did not overflow and x+w is smaller than X+W
-            if (w >= x && W > w) return false;
+            if (w >= x && W > w)
+                return false;
         }
         h += y;
         H += Y;
         if (H <= Y) {
-            if (h >= y || H > h) return false;
+            if (h >= y || H > h)
+                return false;
         } else {
-            if (h >= y && H > h) return false;
+            if (h >= y && H > h)
+                return false;
         }
         return true;
     }
@@ -213,8 +217,7 @@ public class Rectangle implements Cloneable {
         w += x;
         h += y;
         //    overflow || intersect
-        return ((w < x || w > X) &&
-                (h < y || h > Y));
+        return ((w < x || w > X) && (h < y || h > Y));
     }
     
     public boolean intersects(Rectangle r) {
@@ -234,10 +237,7 @@ public class Rectangle implements Cloneable {
         tw += tx;
         th += ty;
         //      overflow || intersect
-        return ((rw < rx || rw > tx) &&
-                (rh < ry || rh > ty) &&
-                (tw < tx || tw > rx) &&
-                (th < ty || th > ry));
+        return ((rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry));
     }
     
     public Rectangle intersection(Rectangle r) {
@@ -253,17 +253,23 @@ public class Rectangle implements Cloneable {
         rx2 += r.width;
         long ry2 = ry1;
         ry2 += r.height;
-        if (tx1 < rx1) tx1 = rx1;
-        if (ty1 < ry1) ty1 = ry1;
-        if (tx2 > rx2) tx2 = rx2;
-        if (ty2 > ry2) ty2 = ry2;
+        if (tx1 < rx1)
+            tx1 = rx1;
+        if (ty1 < ry1)
+            ty1 = ry1;
+        if (tx2 > rx2)
+            tx2 = rx2;
+        if (ty2 > ry2)
+            ty2 = ry2;
         tx2 -= tx1;
         ty2 -= ty1;
         // tx2,ty2 will never overflow (they will never be
         // larger than the smallest of the two source w,h)
         // they might underflow, though...
-        if (tx2 < Integer.MIN_VALUE) tx2 = Integer.MIN_VALUE;
-        if (ty2 < Integer.MIN_VALUE) ty2 = Integer.MIN_VALUE;
+        if (tx2 < Integer.MIN_VALUE)
+            tx2 = Integer.MIN_VALUE;
+        if (ty2 < Integer.MIN_VALUE)
+            ty2 = Integer.MIN_VALUE;
         return new Rectangle(tx1, ty1, (int) tx2, (int) ty2);
     }
     
@@ -292,17 +298,23 @@ public class Rectangle implements Cloneable {
         int ry1 = r.y;
         rx2 += rx1;
         ry2 += ry1;
-        if (tx1 > rx1) tx1 = rx1;
-        if (ty1 > ry1) ty1 = ry1;
-        if (tx2 < rx2) tx2 = rx2;
-        if (ty2 < ry2) ty2 = ry2;
+        if (tx1 > rx1)
+            tx1 = rx1;
+        if (ty1 > ry1)
+            ty1 = ry1;
+        if (tx2 < rx2)
+            tx2 = rx2;
+        if (ty2 < ry2)
+            ty2 = ry2;
         tx2 -= tx1;
         ty2 -= ty1;
         // tx2,ty2 will never underflow since both original rectangles
         // were already proven to be non-empty
         // they might overflow, though...
-        if (tx2 > Integer.MAX_VALUE) tx2 = Integer.MAX_VALUE;
-        if (ty2 > Integer.MAX_VALUE) ty2 = Integer.MAX_VALUE;
+        if (tx2 > Integer.MAX_VALUE)
+            tx2 = Integer.MAX_VALUE;
+        if (ty2 > Integer.MAX_VALUE)
+            ty2 = Integer.MAX_VALUE;
         return new Rectangle(tx1, ty1, (int) tx2, (int) ty2);
     }
     
@@ -319,14 +331,20 @@ public class Rectangle implements Cloneable {
         long y2 = this.height;
         x2 += x1;
         y2 += y1;
-        if (x1 > newx) x1 = newx;
-        if (y1 > newy) y1 = newy;
-        if (x2 < newx) x2 = newx;
-        if (y2 < newy) y2 = newy;
+        if (x1 > newx)
+            x1 = newx;
+        if (y1 > newy)
+            y1 = newy;
+        if (x2 < newx)
+            x2 = newx;
+        if (y2 < newy)
+            y2 = newy;
         x2 -= x1;
         y2 -= y1;
-        if (x2 > Integer.MAX_VALUE) x2 = Integer.MAX_VALUE;
-        if (y2 > Integer.MAX_VALUE) y2 = Integer.MAX_VALUE;
+        if (x2 > Integer.MAX_VALUE)
+            x2 = Integer.MAX_VALUE;
+        if (y2 > Integer.MAX_VALUE)
+            y2 = Integer.MAX_VALUE;
         reshape(x1, y1, (int) x2, (int) y2);
     }
     
@@ -353,17 +371,23 @@ public class Rectangle implements Cloneable {
         int ry1 = r.y;
         rx2 += rx1;
         ry2 += ry1;
-        if (tx1 > rx1) tx1 = rx1;
-        if (ty1 > ry1) ty1 = ry1;
-        if (tx2 < rx2) tx2 = rx2;
-        if (ty2 < ry2) ty2 = ry2;
+        if (tx1 > rx1)
+            tx1 = rx1;
+        if (ty1 > ry1)
+            ty1 = ry1;
+        if (tx2 < rx2)
+            tx2 = rx2;
+        if (ty2 < ry2)
+            ty2 = ry2;
         tx2 -= tx1;
         ty2 -= ty1;
         // tx2,ty2 will never underflow since both original
         // rectangles were non-empty
         // they might overflow, though...
-        if (tx2 > Integer.MAX_VALUE) tx2 = Integer.MAX_VALUE;
-        if (ty2 > Integer.MAX_VALUE) ty2 = Integer.MAX_VALUE;
+        if (tx2 > Integer.MAX_VALUE)
+            tx2 = Integer.MAX_VALUE;
+        if (ty2 > Integer.MAX_VALUE)
+            ty2 = Integer.MAX_VALUE;
         reshape(tx1, ty1, (int) tx2, (int) ty2);
     }
     
@@ -386,35 +410,49 @@ public class Rectangle implements Cloneable {
             // it is clipped so that we avoid the risk that the clipping
             // of x0 will reverse the ordering of x0 and x1.
             x1 -= x0;
-            if (x1 < Integer.MIN_VALUE) x1 = Integer.MIN_VALUE;
-            if (x0 < Integer.MIN_VALUE) x0 = Integer.MIN_VALUE;
-            else if (x0 > Integer.MAX_VALUE) x0 = Integer.MAX_VALUE;
+            if (x1 < Integer.MIN_VALUE)
+                x1 = Integer.MIN_VALUE;
+            if (x0 < Integer.MIN_VALUE)
+                x0 = Integer.MIN_VALUE;
+            else if (x0 > Integer.MAX_VALUE)
+                x0 = Integer.MAX_VALUE;
         } else { // (x1 >= x0)
             // Clip x0 before we subtract it from x1 in case the clipping
             // affects the representable area of the rectangle.
-            if (x0 < Integer.MIN_VALUE) x0 = Integer.MIN_VALUE;
-            else if (x0 > Integer.MAX_VALUE) x0 = Integer.MAX_VALUE;
+            if (x0 < Integer.MIN_VALUE)
+                x0 = Integer.MIN_VALUE;
+            else if (x0 > Integer.MAX_VALUE)
+                x0 = Integer.MAX_VALUE;
             x1 -= x0;
             // The only way x1 can be negative now is if we clipped
             // x0 against MIN and x1 is less than MIN - in which case
             // we want to leave the width negative since the result
             // did not intersect the representable area.
-            if (x1 < Integer.MIN_VALUE) x1 = Integer.MIN_VALUE;
-            else if (x1 > Integer.MAX_VALUE) x1 = Integer.MAX_VALUE;
+            if (x1 < Integer.MIN_VALUE)
+                x1 = Integer.MIN_VALUE;
+            else if (x1 > Integer.MAX_VALUE)
+                x1 = Integer.MAX_VALUE;
         }
         
         if (y1 < y0) {
             // Non-existant in Y direction
             y1 -= y0;
-            if (y1 < Integer.MIN_VALUE) y1 = Integer.MIN_VALUE;
-            if (y0 < Integer.MIN_VALUE) y0 = Integer.MIN_VALUE;
-            else if (y0 > Integer.MAX_VALUE) y0 = Integer.MAX_VALUE;
+            if (y1 < Integer.MIN_VALUE)
+                y1 = Integer.MIN_VALUE;
+            if (y0 < Integer.MIN_VALUE)
+                y0 = Integer.MIN_VALUE;
+            else if (y0 > Integer.MAX_VALUE)
+                y0 = Integer.MAX_VALUE;
         } else { // (y1 >= y0)
-            if (y0 < Integer.MIN_VALUE) y0 = Integer.MIN_VALUE;
-            else if (y0 > Integer.MAX_VALUE) y0 = Integer.MAX_VALUE;
+            if (y0 < Integer.MIN_VALUE)
+                y0 = Integer.MIN_VALUE;
+            else if (y0 > Integer.MAX_VALUE)
+                y0 = Integer.MAX_VALUE;
             y1 -= y0;
-            if (y1 < Integer.MIN_VALUE) y1 = Integer.MIN_VALUE;
-            else if (y1 > Integer.MAX_VALUE) y1 = Integer.MAX_VALUE;
+            if (y1 < Integer.MIN_VALUE)
+                y1 = Integer.MIN_VALUE;
+            else if (y1 > Integer.MAX_VALUE)
+                y1 = Integer.MAX_VALUE;
         }
         
         reshape((int) x0, (int) y0, (int) x1, (int) y1);
@@ -428,10 +466,7 @@ public class Rectangle implements Cloneable {
     public boolean equals(Object obj) {
         if (obj instanceof Rectangle) {
             Rectangle r = (Rectangle) obj;
-            return ((x == r.x) &&
-                    (y == r.y) &&
-                    (width == r.width) &&
-                    (height == r.height));
+            return ((x == r.x) && (y == r.y) && (width == r.width) && (height == r.height));
         }
         return super.equals(obj);
     }

+ 2 - 2
src/main/java/me/shedaniel/math/impl/PointHelper.java

@@ -6,8 +6,8 @@ import net.minecraft.client.MinecraftClient;
 public class PointHelper {
     public static Point fromMouse() {
         MinecraftClient client = MinecraftClient.getInstance();
-        double mx = client.mouse.getX() * (double) client.method_22683().getScaledWidth() / (double) client.method_22683().getWidth();
-        double my = client.mouse.getY() * (double) client.method_22683().getScaledHeight() / (double) client.method_22683().getHeight();
+        double mx = client.mouse.getX() * (double) client.getWindow().getScaledWidth() / (double) client.getWindow().getWidth();
+        double my = client.mouse.getY() * (double) client.getWindow().getScaledHeight() / (double) client.getWindow().getHeight();
         return new Point(mx, my);
     }