diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-07-19 16:19:14 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-07-19 16:19:14 +0800 |
| commit | ff2829153c14e0f7ca655bfd4ef64bffae3212b2 (patch) | |
| tree | c3855dbc8775fa082b101c5acd818dc63a306b36 /src/main/java | |
| parent | 48f309c1676626e0c8d0128220e50e51247c9abb (diff) | |
| download | NotEnoughUpdates-ff2829153c14e0f7ca655bfd4ef64bffae3212b2.tar.gz NotEnoughUpdates-ff2829153c14e0f7ca655bfd4ef64bffae3212b2.tar.bz2 NotEnoughUpdates-ff2829153c14e0f7ca655bfd4ef64bffae3212b2.zip | |
PRE29
Diffstat (limited to 'src/main/java')
21 files changed, 1369 insertions, 142 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 0c35c56c..7fa81a59 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -320,7 +320,7 @@ public class NEUEventListener { if(neu.config.notifications.doRamNotif) { long maxMemoryMB = Runtime.getRuntime().maxMemory()/1024L/1024L; - if(maxMemoryMB > 4100 || true) { + if(maxMemoryMB > 4100) { notificationDisplayMillis = System.currentTimeMillis(); notificationLines = new ArrayList<>(); notificationLines.add(EnumChatFormatting.GRAY+"Too much memory allocated!"); @@ -447,21 +447,28 @@ public class NEUEventListener { Minecraft.getMinecraft().currentScreen instanceof GuiContainer && neu.overlay.isUsingMobsFilter()) { event.setCanceled(true); } + if(event.type != null && event.type.equals(RenderGameOverlayEvent.ElementType.PLAYER_LIST)) { + GlStateManager.enableDepth(); + } } @SubscribeEvent public void onRenderGameOverlayPost(RenderGameOverlayEvent.Post event) { - if(neu.hasSkyblockScoreboard() && event.type == RenderGameOverlayEvent.ElementType.ALL) { + if(neu.hasSkyblockScoreboard() && event.type.equals(RenderGameOverlayEvent.ElementType.ALL)) { DungeonWin.render(event.partialTicks); + GlStateManager.pushMatrix(); + GlStateManager.translate(0, 0, -200); for(TextOverlay overlay : OverlayManager.textOverlays) { if(OverlayManager.dontRenderOverlay != null && OverlayManager.dontRenderOverlay.isAssignableFrom(overlay.getClass())) { continue; } + GlStateManager.translate(0, 0, -1); + GlStateManager.enableDepth(); overlay.render(); } + GlStateManager.popMatrix(); OverlayManager.dontRenderOverlay = null; } - if(Keyboard.isKeyDown(Keyboard.KEY_X)) { notificationDisplayMillis = 0; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index ddef0828..d55bad48 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1109,18 +1109,15 @@ public class NEUOverlay extends Gui { if(rarity1 < rarity2) return mult; if(rarity1 > rarity2) return -mult; } else if(getCompareMode() == COMPARE_MODE_VALUE) { - float cost1 = manager.auctionManager.getLowestBin(o1.get("internalname").getAsString()); - float cost2 = manager.auctionManager.getLowestBin(o2.get("internalname").getAsString()); + String internal1 = o1.get("internalname").getAsString(); + String internal2 = o2.get("internalname").getAsString(); - float craftCost1 = manager.auctionManager.getCraftCost(o1.get("internalname").getAsString()).craftCost; - float craftCost2 = manager.auctionManager.getCraftCost(o2.get("internalname").getAsString()).craftCost; + float cost1 = manager.auctionManager.getLowestBin(internal1); + float cost2 = manager.auctionManager.getLowestBin(internal2); - float diff = (cost1 - craftCost1) - (cost2 - craftCost2); - if(diff > 0) return mult; - if(diff < 0) return -mult; - /*if(cost1 < cost2) return mult; - if(cost1 > cost2) return -mult;*/ + if(cost1 < cost2) return mult; + if(cost1 > cost2) return -mult; } String i1 = o1.get("internalname").getAsString(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 78bb6536..86a36f49 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -6,11 +6,16 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.mojang.authlib.Agent; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; import io.github.moulberry.notenoughupdates.collectionlog.GuiCollectionLog; import io.github.moulberry.notenoughupdates.commands.SimpleCommand; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; +import io.github.moulberry.notenoughupdates.core.config.GuiPositionEditor; import io.github.moulberry.notenoughupdates.core.util.MiscUtils; import io.github.moulberry.notenoughupdates.cosmetics.CapeManager; import io.github.moulberry.notenoughupdates.cosmetics.GuiCosmetics; @@ -62,6 +67,8 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.HttpClients; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; @@ -69,6 +76,7 @@ import java.awt.*; import java.awt.datatransfer.StringSelection; import java.io.*; import java.lang.management.ManagementFactory; +import java.net.Proxy; import java.nio.charset.StandardCharsets; import java.util.*; import java.util.List; @@ -711,9 +719,10 @@ public class NotEnoughUpdates { private ScheduledExecutorService devES = Executors.newSingleThreadScheduledExecutor(); private static final String[] devFailStrings = {"No.", "I said no.", "You aren't allowed to use this.", - "Are you sure you want to use this? Type 'Yes' in chat.", "Lmao you thought", "Ok please stop", - "What do you want from me?", "This command almost certainly does nothing useful for you", - "Ok, this is the last message, after this it will repeat", "No.", "Dammit. I thought that would work. Uhh...", + "Are you sure you want to use this? Type 'Yes' in chat.", "Are you sure you want to use this? Type 'Yes' in chat.", + "Lmao you thought", "Ok please stop", "What do you want from me?", + "This command almost certainly does nothing useful for you", + "Ok, this is the last message, after this it will repeat", "No.", "I said no.", "Dammit. I thought that would work. Uhh...", "\u00a7dFrom \u00a7c[ADMIN] Minikloon\u00a77: If you use that command again, I'll have to ban you", "", "Ok, this is actually the last message, use the command again and you'll crash I promise"}; private int devFailIndex = 0; @@ -726,7 +735,7 @@ public class NotEnoughUpdates { throw new Error("L") { @Override public void printStackTrace() { - throw new Error("Double L"); + throw new Error("L"); } }; } @@ -750,9 +759,15 @@ public class NotEnoughUpdates { DupePOC.doDupe(args[0]); return; }*/ + if(args.length == 1 && args[0].equalsIgnoreCase("positiontest")) { + openGui = new GuiPositionEditor(); + return; + } + if(args.length == 2 && args[0].equalsIgnoreCase("pt")) { EnumParticleTypes t = EnumParticleTypes.valueOf(args[1]); FishingHelper.type = t; + return; } if(args.length == 1 && args[0].equalsIgnoreCase("dev")) { NotEnoughUpdates.INSTANCE.config.hidden.dev = true; @@ -1106,13 +1121,8 @@ public class NotEnoughUpdates { */ @EventHandler public void preinit(FMLPreInitializationEvent event) { - //if(!Minecraft.getMinecraft().getSession().getUsername().equalsIgnoreCase("moulberry")) throw new RuntimeException("moulbeBad"); - INSTANCE = this; - String uuid = Minecraft.getMinecraft().getSession().getPlayerID(); - if(uuid.equalsIgnoreCase("ea9b1c5a-bf68-4fa2-9492-2d4e69693228")) throw new RuntimeException("Ding-dong, racism is wrong."); - neuDir = new File(event.getModConfigurationDirectory(), "notenoughupdates"); neuDir.mkdirs(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java b/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java index a4001675..8a8655f9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java @@ -121,6 +121,7 @@ public class BackgroundBlur { if(event.type == RenderGameOverlayEvent.ElementType.ALL) { processBlurs(); } + Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); } @SubscribeEvent @@ -215,9 +216,8 @@ public class BackgroundBlur { output.blurShaderVert.loadShader(0); GlStateManager.enableDepth(); GL11.glPopMatrix(); - - Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); } + Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false); } public static void renderBlurredBackground(float blurStrength, int screenWidth, int screenHeight, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java index 658ab2f2..d221b37e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java @@ -495,7 +495,7 @@ public class GuiElementTextField { if(focus && System.currentTimeMillis()%1000>500) { String textNCBeforeCursor = textNoColor.substring(0, textField.getCursorPosition()+prependText.length()); int colorCodes = org.apache.commons.lang3.StringUtils.countMatches(textNCBeforeCursor, "\u00B6"); - String textBeforeCursor = text.substring(0, textField.getCursorPosition()+prependText.length()+(((options & COLOUR) != 0) ? colorCodes*2 : 0)); + String textBeforeCursor = text.substring(0, Math.min(text.length(), textField.getCursorPosition()+prependText.length()+(((options & COLOUR) != 0) ? colorCodes*2 : 0))); int numLinesBeforeCursor = org.apache.commons.lang3.StringUtils.countMatches(textBeforeCursor, "\n"); int yOff = numLinesBeforeCursor*extraSize; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java new file mode 100644 index 00000000..a48f3f1a --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/GuiPositionEditor.java @@ -0,0 +1,115 @@ +package io.github.moulberry.notenoughupdates.core.config; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import java.io.IOException; + +public class GuiPositionEditor extends GuiScreen { + + public PositionNew position = new PositionNew(); + + public int clickedX; + public int clickedY; + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawDefaultBackground(); + + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + + int x = position.resolveX(scaledResolution, 200); + int y = position.resolveY(scaledResolution, 100); + + int centerWidth = 176; + int centerHeight = 166; + + float centerWF = centerWidth/2f / (float)width; + float centerHF = centerHeight/2f / (float)height; + + float left = 0; + float top = 0; + float right = 0; + float bottom = 0; + + switch(position.getAnchorX()) { + case MIN: { + left = 0; + right = 0.5f - centerWF; + break; + } + case MID: { + left = 0.5f - centerWF; + right = 0.5f + centerWF; + break; + } + case MAX: { + left = 0.5f + centerWF; + right = 1; + break; + } + } + switch(position.getAnchorY()) { + case MIN: { + top = 0; + bottom = 0.5f - centerHF; + break; + } + case MID: { + top = 0.5f - centerHF; + bottom = 0.5f + centerHF; + break; + } + case MAX: { + top = 0.5f + centerHF; + bottom = 1; + break; + } + } + + Gui.drawRect((int)(left*width), (int)(top*height), (int)(right*width), (int)(bottom*height), 0x40404040); + Gui.drawRect(x, y, x+200, y+100, 0x80404040); + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int x = position.resolveX(scaledResolution, 200); + int y = position.resolveY(scaledResolution, 100); + + if(mouseX > x && mouseX < x+200 && + mouseY > y && mouseY < y+100) { + clickedX = mouseX; + clickedY = mouseY; + } else { + clickedX = -1; + clickedY = -1; + } + } + + @Override + protected void mouseReleased(int mouseX, int mouseY, int state) { + clickedX = -1; + clickedY = -1; + } + + @Override + protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { + if(clickedX >= 0 && clickedY >= 0) { + int deltaX = mouseX - clickedX; + int deltaY = mouseY - clickedY; + + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + + deltaX = position.moveX(scaledResolution, deltaX, 200); + deltaY = position.moveY(scaledResolution, deltaY, 100); + + clickedX += deltaX; + clickedY += deltaY; + } + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java new file mode 100644 index 00000000..842df73d --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/PositionNew.java @@ -0,0 +1,160 @@ +package io.github.moulberry.notenoughupdates.core.config; + +import com.google.gson.annotations.Expose; +import net.minecraft.client.gui.ScaledResolution; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +public class PositionNew { + + public enum Anchor { + MIN(0, 0, 0), + MID(0.5f, -0.5f, 0), + MAX(1f, -1f, 0), + GUI_MIN(0.5f, -1f, -0.5f), + GUI_MAX(0.5f, 0, 0.5f); + + float screenMult; + float elementMult; + float guiMult; + + Anchor(float screenMult, float elementMult, float guiMult) { + this.screenMult = screenMult; + this.elementMult = elementMult; + this.guiMult = guiMult; + } + } + + @Expose + private int x = 0; + @Expose + private int y = 0; + @Expose + private float scaleX = 1; + @Expose + private float scaleY = 1; + + @Expose + private Anchor anchorX = Anchor.MIN; + @Expose + private Anchor anchorY = Anchor.MIN; + + @Expose + private boolean pinned = false; + @Expose + private boolean allowPinToggle = true; + @Expose + private boolean allowResize = true; + + public PositionNew(int x, int y, int scaleX, int scaleY, Anchor anchorX, Anchor anchorY, boolean pinned, boolean allowPinToggle, boolean allowResize) { + this.x = x; + this.y = y; + this.scaleX = scaleX; + this.scaleY = scaleY; + this.anchorX = anchorX; + this.anchorY = anchorY; + this.pinned = pinned; + this.allowPinToggle = allowPinToggle; + this.allowResize = allowResize; + } + + protected PositionNew() { + } + + public int moveX(ScaledResolution scaledResolution, int deltaX, int sizeX) { + int originalX = resolveX(scaledResolution, sizeX); + AtomicInteger atomicInteger = new AtomicInteger(x+deltaX); + AtomicReference<Anchor> atomicReference = new AtomicReference<>(anchorX); + move(atomicInteger, atomicReference, anchorY, (int)Math.ceil(sizeX*scaleX), scaledResolution.getScaledWidth(), 176); + x = atomicInteger.get(); + anchorX = atomicReference.get(); + return resolveX(scaledResolution, sizeX) - originalX; + } + + public int moveY(ScaledResolution scaledResolution, int deltaY, int sizeY) { + int originalY = resolveY(scaledResolution, sizeY); + AtomicInteger atomicInteger = new AtomicInteger(y+deltaY); + AtomicReference<Anchor> atomicReference = new AtomicReference<>(anchorY); + move(atomicInteger, atomicReference, anchorY, (int)Math.ceil(sizeY*scaleY), scaledResolution.getScaledHeight(), 166); + y = atomicInteger.get(); + anchorY = atomicReference.get(); + return resolveY(scaledResolution, sizeY) - originalY; + } + + private void move(AtomicInteger coord, AtomicReference<Anchor> anchor, Anchor oppositeAnchor, int elementSize, int screenSize, int guiSize) { + int centerCoord = resolve(coord.get(), anchor.get(), elementSize, screenSize, guiSize) + elementSize/2; + + if(centerCoord < screenSize/2-guiSize/2) { + if(pinned && centerCoord > screenSize/4-guiSize/4 && oppositeAnchor == Anchor.MID) { + anchor.set(Anchor.GUI_MIN); + } else { + anchor.set(Anchor.MIN); + } + } else if(centerCoord > screenSize/2+guiSize/2) { + if(pinned && centerCoord < screenSize-(screenSize/4-guiSize/4) && oppositeAnchor == Anchor.MID) { + anchor.set(Anchor.GUI_MAX); + } else { + anchor.set(Anchor.MAX); + } + } else { + anchor.set(Anchor.MID); + } + + if(centerCoord - elementSize/2 < 0) centerCoord = elementSize/2; + if(centerCoord + elementSize/2 > screenSize) centerCoord = screenSize - elementSize/2; + + Anchor newAnchor = anchor.get(); + coord.set(Math.round(centerCoord - (elementSize*(newAnchor.elementMult+0.5f)) - screenSize*newAnchor.screenMult - guiSize*newAnchor.guiMult)); + } + + public int resolveX(ScaledResolution scaledResolution, int sizeX) { + return resolve(x, anchorX, (int)Math.ceil(sizeX*scaleX), scaledResolution.getScaledWidth(), 176); + } + + public int resolveY(ScaledResolution scaledResolution, int sizeY) { + return resolve(y, anchorY, (int)Math.ceil(sizeY*scaleY), scaledResolution.getScaledHeight(), 166); + } + + private int resolve(int coord, Anchor anchor, int elementSize, int screenSize, int guiSize) { + return Math.round(screenSize*anchor.screenMult + elementSize*anchor.elementMult + guiSize*anchor.guiMult + coord); + } + + public void setScaleX(float scaleX) { + if(allowResize) { + this.scaleX = scaleX; + } + } + + public void setScaleY(float scaleY) { + if(allowResize) { + this.scaleY = scaleY; + } + } + + public float getScaleX() { + return scaleX; + } + + public float getScaleY() { + return scaleY; + } + + public void setPinned(boolean pinned) { + if(allowPinToggle) { + this.pinned = pinned; + } + } + + public boolean isPinned() { + return pinned; + } + + public Anchor getAnchorX() { + return anchorX; + } + + public Anchor getAnchorY() { + return anchorY; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index aeedd5d1..560cdf51 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -211,24 +211,26 @@ public class CapeManager { public void onRenderPlayer(RenderPlayerEvent.Post e) { if(e.partialRenderTick == 1.0F) return; //rendering in inventory - String uuid = e.entityPlayer.getUniqueID().toString().replace("-", ""); - String clientUuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""); - - if(Minecraft.getMinecraft().thePlayer != null && uuid.equals(clientUuid)) { - String selCape = NotEnoughUpdates.INSTANCE.config.hidden.selectedCape; - if(selCape != null && !selCape.isEmpty()) { - if(localCape == null) { - localCape = new MutablePair<>(new NEUCape(selCape), selCape); - } else { - localCape.setValue(selCape); + try { + String uuid = e.entityPlayer.getUniqueID().toString().replace("-", ""); + String clientUuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""); + + if(Minecraft.getMinecraft().thePlayer != null && uuid.equals(clientUuid)) { + String selCape = NotEnoughUpdates.INSTANCE.config.hidden.selectedCape; + if(selCape != null && !selCape.isEmpty()) { + if(localCape == null) { + localCape = new MutablePair<>(new NEUCape(selCape), selCape); + } else { + localCape.setValue(selCape); + } } } - } - if(uuid.equals(clientUuid) && localCape != null && localCape.getRight() != null && !localCape.getRight().equals("null")) { - localCape.getLeft().onRenderPlayer(e); - } else if(capeMap.containsKey(uuid)) { - capeMap.get(uuid).getLeft().onRenderPlayer(e); - } + if(uuid.equals(clientUuid) && localCape != null && localCape.getRight() != null && !localCape.getRight().equals("null")) { + localCape.getLeft().onRenderPlayer(e); + } else if(capeMap.containsKey(uuid)) { + capeMap.get(uuid).getLeft().onRenderPlayer(e); + } + } catch(Exception ignored) {} } public static void onTickSlow() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java index 5af6e8bb..48601df3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java @@ -348,7 +348,7 @@ public class BetterContainers { return false; } - private static int getCTMIndex(boolean up, boolean right, boolean down, boolean left, boolean upleft, boolean upright, boolean downright, boolean downleft) { + public static int getCTMIndex(boolean up, boolean right, boolean down, boolean left, boolean upleft, boolean upright, boolean downright, boolean downleft) { if(up && right && down && left) { if(upleft && upright && downright && downleft) { return 26; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java index 71fec1c7..32c64f4c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java @@ -68,6 +68,10 @@ public class FishingHelper { private static final ResourceLocation FISHING_WARNING_EXCLAM = new ResourceLocation("notenoughupdates:fishing_warning_exclam.png"); public void onRenderBobber(EntityFishHook hook) { if(Minecraft.getMinecraft().thePlayer.fishEntity == hook && warningState != PlayerWarningState.NOTHING) { + + if(!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning && warningState == PlayerWarningState.FISH_INCOMING) return; + if(!NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR && warningState == PlayerWarningState.FISH_HOOKED) return; + GlStateManager.disableCull(); GlStateManager.disableLighting(); GL11.glDepthFunc(GL11.GL_ALWAYS); @@ -134,7 +138,7 @@ public class FishingHelper { if(Minecraft.getMinecraft().thePlayer != null && event.phase == TickEvent.Phase.END) { if(buildupSoundDelay > 0) buildupSoundDelay--; - if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning) { + if(NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarning || NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) { if(Minecraft.getMinecraft().thePlayer.fishEntity != null) { if(!pingDelayList.isEmpty()) { while(pingDelayList.size() > 5) pingDelayList.remove(pingDelayList.size()-1); @@ -270,7 +274,8 @@ public class FishingHelper { public boolean onSpawnParticle(EnumParticleTypes particleType, double x, double y, double z, double xOffset, double yOff |
