Skip to content

Commit

Permalink
= Pests Destroyer - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
onixiya1337 committed Feb 13, 2024
1 parent 2e9168e commit 6aae013
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.4.5-pre3
version=2.4.5-pre4
shouldRelease=true
4 changes: 4 additions & 0 deletions src/main/java/com/jelly/farmhelperv2/FarmHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public void onTickSendInfoAboutShittyClient(TickEvent.PlayerTickEvent event) {
Notifications.INSTANCE.send("FarmHelper", "You've got Hytils installed in your mods folder! This will cause many issues with rewarping as it sends tons of commands every minute.", 15000);
LogUtils.sendError("You've got §6§lHytils §cinstalled in your mods folder! This will cause many issues with rewarping as it sends tons of commands every minute.");
}
if (ReflectionUtils.hasPackageInstalled("com.tterrag.blur")) {
Notifications.INSTANCE.send("FarmHelper", "You've got BlurMC installed in your mods folder! This will break AutoSell, Pests Destroyer and other features that need to work with inventories!", 15000);
LogUtils.sendError("You've got §6§lBlurMC §cinstalled in your mods folder! This will break AutoSell, Pests Destroyer and other features that need to work with inventories!");
}
if (Minecraft.isRunningOnMac && FarmHelperConfig.autoUngrabMouse) {
FarmHelperConfig.autoUngrabMouse = false;
Notifications.INSTANCE.send("FarmHelper", "Auto Ungrab Mouse feature doesn't work properly on Mac OS. It has been disabled automatically.", 15000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,12 +880,16 @@ private boolean checkIfBlockExists(Vec3 angle0, Vec3 playerPos) {
public void onChat(ClientChatReceivedEvent event) {
if (event.type != 0 || event.message == null) return;
String message = StringUtils.stripControlCodes(event.message.getUnformattedText().trim());
if (message.startsWith("You can't fast travel while in combat!")) {
if (message.startsWith("You can't fast travel while in combat!") && enabled) {
LogUtils.sendWarning("[Pests Destroyer] Can't fast travel while in combat, will try again to teleport.");
enabled = true;
Multithreading.schedule(this::finishMacro, 1_000 + (long) (Math.random() * 1_000), TimeUnit.MILLISECONDS);
return;
}
if (message.toLowerCase().startsWith("there are not any pests on your garden right now") && enabled && state != States.GO_BACK) {
LogUtils.sendDebug("[Pests Destroyer] There are not any Pests on your Garden right now! Keep farming!");
state = States.GO_BACK;
return;
}
if (message.contains("The worm seems to have burrowed")) {
cantReachPest = 0;
return;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/jelly/farmhelperv2/gui/WelcomeGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class WelcomeGUI extends GuiScreen {
static final int CLOSE_BUTTON_ID = 2;
private static final Minecraft mc = Minecraft.getMinecraft();
private final String[] welcomeMessage = {
"⚠ If you downloaded this mod from somewhere else than discord.gg/jellylab or GitHub ⚠",
"⚠ such as YouTube videos, MediaFire, etc. - immediately remove it! It's a virus! ⚠",
"",
"Before you use, you NEED to: ",
"1. Read the guide first! (Click \"Read the guide\").",
"2. Build the farm using schematics provided in our guide.",
Expand Down Expand Up @@ -70,7 +73,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
GL11.glScalef(scale, scale, 0.0F);
for (int i = 0; i < welcomeMessage.length; i++) {
String item = welcomeMessage[i];
this.drawCenteredString(mc.fontRendererObj, item, (fontSize % 2 == 0 ? fontSize : fontSize - 1), (int) (this.height / 2f / scale - 50) + 20 * i, 0xFFFFFF);
this.drawCenteredString(mc.fontRendererObj, item, (fontSize % 2 == 0 ? fontSize : fontSize - 1), (int) (this.height / 2f / scale - 80) + 16 * i, (i < 2 ? 0xFF0000 : 0xFFFFFF));
}
GL11.glScalef(1.0F / scale, 1.0F / scale, 0.0F);
textField.drawTextBox();
Expand Down

0 comments on commit 6aae013

Please sign in to comment.