Skip to content

Commit 396bcd3

Browse files
committed
fix compile errors
1 parent 0377fab commit 396bcd3

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

src/main/java/club/sk1er/patcher/commands/PatcherCommand.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.minecraft.client.Minecraft;
1010
import net.minecraft.client.entity.EntityPlayerSP;
1111
import org.jetbrains.annotations.Nullable;
12+
import org.polyfrost.oneconfig.utils.v1.dsl.ScreensKt;
1213

1314
@Command(value = {"patcher", "polypatcher"})
1415
public class PatcherCommand {
@@ -17,14 +18,13 @@ public class PatcherCommand {
1718
private final int randomBound = 85673;
1819
public static int randomChatMessageId;
1920

20-
@Command
21+
@Handler
2122
private static void main() {
22-
//todo
23-
//Patcher.instance.getPatcherConfig().openGui();
23+
ScreensKt.openUI(Patcher.instance.getPatcherConfig());
2424
}
2525

26-
@Command(value = "blacklist", description = "Tell the client that you don't want to use the 1.11+ chat length on the specified server IP.")
27-
public void blacklist(@Parameter("ip") String ip) {
26+
@Handler(value = "blacklist", description = "Tell the client that you don't want to use the 1.11+ chat length on the specified server IP.")
27+
public void blacklist(@Param("ip") String ip) {
2828
String status = Patcher.instance.addOrRemoveBlacklist(ip) ? "&cnow" : "&ano longer";
2929
ChatUtilities.sendNotification(
3030
"Server Blacklist",
@@ -33,8 +33,8 @@ public void blacklist(@Parameter("ip") String ip) {
3333
Patcher.instance.saveBlacklistedServers();
3434
}
3535

36-
@Command(value = "fov", description = "Change your FOV to a custom value.")
37-
public void fov(@Parameter("amount") float amount) {
36+
@Handler(value = "fov", description = "Change your FOV to a custom value.")
37+
public void fov(@Param("amount") float amount) {
3838
if (amount <= 0) {
3939
ChatUtilities.sendNotification("FOV Changer", "Changing your FOV to or below 0 is disabled due to game-breaking visual bugs.");
4040
return;
@@ -51,8 +51,8 @@ public void fov(@Parameter("amount") float amount) {
5151
mc.gameSettings.saveOptions();
5252
}
5353

54-
@Command(value = {"scale", "invscale", "inventoryscale"}, description = "Change the scale of your inventory independent of your GUI scale.")
55-
public void scale(@Parameter
54+
@Handler(value = {"scale", "invscale", "inventoryscale"}, description = "Change the scale of your inventory independent of your GUI scale.")
55+
public void scale(@Param
5656
//TODO
5757
//(autoCompletesTo = {"help", "off", "none", "small", "normal", "large", "auto", "0", "1", "2", "3", "4", "5"})
5858
String argument) {
@@ -105,22 +105,22 @@ public void scale(@Parameter
105105
Patcher.instance.forceSaveConfig();
106106
}
107107

108-
@Command(value = "sendcoords", description = "Send your current coordinates in chat. Anything after 'sendcoords' will be put at the end of the message.")
109-
public void sendcoords(@Parameter("additional information") @Nullable String message) {
108+
@Handler(value = "sendcoords", description = "Send your current coordinates in chat. Anything after 'sendcoords' will be put at the end of the message.")
109+
public void sendcoords(@Param("additional information") @Nullable String message) {
110110
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
111111
player.sendChatMessage("x: " + (int) player.posX + ", y: " + (int) player.posY + ", z: " + (int) player.posZ +
112112
// might be an issue if they provide a long message?
113113
" " + ((message == null) ? "" : message));
114114
}
115115

116-
@Command(value = "sounds", description = "Open the Sound Configuration GUI.")
116+
@Handler(value = "sounds", description = "Open the Sound Configuration GUI.")
117117
public void sounds() {
118118
//todo
119119
//Patcher.instance.getPatcherSoundConfig().openGui();
120120
}
121121

122-
@Command(value = "fps", description = "Choose what to limit the game's framerate to outside of Minecraft's options. 0 will use your normal framerate.")
123-
public void fps(@Parameter("amount") int amount) {
122+
@Handler(value = "fps", description = "Choose what to limit the game's framerate to outside of Minecraft's options. 0 will use your normal framerate.")
123+
public void fps(@Param("amount") int amount) {
124124
if (amount < 0) {
125125
ChatUtilities.sendNotification("Custom FPS Limiter", "You cannot set your framerate to a negative number.");
126126
return;

src/main/java/club/sk1er/patcher/mixins/bugfixes/mousebindfix/GuiContainerMixin_MouseBindFix.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public abstract class GuiContainerMixin_MouseBindFix extends GuiScreen {
4545
//#else
4646
//$$ if (this.hoveredSlot != null && this.hoveredSlot.getHasStack()) {
4747
//$$ if (this.mc.gameSettings.keyBindPickBlock.isActiveAndMatches(keyCode)) {
48-
//$$ this.handleMouseClick(hoveredSlot, this.hoveredSlot.slotNumber, 0, ClickType.CLONE);
48+
//$$ this.handleMouseClick(this.hoveredSlot, this.hoveredSlot.slotNumber, 0, ClickType.CLONE);
4949
//$$ } else if (this.mc.gameSettings.keyBindDrop.isActiveAndMatches(keyCode)) {
50-
//$$ this.handleMouseClick(hoveredSlot, this.hoveredSlot.slotNumber, this.isCtrlKeyDown() ? 1 : 0, ClickType.THROW);
50+
//$$ this.handleMouseClick(this.hoveredSlot, this.hoveredSlot.slotNumber, this.isCtrlKeyDown() ? 1 : 0, ClickType.THROW);
5151
//$$ }
5252
//$$ }
5353
//#endif

src/main/java/club/sk1er/patcher/util/screenshot/AsyncScreenshots.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import dev.deftu.omnicore.client.OmniDesktop;
44
import dev.deftu.textile.minecraft.MCClickEvent;
5-
import dev.deftu.textile.minecraft.MCSimpleMutableTextHolder;
65
import dev.deftu.textile.minecraft.MCSimpleTextHolder;
76
import dev.deftu.textile.minecraft.MCTextFormat;
7+
import org.polyfrost.oneconfig.api.commands.v1.factories.annotated.Handler;
88
import org.polyfrost.oneconfig.utils.v1.OneImage;
99
import org.polyfrost.oneconfig.utils.v1.Multithreading;
1010
import org.polyfrost.oneconfig.api.commands.v1.factories.annotated.Command;
@@ -30,6 +30,7 @@
3030
import java.awt.image.BufferedImage;
3131
import java.io.File;
3232
import java.io.IOException;
33+
import java.net.URI;
3334
import java.text.SimpleDateFormat;
3435
import java.util.Date;
3536

@@ -180,7 +181,7 @@ private void processPixelValues(int[] pixels, int displayWidth, int displayHeigh
180181

181182
@Command("$openfolder")
182183
public static class ScreenshotsFolder {
183-
@Command
184+
@Handler
184185
public void main() {
185186
try {
186187
OmniDesktop.open(new File("./screenshots"));
@@ -195,7 +196,7 @@ public void main() {
195196
public static class FavoriteScreenshot {
196197

197198
@SuppressWarnings("ResultOfMethodCallIgnored")
198-
@Command
199+
@Handler
199200
public void main() {
200201
try {
201202
final File favoritedScreenshots = getTimestampedPNGFileForDirectory(new File("./favorite_screenshots"));
@@ -215,7 +216,7 @@ public void main() {
215216

216217
@Command("$delete")
217218
public static class DeleteScreenshot {
218-
@Command
219+
@Handler
219220
public void main() {
220221
try {
221222
if (screenshot.exists() && screenshot.delete()) {
@@ -232,7 +233,7 @@ public void main() {
232233

233234
@Command("$upload")
234235
public static class UploadScreenshot {
235-
@Command
236+
@Handler
236237
public void main() {
237238
Multithreading.submit(() -> {
238239
ChatUtilities.sendNotification("Screenshot Manager", "Uploading screenshot...");
@@ -245,7 +246,7 @@ public void main() {
245246
MCSimpleTextHolder text = new MCSimpleTextHolder("Screenshot was uploaded to " + url + ".")
246247
.withFormatting(MCTextFormat.GREEN);
247248
if (url != null) {
248-
text = text.withClickEvent(MCClickEvent.openUrl(url));
249+
text = text.withClickEvent(new MCClickEvent.OpenUrl(URI.create(url)));
249250
}
250251

251252
ChatUtilities.sendMessage(text);
@@ -260,7 +261,7 @@ public void main() {
260261
@Command("$copyss")
261262
public static class CopyScreenshot {
262263

263-
@Command
264+
@Handler
264265
public void main() {
265266
try {
266267
copyScreenshot(true);

0 commit comments

Comments
 (0)