diff options
Diffstat (limited to 'src/main/java')
5 files changed, 39 insertions, 32 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 3b78c2c9..7c807cf4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -609,21 +609,10 @@ public class NotEnoughUpdates { SimpleCommand.ProcessCommandRunnable viewProfileRunnable = new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { - if(Loader.isModLoaded("optifine") && - new File(Minecraft.getMinecraft().mcDataDir, "optionsof.txt").exists()) { - try(InputStream in = new FileInputStream(new File(Minecraft.getMinecraft().mcDataDir, "optionsof.txt"))) { - BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)); - - String line; - while((line = reader.readLine()) != null) { - if(line.contains("ofFastRender:true")) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "Some parts of the profile viewer do not work with OF Fast Render. Go to Video > Performance to disable it.")); - break; - } - } - } catch(Exception e) { - } + if(!OpenGlHelper.isFramebufferEnabled()) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + + "Some parts of the profile viewer do not work with OF Fast Render. Go to Video > Performance to disable it.")); + } if (config.apiKey.apiKey == null || config.apiKey.apiKey.trim().isEmpty()) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + @@ -1046,21 +1035,10 @@ public class NotEnoughUpdates { SimpleCommand cosmeticsCommand = new SimpleCommand("neucosmetics", new SimpleCommand.ProcessCommandRunnable() { public void processCommand(ICommandSender sender, String[] args) { - if(Loader.isModLoaded("optifine") && - new File(Minecraft.getMinecraft().mcDataDir, "optionsof.txt").exists()) { - try(InputStream in = new FileInputStream(new File(Minecraft.getMinecraft().mcDataDir, "optionsof.txt"))) { - BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)); - - String line; - while((line = reader.readLine()) != null) { - if(line.contains("ofFastRender:true")) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "NEU cosmetics do not work with OF Fast Render. Go to Video > Performance to disable it.")); - return; - } - } - } catch(Exception e) { - } + if(!OpenGlHelper.isFramebufferEnabled()) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + + "NEU cosmetics do not work with OF Fast Render. Go to Video > Performance to disable it.")); + } openGui = new GuiCosmetics(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java index 3253f08a..03e6b98e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java @@ -444,7 +444,10 @@ public class StorageManager { } } else { StorageOverlay.getInstance().clearSearch(); + return; } + StorageOverlay.getInstance().fastRenderCheck(); + } public void closeWindowPacket(S2EPacketCloseWindow packet) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 5d841885..352c000d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -1,6 +1,7 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; +import io.github.moulberry.notenoughupdates.NEUEventListener; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.*; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; @@ -28,6 +29,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; + import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -36,6 +38,7 @@ import org.lwjgl.util.vector.Vector2f; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.awt.*; + import java.util.*; import java.util.List; @@ -92,6 +95,8 @@ public class StorageOverlay extends GuiElement { private int guiLeft; private int guiTop; + private boolean fastRender = false; + private int loadCircleIndex = 0; private int rollIndex = 0; private int loadCircleRotation = 0; @@ -948,6 +953,10 @@ public class StorageOverlay extends GuiElement { } GlScissorStack.pop(scaledResolution); + if(fastRender){ + fontRendererObj.drawString("Fast render does not work with Storage overlay.", sizeX/2-fontRendererObj.getStringWidth("Fast render does not work with Storage overlay.")/2, -10, 0xFFFF0000); + } + //Inventory Text fontRendererObj.drawString("Inventory", 180, storageViewSize+6, textColour); searchBar.setCustomTextColour(searchTextColour); @@ -1957,4 +1966,21 @@ public class StorageOverlay extends GuiElement { GlStateManager.bindTexture(0); } + public void fastRenderCheck(){ + if(!OpenGlHelper.isFramebufferEnabled()) { + this.fastRender = true; + NEUEventListener.displayNotification(Lists.newArrayList( + "\u00a74Fast Render Warning", + "\u00a77Due to the way fast render works, it's not compatible with NEU.", + "\u00a77Please disable fast render in your options under", + "\u00a77Options -> Video settings -> Performance -> Fast render", + "\u00a77This can't be fixed.", + "\u00a77", + "\u00a77Press X on your keyboard to close this notifcation"), true, true); + return; + } + + this.fastRender = false; + } + } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index 6a083cae..c9ee8c9b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -66,7 +66,7 @@ public class Misc { maxValue = 500,
minStep = 10
)
- public int chromaSpeed = 100;
+ public int chromaSpeed2 = 400;
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index a4af51ca..fc8e2fa3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -234,7 +234,7 @@ public class Utils { long currentTimeMillis = System.currentTimeMillis(); if(startTime == 0) startTime = currentTimeMillis; - int chromaSpeed = NotEnoughUpdates.INSTANCE.config.misc.chromaSpeed; + int chromaSpeed = 510 - NotEnoughUpdates.INSTANCE.config.misc.chromaSpeed2; if(chromaSpeed < 10) chromaSpeed = 10; if(chromaSpeed > 5000) chromaSpeed = 5000; |