diff options
| author | Moulberry <jjenour@student.unimelb.edu.au> | 2021-09-02 14:09:31 +0930 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-02 14:09:31 +0930 |
| commit | 81eea6bf1f653fa194735d892b40614389975dd3 (patch) | |
| tree | a955e0d03401302332c743f6c396184e45c94c80 /src | |
| parent | 05428d1ccb15f58ccbdb4b14eb9e10b61b0477cc (diff) | |
| parent | 05d6207281e18980b8a28046621c741fa81c1606 (diff) | |
| download | NotEnoughUpdates-81eea6bf1f653fa194735d892b40614389975dd3.tar.gz NotEnoughUpdates-81eea6bf1f653fa194735d892b40614389975dd3.tar.bz2 NotEnoughUpdates-81eea6bf1f653fa194735d892b40614389975dd3.zip | |
Merge pull request #226 from DoKM/master
Pre31 update
Diffstat (limited to 'src')
84 files changed, 4813 insertions, 1437 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index ff618f10..83c4b7ae 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -2,6 +2,7 @@ package io.github.moulberry.notenoughupdates; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.auction.APIManager; +import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.item.ItemStack; @@ -20,6 +21,12 @@ public class ItemPriceInformation { } public static boolean addToTooltip(List<String> tooltip, String internalname, ItemStack stack, boolean useStackSize) { + if(stack.getTagCompound().hasKey("disableNeuTooltip") && stack.getTagCompound().getBoolean("disableNeuTooltip")){ + return false; + } + if(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.disablePriceKey && !KeybindHelper.isKeyDown(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.disablePriceKeyKeybind)){ + return false; + } JsonObject auctionInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(internalname); JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname); float lowestBinAvg = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAvgBin(internalname); @@ -98,6 +105,7 @@ public class ItemPriceInformation { break; case 4: if(craftCost.fromRecipe) { + if((int)craftCost.craftCost == 0){ continue;} if(!added) { tooltip.add(""); added = true; @@ -165,6 +173,7 @@ public class ItemPriceInformation { break; case 3: if(craftCost.fromRecipe) { + if((int)craftCost.craftCost == 0){ continue;} if(!added) { tooltip.add(""); added = true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java new file mode 100644 index 00000000..56a196b4 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUApi.java @@ -0,0 +1,10 @@ +package io.github.moulberry.notenoughupdates; + +import net.minecraftforge.fml.relauncher.ReflectionHelper; + +public class NEUApi { + static boolean disableInventoryButtons = false; + public static void setInventoryButtonsToDisabled(){ + disableInventoryButtons = true; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index b849c890..48cd0e57 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -1,10 +1,7 @@ package io.github.moulberry.notenoughupdates; import com.google.common.collect.Lists; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; +import com.google.gson.*; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; @@ -15,14 +12,10 @@ import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.cosmetics.CapeManager; import io.github.moulberry.notenoughupdates.dungeons.DungeonBlocks; import io.github.moulberry.notenoughupdates.dungeons.DungeonWin; -import io.github.moulberry.notenoughupdates.gamemodes.SBGamemodes; import io.github.moulberry.notenoughupdates.miscfeatures.*; import io.github.moulberry.notenoughupdates.miscgui.*; import io.github.moulberry.notenoughupdates.options.NEUConfig; -import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay; -import io.github.moulberry.notenoughupdates.overlays.OverlayManager; -import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay; -import io.github.moulberry.notenoughupdates.overlays.TextOverlay; +import io.github.moulberry.notenoughupdates.overlays.*; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.util.*; import net.minecraft.client.Minecraft; @@ -41,6 +34,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -51,6 +45,7 @@ import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.*; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -64,6 +59,7 @@ import java.awt.*; import java.awt.datatransfer.StringSelection; import java.io.File; import java.io.IOException; +import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.List; import java.util.*; @@ -170,10 +166,12 @@ public class NEUEventListener { @SubscribeEvent public void onWorldLoad(WorldEvent.Unload event) { NotEnoughUpdates.INSTANCE.saveConfig(); + CrystalMetalDetectorSolver.reset(); } private static long notificationDisplayMillis = 0; private static List<String> notificationLines = null; + private static boolean showNotificationOverInv = false; private static final Pattern BAD_ITEM_REGEX = Pattern.compile("x[0-9]{1,2}$"); @@ -192,18 +190,23 @@ public class NEUEventListener { private int inventoryLoadedTicks = 0; private String loadedInvName = ""; public static boolean inventoryLoaded = false; - public static void displayNotification(List<String> lines, boolean showForever) { + displayNotification(lines, showForever, false); + } + + public static void displayNotification(List<String> lines, boolean showForever, boolean overInventory) { if(showForever) { notificationDisplayMillis = -420; } else { notificationDisplayMillis = System.currentTimeMillis(); } notificationLines = lines; + showNotificationOverInv = overInventory; } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { + Keyboard.enableRepeatEvents(false); if(event.phase != TickEvent.Phase.START) return; if(Minecraft.getMinecraft().theWorld == null) return; if(Minecraft.getMinecraft().thePlayer == null) return; @@ -340,7 +343,7 @@ public class NEUEventListener { if(!joinedSB) { joinedSB = true; - SBGamemodes.loadFromFile(); + //SBGamemodes.loadFromFile(); |
