diff options
| author | DoKM <mcazzyman@gmail.com> | 2021-07-23 10:37:57 +0200 |
|---|---|---|
| committer | DoKM <mcazzyman@gmail.com> | 2021-07-23 10:37:57 +0200 |
| commit | f69a7b921079d0cf6bd29fa8912e687ee3bc6d29 (patch) | |
| tree | c58bd2287a76bed751a6e2169d4a626f8409f98b /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures | |
| parent | cb3c51f303672d350354a32cf504a4a242f9f4aa (diff) | |
| parent | 0f48092ef19488a43114478095f1d4a2040d369c (diff) | |
| download | notenoughupdates-f69a7b921079d0cf6bd29fa8912e687ee3bc6d29.tar.gz notenoughupdates-f69a7b921079d0cf6bd29fa8912e687ee3bc6d29.tar.bz2 notenoughupdates-f69a7b921079d0cf6bd29fa8912e687ee3bc6d29.zip | |
Merge remote-tracking branch 'Moulberry/master'
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures')
7 files changed, 326 insertions, 50 deletions
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 48601df3..0aa5e84d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java @@ -51,9 +51,10 @@ public class BetterContainers { private static long clickedSlotMillis = 0; public static long lastRenderMillis = 0; + private static int lastInvHashcode = 0; + private static int lastHashcodeCheck = 0; + public static HashMap<Integer, ItemStack> itemCache = new HashMap<>(); - public static boolean lastUsingCached = false; - public static boolean usingCached = false; public static void clickSlot(int slot) { clickedSlotMillis = System.currentTimeMillis(); @@ -68,22 +69,30 @@ public class BetterContainers { } public static void bindHook(TextureManager textureManager, ResourceLocation location) { + long currentMillis = System.currentTimeMillis(); + if(isChestOpen() && NEUEventListener.inventoryLoaded) { - if((texture != null && lastClickedSlot != getClickedSlot()) || - lastUsingCached != getUsingCache() || !loaded) { - lastUsingCached = getUsingCache(); + int invHashcode = lastInvHashcode; + + if(currentMillis - lastHashcodeCheck > 50) { + Container container = ((GuiChest)Minecraft.getMinecraft().currentScreen).inventorySlots; + invHashcode = container.getInventory().hashCode(); + } + + if((texture != null && lastClickedSlot != getClickedSlot()) || !loaded || lastInvHashcode != invHashcode) { + lastInvHashcode = invHashcode; lastClickedSlot = getClickedSlot(); generateTex(location); } if(texture != null && loaded) { - lastRenderMillis = System.currentTimeMillis(); + lastRenderMillis = currentMillis; GlStateManager.color(1, 1, 1, 1); textureManager.loadTexture(rl, texture); textureManager.bindTexture(rl); return; } - } else if(System.currentTimeMillis() - lastRenderMillis < 200 && texture != null) { + } else if(currentMillis - lastRenderMillis < 200 && texture != null) { GlStateManager.color(1, 1, 1, 1); textureManager.loadTexture(rl, texture); textureManager.bindTexture(rl); @@ -94,7 +103,7 @@ public class BetterContainers { } public static boolean getUsingCache() { - return usingCached && System.currentTimeMillis() - lastRenderMillis < 300; + return false; } public static boolean isBlacklistedInventory() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java index e953ba60..f3a33aa9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java @@ -126,8 +126,6 @@ public class CrystalOverlay { public static HashMap<CrystalType, BlockPos> crystals = new HashMap<>(); - private static ExecutorService es = Executors.newSingleThreadExecutor(); - public static void tick() { if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableCrystalOverlay) return; if(Minecraft.getMinecraft().theWorld == null) return; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index ba96777f..83ad8a0d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -13,6 +13,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.texture.TextureUtil; @@ -30,6 +31,7 @@ import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.*; +import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -65,6 +67,10 @@ public class CustomItemEffects { public int aoteTeleportationMillis = 0; public Vector3f aoteTeleportationCurr = null; + public int tpTime = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis; + + private int tick; + public long lastMillis = 0; public Vector3f getCurrentPosition() { @@ -84,8 +90,8 @@ public class CustomItemEffects { if(delta <= 0) return; - if(aoteTeleportationMillis > NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis*2) { - aoteTeleportationMillis = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis*2; + if(aoteTeleportationMillis > tpTime*2) { + aoteTeleportationMillis = tpTime*2; } if(aoteTeleportationMillis < 0) aoteTeleportationMillis = 0; @@ -148,12 +154,21 @@ public class CustomItemEffects { } } - if(NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis <= 0 - || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0) return; + if(usingEtherwarp) { + lastEtherwarpUse = tick; + } - boolean aote = NotEnoughUpdates.INSTANCE.config.itemOverlays.enableSmoothAOTE && (internal.equals("ASPECT_OF_THE_END") || internal.equals("ASPECT_OF_THE_VOID")); + if(tpTime <= 0 || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0) return; + + boolean aote = NotEnoughUpdates.INSTANCE.config.itemOverlays.enableSmoothAOTE && + (internal.equals("ASPECT_OF_THE_END") || internal.equals("ASPECT_OF_THE_VOID")); boolean hyp = NotEnoughUpdates.INSTANCE.config.itemOverlays.enableSmoothHyperion && shadowWarp; - if(aote || hyp) { + if(usingEtherwarp) { + tpTime = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillisEtherwarp; + } else { + tpTime = NotEnoughUpdates.INSTANCE.config.itemOverlays.smoothTpMillis; + } + if(usingEtherwarp || aote || hyp) { aoteUseMillis = System.currentTimeMillis(); if(aoteTeleportationCurr == null) { aoteTeleportationCurr = new Vector3f(); @@ -170,6 +185,18 @@ public class CustomItemEffects { public void onGameTick(TickEvent.ClientTickEvent event) { if(event.phase != TickEvent.Phase.END) return; + if(!usingEtherwarp && wasUsingEtherwarp) { + if(Minecraft.getMinecraft().thePlayer.rotationYaw > 0) { + Minecraft.getMinecraft().thePlayer.rotationYaw -= 0.000001; + } else { + Minecraft.getMinecraft().thePlayer.rotationYaw += 0.000001; + } + } + wasUsingEtherwarp = usingEtherwarp; + + tick++; + if(tick > Integer.MAX_VALUE/2) tick = 0; + heldBonemerang = false; bonemerangBreak = false; bonemeragedEntities.clear(); @@ -216,18 +243,92 @@ public class CustomItemEffects { } } } - position.translate(step.x, step.y, step.z); } } + } + + private float lastPartialTicks = 0; + private float currentFOVMult = 1; + private float targetFOVMult = 1; + + private float lastPartialDelta = 0; + + private float currentSensMult = 1; + private float targetSensMult = 1; + + public float getSensMultiplier() { + if(targetSensMult < 0) { + currentSensMult = 1; + } else { + float deltaSens = targetSensMult - currentSensMult; + + currentSensMult += deltaSens*lastPartialDelta*0.1;// (0.05 * ); + if(currentSensMult < 0.25f) currentSensMult = 0.25f; + if(currentSensMult > 1) currentSensMult = 1; + } + return currentSensMult; + } + + public float getFovMultiplier(float partialTicks) { + float partialDelta = partialTicks+tick - lastPartialTicks; + if(partialDelta < 0) partialDelta++; + if(partialDelta > 0) lastPartialDelta = partialDelta; + if(targetFOVMult < 0) { + currentFOVMult = 1; + } else { + float deltaFOV = targetFOVMult - currentFOVMult; + + currentFOVMult += deltaFOV*lastPartialDelta*0.2; + if(currentFOVMult < 0.15f) currentFOVMult = 0.15f; + if(currentFOVMult > 1) currentFOVMult = 1; + } + lastPartialTicks = partialTicks + tick; + return currentFOVMult; } + private boolean wasUsingEtherwarp = false; + private boolean usingEtherwarp = false; + private RaycastResult etherwarpRaycast = null; + private int lastEtherwarpUse = 0; + @SubscribeEvent public void onOverlayDrawn(RenderGameOverlayEvent.Post event) { if(((event.type == null && Loader.isModLoaded("labymod")) || event.type == RenderGameOverlayEvent.ElementType.CROSSHAIRS)) { + ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem(); + String heldInternal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held); + + if(usingEtherwarp) { + String denyTpReason = null; + if(etherwarpRaycast == null) { + denyTpReason = "Too far!"; + } else { + BlockPos pos = etherwarpRaycast.pos; + + if(!etherwarpRaycast.state.getBlock().isCollidable() || + etherwarpRaycast.state.getBlock().getCollisionBoundingBox(Minecraft.getMinecraft().theWorld, etherwarpRaycast.pos, etherwarpRaycast.state) == null) { + denyTpReason = "Not solid!"; + } else { + WorldClient world = Minecraft.getMinecraft().theWorld; + if(world.getBlockState(pos.add(0, 1, 0)).getBlock() != Blocks.air || + world.getBlockState(pos.add(0, 2, 0)).getBlock() != Blocks.air) { + denyTpReason = "No air above!"; + } + } + } + + if(denyTpReason != null) { + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + Utils.drawStringCentered(EnumChatFormatting.RED+"Can't TP: " + denyTpReason, + Minecraft.getMinecraft().fontRendererObj, + scaledResolution.getScaledWidth()/2f, scaledResolution.getScaledHeight()/2f+10, true, 0); + GlStateManager.color(1, 1, 1, 1); + } + } + if(heldBonemerang) { if(bonemerangBreak) { ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); @@ -243,8 +344,6 @@ public class CustomItemEffects { Minecraft.getMinecraft().objectMouseOver.getBlockPos().offset( Minecraft.getMinecraft().objectMouseOver.sideHit, 1)); if(hover.getBlock() == Blocks.air) { - ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem(); - String heldInternal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held); if(heldInternal != null && heldInternal.equals("BUILDERS_WAND")) { ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); @@ -315,6 +414,57 @@ public class CustomItemEffects { } } } + //ethermerge + + private class RaycastResult { + IBlockState state; + BlockPos pos; + + public RaycastResult(IBlockState state, BlockPos pos) { + this.state = state; + this.pos = pos; + } + } + + private RaycastResult raycast(EntityPlayerSP player, float partialTicks, float dist, float step) { + Vector3f pos = new Vector3f((float)player.posX, (float)player.posY+player.getEyeHeight(), (float)player.posZ); + + Vec3 lookVec3 = player.getLook(partialTicks); + + Vector3f look = new Vector3f((float)lookVec3.xCoord, (float)lookVec3.yCoord, (float)lookVec3.zCoord); + look.scale(step / look.length()); + + int stepCount = (int)Math.ceil(dist/step); + + for(int i=0; i<stepCount; i++) { + Vector3f.add(pos, look, pos); + + WorldClient world = Minecraft.getMinecraft().theWorld; + BlockPos position = new BlockPos(pos.x, pos.y, pos.z); + IBlockState state = world.getBlockState(position); + + if(state.getBlock() != Blocks.air) { + //Back-step + Vector3f.sub(pos, look, pos); + look.scale(0.1f); + + for(int j=0; j<10; j++) { + Vector3f.add(pos, look, pos); + + BlockPos position2 = new BlockPos(pos.x, pos.y, pos.z); + IBlockState state2 = world.getBlockState(position2); + + if(state2.getBlock() != Blocks.air) { + return new RaycastResult(state2, position2); + } + } + + return new RaycastResult(state, position); + } + } + + return null; + } public int countItemsInInventoryAndStorage(ItemStack match) { int count = 0; @@ -421,6 +571,12 @@ public class CustomItemEffects { if(aoteTeleportationCurr != null && aoteTeleportationMillis > 0) { event.setCanceled(true); } + usingEtherwarp = false; + etherwarpRaycast = null; + float lastFOVMult = this.targetFOVMult; + this.targetFOVMult = 1; + this.targetSensMult = 1; + ItemStack held = Minecraft.getMinecraft().thePlayer.getHeldItem(); String heldInternal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held); if(heldInternal != null) { @@ -429,6 +585,53 @@ public class CustomItemEffects { double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)event.partialTicks; double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)event.partialTicks; + if(tick - lastEtherwarpUse > 10) { + boolean aotv = Minecraft.getMinecraft().thePlayer.isSneaking() && + (heldInternal.equals("ASPECT_OF_THE_VOID") || heldInternal.equals("ASPECT_OF_THE_END")); + if(aotv || heldInternal.equals("ETHERWARP_CONDUIT")) { + usingEtherwarp = !aotv; + + if(aotv) { + NBTTagCompound tag = held.getTagCompound(); + if(tag != null && tag.hasKey("ExtraAttributes", 10)) { + NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); + usingEtherwarp = ea.hasKey("ethermerge"); + } + } + + if(usingEtherwarp) { + etherwarpRaycast = raycast(Minecraft.getMinecraft().thePlayer, 1f, 60, 0.1f); + + if(etherwarpRaycast != null) { + AxisAlignedBB bb = etherwarpRaycast.state.getBlock().getSelectedBoundingBox(Minecraft.getMinecraft().theWorld, etherwarpRaycast.pos) + .expand(0.01D, 0.01D, 0.01D).offset(-d0, -d1, -d2); + drawFilledBoundingBox(bb, 1f, NotEnoughUpdates.INSTANCE.config.itemOverlays.etherwarpHighlightColour); + + GlStateManager.disableDepth(); + drawOutlineBoundingBox(bb, 2f, NotEnoughUpdates.INSTANCE.config.itemOverlays.etherwarpHighlightColour); + GlStateManager.enableDepth(); + + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + + if(NotEnoughUpdates.INSTANCE.config.itemOverlays.etherwarpZoom) { + float distFactor = 1 - (float)Math.sqrt(etherwarpRaycast.pos.distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()))/60; + + targetFOVMult = distFactor*distFactor*distFactor*0.75f + 0.25f; + if(targetFOVMult < 0.25f) targetFOVMult = 0.25f; + + targetSensMult = distFactor*0.76f + 0.25f; + } + } else if(NotEnoughUpdates.INSTANCE.config.itemOverlays.etherwarpZoom) { + targetFOVMult = lastFOVMult; + } + + return; + } + } + } + if(heldInternal.equals("BLOCK_ZAPPER")) { boolean privateIs = SBInfo.getInstance().getLocation() == null || SBInfo.getInstance().getLocation().equals("dynamic"); if (!privateIs || !NotEnoughUpdates.INSTANCE.config.itemOverlays.enableZapperOverlay || @@ -494,7 +697,9 @@ public class CustomItemEffects { .expand(0.001D, 0.001D, 0.001D).offset(-d0, -d1, -d2), 1f, NotEnoughUpdates.INSTANCE.config.itemOverlays.zapperOverlayColour); } - + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); } else if(NotEnoughUpdates.INSTANCE.config.itemOverlays.enableTreecapOverlay && (heldInternal.equals("JUNGLE_AXE") || heldInternal.equals("TREECAPITATOR_AXE"))) { int maxWood = 10; @@ -1006,7 +1211,9 @@ public class CustomItemEffects { public static void drawOutlineBoundingBox(AxisAlignedBB p_181561_0_, float alpha, String special) { Color c = new Color(SpecialColour.specialToChromaRGB(special), true); - GlStateManager.color(c.getRed()/255f, c.getGreen()/255f, c.getBlue()/255f, c.getAlpha()/255f*alpha); + float newAlpha = c.getAlpha()/255f*alpha; + if(newAlpha > 1) newAlpha = 1; + GlStateManager.color(c.getRed()/255f, c.getGreen()/255f, c.getBlue()/255f, newAlpha); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java index 553a5d40..a73320fc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java @@ -1,37 +1,100 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import java.text.NumberFormat; import java.util.HashMap; +import java.util.WeakHashMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class DamageCommas { - private static final HashMap<Integer, ChatComponentText> replacementMap = new HashMap<>(); + private static final WeakHashMap<EntityLivingBase, ChatComponentText> replacementMap = new WeakHashMap<>(); - //From [MVP++] HY7: private static final EnumChatFormatting[] colours = {EnumChatFormatting.RED, EnumChatFormatting.GOLD, EnumChatFormatting.YELLOW, EnumChatFormatting.WHITE}; - public static void tick() { - replacementMap.clear(); - } + private static final char STAR = '\u2727'; + private static final Pattern PATTERN_CRIT = Pattern.compile("\u00a7f"+STAR+"((?:\u00a7.\\d)+)\u00a7."+STAR+"(.*)"); + private static final Pattern PATTERN_NO_CRIT = Pattern.compile("\u00a77(\\d+)(.*)"); - public static IChatComponent replaceName(IChatComponent name) { - if(NotEnoughUpdates.INSTANCE.config.misc.damageIndicatorStyle == 0) return name; + public static IChatComponent replaceName(EntityLivingBase entity) { + if(!entity.hasCustomName()) return entity.getDisplayName(); - String formatted = name.getFormattedText(); - int hashCode = formatted.hashCode(); + IChatComponent name = entity.getDisplayName(); + if(NotEnoughUpdates.INSTANCE.config.misc.damageIndicatorStyle == 0) return name; - if(replacementMap.containsKey(hashCode)) { - ChatComponentText component = replacementMap.get(hashCode); + if(replacementMap.containsKey(entity)) { + ChatComponentText component = replacementMap.get(entity); if(component == null) return name; return component; } + String formatted = name.getFormattedText(); + + boolean crit = false; + String numbers; + String prefix; + String suffix; + + Matcher matcherCrit = PATTERN_CRIT.matcher(formatted); + if(matcherCrit.matches()) { + crit = true; + numbers = StringUtils.cleanColour(matcherCrit.group(1)); + prefix = "\u00a7f"+STAR; + suffix = "\u00a7f"+STAR+matcherCrit.group(2); + } else { + Matcher matcherNoCrit = PATTERN_NO_CRIT.matcher(formatted); + if(matcherNoCrit.matches()) { + numbers = matcherNoCrit.group(1); + prefix = "\u00A77"; + suffix = "\u00A7r"+matcherNoCrit.group(2); + } else { + replacementMap.put(entity, null); + return name; + } + } + + StringBuilder newFormatted = new StringBuilder(); + + try { + int number = Integer.parseInt(numbers); + + if(number > 999 && NotEnoughUpdates.INSTANCE.config.misc.damageIndicatorStyle == 2) { + newFormatted.append(Utils.shortNumberFormat(number, 0)); + } else { + newFormatted.append(NumberFormat.getIntegerInstance().format(number)); + } + } catch(NumberFormatException e) { + replacementMap.put(entity, null); + return name; + } + + if(crit) { + StringBuilder newFormattedCrit = new StringBuilder(); + + int colourIndex = 0; + for(char c : newFormatted.toString().toCharArray()) { + newFormattedCrit.append(colours[colourIndex++ % colours.length]); + newFormattedCrit.append(c); + } + + newFormatted = newFormattedCrit; + } + + ChatComponentText finalComponent = new ChatComponentText(prefix+newFormatted.toString()+suffix); + + replacementMap.put(entity, finalComponent); + return finalComponent; + + /*if(formatted.startsWith("\u00A7f\u2727")) System.out.println(formatted); + if(formatted.length() >= 7 && (formatted.startsWith("\u00A7f\u2727") || formatted.startsWith("\u00A7f\u2694")) && (formatted.endsWith("\u2727\u00a7r") || formatted.endsWith("\u2694\u00a7r"))) { @@ -79,7 +142,7 @@ public class DamageCommas { if(numLast) numCount--; numLast = false; colLast = true; - } else if(c >= '0' && c <= '9') { + } else if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')) { numLast = true; colLast = false; numCount++; @@ -131,7 +194,7 @@ public class DamageCommas { } } replacementMap.put(hashCode, null); - return name; + return name;*/ } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java index 0a5de509..5b9b3c6b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java @@ -93,7 +93,7 @@ public class EnchantingSolvers { } public static ItemStack overrideStack(IInventory inventory, int slotIndex, ItemStack stack) { - if(!NotEnoughUpdates.INSTANCE.config.enchanting.enableEnchantingSolvers) { + if(!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableEnchantingSolvers) { return null; } @@ -196,7 +196,7 @@ public class EnchantingSolvers { } public static boolean onStackRender(ItemStack stack, IInventory inventory, int slotIndex, int x, int y) { - if(!NotEnoughUpdates.INSTANCE.config.enchanting.enableEnchantingSolvers) { + if(!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableEnchantingSolvers) { return false; } @@ -228,14 +228,14 @@ public class EnchantingSolvers { if(item.containerIndex == slotIndex) { int meta = 0; if(solveIndex == ultrasequencerReplayIndex) { - meta = NotEnoughUpdates.INSTANCE.config.enchanting.seqNext; + meta = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.seqNext; } else if(solveIndex == ultrasequencerReplayIndex+1) { - meta = NotEnoughUpdates.INSTANCE.config.enchanting.seqUpcoming; + meta = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.seqUpcoming; } if(meta > 0) { Utils.drawItemStack(new ItemStack(Item.getItemFromBlock(Blocks.stained_glass_pane), 1, meta-1), x, y); } - if(NotEnoughUpdates.INSTANCE.config.enchanting.seqNumbers && + if(NotEnoughUpdates.INSTANCE.config.enchantingSolvers.seqNumbers && solveIndex >= ultrasequencerReplayIndex) { int w = Minecraft.getMinecraft().fontRendererObj.getStringWidth((solveIndex+1)+""); GlStateManager.disableDepth(); @@ -254,15 +254,15 @@ public class EnchantingSolvers { if(stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass) && superpairStacks.containsKey(slotIndex)) { if(possibleMatches.contains(slotIndex)) { - meta = NotEnoughUpdates.INSTANCE.config.enchanting.supPossible; + meta = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.supPossible; } else { - meta = NotEnoughUpdates.INSTANCE.config.enchanting.supUnmatched; + meta = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.supUnmatched; } } else { if(powerupMatches.contains(slotIndex)) { - meta = NotEnoughUpdates.INSTANCE.config.enchanting.supPower; + meta = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.supPower; } else if(successfulMatches.contains(slotIndex)) { - meta = NotEnoughUpdates.INSTANCE.config.enchanting.supMatched; + meta = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.supMatched; } } if(meta > 0) { @@ -275,7 +275,7 @@ public class EnchantingSolvers { } public static boolean onStackClick(ItemStack stack, int windowId, int slotId, int mouseButtonClicked, int mode) { - if(!NotEnoughUpdates.INSTANCE.config.enchanting.enableEnchantingSolvers) { + if(!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableEnchantingSolvers) { return false; } @@ -368,7 +368,7 @@ public class EnchantingSolvers { public static void processInventoryContents(boolean fromTick) { if(currentSolver != SolverType.CHRONOMATRON && !fromTick) return; - if(!NotEnoughUpdates.INSTANCE.config.enchanting.enableEnchantingSolvers) { + if(!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableEnchantingSolvers) { return; } @@ -530,7 +530,7 @@ public class EnchantingSolvers { @SubscribeEvent public void onItemTooltip(ItemTooltipEvent event) { - if(NotEnoughUpdates.INSTANCE.config.enchanting.hideTooltips && + if(NotEnoughUpdates.INSTANCE.config.enchantingSolvers.hideTooltips && (currentSolver == SolverType.CHRONOMATRON || currentSolver == SolverType.ULTRASEQUENCER)) { String internal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(event.itemStack); if(internal == null && event.toolTip.size() > 0 && !event.toolTip.get(0).trim().replaceAll("\\(#.+\\)$", "").trim().contains(" ")) { 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 3bf75a0f..de7ffe5e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java @@ -49,12 +49,12 @@ public class FishingHelper { } } - private enum PlayerWarningState { + public enum PlayerWarningState { NOTHING, FISH_INCOMING, FISH_HOOKED } - private PlayerWarningState warningState = PlayerWarningState.NOTHING; + public PlayerWarningState warningState = PlayerWarningState.NOTHING; private int hookedWarningStateTicks = 0; public final HashMap<Integer, EntityFishHook> hookEntities = new HashMap<>(); 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 a20e5abb..3253f08a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java @@ -19,7 +19,6 @@ import net.minecraft.network.play.server.S2DPacketOpenWindow; import net.minecraft.network.play.server.S2EPacketCloseWindow; import net.minecraft.network.play.server.S2FPacketSetSlot; import net.minecraft.network.play.server.S30PacketWindowItems; -import org.lwjgl.input.Keyboard; import java.io.*; import java.lang.reflect.Type; @@ -226,7 +225,7 @@ public class StorageManager { } public boolean shouldRenderStorageOverlay(String containerName) { - if(!NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI2) { + if(!NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3) { shouldRenderStorageOverlayCached = false; return false; } |
