aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-01-14 21:10:37 +0100
committernea <nea@nea.moe>2023-01-14 21:10:37 +0100
commit14f2c9d48a31327a13791dc734813bb2fdb0926e (patch)
tree2b608ad4f082aa0d8bedafad98dc7657cdae26c9 /src
parent84bdb5acf6517fa6ccb4d1ec9cf5eacd40cbc1c1 (diff)
parentc20f610853702c0208d301865c015ea8ef973fd4 (diff)
downloadNotEnoughUpdates-14f2c9d48a31327a13791dc734813bb2fdb0926e.tar.gz
NotEnoughUpdates-14f2c9d48a31327a13791dc734813bb2fdb0926e.tar.bz2
NotEnoughUpdates-14f2c9d48a31327a13791dc734813bb2fdb0926e.zip
Merge remote-tracking branch 'origin/master' into museumthing
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/BuildFlags.java1
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java45
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java17
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/ChromaColour.java7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementBoolean.java24
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementColour.java49
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorAccordion.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorBoolean.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorColour.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java1
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorKeybind.java20
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorSlider.java50
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorText.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java36
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/hooks/ThreadDownloadImageHook.java40
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java52
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/loader/NEUDelegatingTweaker.java38
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java14
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java183
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WardrobeMouseButtons.kt59
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemCustomize.java21
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiScreen.java10
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinThreadDownloadImageData.java48
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinThreadDownloadImageDataThread.java46
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/oneconfig/IOneConfigCompat.java52
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java21
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java85
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java12
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java17
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/WardrobeKeybinds.java126
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/FuelBar.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/TextOverlay.java22
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java43
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java29
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java36
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java37
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java25
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java1
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/recipes/Ingredient.java12
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java5
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/StarCultCalculator.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java27
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/KatRecipe.kt2
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/util/PetLeveling.kt24
-rw-r--r--src/main/resources/assets/notenoughupdates/pv_crimson_isle_page.pngbin3370 -> 3752 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/search_mode_button.pngbin0 -> 644 bytes
-rw-r--r--src/main/resources/mixins.notenoughupdates.json4
-rw-r--r--src/main/resources/neukeystore.jksbin101958 -> 104393 bytes
-rw-r--r--src/main/resources/neukeystore.txt2
-rw-r--r--src/oneconfig/java/io/github/moulberry/notenoughupdates/compat/oneconfig/OneConfigCompat.java42
-rw-r--r--src/oneconfig/java/io/github/moulberry/notenoughupdates/compat/oneconfig/OneFancyColor.java113
-rw-r--r--src/oneconfig/java/io/github/moulberry/notenoughupdates/compat/oneconfig/OneFancyKeybind.java52
-rw-r--r--src/oneconfig/java/io/github/moulberry/notenoughupdates/compat/oneconfig/OneMoulConfig.java201
-rw-r--r--src/oneconfig/java/io/github/moulberry/notenoughupdates/compat/oneconfig/OneWrappedKeyBind.java58
-rw-r--r--src/oneconfig/java/io/github/moulberry/notenoughupdates/compat/oneconfig/WrappedConfigSlider.java52
-rw-r--r--src/test/kotlin/io/github/moulberry/notenoughupdates/util/PetLevelingTest.kt37
77 files changed, 1632 insertions, 403 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/BuildFlags.java b/src/main/java/io/github/moulberry/notenoughupdates/BuildFlags.java
index d997d980..2091496d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/BuildFlags.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/BuildFlags.java
@@ -50,6 +50,7 @@ public class BuildFlags {
}
public static final boolean ENABLE_PRONOUNS_IN_PV_BY_DEFAULT = getBuildFlag("pronouns");
+ public static final boolean ENABLE_ONECONFIG_COMPAT_LAYER = getBuildFlag("oneconfig");
private static class Holder {
static Map<String, Boolean> ALL_FLAGS = new HashMap<>();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index 5e9bb55c..3ecf73c0 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -288,7 +288,7 @@ public class NEUManager {
public void loadItem(String internalName) {
itemstackCache.remove(internalName);
try {
- JsonObject json = getJsonFromFile(new File(new File(repoLocation, "items"), internalName + ".json"));
+ JsonObject json = getJsonFromFile(getItemFileForInternalName(internalName));
if (json == null) {
return;
}
@@ -971,6 +971,10 @@ public class NEUManager {
return getUUIDFromNBT(tag);
}
+ public File getItemFileForInternalName(String internalName) {
+ return new File(new File(repoLocation, "items"), internalName + ".json");
+ }
+
public void writeItemToFile(ItemStack stack) {
String internalname = getInternalNameForItem(stack);
@@ -984,7 +988,7 @@ public class NEUManager {
json.addProperty("modver", NotEnoughUpdates.VERSION);
try {
- writeJson(json, new File(new File(repoLocation, "items"), internalname + ".json"));
+ writeJson(json, getItemFileForInternalName(internalname));
} catch (IOException ignored) {
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index cff83cca..7159ef89 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -46,6 +46,7 @@ import io.github.moulberry.notenoughupdates.util.LerpingFloat;
import io.github.moulberry.notenoughupdates.util.NotificationHandler;
import io.github.moulberry.notenoughupdates.util.SpecialColour;
import io.github.moulberry.notenoughupdates.util.Utils;
+import lombok.var;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
@@ -84,6 +85,7 @@ import org.lwjgl.opengl.GL14;
import org.lwjgl.util.vector.Vector2f;
import java.awt.*;
+import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Comparator;
@@ -110,6 +112,7 @@ public class NEUOverlay extends Gui {
"notenoughupdates:supersecretassets/lunar.png");
private static final ResourceLocation SEARCH_BAR = new ResourceLocation("notenoughupdates:search_bar.png");
private static final ResourceLocation SEARCH_BAR_GOLD = new ResourceLocation("notenoughupdates:search_bar_gold.png");
+ private static final ResourceLocation SEARCH_MODE_BUTTON = new ResourceLocation("notenoughupdates:search_mode_button.png");
private final NEUManager manager;
@@ -426,7 +429,7 @@ public class NEUOverlay extends Gui {
};
}
- private MBGuiElement createHelpButton(NEUOverlay overlay) {
+ private MBGuiElement createSearchModeButton() {
return new MBGuiElement() {
@Override
public int getWidth() {
@@ -443,14 +446,12 @@ public class NEUOverlay extends Gui {
@Override
public void mouseClick(float x, float y, int mouseX, int mouseY) {
- if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableHelpButton) {
+ if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableSearchModeButton) {
return;
}
if (Mouse.getEventButtonState()) {
- //displayInformationPane(HTMLInfoPane.createFromWikiUrl(overlay, manager, "Help",
- // "https://moulberry.github.io/files/neu_help.html"));
- //Minecraft.getMinecraft().displayGuiScreen(new HelpGUI());
- ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neuhelp");
+ searchMode = !searchMode;
+ lastSearchMode = System.currentTimeMillis();
Utils.playPressSound();
}
}
@@ -463,7 +464,7 @@ public class NEUOverlay extends Gui {
int paddingUnscaled = getPaddingUnscaled();
int searchYSize = getSearchBarYSize();
- if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableHelpButton) {
+ if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableSearchModeButton) {
return;
}
@@ -473,7 +474,7 @@ public class NEUOverlay extends Gui {
searchYSize + paddingUnscaled * 2, searchYSize + paddingUnscaled * 2, GL11.GL_NEAREST
);
- Minecraft.getMinecraft().getTextureManager().bindTexture(GuiTextures.help);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_MODE_BUTTON);
GlStateManager.color(1f, 1f, 1f, 1f);
Utils.drawTexturedRect((int) x + paddingUnscaled, (int) y + paddingUnscaled,
getSearchBarYSize(), getSearchBarYSize()
@@ -618,7 +619,7 @@ public class NEUOverlay extends Gui {
List<MBGuiElement> children = Lists.newArrayList(
createSettingsButton(this),
createSearchBar(),
- createHelpButton(this)
+ createSearchModeButton()
);
return new MBGuiGroupAligned(children, false) {
public int getPadding() {
@@ -1156,8 +1157,30 @@ public class NEUOverlay extends Gui {
manager.jsonToStack(item));
}
} else if (NotEnoughUpdates.INSTANCE.config.apiData.repositoryEditing &&
- Keyboard.getEventCharacter() == 'k') {
- Minecraft.getMinecraft().displayGuiScreen(new NEUItemEditor(internalname.get(), item));
+ keyPressed == Keyboard.KEY_K) {
+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ var externalEditorCommand = NotEnoughUpdates.INSTANCE.config.hidden.externalEditor;
+ if (externalEditorCommand == null) {
+ Utils.addChatMessage(
+ "§e[NEU] §3No external editor set! Run §b/neudevtest exteditor <