├── src └── minecraft │ ├── invtweaks │ ├── lang │ │ ├── tr_TR.properties │ │ ├── fr_FR.properties │ │ ├── _README.txt │ │ ├── uk_UA.properties │ │ ├── ko_KR.properties │ │ ├── es_ES.properties │ │ ├── da_DK.properties │ │ ├── nl_NL.properties │ │ ├── pt_BR.properties │ │ ├── pt_PT.properties │ │ ├── en_US.properties │ │ ├── de_DE.properties │ │ ├── sv_SE.properties │ │ ├── pl_PL.properties │ │ ├── nb_NO.properties │ │ ├── zh_TW.properties │ │ ├── zh_CN.properties │ │ └── ja_JP.properties │ ├── InvTweaksItemTreeListener.java │ ├── InvTweaksConfigSortingRuleType.java │ ├── InvTweaksConfigProperties.java │ ├── InvTweaksObfuscationGuiButton.java │ ├── InvTweaksContainerSection.java │ ├── InvTweaksShortcutType.java │ ├── DefaultConfig.dat │ ├── InvTweaksGuiModNotWorking.java │ ├── InvTweaksItemTreeItem.java │ ├── InvTweaksShortcutMapping.java │ ├── InvTweaksLocalization.java │ ├── InvTweaksGuiIconButton.java │ ├── InvTweaksGuiSortingButton.java │ ├── InvTweaksGuiSettingsButton.java │ ├── InvTweaksConst.java │ ├── InvTweaksGuiSettingsAbstract.java │ ├── InvTweaksContainerSectionManager.java │ ├── InvTweaksItemTreeCategory.java │ ├── InvTweaksGuiTooltipButton.java │ ├── InvTweaksGuiShortcutsHelp.java │ ├── InvTweaksItemTreeLoader.java │ ├── InvTweaksGuiSettingsAdvanced.java │ ├── InvTweaksModCompatibility.java │ ├── InvTweaksConfigInventoryRuleset.java │ ├── InvTweaksHandlerAutoRefill.java │ └── InvTweaksConfigSortingRule.java │ └── net │ └── minecraft │ └── src │ └── mod_InvTweaks.java ├── invtweaks_docs ├── index_cn.txt ├── index_de.txt ├── index_dk.txt ├── index_es.txt ├── index_it.txt ├── index_jp.txt ├── index_kr.txt ├── index_nl.txt ├── index_pl.txt ├── index_pt.txt ├── index_ru.txt ├── index_tw.txt ├── _static │ └── img │ │ ├── dl.png │ │ ├── demo.jpg │ │ ├── flag │ │ ├── cn.png │ │ ├── dk.png │ │ ├── es.png │ │ ├── fr.png │ │ ├── it.png │ │ ├── jp.png │ │ ├── kr.png │ │ ├── nl.png │ │ ├── pl.png │ │ ├── pt.png │ │ ├── ru.png │ │ ├── tw.png │ │ └── us.png │ │ ├── button10px.png │ │ └── invtweaks.png ├── _themes │ └── nature-custom │ │ ├── theme.conf │ │ └── static │ │ ├── pygments.css │ │ └── nature.css_t ├── README.md ├── langs.txt ├── download.txt ├── index_fr.txt ├── Makefile └── conf.py ├── recompile.sh ├── reobfuscate.sh ├── recompile.bat ├── reobfuscate.bat ├── .gitignore ├── invtweaks_scripts ├── copy_resources.py └── package_mod.py ├── README.md ├── LICENSE.md └── conf └── mcp.cfg /src/minecraft/invtweaks/lang/tr_TR.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | -------------------------------------------------------------------------------- /invtweaks_docs/index_cn.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_de.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_dk.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_es.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_it.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_jp.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_kr.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_nl.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_pl.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_pt.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_ru.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /invtweaks_docs/index_tw.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | 4 | -------------------------------------------------------------------------------- /recompile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | python runtime/recompile.py "$@" 3 | python invtweaks_scripts/copy_resources.py -------------------------------------------------------------------------------- /reobfuscate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | python runtime/reobfuscate.py "$@" 3 | python invtweaks_scripts/package_mod.py 4 | -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/dl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/dl.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/demo.jpg -------------------------------------------------------------------------------- /invtweaks_docs/_themes/nature-custom/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = nature.css 4 | pygments_style = tango 5 | -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/cn.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/dk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/dk.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/es.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/fr.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/it.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/it.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/jp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/jp.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/kr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/kr.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/nl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/nl.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/pl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/pl.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/pt.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/ru.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/tw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/tw.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/flag/us.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/flag/us.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/button10px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/button10px.png -------------------------------------------------------------------------------- /invtweaks_docs/_static/img/invtweaks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/invtweaks_docs/_static/img/invtweaks.png -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/fr_FR.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkalam-alami/inventory-tweaks/HEAD/src/minecraft/invtweaks/lang/fr_FR.properties -------------------------------------------------------------------------------- /recompile.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | runtime\bin\python\python_mcp runtime\recompile.py %* 3 | runtime\bin\python\python_mcp invtweaks_scripts\copy_resources.py 4 | pause 5 | -------------------------------------------------------------------------------- /reobfuscate.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | runtime\bin\python\python_mcp runtime\reobfuscate.py %* 3 | runtime\bin\python\python_mcp invtweaks_scripts\package_mod.py 4 | pause 5 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksItemTreeListener.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | 4 | import java.util.EventListener; 5 | 6 | public interface InvTweaksItemTreeListener extends EventListener { 7 | 8 | void onTreeLoaded(InvTweaksItemTree tree); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/_README.txt: -------------------------------------------------------------------------------- 1 | |==============================================================| 2 | | INVENTORY TWEAKS Mod - By Jimeo Wan (jimeo.wan at gmail.com) | 3 | | Translations readme | 4 | |==============================================================| 5 | 6 | * Want to contibute? 7 | 8 | Awesome, thank you in advance! Now please don't edit these files directly, 9 | everything is done through the Crowdin website (exactly like Minecraft itself): 10 | 11 | http://crowdin.net/project/invtweaks/ -------------------------------------------------------------------------------- /invtweaks_docs/README.md: -------------------------------------------------------------------------------- 1 | # About the docs 2 | 3 | This folder stores the contents of the official website. Each commit made here will be reflected on the documentation thanks to [Read the Docs](http://readthedocs.org). 4 | 5 | ## How to build the website locally 6 | 7 | * Install [Sphinx](http://sphinx.pocoo.org/) 8 | * Open a console 9 | * Set your current directory to `docs/` 10 | * Run: **`sphinx-build . _build`** 11 | * Open `docs/_build/index.html` 12 | 13 | ## Website update 14 | 15 | * Read the docs listens to the `master` branch, so changes from `develop` won't be visible until a release is made. -------------------------------------------------------------------------------- /invtweaks_docs/langs.txt: -------------------------------------------------------------------------------- 1 | .. raw:: html 2 | 3 | 14 | 15 | 16 | 17 | Fork me on GitHub 18 | 19 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksConfigSortingRuleType.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | public enum InvTweaksConfigSortingRuleType { 4 | 5 | RECTANGLE(1), ROW(2), COLUMN(3), SLOT(4); 6 | 7 | private int lowestPriority; 8 | private int highestPriority; 9 | 10 | InvTweaksConfigSortingRuleType(int priorityLevel) { 11 | lowestPriority = priorityLevel * 1000000; 12 | highestPriority = (priorityLevel + 1) * 1000000 - 1; 13 | } 14 | 15 | // Used for computing rule priorities 16 | public int getLowestPriority() { 17 | return lowestPriority; 18 | } 19 | 20 | // Used for computing lock levels 21 | public int getHighestPriority() { 22 | return highestPriority; 23 | } 24 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Filter Minecraft sources 2 | /src/minecraft/* 3 | !/src/minecraft/invtweaks 4 | !/src/minecraft/net 5 | /src/minecraft/net/minecraft/client 6 | /src/minecraft/net/minecraft/server 7 | /src/minecraft/net/minecraft/src/* 8 | !/src/minecraft/net/minecraft/src/InvTweaks* 9 | 10 | # Builds & binaries 11 | bin/ 12 | target/ 13 | lib/ 14 | invtweaks_docs/_build 15 | launcher/ 16 | *.zip 17 | *.jar 18 | 19 | # Tmp files 20 | *~ 21 | *# 22 | 23 | # IDEs 24 | .classpath 25 | .project 26 | .settings 27 | .pydevproject 28 | 29 | # MCP Files 30 | docs/ 31 | conf/ 32 | eclipse/ 33 | jars/ 34 | logs/ 35 | runtime/ 36 | temp/ 37 | reobf/ 38 | CHANGELOG 39 | LICENSE.txt 40 | *.bat 41 | *.sh 42 | 43 | # Misc 44 | *.rej 45 | -------------------------------------------------------------------------------- /invtweaks_scripts/copy_resources.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import shutil 4 | import sys 5 | import os 6 | 7 | # Functions 8 | 9 | INVTWEAKS_SRC = 'src/minecraft/invtweaks/' 10 | INVTWEAKS_BIN = 'bin/minecraft/invtweaks/' 11 | 12 | def copy_resource_tree(resource): 13 | shutil.rmtree(INVTWEAKS_BIN + resource, True) 14 | shutil.copytree(INVTWEAKS_SRC + resource, INVTWEAKS_BIN + resource) 15 | 16 | def copy_resource(resource): 17 | try: 18 | os.remove(INVTWEAKS_BIN + resource) 19 | except OSError: 20 | pass 21 | shutil.copy(INVTWEAKS_SRC + resource, INVTWEAKS_BIN + resource) 22 | 23 | # Resources copy 24 | 25 | print 'Copying InvTweaks resources...' 26 | 27 | copy_resource_tree('lang/') 28 | copy_resource('DefaultConfig.dat') 29 | copy_resource('DefaultTree.dat') 30 | 31 | print 'OK!' -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## This repository is not maintained anymore. 2 | 3 | **Kobata has a well maintained fork with multiple bugfixes and additions. Since March 2013, he is the new official maintainer for InvTweaks.** 4 | 5 | * **Please go to [his fork of this repository](https://github.com/Kobata/inventory-tweaks) for further updates** 6 | * **See also the new [InvTweaks thread](http://www.minecraftforum.net/topic/1720872-inventory-tweaks-151-mar-9/) on the Minecraft forums** 7 | 8 | ## What is Inventory Tweaks? 9 | 10 | This Open Source project (see [License](https://github.com/mkalam-alami/inventory-tweaks/blob/master/src/doc/license.txt)) is a client mod for [Minecraft](http://www.minecraft.net/), a game by [Mojang AB](http://mojang.com/). It implements various features to help players with the management of inventories and chests. A lot of effort has been put to make it as customizable as possible, without being annoying to set up. 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksConfigProperties.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.Collections; 4 | import java.util.Enumeration; 5 | import java.util.LinkedHashSet; 6 | import java.util.LinkedList; 7 | import java.util.List; 8 | import java.util.Properties; 9 | 10 | /** 11 | * Extension of the default Properties class, 12 | * that ensures the entries are listed in alphabetical order. 13 | * @author MARWANE 14 | * 15 | */ 16 | public class InvTweaksConfigProperties extends Properties { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | private final List keys = new LinkedList(); 21 | 22 | public Enumeration keys() { 23 | return Collections.enumeration( 24 | new LinkedHashSet(keys)); 25 | } 26 | 27 | public Object put(String key, Object value) { 28 | keys.add(key); 29 | return super.put(key, value); 30 | } 31 | 32 | public void sortKeys() { 33 | Collections.sort(keys); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /invtweaks_docs/download.txt: -------------------------------------------------------------------------------- 1 | .. image:: _static/img/dl.png 2 | :align: left 3 | 4 | `Inventory Tweaks 1.50 `_ for **Minecraft 1.4.6/1.4.7** (requires `Forge `_ or `ModLoader `_) | `Mirror `_ 5 | 6 | .. image:: _static/img/dl.png 7 | :align: left 8 | 9 | `Inventory Tweaks 1.45 `_ for **Minecraft 1.4.4/1.4.5** (requires `Forge `_ or `ModLoader `_) | `Mirror `_ 10 | 11 | .. image:: _static/img/dl.png 12 | :align: left 13 | 14 | `Inventory Tweaks 1.43b `_ for **Minecraft 1.3.2** (requires `Forge `_ or `ModLoader `_) | `Mirror `_ -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksObfuscationGuiButton.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.src.GuiButton; 5 | 6 | /** 7 | * Obfuscation layer for gui buttons. 8 | * @author Jimeo Wan 9 | * 10 | */ 11 | public class InvTweaksObfuscationGuiButton extends GuiButton { 12 | 13 | public InvTweaksObfuscationGuiButton(int id, int x, int y, int w, int h, String string) { 14 | super(id, x, y, w, h, string); 15 | } 16 | 17 | protected String getDisplayString() { 18 | return displayString; 19 | } 20 | 21 | protected int getTexture(Minecraft mc, String texture) { 22 | return mc.renderEngine.getTexture(texture); 23 | } 24 | 25 | protected boolean isEnabled() { 26 | return enabled; 27 | } 28 | 29 | protected int getXPosition() { 30 | return xPosition; 31 | } 32 | 33 | protected int getYPosition() { 34 | return yPosition; 35 | } 36 | 37 | protected int getWidth() { 38 | return width; 39 | } 40 | 41 | protected int getHeight() { 42 | return height; 43 | } 44 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## Inventory Tweaks Mod license (MIT) 2 | 3 | Copyright (c) 2011-2013 Marwane Kalam-Alami 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksContainerSection.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | /** 4 | * Names for specific parts of containers. 5 | * For unknown container types (such as mod containers), 6 | * only INVENTORY and CHEST sections are available. 7 | */ 8 | public enum InvTweaksContainerSection { 9 | /** The player's inventory */ 10 | INVENTORY, 11 | /** The player's inventory (only the hotbar) */ 12 | INVENTORY_HOTBAR, 13 | /** The player's inventory (all except the hotbar) */ 14 | INVENTORY_NOT_HOTBAR, 15 | /** The chest or dispenser contents. 16 | * Also used for unknown container contents. */ 17 | CHEST, 18 | /** The crafting input */ 19 | CRAFTING_IN, 20 | /** The crafting output */ 21 | CRAFTING_OUT, 22 | /** The armor slots */ 23 | ARMOR, 24 | /** The furnace input */ 25 | FURNACE_IN, 26 | /** The furnace output */ 27 | FURNACE_OUT, 28 | /** The furnace fuel */ 29 | FURNACE_FUEL, 30 | /** The enchantment table slot */ 31 | ENCHANTMENT, 32 | /** The three bottles slots in brewing tables */ 33 | BREWING_BOTTLES, 34 | /** The top slot in brewing tables */ 35 | BREWING_INGREDIENT 36 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/uk_UA.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' 3 | invtweaks.loadconfig.refresh.error=[1] 4 | invtweaks.propsfile.error=[14] 5 | invtweaks.extract.find.error=[15] 6 | invtweaks.extract.create.error=[16] 7 | invtweaks.sort.inventory.error=[2] 8 | invtweaks.sort.chest.error=[3] 9 | invtweaks.sort.autorefill.error=[4] 10 | invtweaks.sort.releaseitem.error=[5] 11 | invtweaks.shortcut.error=[6] 12 | invtweaks.pickup.error=[7] 13 | invtweaks.settings.rulesfile=\u00b3 14 | invtweaks.settings.rulesfile.error=[8] 15 | invtweaks.settings.treefile=\u00b3 16 | invtweaks.settings.treefile.error=[9] 17 | invtweaks.settings.onlinehelp=\u00b3 18 | invtweaks.settings.onlinehelp.error=[10] 19 | invtweaks.settings.advanced.sortonpickup.soloonly=\u04b3 20 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=\u04b3 21 | invtweaks.settings.advanced.sounds.tooltip=\u00b3 22 | invtweaks.settings.advanced.mappingsfile=\u00b3 23 | invtweaks.settings.advanced.mappingsfile.error=[11] 24 | invtweaks.help.shortcuts.rightclick=( 25 | invtweaks.help.shortcuts.forward=( 26 | invtweaks.keyboardfix.error=[12] 27 | invtweaks.modcompat.ci.error=[13] 28 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksShortcutType.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | /** 4 | * 5 | * @author Jimeo Wan 6 | * 7 | */ 8 | public enum InvTweaksShortcutType { 9 | 10 | MOVE_ALL_ITEMS, 11 | MOVE_EVERYTHING, 12 | MOVE_ONE_STACK, 13 | MOVE_ONE_ITEM, 14 | MOVE_UP, 15 | MOVE_DOWN, 16 | MOVE_TO_SPECIFIC_HOTBAR_SLOT, 17 | DROP; 18 | 19 | public static InvTweaksShortcutType fromConfigKey(String property) { 20 | if (InvTweaksConfig.PROP_SHORTCUT_ALL_ITEMS.equals(property)) { 21 | return MOVE_ALL_ITEMS; 22 | } else if (InvTweaksConfig.PROP_SHORTCUT_EVERYTHING.equals(property)) { 23 | return MOVE_EVERYTHING; 24 | } else if (InvTweaksConfig.PROP_SHORTCUT_DOWN.equals(property)) { 25 | return MOVE_DOWN; 26 | } else if (InvTweaksConfig.PROP_SHORTCUT_DROP.equals(property)) { 27 | return DROP; 28 | } else if (InvTweaksConfig.PROP_SHORTCUT_ONE_ITEM.equals(property)) { 29 | return MOVE_ONE_ITEM; 30 | } else if (InvTweaksConfig.PROP_SHORTCUT_UP.equals(property)) { 31 | return MOVE_UP; 32 | } else { 33 | return null; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/DefaultConfig.dat: -------------------------------------------------------------------------------- 1 | |==============================================================| 2 | | INVENTORY TWEAKS Mod - By Jimeo Wan (jimeo.wan at gmail.com) | 3 | | Sorting rules and general configuration | 4 | |==============================================================| 5 | 6 | ====== [ SETTINGS ] ====== 7 | 8 | D LOCKED 9 | 10 | ======== [ GETTING STARTED ] ======== 11 | 12 | # SORTING RULES 13 | # Each line you type is a new constraint you add for sorting your inventory. 14 | # After any change, just press the sorting key to reload the settings. Some examples: 15 | # * "D1 sword" puts any sword in row D, column 1 (see grid below) 16 | # * "A edibleFood" fills the A row with food 17 | # * "1 ironPickaxe" fills the 1 column with an iron pickaxe 18 | # * "A1-C4 blocks" fills the rectangle with any blocks 19 | # * "D LOCKED" avoids items from the hotbar to move out of it when sorting 20 | 21 | # INVENTORY GRID 22 | # 1 2 3 4 5 6 7 8 9 23 | # A [A1][A2][A3][A4][A5][A6][A7][A8][A9] 24 | # B [B1][B2][B3][B4][B5][B6][B7][B8][B9] 25 | # C [C1][C2][C3][C4][C5][C6][C7][C8][C9] 26 | # 27 | # D [D1][D2][D3][D4][D5][D6][D7][D8][D9] 28 | 29 | # AVAILABLE KEYWORDS 30 | # Open the 'InvTweaksTree.txt' file for a list of available keywords. If an item 31 | # is missing from the item tree (for example mod items), you can either add it 32 | # or create a rule by ID. Examples: "D5 203", "D9 12345-13" 33 | 34 | # FULL DOCUMENTATION 35 | # http://modding.kalam-alami.net/?invtweaks -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiModNotWorking.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.logging.Logger; 4 | 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.src.GuiButton; 7 | import net.minecraft.src.GuiScreen; 8 | 9 | 10 | /** 11 | * A help menu for the NoCheatPlus conflict. 12 | * 13 | * @author Jimeo Wan 14 | * 15 | */ 16 | public class InvTweaksGuiModNotWorking extends InvTweaksGuiSettingsAbstract { 17 | 18 | private static final Logger log = Logger.getLogger("InvTweaks"); 19 | 20 | public InvTweaksGuiModNotWorking(Minecraft mc, GuiScreen parentScreen, InvTweaksConfig config) { 21 | super(mc, parentScreen, config); 22 | } 23 | 24 | public void drawScreen(int i, int j, float f) { 25 | super.drawScreen(i, j, f); 26 | 27 | int x = obf.getWindowWidth(this) / 2; 28 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.help.bugsorting.pt1"), x, 80, 0xBBBBBB); 29 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.help.bugsorting.pt2"), x, 95, 0xBBBBBB); 30 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.help.bugsorting.pt3"), x, 110, 0xBBBBBB); 31 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.help.bugsorting.pt4"), x, 150, 0xFFFF99); 32 | } 33 | 34 | protected void actionPerformed(GuiButton guibutton) { 35 | switch (obf.getId(guibutton)) { 36 | // Back to main settings screen 37 | case ID_DONE: 38 | obf.displayGuiScreen(new InvTweaksGuiSettings(mc, parentScreen, config)); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /invtweaks_docs/index_fr.txt: -------------------------------------------------------------------------------- 1 | .. include:: langs.txt 2 | 3 | Site officiel d'Inventory Tweaks 4 | ================================= 5 | 6 | .. image:: _static/img/invtweaks.png 7 | 8 | Qu'est-ce qu'Inventory Tweaks? 9 | ------------------------------ 10 | 11 | .. image:: _static/img/demo.jpg 12 | :align: right 13 | 14 | Ce mod pour Minecraft permet de **facilement gérer ses objets**. Il se met en place très facilement, et vous permettra rapidement de gagner un temps fou, que ce soit en **mode solo ou multijoueur** ! 15 | 16 | * Tous les outils, blocs et autres sont automatiquement remplacés (plus besoin d'ouvrir l'inventaire à chaque fois) 17 | * Triez votre inventaire et vos coffres en un clic 18 | * Personnalisez entièrement la manière dont votre inventaire est trié, grâce à des fichiers de configuration 19 | 20 | Téléchargement 21 | -------------- 22 | 23 | .. include:: download.txt 24 | 25 | 26 | * `Anciennes versions `_ 27 | * `Derniers changements (en anglais) `_ 28 | 29 | Contact 30 | ------- 31 | 32 | * `Obtenez de l'aide sur Minecraft Forums `_ (en anglais) 33 | * `Rejoignez le projet sur Github `_ (eh oui, c'est Open Source !) 34 | * Si besoin je parle français, donc au pire vous pouvez m'envoyer un mail à *jimeo.wan (at) gmail (point) com*. 35 | 36 | 37 | Documentation 38 | ============= 39 | 40 | J'ai pas encore traduit la documentation, mais les menus du mod (accessibles via le bouton "..." depuis l'inventaire) sont déjà en français, donc vous devriez vous en sortir sans trop de soucis. Merci de voir la `page en anglais `_ pour plus de détails. 41 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksItemTreeItem.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | /** 4 | * Representation of an item in the item tree. 5 | * @author Jimeo Wan 6 | * 7 | */ 8 | public class InvTweaksItemTreeItem implements Comparable { 9 | 10 | private String name; 11 | private int id; 12 | private int damage; 13 | private int order; 14 | 15 | /** 16 | * @param name The item name 17 | * @param id The item ID 18 | * @param damage The item variant or -1 19 | * @param order The item order while sorting 20 | */ 21 | public InvTweaksItemTreeItem(String name, int id, int damage, int order) { 22 | this.name = name; 23 | this.id = id; 24 | this.damage = damage; 25 | this.order = order; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public int getId() { 33 | return id; 34 | } 35 | 36 | public int getDamage() { 37 | return damage; 38 | } 39 | 40 | public int getOrder() { 41 | return order; 42 | } 43 | 44 | /** 45 | * Warning: the item equality is not reflective. They are equal if "o" 46 | * matches the item constraints (the opposite can be false). 47 | */ 48 | public boolean equals(Object o) { 49 | if (o == null || !(o instanceof InvTweaksItemTreeItem)) 50 | return false; 51 | InvTweaksItemTreeItem item = (InvTweaksItemTreeItem) o; 52 | return id == item.getId() && (damage == -1 || damage == item.getDamage()); 53 | } 54 | 55 | public String toString() { 56 | return name; 57 | } 58 | 59 | @Override 60 | public int compareTo(InvTweaksItemTreeItem item) { 61 | return item.order - order; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/minecraft/net/minecraft/src/mod_InvTweaks.java: -------------------------------------------------------------------------------- 1 | package net.minecraft.src; 2 | import invtweaks.InvTweaks; 3 | import invtweaks.InvTweaksConst; 4 | 5 | import java.util.logging.Logger; 6 | 7 | import net.minecraft.client.Minecraft; 8 | 9 | /** 10 | * ModLoader entry point to load and configure the mod. 11 | * 12 | * @author Jimeo Wan 13 | * 14 | * Contact: jimeo.wan (at) gmail (dot) com 15 | * Website: {@link http://wan.ka.free.fr/?invtweaks} 16 | * Source code: {@link https://github.com/mkalam-alami/inventory-tweaks} 17 | * License: MIT 18 | * 19 | */ 20 | public class mod_InvTweaks extends BaseMod { 21 | 22 | private static final Logger log = Logger.getLogger("InvTweaks"); 23 | 24 | private InvTweaks instance; 25 | 26 | private InvTweaksObfuscation obf; 27 | 28 | @Override 29 | public String getName() { 30 | return "Inventory Tweaks"; 31 | } 32 | 33 | @Override 34 | public String getVersion() { 35 | return InvTweaksConst.MOD_VERSION; 36 | } 37 | 38 | @Override 39 | public void load() { 40 | Minecraft mc = ModLoader.getMinecraftInstance(); 41 | obf = new InvTweaksObfuscation(mc); 42 | 43 | // Register onTick hook 44 | ModLoader.setInGameHook(this, true, true); 45 | 46 | // Instantiate mod core 47 | instance = new InvTweaks(mc); 48 | } 49 | 50 | /** 51 | * Called by ModLoader for each tick during the game. 52 | */ 53 | public boolean onTickInGame(float clock, Minecraft minecraft) { 54 | if (obf.getCurrentScreen() != null) { 55 | instance.onTickInGUI(obf.getCurrentScreen()); 56 | } 57 | else { 58 | instance.onTickInGame(); 59 | } 60 | return true; 61 | } 62 | 63 | /** 64 | * Called by ModLoader when an item has been picked up. 65 | */ 66 | 67 | @Override 68 | public void onItemPickup(EntityPlayer entityplayer, ItemStack itemstack) { 69 | instance.setItemPickupPending(true); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksShortcutMapping.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.LinkedList; 4 | import java.util.List; 5 | import java.util.Map; 6 | import java.util.logging.Logger; 7 | 8 | import org.lwjgl.input.Keyboard; 9 | 10 | 11 | /** 12 | * 13 | * @author Jimeo Wan 14 | * 15 | */ 16 | public class InvTweaksShortcutMapping { 17 | 18 | private static final Logger log = Logger.getLogger("InvTweaks"); 19 | 20 | private List keysToHold = new LinkedList(); 21 | 22 | public InvTweaksShortcutMapping(int keyCode) { 23 | keysToHold.add(keyCode); 24 | } 25 | 26 | public InvTweaksShortcutMapping(int... keyCodes) { 27 | for (int keyCode : keyCodes) { 28 | keysToHold.add(keyCode); 29 | } 30 | } 31 | public InvTweaksShortcutMapping(String keyName) { 32 | this(new String[]{ keyName }); 33 | } 34 | 35 | public InvTweaksShortcutMapping(String... keyNames) { 36 | for (String keyName : keyNames) { 37 | // - Accept both KEY_### and ###, in case someone 38 | // takes the LWJGL Javadoc at face value 39 | // - Accept LALT & RALT instead of LMENU & RMENU 40 | keyName = keyName.trim().replace("KEY_", "").replace("ALT", "MENU"); 41 | keysToHold.add(Keyboard.getKeyIndex(keyName)); 42 | } 43 | } 44 | 45 | public boolean isTriggered(Map pressedKeys) { 46 | for (Integer keyToHold : keysToHold) { 47 | if (keyToHold != Keyboard.KEY_LCONTROL) { 48 | if (!pressedKeys.get(keyToHold)) { 49 | return false; 50 | } 51 | } 52 | // AltGr also activates LCtrl, make sure the real LCtrl has been pressed 53 | else if (!pressedKeys.get(keyToHold) || Keyboard.isKeyDown(Keyboard.KEY_RMENU)) { 54 | return false; 55 | } 56 | } 57 | return true; 58 | } 59 | 60 | public List getKeyCodes() { 61 | return this.keysToHold; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /invtweaks_scripts/package_mod.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import shutil 4 | import sys 5 | import os 6 | import zipfile 7 | 8 | # Constants 9 | 10 | INVTWEAKS_SRC = 'src/minecraft/invtweaks' 11 | INVTWEAKS_CLASS = 'reobf/minecraft' 12 | INVTWEAKS_TMP = 'temp/invtweaks' 13 | 14 | # Remove tmp dir 15 | 16 | shutil.rmtree(INVTWEAKS_TMP, True) 17 | 18 | # Gather files 19 | 20 | print 'Packaging InvTweaks...' 21 | 22 | shutil.copytree(INVTWEAKS_CLASS, INVTWEAKS_TMP) 23 | shutil.copy(INVTWEAKS_SRC + '/DefaultConfig.dat', INVTWEAKS_TMP + '/invtweaks/DefaultConfig.dat') 24 | shutil.copy(INVTWEAKS_SRC + '/DefaultTree.dat', INVTWEAKS_TMP + '/invtweaks/DefaultTree.dat') 25 | shutil.copytree(INVTWEAKS_SRC + '/lang', INVTWEAKS_TMP + '/invtweaks/lang') 26 | shutil.copy('LICENSE.md', INVTWEAKS_TMP + '/LICENSE.txt') 27 | 28 | # Zip 29 | 30 | def get_compression_mode(): 31 | try: 32 | import zlib 33 | return zipfile.ZIP_DEFLATED 34 | except: 35 | print '(...but without compressing)' 36 | return zipfile.ZIP_STORED 37 | 38 | def write_to_zip(zip, compression, path): 39 | archive_path = path.replace(INVTWEAKS_TMP, '') 40 | zip.write(path, arcname=archive_path, compress_type=compression) 41 | 42 | def list_files_recursive(folder): 43 | contents = [] 44 | for folder_element in os.listdir(folder): 45 | sys.stdout.write(folder_element + '\n') 46 | if os.path.isfile(folder_element): 47 | contents.append(folder_element) 48 | else: 49 | contents.extend(list_files_recursive(folder_element)) 50 | return contents 51 | 52 | print 'Zipping InvTweaks...' 53 | 54 | compression_mode = get_compression_mode() 55 | invtweaks_zip = zipfile.ZipFile('InvTweaks-DEV.zip', mode='w') 56 | for root, dirs, files in os.walk(INVTWEAKS_TMP): 57 | for file in files: 58 | write_to_zip(invtweaks_zip, compression_mode, root + '/' + file) 59 | 60 | print 'OK!' -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksLocalization.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.io.InputStream; 4 | import java.util.Properties; 5 | import java.util.logging.Logger; 6 | 7 | import net.minecraft.src.InvTweaksObfuscation; 8 | 9 | 10 | /** 11 | * The global mod's configuration. 12 | * 13 | * @author Jimeo Wan 14 | * 15 | */ 16 | public class InvTweaksLocalization { 17 | 18 | private static final Logger log = Logger.getLogger("InvTweaks"); 19 | private static final String LANG_RESOURCES_LOCATION = "/invtweaks/lang/"; 20 | private static final String DEFAULT_LANGUAGE = "en_US"; 21 | private static Properties defaultMappings = new Properties(); 22 | private static Properties mappings = new Properties(); 23 | private static String loadedLanguage = null; 24 | 25 | public synchronized static String get(String key) { 26 | 27 | String currentLanguage = InvTweaksObfuscation.getCurrentLanguage(); 28 | if (!currentLanguage.equals(loadedLanguage)) { 29 | loadedLanguage = load(currentLanguage); 30 | } 31 | 32 | return mappings.getProperty(key, 33 | defaultMappings.getProperty(key, key)); 34 | 35 | } 36 | 37 | private static String load(String currentLanguage) { 38 | 39 | defaultMappings.clear(); 40 | mappings.clear(); 41 | 42 | try { 43 | InputStream langStream = InvTweaksLocalization.class.getResourceAsStream(LANG_RESOURCES_LOCATION + currentLanguage + ".properties"); 44 | InputStream defaultLangStream = InvTweaksLocalization.class.getResourceAsStream(LANG_RESOURCES_LOCATION + DEFAULT_LANGUAGE + ".properties"); 45 | 46 | mappings.load((langStream == null) ? defaultLangStream : langStream); 47 | defaultMappings.load(defaultLangStream); 48 | 49 | if (langStream != null) { 50 | langStream.close(); 51 | } 52 | defaultLangStream.close(); 53 | } catch (Exception e) { 54 | e.printStackTrace(); 55 | } 56 | 57 | return currentLanguage; 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiIconButton.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | import org.lwjgl.opengl.GL11; 6 | 7 | /** 8 | * Icon-size button, which get drawns in a specific way to fit its small size. 9 | * @author Jimeo Wan 10 | * 11 | */ 12 | public class InvTweaksGuiIconButton extends InvTweaksGuiTooltipButton { 13 | 14 | protected InvTweaksConfigManager cfgManager; 15 | 16 | private boolean useCustomTexture; 17 | 18 | public InvTweaksGuiIconButton(InvTweaksConfigManager cfgManager, 19 | int id, int x, int y, int w, int h, 20 | String displayString, String tooltip, boolean useCustomTexture) { 21 | super(id, x, y, w, h, displayString, tooltip); 22 | this.cfgManager = cfgManager; 23 | this.useCustomTexture = useCustomTexture; 24 | } 25 | 26 | public void drawButton(Minecraft minecraft, int i, int j) { 27 | super.drawButton(minecraft, i, j); 28 | 29 | // Draw background (use the 4 corners of the texture to fit best its small size) 30 | int k = getHoverState(isMouseOverButton(i, j)); 31 | GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); 32 | 33 | if (useCustomTexture) { 34 | GL11.glBindTexture(3553, getTexture(minecraft, "/gui/button10px.png")); 35 | drawTexturedModalRect(getXPosition(), getYPosition(), (k - 1) * 10, 0, getWidth(), getHeight()); 36 | } 37 | else { 38 | GL11.glBindTexture(3553, getTexture(minecraft, "/gui/gui.png")); 39 | drawTexturedModalRect(getXPosition(), getYPosition(), 1, 46 + k * 20 + 1, getWidth() / 2, getHeight() / 2); 40 | drawTexturedModalRect(getXPosition(), getYPosition() + getHeight() / 2, 1, 46 + k * 20 + 20 - getHeight() / 2 - 1, getWidth() / 2, getHeight() / 2); 41 | drawTexturedModalRect(getXPosition() + getWidth() / 2, getYPosition(), 200 - getWidth() / 2 - 1, 46 + k * 20 + 1, getWidth() / 2, getHeight() / 2); 42 | drawTexturedModalRect(getXPosition() + getWidth() / 2, getYPosition() + getHeight() / 2, 200 - getWidth() / 2 - 1, 46 + k * 20 + 19 - getHeight() / 2, getWidth() / 2, 43 | getHeight() / 2); 44 | } 45 | 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiSortingButton.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import net.minecraft.client.Minecraft; 4 | 5 | /** 6 | * Chest sorting button 7 | * @author Jimeo Wan 8 | * 9 | */ 10 | public class InvTweaksGuiSortingButton extends InvTweaksGuiIconButton { 11 | 12 | private final InvTweaksContainerSection section = InvTweaksContainerSection.CHEST; 13 | 14 | private int algorithm; 15 | private int rowSize; 16 | 17 | public InvTweaksGuiSortingButton(InvTweaksConfigManager cfgManager, 18 | int id, int x, int y, int w, int h, 19 | String displayString, String tooltip, 20 | int algorithm, int rowSize, boolean useCustomTexture) { 21 | super(cfgManager, id, x, y, w, h, displayString, tooltip, useCustomTexture); 22 | this.algorithm = algorithm; 23 | this.rowSize = rowSize; 24 | } 25 | 26 | public void drawButton(Minecraft minecraft, int i, int j) { 27 | super.drawButton(minecraft, i, j); 28 | 29 | // Display symbol 30 | int textColor = getTextColor(i, j); 31 | if (getDisplayString().equals("h")) { 32 | drawRect(getXPosition() + 3, getYPosition() + 3, getXPosition() + getWidth() - 3, getYPosition() + 4, textColor); 33 | drawRect(getXPosition() + 3, getYPosition() + 6, getXPosition() + getWidth() - 3, getYPosition() + 7, textColor); 34 | } else if (getDisplayString().equals("v")) { 35 | drawRect(getXPosition() + 3, getYPosition() + 3, getXPosition() + 4, getYPosition() + getHeight() - 3, textColor); 36 | drawRect(getXPosition() + 6, getYPosition() + 3, getXPosition() + 7, getYPosition() + getHeight() - 3, textColor); 37 | } else { 38 | drawRect(getXPosition() + 3, getYPosition() + 3, getXPosition() + getWidth() - 3, getYPosition() + 4, textColor); 39 | drawRect(getXPosition() + 5, getYPosition() + 4, getXPosition() + 6, getYPosition() + 5, textColor); 40 | drawRect(getXPosition() + 4, getYPosition() + 5, getXPosition() + 5, getYPosition() + 6, textColor); 41 | drawRect(getXPosition() + 3, getYPosition() + 6, getXPosition() + getWidth() - 3, getYPosition() + 7, textColor); 42 | } 43 | } 44 | 45 | /** 46 | * Sort container 47 | */ 48 | public boolean mousePressed(Minecraft minecraft, int i, int j) { 49 | if (super.mousePressed(minecraft, i, j)) { 50 | try { 51 | new InvTweaksHandlerSorting( 52 | minecraft, cfgManager.getConfig(), 53 | section, algorithm, rowSize).sort(); 54 | } catch (Exception e) { 55 | InvTweaks.logInGameErrorStatic("invtweaks.sort.chest.error", e); 56 | e.printStackTrace(); 57 | } 58 | return true; 59 | } else { 60 | return false; 61 | } 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /invtweaks_docs/_themes/nature-custom/static/pygments.css: -------------------------------------------------------------------------------- 1 | .c { color: #999988; font-style: italic } /* Comment */ 2 | .k { font-weight: bold } /* Keyword */ 3 | .o { font-weight: bold } /* Operator */ 4 | .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 5 | .cp { color: #999999; font-weight: bold } /* Comment.preproc */ 6 | .c1 { color: #999988; font-style: italic } /* Comment.Single */ 7 | .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 8 | .ge { font-style: italic } /* Generic.Emph */ 9 | .gr { color: #aa0000 } /* Generic.Error */ 10 | .gh { color: #999999 } /* Generic.Heading */ 11 | .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 12 | .go { color: #111 } /* Generic.Output */ 13 | .gp { color: #555555 } /* Generic.Prompt */ 14 | .gs { font-weight: bold } /* Generic.Strong */ 15 | .gu { color: #aaaaaa } /* Generic.Subheading */ 16 | .gt { color: #aa0000 } /* Generic.Traceback */ 17 | .kc { font-weight: bold } /* Keyword.Constant */ 18 | .kd { font-weight: bold } /* Keyword.Declaration */ 19 | .kp { font-weight: bold } /* Keyword.Pseudo */ 20 | .kr { font-weight: bold } /* Keyword.Reserved */ 21 | .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 22 | .m { color: #009999 } /* Literal.Number */ 23 | .s { color: #bb8844 } /* Literal.String */ 24 | .na { color: #008080 } /* Name.Attribute */ 25 | .nb { color: #999999 } /* Name.Builtin */ 26 | .nc { color: #445588; font-weight: bold } /* Name.Class */ 27 | .no { color: #ff99ff } /* Name.Constant */ 28 | .ni { color: #800080 } /* Name.Entity */ 29 | .ne { color: #990000; font-weight: bold } /* Name.Exception */ 30 | .nf { color: #990000; font-weight: bold } /* Name.Function */ 31 | .nn { color: #555555 } /* Name.Namespace */ 32 | .nt { color: #000080 } /* Name.Tag */ 33 | .nv { color: purple } /* Name.Variable */ 34 | .ow { font-weight: bold } /* Operator.Word */ 35 | .mf { color: #009999 } /* Literal.Number.Float */ 36 | .mh { color: #009999 } /* Literal.Number.Hex */ 37 | .mi { color: #009999 } /* Literal.Number.Integer */ 38 | .mo { color: #009999 } /* Literal.Number.Oct */ 39 | .sb { color: #bb8844 } /* Literal.String.Backtick */ 40 | .sc { color: #bb8844 } /* Literal.String.Char */ 41 | .sd { color: #bb8844 } /* Literal.String.Doc */ 42 | .s2 { color: #bb8844 } /* Literal.String.Double */ 43 | .se { color: #bb8844 } /* Literal.String.Escape */ 44 | .sh { color: #bb8844 } /* Literal.String.Heredoc */ 45 | .si { color: #bb8844 } /* Literal.String.Interpol */ 46 | .sx { color: #bb8844 } /* Literal.String.Other */ 47 | .sr { color: #808000 } /* Literal.String.Regex */ 48 | .s1 { color: #bb8844 } /* Literal.String.Single */ 49 | .ss { color: #bb8844 } /* Literal.String.Symbol */ 50 | .bp { color: #999999 } /* Name.Builtin.Pseudo */ 51 | .vc { color: #ff99ff } /* Name.Variable.Class */ 52 | .vg { color: #ff99ff } /* Name.Variable.Global */ 53 | .vi { color: #ff99ff } /* Name.Variable.Instance */ 54 | .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiSettingsButton.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.concurrent.TimeoutException; 4 | import java.util.logging.Logger; 5 | 6 | 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.src.InvTweaksObfuscation; 9 | 10 | /** 11 | * Button that opens the inventory & chest settings screen. 12 | * @author Jimeo Wan 13 | * 14 | */ 15 | public class InvTweaksGuiSettingsButton extends InvTweaksGuiIconButton { 16 | 17 | private static final Logger log = Logger.getLogger("InvTweaks"); 18 | 19 | public InvTweaksGuiSettingsButton(InvTweaksConfigManager cfgManager, 20 | int id, int x, int y, int w, int h, 21 | String displayString, String tooltip, boolean useCustomTexture) { 22 | super(cfgManager, id, x, y, w, h, displayString, tooltip, useCustomTexture); 23 | } 24 | 25 | public void drawButton(Minecraft minecraft, int i, int j) { 26 | super.drawButton(minecraft, i, j); 27 | 28 | // Display string 29 | InvTweaksObfuscation obf = new InvTweaksObfuscation(minecraft); 30 | drawCenteredString(obf.getFontRenderer(), 31 | getDisplayString(), 32 | getXPosition() + 5, 33 | getYPosition() - 1, 34 | getTextColor(i, j)); 35 | } 36 | 37 | /** 38 | * Displays inventory settings GUI 39 | */ 40 | public boolean mousePressed(Minecraft minecraft, int i, int j) { 41 | 42 | InvTweaksObfuscation obf = new InvTweaksObfuscation(minecraft); 43 | InvTweaksConfig config = cfgManager.getConfig(); 44 | 45 | if (super.mousePressed(minecraft, i, j)) { 46 | // Put hold item down if necessary 47 | InvTweaksContainerSectionManager containerMgr; 48 | 49 | try { 50 | containerMgr = new InvTweaksContainerSectionManager( 51 | minecraft, InvTweaksContainerSection.INVENTORY); 52 | if (obf.getHeldStack() != null) { 53 | try { 54 | // Put hold item down 55 | for (int k = containerMgr.getSize() - 1; k >= 0; k--) { 56 | if (containerMgr.getItemStack(k) == null) { 57 | containerMgr.leftClick(k); 58 | break; 59 | } 60 | } 61 | } catch (TimeoutException e) { 62 | InvTweaks.logInGameErrorStatic("invtweaks.sort.releaseitem.error", e); 63 | } 64 | } 65 | } catch (Exception e) { 66 | log.severe(e.getMessage()); 67 | } 68 | 69 | // Refresh config 70 | cfgManager.makeSureConfigurationIsLoaded(); 71 | 72 | // Display menu 73 | obf.displayGuiScreen(new InvTweaksGuiSettings(minecraft, obf.getCurrentScreen(), config)); 74 | return true; 75 | } else { 76 | return false; 77 | } 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksConst.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.io.File; 4 | import java.util.logging.Level; 5 | 6 | import net.minecraft.client.Minecraft; 7 | 8 | public class InvTweaksConst { 9 | 10 | // Mod version 11 | public static final String MOD_VERSION = "1.50 (1.4.7)"; 12 | 13 | // Mod tree version 14 | // Change only when the tree evolves significantly enough to need to override all configs 15 | public static final String TREE_VERSION = "1.4.0"; 16 | 17 | // Timing constants 18 | public static final int RULESET_SWAP_DELAY = 1000; 19 | public static final int AUTO_REFILL_DELAY = 200; 20 | public static final int AUTO_REFILL_DAMAGE_TRESHOLD = 5; 21 | public static final int POLLING_DELAY = 3; 22 | public static final int POLLING_TIMEOUT = 1500; 23 | public static final int CHEST_ALGORITHM_SWAP_MAX_INTERVAL = 2000; 24 | public static final int TOOLTIP_DELAY = 800; 25 | public static final int INTERRUPT_DELAY = 300; 26 | 27 | // File constants 28 | public static final String MINECRAFT_DIR = getMinecraftDir(); 29 | public static final String MINECRAFT_CONFIG_DIR = MINECRAFT_DIR + "config" + File.separatorChar; 30 | public static final String CONFIG_PROPS_FILE = MINECRAFT_CONFIG_DIR + "InvTweaks.cfg"; 31 | public static final String CONFIG_RULES_FILE = MINECRAFT_CONFIG_DIR + "InvTweaksRules.txt"; 32 | public static final String CONFIG_TREE_FILE = MINECRAFT_CONFIG_DIR + "InvTweaksTree.txt"; 33 | public static final String OLD_CONFIG_TREE_FILE = MINECRAFT_CONFIG_DIR + "InvTweaksTree.xml"; 34 | public static final String OLDER_CONFIG_RULES_FILE = MINECRAFT_DIR + "InvTweaksRules.txt"; 35 | public static final String OLDER_CONFIG_TREE_FILE = MINECRAFT_DIR + "InvTweaksTree.txt"; 36 | public static final String DEFAULT_CONFIG_FILE = "DefaultConfig.dat"; 37 | public static final String DEFAULT_CONFIG_TREE_FILE = "DefaultTree.dat"; 38 | public static final String HELP_URL = "http://modding.kalam-alami.net/invtweaks"; 39 | 40 | // Global mod constants 41 | public static final String INGAME_LOG_PREFIX = "InvTweaks: "; 42 | public static final Level DEFAULT_LOG_LEVEL = Level.WARNING; 43 | public static final Level DEBUG = Level.INFO; 44 | public static final int JIMEOWAN_ID = 54696386; // Used in GUIs 45 | 46 | // Minecraft constants 47 | public static final int INVENTORY_SIZE = 36; 48 | public static final int INVENTORY_ROW_SIZE = 9; 49 | public static final int CHEST_ROW_SIZE = INVENTORY_ROW_SIZE; 50 | public static final int DISPENSER_ROW_SIZE = 3; 51 | public static final int INVENTORY_HOTBAR_SIZE = INVENTORY_ROW_SIZE; 52 | public static final int PLAYER_INVENTORY_WINDOW_ID = 0; 53 | public static final int SLOW_SORTING_DELAY = 30; 54 | 55 | /** 56 | * Returns the Minecraft folder ensuring: 57 | * - It is an absolute path 58 | * - It ends with a folder separator 59 | */ 60 | public static String getMinecraftDir() { 61 | String absolutePath = Minecraft.getMinecraftDir().getAbsolutePath(); 62 | if (absolutePath.endsWith(".")) { 63 | return absolutePath.substring(0, absolutePath.length() - 1); 64 | } 65 | if (absolutePath.endsWith(File.separator)) { 66 | return absolutePath; 67 | } else { 68 | return absolutePath + File.separatorChar; 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/ko_KR.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' \ud65c\uc131\ud654 3 | invtweaks.loadconfig.invalidkeywords=\uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 \ud0a4\uc6cc\ub4dc \ubc1c\uacac 4 | invtweaks.loadconfig.done=\uad6c\uc131 \ubd88\ub7ec\uc624\uae30 \uc644\ub8cc. 5 | invtweaks.propsfile.loaded=\ubaa8\ub4dc \uc18d\uc131 \ubd88\ub7ec\uc624\uae30 \uc644\ub8cc 6 | invtweaks.sort.inventory.error=[2] \uc778\ubca4\ud1a0\ub9ac\ub97c \uc815\ub82c\ud558\uc9c0 \ubabb\ud558\uc600\uc2b5\ub2c8\ub2e4. 7 | invtweaks.sort.chest.error=[3] \ucee8\ud14c\uc774\ub108 \uc815\ub82c\uc744 \ud558\uc9c0 \ubabb\ud558\uc600\uc2b5\ub2c8\ub2e4. 8 | invtweaks.button.settings.tooltip=\uc778\ubca4\ud1a0\ub9ac \uc124\uc815 9 | invtweaks.button.chest1.tooltip=\uae30\ubcf8 \uc815\ub82c 10 | invtweaks.button.chest2.tooltip=\uc5f4 \uc815\ub82c 11 | invtweaks.button.chest3.tooltip=\ud589 \uc815\ub82c 12 | invtweaks.settings.title=\uc778\ubca4\ud1a0\ub9ac\uc640 \ucc3d\uace0 \uc124\uc815 13 | invtweaks.settings.on=\ucf1c\uae30 14 | invtweaks.settings.off=\ub044\uae30 15 | invtweaks.settings.middleclick=\ub9c8\uc6b0\uc2a4 \uac00\uc6b4\ub370 \ud074\ub9ad 16 | invtweaks.settings.middleclick.tooltip=\ub9c8\uc6b0\uc2a4 \uac00\uc6b4\ub370 \ud074\ub9ad\uc744 \uc0ac\uc6a9\ud558\uc5ec\n\uc815\ub82c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. 17 | invtweaks.settings.chestbuttons=\uc0c1\uc790 \ubc84\ud2bc 18 | invtweaks.settings.shortcuts=\ub2e8\ucd95\ud0a4 19 | invtweaks.settings.autorefill=\uc790\ub3d9 \ucc44\uc6b0\uae30 20 | invtweaks.settings.moreoptions=\uae30\ud0c0 \uc635\uc158... 21 | invtweaks.settings.rulesfile=\uc815\ub82c \uaddc\uce59 \ud30c\uc77c \uc5f4\uae30... 22 | invtweaks.settings.rulesfile.error=[8] \uaddc\uce59 \ud30c\uc77c\uc744 \uc5f4\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4. 23 | invtweaks.settings.treefile=\uc544\uc774\ud15c \ud2b8\ub9ac \ud30c\uc77c \uc5f4\uae30... 24 | invtweaks.settings.treefile.error=[9] \ud2b8\ub9ac \ud30c\uc77c\uc744 \uc5f4\uc9c0 \ubabb\ud558\uc600\uc2b5\ub2c8\ub2e4. 25 | invtweaks.settings.onlinehelp=\ube0c\ub77c\uc6b0\uc800\ub97c \uc774\uc6a9\ud574 \ub3c4\uc6c0\ub9d0 \uc5f4\uae30... 26 | invtweaks.settings.onlinehelp.error=[10] \ub3c4\uc6c0\ub9d0 \ud30c\uc77c \uc5f4\uae30 \uc2e4\ud328 27 | invtweaks.settings.exit=\uc644\ub8cc 28 | invtweaks.settings.advanced.sortonpickup=\ub4e4\uace0\uc788\ub294 \uc544\uc774\ud15c \uc815\ub82c 29 | invtweaks.settings.advanced.sortonpickup.soloonly=\uc2f1\uae00\ud50c\ub808\uc774\uc5b4\ub9cc 30 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=\uc2f1\uae00\ud50c\ub808\uc774\uc5b4 \ubaa8\ub4dc\ub9cc \uac00\ub2a5 31 | invtweaks.settings.advanced.sounds=\uc18c\ub9ac \uc0ac\uc6a9 32 | invtweaks.help.shortcuts.title=\ub2e8\ucd95\ud0a4 \ub3c4\uc6c0\ub9d0 33 | invtweaks.help.shortcuts.click=\ud074\ub9ad 34 | invtweaks.help.shortcuts.or=\ub610\ub294 35 | invtweaks.help.shortcuts.onestack=\ud55c \uc2a4\ud0dd \uc774\ub3d9 36 | invtweaks.help.shortcuts.oneitem=\ud55c \uc544\uc774\ud15c \uc774\ub3d9 37 | invtweaks.help.shortcuts.allitems=\ub3d9\uc77c\ud55c \uc720\ud615\uc758 \ubaa8\ub4e0 \ud56d\ubaa9 \uc774\ub3d9 38 | invtweaks.help.shortcuts.everything=\ubaa8\ub450 \uc774\ub3d9 39 | invtweaks.help.shortcuts.emptyslot=\ube48 \uc2ac\ub86f\uc73c\ub85c \uc774\ub3d9 40 | invtweaks.help.shortcuts.drop=\ub4dc\ub86d 41 | invtweaks.help.shortcuts.forward=(\ub4a4\ub85c) 42 | invtweaks.keyboardfix.recover=\ubcf5\uad6c\ud558\uc600\uc2b5\ub2c8\ub2e4. \uadf8\uac83\uc5d0 \ub300\ud574 \uc8c4\uc1a1\ud569\ub2c8\ub2e4. 43 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiSettingsAbstract.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.List; 4 | import java.util.logging.Logger; 5 | 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.src.GuiButton; 8 | import net.minecraft.src.GuiScreen; 9 | import net.minecraft.src.InvTweaksObfuscation; 10 | 11 | import org.lwjgl.input.Keyboard; 12 | import org.lwjgl.util.Point; 13 | 14 | 15 | /** 16 | * The inventory and chest settings menu. 17 | * 18 | * @author Jimeo Wan 19 | * 20 | */ 21 | public abstract class InvTweaksGuiSettingsAbstract extends GuiScreen { 22 | 23 | protected static final Logger log = Logger.getLogger("InvTweaks"); 24 | 25 | protected static String ON; 26 | protected static String OFF; 27 | protected static String DISABLE_CI; 28 | 29 | protected Minecraft mc; 30 | protected InvTweaksObfuscation obf; 31 | protected InvTweaksConfig config; 32 | protected GuiScreen parentScreen; 33 | 34 | protected static String LABEL_DONE; 35 | protected final static int ID_DONE = 200; 36 | 37 | public InvTweaksGuiSettingsAbstract(Minecraft mc, GuiScreen parentScreen, 38 | InvTweaksConfig config) { 39 | 40 | LABEL_DONE = InvTweaksLocalization.get("invtweaks.settings.exit"); 41 | ON = ": " + InvTweaksLocalization.get("invtweaks.settings.on"); 42 | OFF = ": " + InvTweaksLocalization.get("invtweaks.settings.off"); 43 | DISABLE_CI = ": " + InvTweaksLocalization.get("invtweaks.settings.disableci"); 44 | 45 | this.mc = mc; 46 | this.obf = new InvTweaksObfuscation(mc); 47 | this.parentScreen = parentScreen; 48 | this.config = config; 49 | } 50 | 51 | public void initGui() { 52 | 53 | List controlList = obf.getControlList(this); 54 | Point p = new Point(); 55 | moveToButtonCoords(1, p); 56 | controlList.add(new GuiButton(ID_DONE, p.getX() + 55, obf.getWindowHeight(this) / 6 + 168, LABEL_DONE)); // GuiButton 57 | 58 | // Save control list 59 | obf.setControlList(this, controlList); 60 | 61 | } 62 | 63 | public void drawScreen(int i, int j, float f) { 64 | drawDefaultBackground(); 65 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.settings.title"), obf.getWindowWidth(this) / 2, 20, 0xffffff); 66 | super.drawScreen(i, j, f); 67 | } 68 | 69 | protected void actionPerformed(GuiButton guibutton) { 70 | if (obf.getId(guibutton) == ID_DONE) { 71 | obf.displayGuiScreen(parentScreen); 72 | } 73 | } 74 | 75 | protected void keyTyped(char c, int keyCode) { 76 | if (keyCode == Keyboard.KEY_ESCAPE) { 77 | obf.displayGuiScreen(parentScreen); 78 | } 79 | } 80 | 81 | protected void moveToButtonCoords(int buttonOrder, Point p) { 82 | p.setX(obf.getWindowWidth(this) / 2 - 155 + ((buttonOrder+1) % 2) * 160); 83 | p.setY(obf.getWindowHeight(this) / 6 + (buttonOrder / 2) * 24); 84 | } 85 | 86 | protected void toggleBooleanButton(GuiButton guibutton, String property, String label) { 87 | Boolean enabled = !new Boolean(config.getProperty(property)); 88 | config.setProperty(property, enabled.toString()); 89 | obf.setDisplayString(guibutton, computeBooleanButtonLabel(property, label)); 90 | } 91 | 92 | protected String computeBooleanButtonLabel(String property, String label) { 93 | String propertyValue = config.getProperty(property); 94 | if (propertyValue.equals(InvTweaksConfig.VALUE_CI_COMPATIBILITY)) { 95 | return label + DISABLE_CI; 96 | } else { 97 | Boolean enabled = new Boolean(propertyValue); 98 | return label + ((enabled) ? ON : OFF); 99 | } 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksContainerSectionManager.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.List; 4 | import java.util.concurrent.TimeoutException; 5 | 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.src.Container; 8 | import net.minecraft.src.ItemStack; 9 | import net.minecraft.src.Slot; 10 | 11 | /** 12 | * Allows to perform various operations on a single section of 13 | * the inventory and/or containers. Works in both single and multiplayer. 14 | * 15 | * @author Jimeo Wan 16 | * 17 | */ 18 | public class InvTweaksContainerSectionManager { 19 | 20 | private InvTweaksContainerManager containerMgr; 21 | private InvTweaksContainerSection section; 22 | 23 | public InvTweaksContainerSectionManager(Minecraft mc, InvTweaksContainerSection section) throws Exception { 24 | this(new InvTweaksContainerManager(mc), section); 25 | } 26 | 27 | public void setClickDelay(int delay) { 28 | this.containerMgr.setClickDelay(delay); 29 | } 30 | 31 | public InvTweaksContainerSectionManager(InvTweaksContainerManager manager, InvTweaksContainerSection section) throws Exception { 32 | this.containerMgr = manager; 33 | this.section = section; 34 | if (!containerMgr.hasSection(section)) { 35 | throw new Exception("Section not available"); 36 | } 37 | } 38 | 39 | public boolean move(int srcIndex, int destIndex) throws TimeoutException { 40 | return containerMgr.move(section, srcIndex, section, destIndex); 41 | } 42 | 43 | public boolean moveSome(int srcIndex, int destIndex, int amount) throws TimeoutException { 44 | return containerMgr.moveSome(section, srcIndex, section, destIndex, amount); 45 | } 46 | 47 | public boolean drop(int srcIndex) throws TimeoutException { 48 | return containerMgr.drop(section, srcIndex); 49 | } 50 | 51 | public boolean dropSome(int srcIndex, int amount) throws TimeoutException { 52 | return containerMgr.dropSome(section, srcIndex, amount); 53 | } 54 | 55 | public boolean putHoldItemDown(int destIndex) throws TimeoutException { 56 | return containerMgr.putHoldItemDown(section, destIndex); 57 | } 58 | 59 | public void leftClick(int index) throws TimeoutException { 60 | containerMgr.leftClick(section, index); 61 | } 62 | 63 | public void rightClick(int index) throws TimeoutException { 64 | containerMgr.rightClick(section, index); 65 | } 66 | 67 | public void click(int index, boolean rightClick) throws TimeoutException { 68 | containerMgr.click(section, index, rightClick); 69 | } 70 | 71 | public List getSlots() { 72 | return containerMgr.getSlots(section); 73 | } 74 | 75 | public int getSize() { 76 | return containerMgr.getSize(section); 77 | } 78 | 79 | public int getFirstEmptyIndex() { 80 | return containerMgr.getFirstEmptyIndex(section); 81 | } 82 | 83 | public boolean isSlotEmpty(int slot) { 84 | return containerMgr.isSlotEmpty(section, slot); 85 | } 86 | 87 | public Slot getSlot(int index) { 88 | return containerMgr.getSlot(section, index); 89 | } 90 | 91 | public int getSlotIndex(int slotNumber) { 92 | if (isSlotInSection(slotNumber)) { 93 | return containerMgr.getSlotIndex(slotNumber); 94 | } 95 | else { 96 | return -1; 97 | } 98 | } 99 | 100 | public boolean isSlotInSection(int slotNumber) { 101 | return containerMgr.getSlotSection(slotNumber) == section; 102 | } 103 | 104 | public ItemStack getItemStack(int index) throws NullPointerException, IndexOutOfBoundsException { 105 | return containerMgr.getItemStack(section, index); 106 | } 107 | 108 | public Container getContainer() { 109 | return containerMgr.getContainer(); 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/es_ES.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' habilitado 3 | invtweaks.loadconfig.refresh.error=[1] Error al actualizar las propiedades del archivo 4 | invtweaks.loadconfig.invalidkeywords=Palabras clave inv\u00e1lidas 5 | invtweaks.loadconfig.done=Configurac\u00edon cargada. 6 | invtweaks.propsfile.loaded=Propiedades del mod cargadas 7 | invtweaks.extract.create.error=[16] El mod no funcionar\u00e1, porque fall\u00f3 %s de la creaci\u00f3n\! 8 | invtweaks.sort.inventory.error=[2] Error al ordenar el inventario 9 | invtweaks.sort.chest.error=[3] Error al ordenar el contenedor 10 | invtweaks.sort.autorefill.error=[4] Error al activar la recarga autom\u00e1tica 11 | invtweaks.sort.releaseitem.error=[5] Error al liberar el elemento 12 | invtweaks.shortcut.error=[6] Error al activar el acceso directo 13 | invtweaks.pickup.error=[7] Error al mover la pila recogida 14 | invtweaks.button.settings.tooltip=Ajustes del inventario 15 | invtweaks.button.chest1.tooltip=Orden predeterminado 16 | invtweaks.button.chest2.tooltip=Ordenar por columnas 17 | invtweaks.button.chest3.tooltip=Ordenar en filas 18 | invtweaks.settings.title=Ajustes de inventario y cofres 19 | invtweaks.settings.on=ON 20 | invtweaks.settings.off=OFF 21 | invtweaks.settings.disableci=Deshabilitar CI 22 | invtweaks.settings.disableci.tooltip=En conflicto con el inventario 23 | invtweaks.settings.middleclick=Clic central 24 | invtweaks.settings.middleclick.tooltip=Permite ordenarlo\nmediante el clic central 25 | invtweaks.settings.chestbuttons=Botones del cofre 26 | invtweaks.settings.chestbuttons.tooltip=Agrega tres botones en\nlos cofres para ordenarlos 27 | invtweaks.settings.shortcuts=Atajos 28 | invtweaks.settings.shortcuts.tooltip=Permite a varios atajos\npara mover \u00edtems 29 | invtweaks.settings.autorefill=Recarga autom\u00e1tica 30 | invtweaks.settings.autorefill.tooltip=Reemplazar herramientas rotas y stacks vacios con nuevos desde tu inventario 31 | invtweaks.settings.moreoptions=M\u00e1s opciones... 32 | invtweaks.settings.moreoptions.tooltip=Cosas a\u00fan m\u00e1s Interesantes 33 | invtweaks.settings.rulesfile=Abrir el archivo de reglas de clasificaci\u00f3n... 34 | invtweaks.settings.rulesfile.error=[8] Error al abrir el archivo de reglas 35 | invtweaks.settings.treefile=Abrir el arbol de items... 36 | invtweaks.settings.treefile.error=[9] Error al abrir el archivo de \u00e1rbol 37 | invtweaks.settings.onlinehelp=Abrir la ayuda en el explorador... 38 | invtweaks.settings.onlinehelp.error=[10] Error al abrir la ayuda 39 | invtweaks.settings.pvpwarning.pt1=Nota\: En los servidores PvP la recarga autom\u00e1tica y auto-equiparte armaduras 40 | invtweaks.settings.pvpwarning.pt2=puede ser, tal vez, considerado uso de trampas. 41 | invtweaks.settings.exit=Hecho 42 | invtweaks.settings.advanced.sortonpickup=Clasificar en la recogida 43 | invtweaks.settings.advanced.sortonpickup.soloonly=Solo SP 44 | invtweaks.settings.advanced.sortonpickup.tooltip=Evita llenar la barra de acceso r\u00e1pido a\ntodo lo que usted toma 45 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=S\u00f3lo en el modo un jugador 46 | invtweaks.settings.advanced.autoequip=Auto-equipar armadura 47 | invtweaks.settings.advanced.autoequip.tooltip=Equipa el mejor blindaje\ndisponible al ordenar 48 | invtweaks.settings.advanced.sounds=Activar sonido 49 | invtweaks.settings.advanced.sounds.tooltip=Reproducir sonidos al ordenar o al activar la recarga autom\u00e1tica 50 | invtweaks.settings.advanced.mappingsfile=Abrir los mapas de atajo... 51 | invtweaks.settings.advanced.mappingsfile.error=[11] Fall\u00f3 abrir el archivo de mapas 52 | invtweaks.help.shortcuts.title=Ayuda de m\u00e9todos abreviados 53 | invtweaks.help.shortcuts.click=Click 54 | invtweaks.help.shortcuts.or=o 55 | invtweaks.help.shortcuts.onestack=Mover una pila 56 | invtweaks.help.shortcuts.oneitem=Mover un objeto 57 | invtweaks.help.shortcuts.allitems=Mover todos los objetos del mismo tipo 58 | invtweaks.help.shortcuts.everything=Mover todo 59 | invtweaks.help.shortcuts.hotbar=Mover a la barra de acceso r\u00e1pido 60 | invtweaks.help.shortcuts.emptyslot=Mover a un espacio vac\u00edo 61 | invtweaks.help.shortcuts.rightclick=(Cualquier acceso directo) + clic derecho en vez de izquierdo 62 | invtweaks.help.shortcuts.drop=Soltar 63 | invtweaks.help.shortcuts.craftall=Craftear todo al inventario 64 | invtweaks.help.shortcuts.craftone=Fabricar al inventario 65 | invtweaks.help.shortcuts.selectconfig=Selecciona una configuraci\u00f3n de orden 66 | invtweaks.help.shortcuts.forward=(Alrevez) 67 | invtweaks.keyboardfix.error=[12] Estoy teniendo problemas con el teclado 68 | invtweaks.keyboardfix.recover=Ya est\u00e1 solucionado, perd\u00f3n por las molestias. 69 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksItemTreeCategory.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | 4 | 5 | 6 | import java.util.ArrayList; 7 | import java.util.Collection; 8 | import java.util.HashMap; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.Vector; 12 | import java.util.logging.Logger; 13 | 14 | /** 15 | * Representation of a category in the item tree, i.e. a group of items. 16 | * @author Jimeo Wan 17 | * 18 | */ 19 | public class InvTweaksItemTreeCategory { 20 | 21 | private static final Logger log = Logger.getLogger("InvTweaks"); 22 | 23 | private final Map> items = 24 | new HashMap>(); 25 | private final Vector matchingItems = new Vector(); 26 | private final Vector subCategories = 27 | new Vector(); 28 | private String name; 29 | private int order = -1; 30 | 31 | public InvTweaksItemTreeCategory(String name) { 32 | this.name = (name != null) ? name.toLowerCase() : null; 33 | } 34 | 35 | public boolean contains(InvTweaksItemTreeItem item) { 36 | List storedItems = items.get(item.getId()); 37 | if (storedItems != null) { 38 | for (InvTweaksItemTreeItem storedItem : storedItems) { 39 | if (storedItem.equals(item)) 40 | return true; 41 | } 42 | } 43 | for (InvTweaksItemTreeCategory category : subCategories) { 44 | if (category.contains(item)) { 45 | return true; 46 | } 47 | } 48 | return false; 49 | } 50 | 51 | public void addCategory(InvTweaksItemTreeCategory category) { 52 | subCategories.add(category); 53 | } 54 | 55 | public void addItem(InvTweaksItemTreeItem item) { 56 | 57 | // Add item to category 58 | if (items.get(item.getId()) == null) { 59 | List itemList = new ArrayList(); 60 | itemList.add(item); 61 | items.put(item.getId(), itemList); 62 | } else { 63 | items.get(item.getId()).add(item); 64 | } 65 | matchingItems.add(item.getName()); 66 | 67 | // Categorie's order is defined by its lowest item order 68 | if (order == -1 || order > item.getOrder()) { 69 | order = item.getOrder(); 70 | } 71 | } 72 | 73 | public int getCategoryOrder() { 74 | if (this.order != -1) { 75 | return this.order; 76 | } else { 77 | int order; 78 | for (InvTweaksItemTreeCategory category : subCategories) { 79 | order = category.getCategoryOrder(); 80 | if (order != -1) 81 | return order; 82 | } 83 | return -1; 84 | } 85 | } 86 | 87 | public int findCategoryOrder(String keyword) { 88 | if (keyword.equals(name)) { 89 | return getCategoryOrder(); 90 | } else { 91 | int result; 92 | for (InvTweaksItemTreeCategory category : subCategories) { 93 | result = category.findCategoryOrder(keyword); 94 | if (result != -1) { 95 | return result; 96 | } 97 | } 98 | return -1; 99 | } 100 | } 101 | 102 | public int findKeywordDepth(String keyword) { 103 | if (name.equals(keyword)) { 104 | return 0; 105 | } else if (matchingItems.contains(keyword)) { 106 | return 1; 107 | } else { 108 | int result; 109 | for (InvTweaksItemTreeCategory category : subCategories) { 110 | result = category.findKeywordDepth(keyword); 111 | if (result != -1) { 112 | return result + 1; 113 | } 114 | } 115 | return -1; 116 | } 117 | } 118 | 119 | /** 120 | * Returns a references to all categories contained in this one. 121 | * 122 | * @return 123 | */ 124 | public Collection getSubCategories() { 125 | return subCategories; 126 | } 127 | 128 | public Collection> getItems() { 129 | return items.values(); 130 | } 131 | 132 | public String getName() { 133 | return name; 134 | } 135 | 136 | public String toString() { 137 | return name + " (" + subCategories.size() + 138 | " cats, " + items.size() + " items)"; 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/da_DK.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' aktiveret 3 | invtweaks.loadconfig.refresh.error=[1]Kunne ikke opdatere egenskaber fra filen 4 | invtweaks.loadconfig.invalidkeywords=Ugyldig n\u00f8gleord fundet 5 | invtweaks.loadconfig.filemissing=mangler, opretter den standarde. 6 | invtweaks.loadconfig.done=Konfiguration indl\u00e6st. 7 | invtweaks.propsfile.loaded=Tilf\u00f8jelsets egenskaber indl\u00e6st 8 | invtweaks.propsfile.error=[14]Kunne ikke lave egenskaberfilen 9 | invtweaks.extract.find.error=[15]Moddet vile ikke virke, fordi %s ikke kan findes\! 10 | invtweaks.extract.create.error=[16]Moddet vil ikke virke, fordi %s ikke kunne oprettes\! 11 | invtweaks.sort.inventory.error=[2]Kunne ikke sortere dine ting 12 | invtweaks.sort.chest.error=[3]Kunne ikke sortere beholder 13 | invtweaks.sort.autorefill.error=[4]Kunne ikke udl\u00f8se auto-fyld 14 | invtweaks.sort.releaseitem.error=[5]Kunne ikke slippe tingen 15 | invtweaks.shortcut.error=[6]Kunne ikke udl\u00f8se genvejen 16 | invtweaks.pickup.error=[7]Kunne ikke flytte den valgte bunke 17 | invtweaks.button.settings.tooltip=Indstillinger for taske 18 | invtweaks.button.chest1.tooltip=Standard sortering 19 | invtweaks.button.chest2.tooltip=Sorter i kolonner 20 | invtweaks.button.chest3.tooltip=Sorter i r\u00e6kker 21 | invtweaks.settings.title=Beholder- og kisteindstillinger 22 | invtweaks.settings.on=T\u00c6ND 23 | invtweaks.settings.off=SLUK 24 | invtweaks.settings.disableci=Deaktiver CI 25 | invtweaks.settings.disableci.tooltip=I konflikt med Convenient Inventory 26 | invtweaks.settings.middleclick=Musehjulsklik 27 | invtweaks.settings.middleclick.tooltip=Giver mulighed for at sortere ved musehjulsklik 28 | invtweaks.settings.chestbuttons=Kisteknapper 29 | invtweaks.settings.chestbuttons.tooltip=Tilf\u00f8jer 3 knapper ved kister for at sortere dem 30 | invtweaks.settings.shortcuts=Genveje 31 | invtweaks.settings.shortcuts.tooltip=Aktiverer forskellige genveje til at flytte ting rundt 32 | invtweaks.settings.autorefill=Auto-genopfyld 33 | invtweaks.settings.autorefill.tooltip=Erstatter \u00f8delagte v\u00e6rkt\u00f8jer & t\u00f8mte bundter med nye fra din beholder 34 | invtweaks.settings.moreoptions=Flere indstillinger... 35 | invtweaks.settings.moreoptions.tooltip=Endnu flere seje ting 36 | invtweaks.settings.rulesfile=\u00c5bn sorterings regelfilen... 37 | invtweaks.settings.rulesfile.error=Kunne ikke \u00e5bne regelfilen 38 | invtweaks.settings.treefile=\u00c5bn filen for hvordan ting skal sorteres... 39 | invtweaks.settings.treefile.error=[9]Kunne ikke \u00e5bne tr\u00e6-fil 40 | invtweaks.settings.onlinehelp=\u00c5bn hj\u00e6lp i browseren... 41 | invtweaks.settings.onlinehelp.error=[10]Kunne ikke \u00e5bne hj\u00e6lpen 42 | invtweaks.settings.pvpwarning.pt1=Bem\u00e6rk\: P\u00e5 PvP servere, auto-genopfyld & auto-ikl\u00e6d rustning 43 | invtweaks.settings.pvpwarning.pt2=indstillinger betragtes ofte for snyd\! 44 | invtweaks.settings.exit=F\u00e6rdig 45 | invtweaks.settings.advanced.sortonpickup=Sorter ved opsamling 46 | invtweaks.settings.advanced.sortonpickup.soloonly=Kun SP 47 | invtweaks.settings.advanced.sortonpickup.tooltip=Undg\u00e5r at fylde hurtigbaren med ting du samler op 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Kun n\u00e5r du spiller alene 49 | invtweaks.settings.advanced.autoequip=Auto-udstyr rustning 50 | invtweaks.settings.advanced.autoequip.tooltip=Ikl\u00e6d den bedste rustning tilg\u00e6ngeligt n\u00e5r du sorterer 51 | invtweaks.settings.advanced.sounds=Aktiver lyd 52 | invtweaks.settings.advanced.sounds.tooltip=Afspil lyde n\u00e5r du sorterer eller n\u00e5r auto-genfyld udl\u00f8ses 53 | invtweaks.settings.advanced.mappingsfile=\u00c5bn genvejsfilen 54 | invtweaks.settings.advanced.mappingsfile.error=[11]Fejl ved \u00e5bning af "mappings" fil 55 | invtweaks.help.shortcuts.title=Hj\u00e6lp til genveje 56 | invtweaks.help.shortcuts.click=Klik p\u00e5 57 | invtweaks.help.shortcuts.or=eller 58 | invtweaks.help.shortcuts.onestack=Flyt en bunke 59 | invtweaks.help.shortcuts.oneitem=Flyt en ting 60 | invtweaks.help.shortcuts.allitems=Flyt alle ting af samme type 61 | invtweaks.help.shortcuts.everything=Flyt alt 62 | invtweaks.help.shortcuts.hotbar=Flyt til hurtigskiftbar 63 | invtweaks.help.shortcuts.emptyslot=Flyt til tom plads 64 | invtweaks.help.shortcuts.rightclick=(Enhver genvej)+H\u00f8jreklik i stedet for venstreklik 65 | invtweaks.help.shortcuts.drop=Slip 66 | invtweaks.help.shortcuts.craftall=Lav alle til beholder 67 | invtweaks.help.shortcuts.craftone=Lav til beholder 68 | invtweaks.help.shortcuts.selectconfig=V\u00e6lg sorteringskonfiguration 69 | invtweaks.help.shortcuts.forward=(Tilbage) 70 | invtweaks.keyboardfix.error=[12]Jeg har problemer med tastaturet 71 | invtweaks.keyboardfix.recover=Ok, det er repareret, undskyld for det. 72 | invtweaks.modcompat.ci.error=[13]Kunne ikke styre kompatibilitet med "Convenient Inventory" 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/nl_NL.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' ingeschakeld 3 | invtweaks.loadconfig.refresh.error=[1] Vernieuwen gegevens in bestand mislukt 4 | invtweaks.loadconfig.invalidkeywords=Ongeldige trefwoorden gevonden 5 | invtweaks.loadconfig.filemissing=ontbrekend, een standaard maken. 6 | invtweaks.loadconfig.done=Configuratie geladen. 7 | invtweaks.propsfile.loaded=Mod eigenschappen geladen 8 | invtweaks.propsfile.error=[14] Mod eigenschappen bestand maken mislukt 9 | invtweaks.extract.find.error=[15] De mod zal niet werken, omdat %s niet gevonden is\! 10 | invtweaks.extract.create.error=[16] De mod zal niet werken, omdat het maken van %s is mislukt\! 11 | invtweaks.sort.inventory.error=[2] Sorteren inventaris mislukt 12 | invtweaks.sort.chest.error=[3] Sorteren container mislukt 13 | invtweaks.sort.autorefill.error=[4] Automatisch bijvullen mislukt 14 | invtweaks.sort.releaseitem.error=[5] Vrijlaten item mislukt 15 | invtweaks.shortcut.error=[6] Snelkoppeling activeren mislukt 16 | invtweaks.pickup.error=[7] Verplaatsen opgepakte stapel mislukt 17 | invtweaks.button.settings.tooltip=Inventaris instellingen 18 | invtweaks.button.chest1.tooltip=Standaard sorteren 19 | invtweaks.button.chest2.tooltip=Sorteer in kolommen 20 | invtweaks.button.chest3.tooltip=Sorteer in rijen 21 | invtweaks.settings.title=Inventaris en kist instellingen 22 | invtweaks.settings.on=AAN 23 | invtweaks.settings.off=UIT 24 | invtweaks.settings.disableci=Schakel CI uit 25 | invtweaks.settings.disableci.tooltip=In conflict met Convenient Inventory 26 | invtweaks.settings.middleclick=Midden klik 27 | invtweaks.settings.middleclick.tooltip=Staat het sorteren met middelste klik toe 28 | invtweaks.settings.chestbuttons=Kist knoppen 29 | invtweaks.settings.chestbuttons.tooltip=Voegt drie knoppen aan kisten toe om ze te sorteren 30 | invtweaks.settings.shortcuts=Sneltoetsen 31 | invtweaks.settings.shortcuts.tooltip=Schakel verschillende snelkoppelingen aan om items te verplaatsen 32 | invtweaks.settings.autorefill=Automatisch bijvullen 33 | invtweaks.settings.autorefill.tooltip=Vervangt gebroken gereedschap en leeggemaakte stapels met anderen uit je inventaris 34 | invtweaks.settings.moreoptions=Meer opties... 35 | invtweaks.settings.moreoptions.tooltip=Nog meer coole dingen 36 | invtweaks.settings.rulesfile=Open het bestand met de sorteerregels... 37 | invtweaks.settings.rulesfile.error=[8] Openen van bestand met regels mislukt 38 | invtweaks.settings.treefile=Open het item tree bestand... 39 | invtweaks.settings.treefile.error=[9] Tree bestand openen mislukt 40 | invtweaks.settings.onlinehelp=Help openen in browser... 41 | invtweaks.settings.onlinehelp.error=[10] Help openen mislukt 42 | invtweaks.settings.pvpwarning.pt1=Opmerking\: Op een PvP server kan automatisch bijvullen en auto-uitrusten van pantser 43 | invtweaks.settings.pvpwarning.pt2=gezien worden als valsspelen\! 44 | invtweaks.settings.exit=Klaar 45 | invtweaks.settings.advanced.sortonpickup=Sorteer bij oppakken 46 | invtweaks.settings.advanced.sortonpickup.soloonly=Alleen SP 47 | invtweaks.settings.advanced.sortonpickup.tooltip=Vermijdt de hotbar te vullen met alles wat je oppakt 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Alleen in single-player modus 49 | invtweaks.settings.advanced.autoequip=Auto-uitrusten pantser 50 | invtweaks.settings.advanced.autoequip.tooltip=Rust je uit met het beste pantser bij het sorteren 51 | invtweaks.settings.advanced.sounds=Schakel het geluid in 52 | invtweaks.settings.advanced.sounds.tooltip=Speel een geluid af bij het sorteren of bij het automatisch vullen 53 | invtweaks.settings.advanced.mappingsfile=Open het snelkoppelingen toewijzing bestand... 54 | invtweaks.settings.advanced.mappingsfile.error=[11] Toewijzingen bestand openen mislukt 55 | invtweaks.help.shortcuts.title=Sneltoetsen 56 | invtweaks.help.shortcuts.click=Klik 57 | invtweaks.help.shortcuts.or=of 58 | invtweaks.help.shortcuts.onestack=Verplaats een stapel 59 | invtweaks.help.shortcuts.oneitem=Verplaats een item 60 | invtweaks.help.shortcuts.allitems=Verplaats alle items van hetzelfde type 61 | invtweaks.help.shortcuts.everything=Verplaats alles 62 | invtweaks.help.shortcuts.hotbar=Verplaats naar hotbar 63 | invtweaks.help.shortcuts.emptyslot=Verplaats naar leeg slot 64 | invtweaks.help.shortcuts.rightclick=(Elke snelkoppeling) + Rechter in plaats van linker muisknop 65 | invtweaks.help.shortcuts.drop=Laat vallen 66 | invtweaks.help.shortcuts.craftall=Maak alles naar inventaris 67 | invtweaks.help.shortcuts.craftone=Maak naar inventaris 68 | invtweaks.help.shortcuts.selectconfig=Selecteer sorteer configuratie 69 | invtweaks.help.shortcuts.forward=(Achterstevoren) 70 | invtweaks.keyboardfix.error=[12] Ik heb problemen met het toetsenbord 71 | invtweaks.keyboardfix.recover=Ok het is gemaakt, sorry daarvoor 72 | invtweaks.modcompat.ci.error=[13] 'Convenient Inventory' comptabiliteit beheren mislukt 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/pt_BR.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' Ativado 3 | invtweaks.loadconfig.refresh.error=[1] Falha ao atualizar as propriedades de arquivo 4 | invtweaks.loadconfig.invalidkeywords=Palavras-chave inv\u00e1lidas encontradas 5 | invtweaks.loadconfig.filemissing=faltando, criando um padr\u00e3o. 6 | invtweaks.loadconfig.done=Configura\u00e7\u00e3o carregada. 7 | invtweaks.propsfile.loaded=Propriedades do mod carregado 8 | invtweaks.propsfile.error=[14] Falha ao criar o arquivo de propriedades do mod 9 | invtweaks.extract.find.error=[15] O mod n\u00e3o funcionar\u00e1, porque %s n\u00e3o pode ser encontrada\! 10 | invtweaks.extract.create.error=[16] O mod n\u00e3o funcionar\u00e1 porque a cria\u00e7\u00e3o %s falhou\! 11 | invtweaks.sort.inventory.error=[2] Falha ao ordenar invent\u00e1rio 12 | invtweaks.sort.chest.error=[3] Falha ao ordenar recipiente 13 | invtweaks.sort.autorefill.error=[4] Falha ao acionar auto-recarga 14 | invtweaks.sort.releaseitem.error=[5] Falha ao liberar o item 15 | invtweaks.shortcut.error=[6] Falha ao acionar atalho 16 | invtweaks.pickup.error=[7] Falha ao mover pilha retirada 17 | invtweaks.button.settings.tooltip=configura\u00e7\u00f5es de invent\u00e1rio 18 | invtweaks.button.chest1.tooltip=classifica\u00e7\u00e3o padr\u00e3o 19 | invtweaks.button.chest2.tooltip=Ordenar em colunas 20 | invtweaks.button.chest3.tooltip=Ordenar em linhas 21 | invtweaks.settings.title=Ajustes de invent\u00e1rio e ba\u00fas 22 | invtweaks.settings.on=Ligado 23 | invtweaks.settings.off=Desligado 24 | invtweaks.settings.key=Tecla de ordena\u00e7\u00e3o\: 25 | invtweaks.settings.disableci=Desativar CI 26 | invtweaks.settings.disableci.tooltip=Em conflito com "Convenient Inventory" 27 | invtweaks.settings.middleclick=Clique do meio 28 | invtweaks.settings.middleclick.tooltip=Permite classificar usando o clique do meio 29 | invtweaks.settings.chestbuttons=bot\u00f5es do ba\u00fa 30 | invtweaks.settings.chestbuttons.tooltip=Adiciona tr\u00eas bot\u00f5es aos ba\u00fas para classific\u00e1-los 31 | invtweaks.settings.shortcuts=Atalhos 32 | invtweaks.settings.shortcuts.tooltip=Permite v\u00e1rios atalhos para mover itens 33 | invtweaks.settings.autorefill=Auto-recarga 34 | invtweaks.settings.autorefill.tooltip=Substitui ferramentas quebradas e pilhas vazias com os outros de seu invent\u00e1rio 35 | invtweaks.settings.moreoptions=Mais op\u00e7\u00f5es... 36 | invtweaks.settings.moreoptions.tooltip=Ainda mais coisas legais 37 | invtweaks.settings.rulesfile=Abra o arquivo de regras de classifica\u00e7\u00e3o... 38 | invtweaks.settings.rulesfile.error=[8] Falha ao abrir o arquivo de regras 39 | invtweaks.settings.treefile=Abra o arquivo de \u00e1rvore de itens... 40 | invtweaks.settings.treefile.error=[9] Falha ao abrir o arquivo de \u00e1rvore 41 | invtweaks.settings.onlinehelp=Abra ajudar no navegador... 42 | invtweaks.settings.onlinehelp.error=[10] Falha ao abrir a ajuda 43 | invtweaks.settings.pvpwarning.pt1=Note\: Em servidores PvP, a op\u00e7\u00e3o de armadura de auto-recarga e auto-equip 44 | invtweaks.settings.pvpwarning.pt2=s\u00e3o muitas vezes considerados cheating\! 45 | invtweaks.settings.exit=Feito 46 | invtweaks.settings.advanced.sortonpickup=Ordenar ao retirar 47 | invtweaks.settings.advanced.sortonpickup.soloonly=Somente SP 48 | invtweaks.settings.advanced.sortonpickup.tooltip=Evitar a preencher o hotbar com tudo o que voc\u00ea pega 49 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Apenas no modo single player 50 | invtweaks.settings.advanced.autoequip=Auto-equipar armadura 51 | invtweaks.settings.advanced.autoequip.tooltip=Equipa a melhor armadura dispon\u00edvel ao ordenar 52 | invtweaks.settings.advanced.sounds=ativar som 53 | invtweaks.settings.advanced.sounds.tooltip=Reproduzir sons ao ordenar ou quando auto-recarga \u00e9 acionado 54 | invtweaks.settings.advanced.mappingsfile=Abra o arquivo de atalhos mapeados... 55 | invtweaks.settings.advanced.mappingsfile.error=[11] Falha ao abrir o arquivo de mapeamentos 56 | invtweaks.help.shortcuts.title=Atalhos de ajudar 57 | invtweaks.help.shortcuts.click=clique 58 | invtweaks.help.shortcuts.or=ou 59 | invtweaks.help.shortcuts.onestack=Mover uma pilha 60 | invtweaks.help.shortcuts.oneitem=Mover um item 61 | invtweaks.help.shortcuts.allitems=Mover todos os itens do mesmo tipo 62 | invtweaks.help.shortcuts.everything=mover tudo 63 | invtweaks.help.shortcuts.hotbar=Mover para hotbar 64 | invtweaks.help.shortcuts.emptyslot=Mover para slot vazio 65 | invtweaks.help.shortcuts.rightclick=(Qualquer atalho) + direito em vez de clique esquerdo 66 | invtweaks.help.shortcuts.drop=largar 67 | invtweaks.help.shortcuts.craftall=Todo o craft para o invent\u00e1rio 68 | invtweaks.help.shortcuts.craftone=Craft para o invent\u00e1rio 69 | invtweaks.help.shortcuts.selectconfig=Selecione configura\u00e7\u00e3o de ordena\u00e7\u00e3o 70 | invtweaks.help.shortcuts.forward=(para tr\u00e1s) 71 | invtweaks.keyboardfix.error=[12] Estou tendo problemas com o teclado 72 | invtweaks.keyboardfix.recover=Ok reparado, desculpe por isso. 73 | invtweaks.modcompat.ci.error=[13] Falha para gerenciar compatibilidade "Convenient\u00a0Inventory" 74 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/pt_PT.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' ativado 3 | invtweaks.loadconfig.refresh.error=[1] Falha ao atualizar propriedades de ficheiro 4 | invtweaks.loadconfig.invalidkeywords=Palavras chave inv\u00e1lidas eliminadas 5 | invtweaks.loadconfig.filemissing=em falta, criando um padr\u00e3o. 6 | invtweaks.loadconfig.done=Configura\u00e7\u00e3o carregada. 7 | invtweaks.propsfile.loaded=Propriedades do mod carregadas 8 | invtweaks.propsfile.error=[14] Falha ao criar o ficheiro de propriedades do mod 9 | invtweaks.extract.find.error=[15] O mod n\u00e3o funcionar\u00e1 porque %s n\u00e3o p\u00f4de ser encontrado\! 10 | invtweaks.extract.create.error=[16] O mod n\u00e3o funcionar\u00e1 porque a cria\u00e7\u00e3o de %s falhou\! 11 | invtweaks.sort.inventory.error=[2] Falha ao ordenar invent\u00e1rio 12 | invtweaks.sort.chest.error=[3] Falha ao ordenar recipiente 13 | invtweaks.sort.autorefill.error=[4] Falha ao ativar a auto-recarga 14 | invtweaks.sort.releaseitem.error=[5] Falha ao libertar o item 15 | invtweaks.shortcut.error=[6] Falha ao acionar o atalho 16 | invtweaks.pickup.error=[7] Falha ao mover a pilha apanhada 17 | invtweaks.button.settings.tooltip=Configurar o invent\u00e1rio 18 | invtweaks.button.chest1.tooltip=Ordena\u00e7\u00e3o padr\u00e3o 19 | invtweaks.button.chest2.tooltip=Ordenar por colunas 20 | invtweaks.button.chest3.tooltip=Ordenar por linhas 21 | invtweaks.settings.title=Configurar invent\u00e1rio e ba\u00fas 22 | invtweaks.settings.on=Ligado 23 | invtweaks.settings.off=Desligado 24 | invtweaks.settings.key=Tecla de atalho para ordenar\: 25 | invtweaks.settings.disableci=Desativar CI 26 | invtweaks.settings.disableci.tooltip=Em conflito com "Convenient Inventory" 27 | invtweaks.settings.middleclick=Clique do meio 28 | invtweaks.settings.middleclick.tooltip=Permite re-ordenar usando o clique do meio 29 | invtweaks.settings.chestbuttons=Bot\u00f5es de ba\u00fa 30 | invtweaks.settings.chestbuttons.tooltip=Adiciona tr\u00eas bot\u00f5es aos ba\u00fas para os ordenar 31 | invtweaks.settings.shortcuts=Atalhos 32 | invtweaks.settings.shortcuts.tooltip=Ativa v\u00e1rios atalhos para mover itens 33 | invtweaks.settings.autorefill=Auto-recarga 34 | invtweaks.settings.autorefill.tooltip=Substitui ferramentas partidas e pilhas vazias com outras no teu invent\u00e1rio 35 | invtweaks.settings.moreoptions=Mais op\u00e7\u00f5es... 36 | invtweaks.settings.moreoptions.tooltip=Ainda mais coisas fixes 37 | invtweaks.settings.rulesfile=Abrir o ficheiro de regras de classifica\u00e7\u00e3o... 38 | invtweaks.settings.rulesfile.error=[8] Falha ao abrir o ficheiro de regras de classifica\u00e7\u00e3o 39 | invtweaks.settings.treefile=Abrir o ficheiro da \u00e1rvore de itens... 40 | invtweaks.settings.treefile.error=[9] Falha ao abrir o ficheiro da \u00e1rvore 41 | invtweaks.settings.onlinehelp=Abrir a ajuda no navegador... 42 | invtweaks.settings.onlinehelp.error=[10] Falha ao abrir ajuda 43 | invtweaks.settings.pvpwarning.pt1=Nota\: Em servidores PvP, a auto-recarga e o equipamento autom\u00e1tico 44 | invtweaks.settings.pvpwarning.pt2=s\u00e3o normalmente considerados batota\! 45 | invtweaks.settings.exit=Conclu\u00eddo 46 | invtweaks.settings.advanced.sortonpickup=Ordenar ao apanhar 47 | invtweaks.settings.advanced.sortonpickup.soloonly=Apenas SP 48 | invtweaks.settings.advanced.sortonpickup.tooltip=Evita encher a hotbar com tudo que \u00e9 apanhado 49 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Apenas no modo de Um Jogador 50 | invtweaks.settings.advanced.autoequip=Equipar automaticamente armadura 51 | invtweaks.settings.advanced.autoequip.tooltip=Equipar a melhor armadura quando se ordena 52 | invtweaks.settings.advanced.sounds=Ativar som 53 | invtweaks.settings.advanced.sounds.tooltip=Tocar sons quando se ordena ou quando a auto-recarga \u00e9 ativada 54 | invtweaks.settings.advanced.mappingsfile=Abrir o ficheiro de mapeamento dos atalhos... 55 | invtweaks.settings.advanced.mappingsfile.error=[11]Falha ao abrir ficheiro de mapeamentos 56 | invtweaks.help.shortcuts.title=Ajuda para atalhos 57 | invtweaks.help.shortcuts.click=Cliqua em 58 | invtweaks.help.shortcuts.or=ou 59 | invtweaks.help.shortcuts.onestack=Mover uma pilha 60 | invtweaks.help.shortcuts.oneitem=Mover um item 61 | invtweaks.help.shortcuts.allitems=Mover todos os itens do mesmo tipo 62 | invtweaks.help.shortcuts.everything=Mover tudo 63 | invtweaks.help.shortcuts.hotbar=Mover para hotbar 64 | invtweaks.help.shortcuts.emptyslot=Mover para espa\u00e7o vazio 65 | invtweaks.help.shortcuts.rightclick=(Qualquer atalho) + clique direito em vez de clique esquerdo 66 | invtweaks.help.shortcuts.drop=Largar 67 | invtweaks.help.shortcuts.craftall=Construir tudo para o invent\u00e1rio 68 | invtweaks.help.shortcuts.craftone=Construir para o invent\u00e1rio 69 | invtweaks.help.shortcuts.selectconfig=Seleciona a configura\u00e7\u00e3o de classifica\u00e7\u00e3o 70 | invtweaks.help.shortcuts.forward=(Para tr\u00e1s) 71 | invtweaks.keyboardfix.error=[12] Estou a ter problemas com o teclado 72 | invtweaks.keyboardfix.recover=Tudo voltou ao normal, desculpa-me por isso. 73 | invtweaks.modcompat.ci.error=[13] Falha ao gerir compatibilidade com "Convenient Inventory" 74 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/en_US.properties: -------------------------------------------------------------------------------- 1 | invtweaks.loadconfig.enabled='%s' enabled 2 | invtweaks.loadconfig.refresh.error=[1] Failed to refresh properties from file 3 | invtweaks.loadconfig.invalidkeywords=Invalid keywords found 4 | invtweaks.loadconfig.filemissing=missing, creating default one. 5 | invtweaks.loadconfig.done=Configuration loaded. 6 | invtweaks.propsfile.loaded=Mod properties loaded 7 | invtweaks.propsfile.error=[14] Failed to create the mod properties file 8 | invtweaks.extract.find.error=[15] The mod won't work, because %s could not be found! 9 | invtweaks.extract.create.error=[16] The mod won't work, because %s creation failed! 10 | invtweaks.sort.inventory.error=[2] Failed to sort inventory 11 | invtweaks.sort.chest.error=[3] Failed to sort container 12 | invtweaks.sort.autorefill.error=[4] Failed to trigger auto-refill 13 | invtweaks.sort.releaseitem.error=[5] Failed to release item 14 | invtweaks.shortcut.error=[6] Failed to trigger shortcut 15 | invtweaks.pickup.error=[7] Failed to move picked up stack 16 | invtweaks.button.settings.tooltip=Inventory settings 17 | invtweaks.button.chest1.tooltip=Default sorting 18 | invtweaks.button.chest2.tooltip=Sort in columns 19 | invtweaks.button.chest3.tooltip=Sort in rows 20 | invtweaks.settings.title=Inventory and chests settings 21 | invtweaks.settings.on=ON 22 | invtweaks.settings.off=OFF 23 | invtweaks.settings.key=Sort key: 24 | invtweaks.settings.disableci=Disable CI 25 | invtweaks.settings.disableci.tooltip=In conflict with Convenient Inventory 26 | invtweaks.settings.middleclick=Middle click 27 | invtweaks.settings.middleclick.tooltip=Allows to sort using\nthe middle click 28 | invtweaks.settings.chestbuttons=Chest buttons 29 | invtweaks.settings.chestbuttons.tooltip=Adds three buttons\non chests to sort them 30 | invtweaks.settings.shortcuts=Shortcuts 31 | invtweaks.settings.shortcuts.tooltip=Enables various shortcuts\nto move items around 32 | invtweaks.settings.autorefill=Auto-refill 33 | invtweaks.settings.autorefill.tooltip=Replaces broken tools & emptied stacks\nwith others from your inventory 34 | invtweaks.settings.beforebreak=Repair-friendly refill 35 | invtweaks.settings.beforebreak.tooltip=Replaces tools just before they break 36 | invtweaks.settings.moreoptions=More options... 37 | invtweaks.settings.moreoptions.tooltip=Even more cool stuff 38 | invtweaks.settings.rulesfile=Open the sorting rules file... 39 | invtweaks.settings.rulesfile.error=[8] Failed to open rules file 40 | invtweaks.settings.treefile=Open the item tree file... 41 | invtweaks.settings.treefile.error=[9] Failed to open tree file 42 | invtweaks.settings.onlinehelp=Open help in browser... 43 | invtweaks.settings.onlinehelp.error=[10] Failed to open help 44 | invtweaks.help.bugsorting=Not working? 45 | invtweaks.help.bugsorting.pt1=If your server seems to 'cancel' what this mod does, 46 | invtweaks.help.bugsorting.pt2=it's probably caused by it using the NoCheatPlus plugin. 47 | invtweaks.help.bugsorting.pt3=Ask your admin to disable the following options: 48 | invtweaks.help.bugsorting.pt4="inventory.fastclick" and "combined.improbable" 49 | invtweaks.settings.pvpwarning.pt1=Note: On PvP servers, the auto-refill & auto-equip armor 50 | invtweaks.settings.pvpwarning.pt2=options are often considered cheating! 51 | invtweaks.settings.exit=Done 52 | invtweaks.settings.advanced.sortonpickup=Sort on pickup 53 | invtweaks.settings.advanced.sortonpickup.soloonly=SP only 54 | invtweaks.settings.advanced.sortonpickup.tooltip=Avoids to fill the hotbar with\neverything that you pickup 55 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Only in single player mode 56 | invtweaks.settings.advanced.autoequip=Auto-equip armor 57 | invtweaks.settings.advanced.autoequip.tooltip=Equips the best available\narmor when sorting 58 | invtweaks.settings.advanced.sounds=Enable sound 59 | invtweaks.settings.advanced.sounds.tooltip=Play sounds when sorting\nor when auto-refill is triggered 60 | invtweaks.settings.advanced.mappingsfile=Open the shortcuts mappings file... 61 | invtweaks.settings.advanced.mappingsfile.error=[11] Failed to open mappings file 62 | invtweaks.help.shortcuts.title=Shortcuts help 63 | invtweaks.help.shortcuts.click=Click 64 | invtweaks.help.shortcuts.or=or 65 | invtweaks.help.shortcuts.onestack=Move one stack 66 | invtweaks.help.shortcuts.oneitem=Move one item 67 | invtweaks.help.shortcuts.allitems=Move all items of same type 68 | invtweaks.help.shortcuts.everything=Move everything 69 | invtweaks.help.shortcuts.hotbar=Move to hotbar 70 | invtweaks.help.shortcuts.emptyslot=Move to empty slot 71 | invtweaks.help.shortcuts.rightclick=(Any shortcut) + Right instead of left click 72 | invtweaks.help.shortcuts.drop=Drop 73 | invtweaks.help.shortcuts.craftall=Craft all to inventory 74 | invtweaks.help.shortcuts.craftone=Craft to inventory 75 | invtweaks.help.shortcuts.selectconfig=Select sorting configuration 76 | invtweaks.help.shortcuts.forward=(Forward) 77 | invtweaks.help.shortcuts.forward=(Backwards) 78 | invtweaks.keyboardfix.error=[12] I'm having troubles with the keyboard 79 | invtweaks.keyboardfix.recover=Ok it's repaired, sorry about that. 80 | invtweaks.modcompat.ci.error=[13] Failed to manage 'Convenient Inventory' compatibility -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/de_DE.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' aktiviert 3 | invtweaks.loadconfig.refresh.error=[1] Fehler beim Aktualisieren der Eigenschaften-Datei 4 | invtweaks.loadconfig.invalidkeywords=Ung\u00fcltige Stichworte gefunden 5 | invtweaks.loadconfig.filemissing=fehlt, erstelle Standard. 6 | invtweaks.loadconfig.done=Konfiguration geladen. 7 | invtweaks.propsfile.loaded=Mod Eigenschaften geladen 8 | invtweaks.propsfile.error=[14]Fehler bei der Erstellung der Konfigurations-Datei 9 | invtweaks.extract.find.error=[15] Die Mod wird nicht funktionieren, da %s nicht gefunden werden konnte\! 10 | invtweaks.extract.create.error=[16] Die Mod wird nicht funktionieren, weil %s fehlgeschlug\! 11 | invtweaks.sort.inventory.error=[2] Konnte Inventar nicht sortieren 12 | invtweaks.sort.chest.error=[3] Fehler beim Sortieren des Beh\u00e4lters 13 | invtweaks.sort.autorefill.error=[4] Fehler beim Ausf\u00fchren des automatischen Auff\u00fcllens 14 | invtweaks.sort.releaseitem.error=[5] Fehler beim Element freigeben 15 | invtweaks.shortcut.error=[6] Fehler bei der Ausl\u00f6sung der Tastenkombi 16 | invtweaks.pickup.error=[7] Konnte aufgenommenen Stapel nicht bewegen 17 | invtweaks.button.settings.tooltip=Inventar Einstellungen 18 | invtweaks.button.chest1.tooltip=Standard Sortierung 19 | invtweaks.button.chest2.tooltip=Sortieren in Spalten 20 | invtweaks.button.chest3.tooltip=In Zeilen sortieren 21 | invtweaks.settings.title=Inventar und Truhen Einstellungen 22 | invtweaks.settings.on=AN 23 | invtweaks.settings.off=AUS 24 | invtweaks.settings.disableci=CI deaktivieren 25 | invtweaks.settings.disableci.tooltip=In Konflikt mit dem Mod Convenient Inventory 26 | invtweaks.settings.middleclick=mittlere Maustaste 27 | invtweaks.settings.middleclick.tooltip=Erm\u00f6glicht das Sortieren mit der mittleren Maustaste auszul\u00f6sen 28 | invtweaks.settings.chestbuttons=Truhen Schaltfl\u00e4chen 29 | invtweaks.settings.chestbuttons.tooltip=F\u00fcgt drei Schaltfl\u00e4chen auf Truhen hinzu um sie zu sortieren 30 | invtweaks.settings.shortcuts=Verkn\u00fcpfungen 31 | invtweaks.settings.shortcuts.tooltip=Erm\u00f6glicht verschiedenen Tasten Elemente zu bewegen 32 | invtweaks.settings.autorefill=Automatisches Auff\u00fcllen 33 | invtweaks.settings.autorefill.tooltip=Ersetzt defekte Werkzeuge & geleerte Stapel mit anderen aus dem Inventar 34 | invtweaks.settings.moreoptions=Mehr Optionen... 35 | invtweaks.settings.moreoptions.tooltip=Noch mehr coole Sachen 36 | invtweaks.settings.rulesfile=Sortierungsregeln \u00f6ffnen... 37 | invtweaks.settings.rulesfile.error=[8] Fehler beim \u00d6ffnen der Regel-Datei 38 | invtweaks.settings.treefile=\u00d6ffnen Sie die Baum-Datei des Elements... 39 | invtweaks.settings.treefile.error=[9] Fehler beim Baum-Datei \u00f6ffnen 40 | invtweaks.settings.onlinehelp=\u00d6ffnen der Hilfe im Browser... 41 | invtweaks.settings.onlinehelp.error=[10] Fehler beim \u00d6ffnen der Hilfe 42 | invtweaks.settings.pvpwarning.pt1=Hinweis\: Auf PvP-Servern werden die Auto-Auff\u00fcllen und Auto-Ausr\u00fcsten 43 | invtweaks.settings.pvpwarning.pt2=Funktionen oft als schummeln angesehen\! 44 | invtweaks.settings.exit=Fertig 45 | invtweaks.settings.advanced.sortonpickup=Beim Aufnehmen sortieren 46 | invtweaks.settings.advanced.sortonpickup.soloonly=Nur SP 47 | invtweaks.settings.advanced.sortonpickup.tooltip=Vermeidet die Hotbar mit allem zu f\u00fcllen, dass Sie aufnehmen 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Nur im Einzelspieler-Modus 49 | invtweaks.settings.advanced.autoequip=R\u00fcstung automatisch anziehen 50 | invtweaks.settings.advanced.autoequip.tooltip=R\u00fcstet die beste verf\u00fcgbare R\u00fcstung beim Sortieren aus 51 | invtweaks.settings.advanced.sounds=Sound aktivieren 52 | invtweaks.settings.advanced.sounds.tooltip=Spiele T\u00f6ne wenn Sortieren oder automatisches Auff\u00fcllen aktiviert wird 53 | invtweaks.settings.advanced.mappingsfile=\u00d6ffnen Sie die Verkn\u00fcpfungs-Zuordnungs-Datei ... 54 | invtweaks.settings.advanced.mappingsfile.error=[11] Fehler beim \u00d6ffnen der Zuordnungsdatei 55 | invtweaks.help.shortcuts.title=Tastenkombinationen-Hilfe 56 | invtweaks.help.shortcuts.click=Klick 57 | invtweaks.help.shortcuts.or=oder 58 | invtweaks.help.shortcuts.onestack=Bewegen Sie einen Stapel 59 | invtweaks.help.shortcuts.oneitem=Verschieben eines Elements 60 | invtweaks.help.shortcuts.allitems=Alle Items gleichen Typs verschieben 61 | invtweaks.help.shortcuts.everything=Bewegen Sie alles 62 | invtweaks.help.shortcuts.hotbar=zur Hotbar verschieben 63 | invtweaks.help.shortcuts.emptyslot=In leeren Platz verschieben 64 | invtweaks.help.shortcuts.rightclick=(Jede Tastenkombi)+ rechts statt links klicken 65 | invtweaks.help.shortcuts.drop=Fallen lassen 66 | invtweaks.help.shortcuts.craftall=Alles herstellen und ins Inventar legen 67 | invtweaks.help.shortcuts.craftone=Herstellen und im Inventar ablegen 68 | invtweaks.help.shortcuts.selectconfig=W\u00e4hlen Sie Ihre Sortier-Konfiguration 69 | invtweaks.help.shortcuts.forward=(R\u00fcckw\u00e4rts) 70 | invtweaks.keyboardfix.error=[12] Ich habe Probleme mit der Tastatur 71 | invtweaks.keyboardfix.recover=OK, es ist repariert, Entschuldigung. 72 | invtweaks.modcompat.ci.error=[13] Konnte Kompatibilit\u00e4t mit 'Convenient Inventory' nicht verwalten 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/sv_SE.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' aktiverat 3 | invtweaks.loadconfig.refresh.error=[1] Misslyckades med att uppdatera egenskaper fr\u00e5n fil 4 | invtweaks.loadconfig.invalidkeywords=Ogiltiga nyckelord hittades 5 | invtweaks.loadconfig.filemissing=saknas, skapar en standard. 6 | invtweaks.loadconfig.done=Konfiguration laddad. 7 | invtweaks.propsfile.loaded=Modegenskaper laddat 8 | invtweaks.propsfile.error=[14] Misslyckades med att skapa egenskapsfilen f\u00f6r moddet 9 | invtweaks.extract.find.error=[15] Moddet kommer inte att fungera, eftersom %s inte kunde hittas\! 10 | invtweaks.extract.create.error=[16] Moddet kommer inte att fungera, eftersom %s inte gick att skapa\! 11 | invtweaks.sort.inventory.error=[2] Misslyckades med att sortera inventering 12 | invtweaks.sort.chest.error=[3] Misslyckades att sortera beh\u00e5llare 13 | invtweaks.sort.autorefill.error=[4] Misslyckades med att utl\u00f6sa auto-p\u00e5fyllning 14 | invtweaks.sort.releaseitem.error=[5] Misslyckades med att frig\u00f6ra objekt 15 | invtweaks.shortcut.error=[6] Misslyckades med att utl\u00f6sa genv\u00e4g 16 | invtweaks.pickup.error=[7] Misslyckades att flytta den upplockade stacken 17 | invtweaks.button.settings.tooltip=Inst\u00e4llningar f\u00f6r inventering 18 | invtweaks.button.chest1.tooltip=Standardsortering 19 | invtweaks.button.chest2.tooltip=Sortera i kolumner 20 | invtweaks.button.chest3.tooltip=Sortera i rader 21 | invtweaks.settings.title=Inst\u00e4llningar f\u00f6r inventering och kistor 22 | invtweaks.settings.on=P\u00c5 23 | invtweaks.settings.off=AV 24 | invtweaks.settings.disableci=Avaktiivera CI 25 | invtweaks.settings.disableci.tooltip=I konflikt med Convenient Inventory 26 | invtweaks.settings.middleclick=Mellanklick 27 | invtweaks.settings.middleclick.tooltip=G\u00f6r det m\u00f6jligt att sortera med mittenklick 28 | invtweaks.settings.chestbuttons=L\u00e5d-knappar 29 | invtweaks.settings.chestbuttons.tooltip=L\u00e4gger till tre knappar p\u00e5 kistor f\u00f6r att sortera dem 30 | invtweaks.settings.shortcuts=Genv\u00e4gar 31 | invtweaks.settings.shortcuts.tooltip=M\u00f6jligg\u00f6r olika genv\u00e4gar f\u00f6r att flytta omkring objekt 32 | invtweaks.settings.autorefill=Auto-p\u00e5fyllning 33 | invtweaks.settings.autorefill.tooltip=Ers\u00e4tter trasiga verktyg & t\u00f6mda h\u00f6gar med andra fr\u00e5n din inventering 34 | invtweaks.settings.moreoptions=Mer inst\u00e4llningar... 35 | invtweaks.settings.moreoptions.tooltip=\u00c4nnu mer coola grejer 36 | invtweaks.settings.rulesfile=\u00d6ppna filen sorteringregler... 37 | invtweaks.settings.rulesfile.error=[8] Misslyckades med att \u00f6ppna regelfilen 38 | invtweaks.settings.treefile=\u00d6ppna objekttr\u00e4d filen... 39 | invtweaks.settings.treefile.error=[9] Misslyckades att \u00f6ppna tr\u00e4d-fil 40 | invtweaks.settings.onlinehelp=\u00d6ppna hj\u00e4lpen i webbl\u00e4saren... 41 | invtweaks.settings.onlinehelp.error=[10] Misslyckades med att \u00f6ppna hj\u00e4lpen 42 | invtweaks.settings.pvpwarning.pt1=Obs\: P\u00e5 PvP servrar, s\u00e5 kommer auto-p\u00e5fyllning & auto-ekipera rustning 43 | invtweaks.settings.pvpwarning.pt2=alternativ anses ofta vara fusk\! 44 | invtweaks.settings.exit=F\u00e4rdig 45 | invtweaks.settings.advanced.sortonpickup=Sortera p\u00e5 upplockning 46 | invtweaks.settings.advanced.sortonpickup.soloonly=SP endast 47 | invtweaks.settings.advanced.sortonpickup.tooltip=Undviker att fylla snabbf\u00e4ltet med allt som du plockar upp 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Endast i enspelarl\u00e4get 49 | invtweaks.settings.advanced.autoequip=Auto-ekipera rustning 50 | invtweaks.settings.advanced.autoequip.tooltip=Ekiperar den b\u00e4sta tillg\u00e4ngliga rustning vid sortering 51 | invtweaks.settings.advanced.sounds=Aktivera ljud 52 | invtweaks.settings.advanced.sounds.tooltip=Spela upp ljud n\u00e4r sortering eller n\u00e4r auto-p\u00e5fyllning utl\u00f6ses 53 | invtweaks.settings.advanced.mappingsfile=\u00d6ppna genv\u00e4gkartl\u00e4ggningsfilen... 54 | invtweaks.settings.advanced.mappingsfile.error=[11] Misslyckades med att \u00f6ppna kartl\u00e4ggningsfilen 55 | invtweaks.help.shortcuts.title=Genv\u00e4gshj\u00e4lp 56 | invtweaks.help.shortcuts.click=Klicka 57 | invtweaks.help.shortcuts.or=eller 58 | invtweaks.help.shortcuts.onestack=Flytta en stack 59 | invtweaks.help.shortcuts.oneitem=Flytta ett objekt 60 | invtweaks.help.shortcuts.allitems=Flytta alla objekt av samma typ 61 | invtweaks.help.shortcuts.everything=Flytta allt 62 | invtweaks.help.shortcuts.hotbar=Flytta till snabbf\u00e4lt 63 | invtweaks.help.shortcuts.emptyslot=Flytta till tom plats 64 | invtweaks.help.shortcuts.rightclick=(N\u00e5gon genv\u00e4g) + h\u00f6ger- i st\u00e4llet f\u00f6r v\u00e4nsterklick 65 | invtweaks.help.shortcuts.drop=Sl\u00e4pp 66 | invtweaks.help.shortcuts.craftall=Snickra alla till inventeringen 67 | invtweaks.help.shortcuts.craftone=Snickra till inventeringen 68 | invtweaks.help.shortcuts.selectconfig=V\u00e4lj sorteringskonfiguration 69 | invtweaks.help.shortcuts.forward=(Bakl\u00e4nges) 70 | invtweaks.keyboardfix.error=[12] Jag har problem med tangentbordet 71 | invtweaks.keyboardfix.recover=Ok det \u00e4r reparerat, ledsen f\u00f6r det. 72 | invtweaks.modcompat.ci.error=[13] Misslyckades med att hantera kompatibilitet med 'Convenient Inventory' 73 | -------------------------------------------------------------------------------- /invtweaks_docs/_themes/nature-custom/static/nature.css_t: -------------------------------------------------------------------------------- 1 | /** 2 | * Sphinx stylesheet -- default theme 3 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | */ 5 | 6 | @import url("basic.css"); 7 | 8 | /* -- page layout ----------------------------------------------------------- */ 9 | 10 | body { 11 | font-family: Arial, sans-serif; 12 | font-size: 100%; 13 | background-color: #111; 14 | color: #555; 15 | margin: 0; 16 | padding: 0; 17 | } 18 | 19 | div.documentwrapper { 20 | float: left; 21 | width: 100%; 22 | } 23 | 24 | div.bodywrapper { 25 | margin: 0 0 0 230px; 26 | background-color: #ffffff; 27 | } 28 | 29 | hr{ 30 | border: 1px solid #B1B4B6; 31 | } 32 | 33 | div.document { 34 | background-color: #eee; 35 | } 36 | 37 | div.body { 38 | color: #3E4349; 39 | padding: 0 30px 30px 30px; 40 | font-size: 0.9em; 41 | max-width: 800px; 42 | } 43 | 44 | div.footer { 45 | color: #555; 46 | width: 100%; 47 | padding: 13px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #444; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: #6BA81E; 59 | line-height: 32px; 60 | color: #fff; 61 | text-shadow: 0px 1px 0 #444; 62 | font-size: 0.80em; 63 | } 64 | 65 | div.related a { 66 | color: #E2F3CC; 67 | } 68 | 69 | div.sphinxsidebar { 70 | font-size: 0.75em; 71 | line-height: 1.5em; 72 | } 73 | 74 | div.sphinxsidebarwrapper{ 75 | padding: 20px 0; 76 | } 77 | 78 | div.sphinxsidebar h3, 79 | div.sphinxsidebar h4 { 80 | font-family: Arial, sans-serif; 81 | color: #222; 82 | font-size: 1.2em; 83 | font-weight: normal; 84 | margin: 0; 85 | padding: 5px 10px; 86 | background-color: #ddd; 87 | text-shadow: 1px 1px 0 white 88 | } 89 | 90 | div.sphinxsidebar h4{ 91 | font-size: 1.1em; 92 | } 93 | 94 | div.sphinxsidebar h3 a { 95 | color: #444; 96 | } 97 | 98 | 99 | div.sphinxsidebar p { 100 | color: #888; 101 | padding: 5px 20px; 102 | } 103 | 104 | div.sphinxsidebar p.topless { 105 | } 106 | 107 | div.sphinxsidebar ul { 108 | margin: 10px 20px; 109 | padding: 0; 110 | color: #000; 111 | } 112 | 113 | div.sphinxsidebar a { 114 | color: #444; 115 | } 116 | 117 | div.sphinxsidebar input { 118 | border: 1px solid #ccc; 119 | font-family: sans-serif; 120 | font-size: 1em; 121 | } 122 | 123 | div.sphinxsidebar input[type=text]{ 124 | margin-left: 20px; 125 | } 126 | 127 | /* -- body styles ----------------------------------------------------------- */ 128 | 129 | a { 130 | color: #005B81; 131 | text-decoration: none; 132 | } 133 | 134 | a:hover { 135 | color: #E32E00; 136 | text-decoration: underline; 137 | } 138 | 139 | div.body h1, 140 | div.body h2, 141 | div.body h3, 142 | div.body h4, 143 | div.body h5, 144 | div.body h6 { 145 | font-family: Arial, sans-serif; 146 | background-color: #BED4EB; 147 | font-weight: normal; 148 | color: #212224; 149 | margin: 30px 0px 10px 0px; 150 | padding: 5px 0 5px 10px; 151 | text-shadow: 0px 1px 0 white 152 | } 153 | 154 | div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } 155 | div.body h2 { font-size: 130%; background-color: #C8D5E3; } 156 | div.body h3 { font-size: 120%; } 157 | div.body h4 { font-size: 110%; background-color: #D8DEE3; } 158 | div.body h5 { font-size: 100%; background-color: #D8DEE3; } 159 | div.body h6 { font-size: 100%; background-color: #D8DEE3; } 160 | 161 | a.headerlink { 162 | color: #c60f0f; 163 | font-size: 0.8em; 164 | padding: 0 4px 0 4px; 165 | text-decoration: none; 166 | } 167 | 168 | a.headerlink:hover { 169 | background-color: #c60f0f; 170 | color: white; 171 | } 172 | 173 | div.body p, div.body dd, div.body li { 174 | line-height: 1.5em; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.highlight{ 182 | background-color: white; 183 | } 184 | 185 | div.note { 186 | background-color: #eee; 187 | border: 1px solid #ccc; 188 | } 189 | 190 | div.seealso { 191 | background-color: #ffc; 192 | border: 1px solid #ff6; 193 | } 194 | 195 | div.topic { 196 | background-color: #eee; 197 | } 198 | 199 | div.warning { 200 | background-color: #ffe4e4; 201 | border: 1px solid #f66; 202 | } 203 | 204 | p.admonition-title { 205 | display: inline; 206 | } 207 | 208 | p.admonition-title:after { 209 | content: ":"; 210 | } 211 | 212 | pre { 213 | padding: 10px; 214 | background-color: White; 215 | color: #222; 216 | line-height: 1.2em; 217 | border: 1px solid #C6C9CB; 218 | font-size: 1.2em; 219 | margin: 1.5em 0 1.5em 0; 220 | -webkit-box-shadow: 1px 1px 1px #d8d8d8; 221 | -moz-box-shadow: 1px 1px 1px #d8d8d8; 222 | } 223 | 224 | tt { 225 | background-color: #ecf0f3; 226 | color: #222; 227 | padding: 1px 2px; 228 | font-size: 1.2em; 229 | font-family: monospace; 230 | } 231 | 232 | div.sphinxsidebar ul { 233 | font-weight: bold; 234 | } 235 | 236 | div.sphinxsidebar ul ul, div.sphinxsidebar ul.want-points { 237 | font-weight: normal; 238 | } 239 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/pl_PL.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' w\u0142\u0105czone 3 | invtweaks.loadconfig.refresh.error=Nie uda\u0142o si\u0119 od\u015bwie\u017cy\u0107 ustawie\u0144 z pliku 4 | invtweaks.loadconfig.invalidkeywords=Znaleziono nieprawid\u0142owe s\u0142owa kluczowe 5 | invtweaks.loadconfig.filemissing=Brakuje ,tworz\u0119 domy\u015blny. 6 | invtweaks.loadconfig.done=Konfiguracja za\u0142adowana. 7 | invtweaks.propsfile.loaded=W\u0142a\u015bciwo\u015bci moda za\u0142adowane 8 | invtweaks.propsfile.error=Nie uda\u0142o si\u0119 utworzy\u0107 pliku w\u0142a\u015bciwo\u015bci moda 9 | invtweaks.extract.find.error=Mod nie zadzia\u0142a, poniewa\u017c nie mo\u017cna odnale\u017a\u0107 %s\! 10 | invtweaks.extract.create.error=Mod nie zadzia\u0142a, poniewa\u017c tworzenie %s si\u0119 nie powiod\u0142o\! 11 | invtweaks.sort.inventory.error=Nie uda\u0142o si\u0119 posortowa\u0107 ekwipunku 12 | invtweaks.sort.chest.error=Nie uda\u0142o si\u0119 posortowa\u0107 skrzyni 13 | invtweaks.sort.autorefill.error=Nie uda\u0142o si\u0119 uruchomi\u0107 auto-podmiany 14 | invtweaks.sort.releaseitem.error=Nie uda\u0142o si\u0119 pu\u015bci\u0107 elementu 15 | invtweaks.shortcut.error=Nie uda\u0142o si\u0119 wywo\u0142a\u0107 skr\u00f3tu 16 | invtweaks.pickup.error=Nie mo\u017cna przenie\u015b\u0107 podniesionego stosu 17 | invtweaks.button.settings.tooltip=Ustawienia ekwipunku 18 | invtweaks.button.chest1.tooltip=Domy\u015blne sortowanie 19 | invtweaks.button.chest2.tooltip=Sortuj kolumnami 20 | invtweaks.button.chest3.tooltip=Sortuj rz\u0119dami 21 | invtweaks.settings.title=Ustawienia ekwipunku i skrzy\u0144 22 | invtweaks.settings.on=ON 23 | invtweaks.settings.off=OFF 24 | invtweaks.settings.disableci=Wy\u0142\u0105cz CI 25 | invtweaks.settings.disableci.tooltip=Konfliktuje z Convenient Inventory 26 | invtweaks.settings.middleclick=\u015arodkowy przycisk 27 | invtweaks.settings.middleclick.tooltip=Pozwala sortowa\u0107 u\u017cywaj\u0105c \u015brodkowego przycisku 28 | invtweaks.settings.chestbuttons=Przyciski w skrzyni 29 | invtweaks.settings.chestbuttons.tooltip=Dodaje w skrzyniach trzy przyciski do sortowania 30 | invtweaks.settings.shortcuts=Skr\u00f3ty 31 | invtweaks.settings.shortcuts.tooltip=Zezwala na r\u00f3\u017cne skr\u00f3ty do przenoszenia rzeczy 32 | invtweaks.settings.autorefill=Auto-podmiana 33 | invtweaks.settings.autorefill.tooltip=Podmienia zniszczone narz\u0119dzia i puste stosy u\u017cywaj\u0105c innych z Twojego ekwipunku 34 | invtweaks.settings.moreoptions=Wi\u0119cej opcji... 35 | invtweaks.settings.moreoptions.tooltip=Jeszcze wi\u0119cej odjazdowych rzeczy 36 | invtweaks.settings.rulesfile=Otw\u00f3rz plik zasad sortowania... 37 | invtweaks.settings.rulesfile.error=Nie mo\u017cna otworzy\u0107 pliku zasad 38 | invtweaks.settings.treefile=Otw\u00f3rz plik drzewa element\u00f3w... 39 | invtweaks.settings.treefile.error=Nie uda\u0142o si\u0119 otworzy\u0107 pliku drzewa 40 | invtweaks.settings.onlinehelp=Otw\u00f3rz pomoc w przegl\u0105darce... 41 | invtweaks.settings.onlinehelp.error=Nie uda\u0142o si\u0119 otworzy\u0107 pomocy 42 | invtweaks.settings.pvpwarning.pt1=Uwaga\: na serwerach PvP, auto-podmiana & auto-zak\u0142adanie zbroi 43 | invtweaks.settings.pvpwarning.pt2=jest uznawane za oszustwo\! 44 | invtweaks.settings.exit=Gotowe 45 | invtweaks.settings.advanced.sortonpickup=Sortuj po podniesieniu 46 | invtweaks.settings.advanced.sortonpickup.soloonly=Tylko SP 47 | invtweaks.settings.advanced.sortonpickup.tooltip=Unika wype\u0142niania hotbara wszystkim co podniesiesz 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Tylko w trybie dla jednego gracza 49 | invtweaks.settings.advanced.autoequip=Auto-zak\u0142adanie zbroi 50 | invtweaks.settings.advanced.autoequip.tooltip=Zak\u0142ada najlepsz\u0105 dost\u0119pn\u0105 zbroj\u0119 podczas sortowania 51 | invtweaks.settings.advanced.sounds=W\u0142\u0105cz d\u017awi\u0119k 52 | invtweaks.settings.advanced.sounds.tooltip=Odtwarzaj d\u017awi\u0119ki przy sortowaniu lub podczas auto-podmiany 53 | invtweaks.settings.advanced.mappingsfile=Otw\u00f3rz plik mapowania skr\u00f3t\u00f3w... 54 | invtweaks.settings.advanced.mappingsfile.error=Nie uda\u0142o si\u0119 otworzy\u0107 pliku mapowania 55 | invtweaks.help.shortcuts.title=Szubka pomoc 56 | invtweaks.help.shortcuts.click=Klikni\u0119cie 57 | invtweaks.help.shortcuts.or=lub 58 | invtweaks.help.shortcuts.onestack=Przenie\u015b stos 59 | invtweaks.help.shortcuts.oneitem=Przenie\u015b jeden przedmiot 60 | invtweaks.help.shortcuts.allitems=Przenie\u015b przedmioty tej samej kategorii 61 | invtweaks.help.shortcuts.everything=Przenie\u015b wszystko 62 | invtweaks.help.shortcuts.hotbar=Przenie\u015b na pasek 63 | invtweaks.help.shortcuts.emptyslot=Przenie\u015b na wolne miejsce 64 | invtweaks.help.shortcuts.rightclick=(Ka\u017cdy skr\u00f3t) + Prawy zamiast lewego przycisku myszy 65 | invtweaks.help.shortcuts.drop=Upu\u015b\u0107 66 | invtweaks.help.shortcuts.craftall=Utw\u00f3rz wszystko do ekwipunku 67 | invtweaks.help.shortcuts.craftone=Utw\u00f3rz do ekwipunku 68 | invtweaks.help.shortcuts.selectconfig=Wybierz konfiguracj\u0119 sortowania 69 | invtweaks.help.shortcuts.forward=(Do ty\u0142u) 70 | invtweaks.keyboardfix.error=Mam problemy z klawiatur\u0105 71 | invtweaks.keyboardfix.recover=Ok ju\u017c naprawione, przepraszam. 72 | invtweaks.modcompat.ci.error=Nie uda\u0142o si\u0119 zaradzi\u0107 niezgodno\u015bci z 'Convenient Inventory' 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/nb_NO.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled=%s' Sl\u00e5tt p\u00e5 3 | invtweaks.loadconfig.refresh.error=Kunne ikke oppdatere egenskaper fra fil 4 | invtweaks.loadconfig.invalidkeywords=Ugyldig n\u00f8kkelord funnet 5 | invtweaks.loadconfig.filemissing=Mangler, lag en standard. 6 | invtweaks.loadconfig.done=Konfigurasjon lastet. 7 | invtweaks.propsfile.loaded=Mod egenskaper lastet 8 | invtweaks.propsfile.error=Kunne ikke lage mod fil for egenskaper 9 | invtweaks.extract.find.error=Denne modden virker ikke, fordi %s kunne ikke finnes\! 10 | invtweaks.extract.create.error=Denne modden fungerer ikke, fordi %s kunne ikke bli lagd\! 11 | invtweaks.sort.inventory.error=Kunne ikke sortere ryggsekken 12 | invtweaks.sort.chest.error=Kunne ikke sortere lagringsplass 13 | invtweaks.sort.autorefill.error=Kunne ikke sl\u00e5 p\u00e5 automatisk fylling 14 | invtweaks.sort.releaseitem.error=Kunne ikke slippe element 15 | invtweaks.shortcut.error=Kunne ikke bruke snarvei 16 | invtweaks.pickup.error=Kunne ikke bevege stabelen som ble plukket opp 17 | invtweaks.button.settings.tooltip=Ryggsekk innstillinger 18 | invtweaks.button.chest1.tooltip=Standard sortering 19 | invtweaks.button.chest2.tooltip=Sorter i s\u00f8yler 20 | invtweaks.button.chest3.tooltip=Sorter i rader 21 | invtweaks.settings.title=Ryggsekk- og kiste instillinger 22 | invtweaks.settings.on=P\u00c5 23 | invtweaks.settings.off=AV 24 | invtweaks.settings.key=Tast for sortering\: 25 | invtweaks.settings.disableci=Sl\u00e5 av Cl 26 | invtweaks.settings.disableci.tooltip=I konflikt med Conveient Inventory 27 | invtweaks.settings.middleclick=Midtklikk 28 | invtweaks.settings.middleclick.tooltip=Tillat \u00e5 sortere med \u00e5 bruke midt-klikk 29 | invtweaks.settings.chestbuttons=Kisteknapper 30 | invtweaks.settings.chestbuttons.tooltip=Legger til tre knapper p\u00e5 kister for \u00e5 sortere dem 31 | invtweaks.settings.shortcuts=Snarveier 32 | invtweaks.settings.shortcuts.tooltip=Sl\u00e5 p\u00e5 ulike snarveier for \u00e5 bevege elementene rundt 33 | invtweaks.settings.autorefill=Automatisk fylling 34 | invtweaks.settings.autorefill.tooltip=Erstatter \u00f8delagte redskaper & tomme stabler med andre fra ryggsekken din 35 | invtweaks.settings.beforebreak=Reparering-vennlig gjennfylling 36 | invtweaks.settings.beforebreak.tooltip=Erstatter redskaper rett f\u00f8r de \u00f8delegges 37 | invtweaks.settings.moreoptions=Mer innstillinger... 38 | invtweaks.settings.moreoptions.tooltip=Enda mer kule ting 39 | invtweaks.settings.rulesfile=\u00c5pne filen for sorteringsregler... 40 | invtweaks.settings.rulesfile.error=Kunne ikke \u00e5pne filen for regler 41 | invtweaks.settings.treefile=\u00c5pne filen for element-treet... 42 | invtweaks.settings.treefile.error=Kunne ikke \u00e5pne filen for elemtent-treet 43 | invtweaks.settings.onlinehelp=\u00c5pne hjelp i internettleser... 44 | invtweaks.settings.onlinehelp.error=Kunne ikke \u00e5pne hjelp 45 | invtweaks.settings.slowsorting=Ingen jukse/hack modus 46 | invtweaks.settings.slowsorting.pt1=Dersom serveren din ser ut til \u00e5 'ignorere' hva denne modden gj\u00f8r, 47 | invtweaks.settings.slowsorting.pt2=Bruk denne innstillingen for \u00e5 komme seg rundt 'No-cheat' plugin\: 48 | invtweaks.settings.slowsorting.pt3=det gj\u00f8r at modden klikker sakte for \u00e5 bevege elementer rundt. 49 | invtweaks.settings.pvpwarning.pt1=Notat\: P\u00e5 PvP servere kan auto-fylling & auto-utstyre rustning 50 | invtweaks.settings.pvpwarning.pt2=innstillinger regnes ofte som juksing\! 51 | invtweaks.settings.exit=Ferdig 52 | invtweaks.settings.advanced.sortonpickup=Sort\u00e8r n\u00e5r elementer plukkes opp 53 | invtweaks.settings.advanced.sortonpickup.soloonly=Kun SP 54 | invtweaks.settings.advanced.sortonpickup.tooltip=Unng\u00e5r \u00e5 fylle hotbaren med alt du plukker opp 55 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=Kun i enspiller modus 56 | invtweaks.settings.advanced.autoequip=Automatisk utstyr rustning 57 | invtweaks.settings.advanced.autoequip.tooltip=Utstyrer den beste type rustning n\u00e5r ryggsekken sorteres 58 | invtweaks.settings.advanced.sounds=Sl\u00e5 p\u00e5 lyd 59 | invtweaks.settings.advanced.sounds.tooltip=Spill lyd n\u00e5r du sorterer eller n\u00e5r den automatiske fyllingen sl\u00e5s p\u00e5 60 | invtweaks.settings.advanced.mappingsfile=\u00c5pne snarvei til kartleggings fil... 61 | invtweaks.settings.advanced.mappingsfile.error=Kunne ikke \u00e5pne karleggingsfil 62 | invtweaks.help.shortcuts.title=Hjelp for snarveier 63 | invtweaks.help.shortcuts.click=Klikk 64 | invtweaks.help.shortcuts.or=eller 65 | invtweaks.help.shortcuts.onestack=Flytt en stabel 66 | invtweaks.help.shortcuts.oneitem=Flytt ett element 67 | invtweaks.help.shortcuts.allitems=Flytt alle elementer av samme type 68 | invtweaks.help.shortcuts.everything=Flytt alt 69 | invtweaks.help.shortcuts.hotbar=Flytt til hotbar 70 | invtweaks.help.shortcuts.emptyslot=Flytt til en tom plass 71 | invtweaks.help.shortcuts.rightclick=(Hvilken som helst snarvei) + H\u00f8yre istedenfor venstre-klikk 72 | invtweaks.help.shortcuts.drop=Slipp 73 | invtweaks.help.shortcuts.craftall=Lag alt til ryggsekk 74 | invtweaks.help.shortcuts.craftone=Lag til ryggsekk 75 | invtweaks.help.shortcuts.selectconfig=Velg sorteringsinnstillinger 76 | invtweaks.help.shortcuts.forward=(Bakover) 77 | invtweaks.keyboardfix.error=Jeg har problemer med tastaturet 78 | invtweaks.keyboardfix.recover=Ok det er reparert, beklager. 79 | invtweaks.modcompat.ci.error=Kunne ikke administrere 'Convenient Inventory' kompatibilitet 80 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiTooltipButton.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import invtweaks.InvTweaksConst; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.src.FontRenderer; 6 | import net.minecraft.src.InvTweaksObfuscation; 7 | 8 | /** 9 | * Icon-size button, which get drawns in a specific way to fit its small size. 10 | * @author Jimeo Wan 11 | * 12 | */ 13 | public class InvTweaksGuiTooltipButton extends InvTweaksObfuscationGuiButton { 14 | 15 | public final static int DEFAULT_BUTTON_WIDTH = 200; 16 | public final static int LINE_HEIGHT = 11; 17 | 18 | private int hoverTime = 0; 19 | private long prevSystemTime = 0; 20 | 21 | private String tooltip = null; 22 | private String[] tooltipLines = null; 23 | private int tooltipWidth = -1; 24 | private boolean drawBackground = true; 25 | 26 | public InvTweaksGuiTooltipButton(int id, 27 | int x, int y, String displayString) { 28 | this(id, x, y, 150, 20, displayString, null); 29 | } 30 | 31 | /** 32 | * Default size is 150, the common "GuiSmallButton" button size. 33 | */ 34 | public InvTweaksGuiTooltipButton(int id, 35 | int x, int y, String displayString, String tooltip) { 36 | this(id, x, y, 150, 20, displayString, tooltip); 37 | } 38 | 39 | public InvTweaksGuiTooltipButton(int id, int x, int y, int w, int h, 40 | String displayString) { 41 | this(id, x, y, w, h, displayString, null); 42 | } 43 | 44 | public InvTweaksGuiTooltipButton(int id, int x, int y, int w, int h, 45 | String displayString, String tooltip) { 46 | super(id, x, y, w, h, displayString); 47 | if (tooltip != null) { 48 | setTooltip(tooltip); 49 | } 50 | } 51 | 52 | public InvTweaksGuiTooltipButton(int id, int x, int y, int w, int h, 53 | String displayString, String tooltip, boolean drawBackground) { 54 | super(id, x, y, w, h, displayString); 55 | if (tooltip != null) { 56 | setTooltip(tooltip); 57 | } 58 | this.drawBackground = drawBackground; 59 | } 60 | 61 | public void drawButton(Minecraft minecraft, int i, int j) { 62 | if (this.drawBackground) { 63 | super.drawButton(minecraft, i, j); 64 | } 65 | else { 66 | this.drawString(minecraft.fontRenderer, this.displayString, this.xPosition, this.yPosition + (this.height - 8) / 2, 0x999999); 67 | } 68 | 69 | InvTweaksObfuscation obf = new InvTweaksObfuscation(minecraft); 70 | 71 | if (tooltipLines != null) { 72 | // Compute hover time 73 | if (isMouseOverButton(i, j)) { 74 | long systemTime = System.currentTimeMillis(); 75 | if (prevSystemTime != 0) { 76 | hoverTime += systemTime - prevSystemTime; 77 | } 78 | prevSystemTime = systemTime; 79 | } 80 | else { 81 | hoverTime = 0; 82 | prevSystemTime = 0; 83 | } 84 | 85 | // Draw tooltip if hover time is long enough 86 | if (hoverTime > InvTweaksConst.TOOLTIP_DELAY && tooltipLines != null) { 87 | 88 | FontRenderer fontRenderer = obf.getFontRenderer(); 89 | 90 | // Compute tooltip params 91 | int x = i + 12, y = j - LINE_HEIGHT*tooltipLines.length; 92 | if (tooltipWidth == -1) { 93 | for (String line : tooltipLines) { 94 | tooltipWidth = Math.max( 95 | obf.getStringWidth(fontRenderer, line), 96 | tooltipWidth); 97 | } 98 | } 99 | if (x + tooltipWidth > obf.getWindowWidth(obf.getCurrentScreen())) { 100 | x = obf.getWindowWidth(obf.getCurrentScreen()) - tooltipWidth; 101 | } 102 | 103 | // Draw background 104 | drawGradientRect(x - 3, y - 3, 105 | x + tooltipWidth + 3, y + LINE_HEIGHT*tooltipLines.length, 106 | 0xc0000000, 0xc0000000); 107 | 108 | // Draw lines 109 | int lineCount = 0; 110 | for (String line : tooltipLines) { 111 | obf.drawStringWithShadow(fontRenderer, 112 | line, x, y + (lineCount++)*LINE_HEIGHT, -1); 113 | } 114 | } 115 | } 116 | 117 | } 118 | 119 | protected boolean isMouseOverButton(int i, int j) { 120 | return i >= getXPosition() && j >= getYPosition() 121 | && i < getXPosition() + getWidth() 122 | && j < getYPosition() + getHeight(); 123 | } 124 | 125 | protected int getTextColor(int i, int j) { 126 | 127 | int textColor = 0xffe0e0e0; 128 | if (!isEnabled()) { 129 | textColor = 0xffa0a0a0; 130 | } else if (isMouseOverButton(i, j)) { 131 | textColor = 0xffffffa0; 132 | } 133 | return textColor; 134 | 135 | } 136 | 137 | public void setTooltip(String tooltip) { 138 | this.tooltip = tooltip; 139 | this.tooltipLines = tooltip.split("\n"); 140 | } 141 | 142 | public String getTooltip() { 143 | return tooltip; 144 | } 145 | 146 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/zh_TW.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' \u555f\u7528 3 | invtweaks.loadconfig.refresh.error=[1] \u5f9e\u6a94\u6848\u91cd\u65b0\u8b80\u53d6\u8a2d\u5b9a\u6a94\u5931\u6557 4 | invtweaks.loadconfig.invalidkeywords=\u95dc\u9375\u5b57\u767c\u73fe\u7121\u6548 5 | invtweaks.loadconfig.filemissing=\u907a\u5931\uff0c\u5efa\u7acb\u4e00\u500b\u9810\u8a2d\u7684\u3002 6 | invtweaks.loadconfig.done=\u8a2d\u5b9a\u8f09\u5165\u3002 7 | invtweaks.propsfile.loaded=Mod \u8a2d\u5b9a\u6a94\u8f09\u5165 8 | invtweaks.propsfile.error=[14] \u5efa\u7acb Mod \u8a2d\u5b9a\u6a94\u5931\u6557 9 | invtweaks.extract.find.error=[15] \u7531\u65bc\u627e\u4e0d\u5230 %s\uff0cMod \u4e0d\u80fd\u57f7\u884c\! 10 | invtweaks.extract.create.error=[16] \u7531\u65bc\u5efa\u7acb %s \u5931\u6557\uff0cMod \u4e0d\u80fd\u57f7\u884c\! 11 | invtweaks.sort.inventory.error=[2] \u6392\u5e8f\u5eab\u5b58\u5931\u6557 12 | invtweaks.sort.chest.error=[3] \u6392\u5e8f\u7bb1\u5b50\u5931\u6557 13 | invtweaks.sort.autorefill.error=[4] \u5f15\u767c\u81ea\u52d5-\u88dd\u586b\u5931\u6557 14 | invtweaks.sort.releaseitem.error=[5] \u91cb\u51fa\u7269\u54c1\u5931\u6557 15 | invtweaks.shortcut.error=[6] \u89f8\u767c\u6377\u5f91\u5931\u6557 16 | invtweaks.pickup.error=[7] \u79fb\u52d5\u62ff\u8d77\u7684\u5806\u758a\u5931\u6557 17 | invtweaks.button.settings.tooltip=\u5eab\u5b58\u914d\u7f6e 18 | invtweaks.button.chest1.tooltip=\u9810\u8a2d\u6392\u5e8f 19 | invtweaks.button.chest2.tooltip=\u4ee5\u5217\u6392\u5e8f 20 | invtweaks.button.chest3.tooltip=\u4ee5\u884c\u6392\u5e8f 21 | invtweaks.settings.title=\u5eab\u5b58\u548c\u7bb1\u5b50\u914d\u7f6e 22 | invtweaks.settings.on=\u958b 23 | invtweaks.settings.off=\u95dc 24 | invtweaks.settings.disableci=\u7981\u7528 CI 25 | invtweaks.settings.disableci.tooltip=Convenient Inventory \u6709\u885d\u7a81 26 | invtweaks.settings.middleclick=\u4e2d\u9375\u9ede\u64ca 27 | invtweaks.settings.middleclick.tooltip=\u5141\u8a31\u6392\u5e8f\u4f7f\u7528\n\u4e2d\u9375\u9ede\u64ca 28 | invtweaks.settings.chestbuttons=\u7bb1\u5b50\u6309\u9215 29 | invtweaks.settings.chestbuttons.tooltip=\u5728\u7bb1\u5b50\u52a0\u5165\u4e09\u500b\u6309\u9215\n\u6392\u5217\u5b83\u5011 30 | invtweaks.settings.shortcuts=\u5feb\u6377\u9375 31 | invtweaks.settings.shortcuts.tooltip=\u555f\u7528\u5404\u7a2e\u5feb\u6377\u9375\n\u79fb\u52d5\u5404\u500b\u7269\u54c1 32 | invtweaks.settings.autorefill=\u81ea\u52d5-\u88dd\u586b 33 | invtweaks.settings.autorefill.tooltip=\u5f9e\u4f60\u7684\u5eab\u5b58\n\u66ff\u63db\u640d\u6bc0\u5de5\u5177 & \u6e05\u7a7a\u5806\u758a 34 | invtweaks.settings.moreoptions=\u66f4\u591a\u8a2d\u5b9a... 35 | invtweaks.settings.moreoptions.tooltip=\u66f4\u591a\u5f88\u9177\u7684\u6771\u897f 36 | invtweaks.settings.rulesfile=\u958b\u555f\u6392\u5e8f\u898f\u5247\u6a94\u6848... 37 | invtweaks.settings.rulesfile.error=[8] \u958b\u555f\u6392\u5e8f\u898f\u5247\u6a94\u6848\u5931\u6557 38 | invtweaks.settings.treefile=\u958b\u555f\u7269\u54c1\u6a39\u72c0\u6a94\u6848... 39 | invtweaks.settings.treefile.error=[9] \u958b\u555f\u7269\u54c1\u6a39\u72c0\u6a94\u6848\u5931\u6557 40 | invtweaks.settings.onlinehelp=\u5728\u700f\u89bd\u5668\u4e2d\u958b\u555f\u8aaa\u660e... 41 | invtweaks.settings.onlinehelp.error=[10] \u958b\u555f\u8aaa\u660e\u5931\u6557 42 | invtweaks.settings.pvpwarning.pt1=\u6ce8\u610f\: \u5728 PvP \u4f3a\u670d\u5668\uff0c\u81ea\u52d5-\u88dd\u586b & \u81ea\u52d5-\u88dd\u5099\u93a7\u7532 43 | invtweaks.settings.pvpwarning.pt2=\u6b64\u8a2d\u5b9a\u5f80\u5f80\u8996\u70ba\u4f5c\u5f0a\! 44 | invtweaks.settings.exit=\u5b8c\u6210 45 | invtweaks.settings.advanced.sortonpickup=\u62fe\u53d6\u6392\u5e8f 46 | invtweaks.settings.advanced.sortonpickup.soloonly=\u53ea\u9650\u55ae\u4eba\u904a\u6232 47 | invtweaks.settings.advanced.sortonpickup.tooltip=\u907f\u514d\u4f60\u62ff\u8d77\u7684\u4efb\u4f55\u6771\u897f\n\u88dd\u586b\u5feb\u6377\u5217 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=\u53ea\u7528\u65bc\u55ae\u4eba\u904a\u6232\u6a21\u5f0f 49 | invtweaks.settings.advanced.autoequip=\u81ea\u52d5-\u88dd\u5099\u93a7\u7532 50 | invtweaks.settings.advanced.autoequip.tooltip=\u6392\u5e8f\u6642\n\u88dd\u5099\u6700\u4f73\u93a7\u7532 51 | invtweaks.settings.advanced.sounds=\u555f\u7528\u97f3\u6548 52 | invtweaks.settings.advanced.sounds.tooltip=\u7576\u6392\u5e8f\u6216\u5f15\u767c\u518d\u6b21\u81ea\u52d5-\u88dd\u586b\u6642\n\u64ad\u653e\u8072\u97f3 53 | invtweaks.settings.advanced.mappingsfile=\u958b\u555f\u5feb\u6377\u9375\u6620\u5c04\u6a94\u6848... 54 | invtweaks.settings.advanced.mappingsfile.error=[11] \u958b\u555f\u6620\u5c04\u6a94\u6848\u5931\u6557 55 | invtweaks.help.shortcuts.title=\u5feb\u6377\u9375\u8aaa\u660e 56 | invtweaks.help.shortcuts.click=\u9ede\u64ca 57 | invtweaks.help.shortcuts.or=\u6216 58 | invtweaks.help.shortcuts.onestack=\u79fb\u52d5\u4e00\u500b\u5806\u758a 59 | invtweaks.help.shortcuts.oneitem=\u79fb\u52d5\u4e00\u500b\u7269\u54c1 60 | invtweaks.help.shortcuts.allitems=\u79fb\u52d5\u6240\u6709\u76f8\u540c\u985e\u578b\u7269\u54c1 61 | invtweaks.help.shortcuts.everything=\u79fb\u52d5\u6240\u6709 62 | invtweaks.help.shortcuts.hotbar=\u79fb\u52d5\u5230\u5feb\u6377\u5217 63 | invtweaks.help.shortcuts.emptyslot=\u79fb\u52d5\u5230\u7a7a\u683c 64 | invtweaks.help.shortcuts.rightclick=(\u4efb\u4f55\u5feb\u6377\u9375) + \u53f3\u9375\u9ede\u64ca\uff0c\u800c\u4e0d\u662f\u5de6\u9375\u9ede\u64ca 65 | invtweaks.help.shortcuts.drop=\u4e1f\u68c4 66 | invtweaks.help.shortcuts.craftall=\u5de5\u85dd\u54c1\u5168\u90e8\u81f3\u5eab\u5b58 67 | invtweaks.help.shortcuts.craftone=\u5de5\u85dd\u54c1\u81f3\u5eab\u5b58 68 | invtweaks.help.shortcuts.selectconfig=\u9078\u64c7\u6392\u5e8f\u914d\u7f6e 69 | invtweaks.help.shortcuts.forward=(\u5411\u5f8c) 70 | invtweaks.keyboardfix.error=[12] \u6211\u6709\u9375\u76e4\u7684\u554f\u984c 71 | invtweaks.keyboardfix.recover=OK \u5df2\u4fee\u5fa9\uff0c\u5c0d\u6b64\u5f88\u62b1\u6b49\u3002 72 | invtweaks.modcompat.ci.error=[13] \u7ba1\u7406 'Convenient Inventory' \u76f8\u5bb9\u5931\u6557 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/zh_CN.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' \u5df2\u542f\u7528 3 | invtweaks.loadconfig.refresh.error=[1] \u65e0\u6cd5\u4ece\u6587\u4ef6\u4e2d\u66f4\u65b0\u914d\u7f6e 4 | invtweaks.loadconfig.invalidkeywords=\u5173\u952e\u8bcd\u65e0\u6548 5 | invtweaks.loadconfig.filemissing=\u7f3a\u5931\uff0c\u6b63\u5728\u521b\u5efa\u4e00\u4e2a\u9ed8\u8ba4\u914d\u7f6e 6 | invtweaks.loadconfig.done=\u914d\u7f6e\u6587\u4ef6\u5df2\u8f7d\u5165 7 | invtweaks.propsfile.loaded=Mod\u5c5e\u6027\u6587\u4ef6\u5df2\u8f7d\u5165 8 | invtweaks.propsfile.error=[14] \u65e0\u6cd5\u521b\u5efaMod\u5c5e\u6027\u6587\u4ef6 9 | invtweaks.extract.find.error=[15] Mod\u65e0\u6cd5\u5de5\u4f5c\uff0c\u56e0\u4e3a\u627e\u4e0d\u5230%s\uff01 10 | invtweaks.extract.create.error=[16] Mod\u65e0\u6cd5\u5de5\u4f5c\uff0c\u56e0\u4e3a%s\u521b\u5efa\u5931\u8d25\uff01 11 | invtweaks.sort.inventory.error=[2] \u65e0\u6cd5\u6574\u7406\u80cc\u5305 12 | invtweaks.sort.chest.error=[3] \u65e0\u6cd5\u6574\u7406\u5bb9\u5668 13 | invtweaks.sort.autorefill.error=[4] \u65e0\u6cd5\u89e6\u53d1\u81ea\u52a8\u586b\u88c5 14 | invtweaks.sort.releaseitem.error=[5]\u65e0\u6cd5\u653e\u4e0b\u7269\u54c1 15 | invtweaks.shortcut.error=[6] \u65e0\u6cd5\u89e6\u53d1\u5feb\u6377\u952e 16 | invtweaks.pickup.error=[7]\u65e0\u6cd5\u79fb\u52a8\u62fe\u53d6\u7684\u5806\u53e0 17 | invtweaks.button.settings.tooltip=\u80cc\u5305\u7269\u54c1\u680f\u8bbe\u7f6e 18 | invtweaks.button.chest1.tooltip=\u9ed8\u8ba4\u8bbe\u7f6e 19 | invtweaks.button.chest2.tooltip=\u4ee5\u5217\u6574\u7406 20 | invtweaks.button.chest3.tooltip=\u4ee5\u884c\u6574\u7406 21 | invtweaks.settings.title=\u80cc\u5305\u7269\u54c1\u680f\u548c\u7bb1\u5b50\u8bbe\u7f6e 22 | invtweaks.settings.on=\u5f00\u542f 23 | invtweaks.settings.off=\u5173\u95ed 24 | invtweaks.settings.disableci=\u7981\u7528 CI 25 | invtweaks.settings.disableci.tooltip=\u4e0eConvenient Inventory\u51b2\u7a81 26 | invtweaks.settings.middleclick=\u9f20\u6807\u4e2d\u952e 27 | invtweaks.settings.middleclick.tooltip=\u4f7f\u7528\u9f20\u6807\u4e2d\u952e\u6765\u6392\u5e8f\u6574\u7406 28 | invtweaks.settings.chestbuttons=\u7bb1\u5b50\u6309\u94ae 29 | invtweaks.settings.chestbuttons.tooltip=\u5728\u7bb1\u5b50\u4e0a\u6dfb\u52a0\u4e09\u4e2a\u6309\u94ae\u7528\u6765\u6392\u5e8f\u6574\u7406 30 | invtweaks.settings.shortcuts=\u5feb\u6377\u952e 31 | invtweaks.settings.shortcuts.tooltip=\u542f\u7528\u5404\u79cd\u5feb\u6377\u952e\u6765\u79fb\u52a8\u7269\u54c1 32 | invtweaks.settings.autorefill=\u81ea\u52a8\u88c5\u586b 33 | invtweaks.settings.autorefill.tooltip=\u7528\u80cc\u5305\u5185\u7269\u54c1\u66ff\u6362\u635f\u574f\u7684\u5de5\u5177\u548c\u7528\u5c3d\u7684\u5806\u53e0 34 | invtweaks.settings.moreoptions=\u66f4\u591a\u9009\u9879... 35 | invtweaks.settings.moreoptions.tooltip=\u66f4\u591a\u9177\u7684\u4e1c\u897f 36 | invtweaks.settings.rulesfile=\u6253\u5f00\u6392\u5e8f\u89c4\u5219\u6587\u4ef6... 37 | invtweaks.settings.rulesfile.error=[8]\u65e0\u6cd5\u6253\u5f00\u89c4\u5219\u6587\u4ef6 38 | invtweaks.settings.treefile=\u6253\u5f00\u7269\u54c1\u6811\u6587\u4ef6... 39 | invtweaks.settings.treefile.error=[9] \u65e0\u6cd5\u6253\u5f00\u6811\u6587\u4ef6 40 | invtweaks.settings.onlinehelp=\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u5e2e\u52a9... 41 | invtweaks.settings.onlinehelp.error=[10]\u65e0\u6cd5\u6253\u5f00\u5e2e\u52a9\u6587\u4ef6 42 | invtweaks.settings.pvpwarning.pt1=\u63d0\u793a\: \u5728PVP\u670d\u52a1\u5668\u4e0a\uff0c\u81ea\u52a8\u586b\u88c5\u548c\u81ea\u52a8\u88c5\u5907\u76d4\u7532 43 | invtweaks.settings.pvpwarning.pt2=\u9009\u9879\u901a\u5e38\u88ab\u89c6\u4f5c\u4e3a\u4f5c\u5f0a\uff01 44 | invtweaks.settings.exit=\u5b8c\u6210 45 | invtweaks.settings.advanced.sortonpickup=\u62fe\u53d6\u7269\u54c1\u65f6\u6392\u5e8f 46 | invtweaks.settings.advanced.sortonpickup.soloonly=\u4ec5\u9650\u5355\u4eba\u6e38\u620f 47 | invtweaks.settings.advanced.sortonpickup.tooltip=\u907f\u514d\u7528\u4f60\u62fe\u53d6\u7684\u7269\u54c1\u6765\u586b\u88c5\u5feb\u6377\u680f 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=\u4ec5\u9650\u5355\u4eba\u6e38\u620f\u6a21\u5f0f 49 | invtweaks.settings.advanced.autoequip=\u81ea\u52a8\u88c5\u5907\u76d4\u7532 50 | invtweaks.settings.advanced.autoequip.tooltip=\u5f53\u6574\u7406\u65f6\u88c5\u5907\u4e0a\u6700\u597d\u7684\u76d4\u7532 51 | invtweaks.settings.advanced.sounds=\u5f00\u542f\u97f3\u6548 52 | invtweaks.settings.advanced.sounds.tooltip=\u5728\u6392\u5e8f\u6216\u8005\u81ea\u52a8\u586b\u88c5\u65f6\u64ad\u653e\u97f3\u6548 53 | invtweaks.settings.advanced.mappingsfile=\u6253\u5f00\u5feb\u6377\u952e\u6620\u5c04\u6587\u4ef6 54 | invtweaks.settings.advanced.mappingsfile.error=[11]\u65e0\u6cd5\u6253\u5f00\u6620\u5c04\u6587\u4ef6 55 | invtweaks.help.shortcuts.title=\u5feb\u6377\u952e\u5e2e\u52a9 56 | invtweaks.help.shortcuts.click=\u70b9\u51fb 57 | invtweaks.help.shortcuts.or=\u6216\u8005 58 | invtweaks.help.shortcuts.onestack=\u79fb\u52a8\u4e00\u53e0\u7269\u54c1 59 | invtweaks.help.shortcuts.oneitem=\u79fb\u52a8\u4e00\u4e2a\u7269\u54c1 60 | invtweaks.help.shortcuts.allitems=\u79fb\u52a8\u6240\u6709\u540c\u7c7b\u578b\u7269\u54c1 61 | invtweaks.help.shortcuts.everything=\u79fb\u52a8\u6240\u6709\u4e1c\u897f 62 | invtweaks.help.shortcuts.hotbar=\u79fb\u52a8\u5230\u5feb\u6377\u680f 63 | invtweaks.help.shortcuts.emptyslot=\u79fb\u52a8\u81f3\u7a7a\u680f\u4f4d 64 | invtweaks.help.shortcuts.rightclick=(\u4efb\u610f\u5feb\u6377\u952e) + \u9f20\u6807\u53f3\u952e 65 | invtweaks.help.shortcuts.drop=\u4e22\u4e0b 66 | invtweaks.help.shortcuts.craftall=\u5236\u4f5c\u5168\u90e8\u81f3\u7269\u54c1\u680f 67 | invtweaks.help.shortcuts.craftone=\u5236\u4f5c\u81f3\u7269\u54c1\u680f 68 | invtweaks.help.shortcuts.selectconfig=\u9009\u62e9\u6392\u5e8f\u7684\u914d\u7f6e 69 | invtweaks.help.shortcuts.forward=(\u5411\u540e) 70 | invtweaks.keyboardfix.error=[12] \u6211\u7684\u952e\u76d8\u6709\u95ee\u9898 71 | invtweaks.keyboardfix.recover=\u95ee\u9898\u5df2\u4fee\u590d\uff0c\u62b1\u6b49 72 | invtweaks.modcompat.ci.error=[13] \u65e0\u6cd5\u4e0e'Convenient Inventory'\u8fbe\u6210\u517c\u5bb9 73 | -------------------------------------------------------------------------------- /invtweaks_docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | clean: 42 | -rm -rf $(BUILDDIR)/* 43 | 44 | html: 45 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 | 49 | dirhtml: 50 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 | @echo 52 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 | 54 | singlehtml: 55 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 | @echo 57 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 | 59 | pickle: 60 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 | @echo 62 | @echo "Build finished; now you can process the pickle files." 63 | 64 | json: 65 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 | @echo 67 | @echo "Build finished; now you can process the JSON files." 68 | 69 | htmlhelp: 70 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 | @echo 72 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 | ".hhp project file in $(BUILDDIR)/htmlhelp." 74 | 75 | qthelp: 76 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 | @echo 78 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/InventoryTweaks.qhcp" 81 | @echo "To view the help file:" 82 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/InventoryTweaks.qhc" 83 | 84 | devhelp: 85 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 | @echo 87 | @echo "Build finished." 88 | @echo "To view the help file:" 89 | @echo "# mkdir -p $$HOME/.local/share/devhelp/InventoryTweaks" 90 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/InventoryTweaks" 91 | @echo "# devhelp" 92 | 93 | epub: 94 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 | @echo 96 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 | 98 | latex: 99 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 | @echo 101 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 | "(use \`make latexpdf' here to do that automatically)." 104 | 105 | latexpdf: 106 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 | @echo "Running LaTeX files through pdflatex..." 108 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 109 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 | 111 | text: 112 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 | @echo 114 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 | 116 | man: 117 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 | @echo 119 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 | 121 | texinfo: 122 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 123 | @echo 124 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 125 | @echo "Run \`make' in that directory to run these through makeinfo" \ 126 | "(use \`make info' here to do that automatically)." 127 | 128 | info: 129 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 130 | @echo "Running Texinfo files through makeinfo..." 131 | make -C $(BUILDDIR)/texinfo info 132 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 133 | 134 | gettext: 135 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 136 | @echo 137 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 138 | 139 | changes: 140 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 141 | @echo 142 | @echo "The overview file is in $(BUILDDIR)/changes." 143 | 144 | linkcheck: 145 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 146 | @echo 147 | @echo "Link check complete; look for any errors in the above output " \ 148 | "or in $(BUILDDIR)/linkcheck/output.txt." 149 | 150 | doctest: 151 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 152 | @echo "Testing of doctests in the sources finished, look at the " \ 153 | "results in $(BUILDDIR)/doctest/output.txt." 154 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiShortcutsHelp.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.util.LinkedList; 4 | import java.util.List; 5 | 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.src.GuiButton; 8 | import net.minecraft.src.GuiScreen; 9 | import net.minecraft.src.InvTweaksObfuscation; 10 | 11 | import org.lwjgl.input.Keyboard; 12 | 13 | 14 | public class InvTweaksGuiShortcutsHelp extends GuiScreen { 15 | 16 | private final static int ID_DONE = 0; 17 | 18 | private InvTweaksObfuscation obf; 19 | private GuiScreen parentScreen; 20 | private InvTweaksConfig config; 21 | 22 | public InvTweaksGuiShortcutsHelp(Minecraft mc, 23 | GuiScreen parentScreen, InvTweaksConfig config) { 24 | this.obf = new InvTweaksObfuscation(mc); 25 | this.parentScreen = parentScreen; 26 | this.config = config; 27 | } 28 | 29 | public void initGui() { 30 | // Create Done button 31 | List controlList = new LinkedList(); 32 | controlList.add(new GuiButton(ID_DONE, 33 | obf.getWindowWidth(this) / 2 - 100, 34 | obf.getWindowHeight(this) / 6 + 168, "Done")); 35 | obf.setControlList(this, controlList); 36 | } 37 | 38 | public void drawScreen(int i, int j, float f) { 39 | 40 | // Note: 0x0000EEFF = blue color (currently unused) 41 | 42 | drawDefaultBackground(); 43 | drawCenteredString(obf.getFontRenderer(), "WARNING: Since 1.3.1, shortcuts won't work as expected. Looking for a workaround...", obf.getWindowWidth(this) / 2, 5, 0xff0000); 44 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.help.shortcuts.title"), obf.getWindowWidth(this) / 2, 20, 0xffffff); // Gui.drawCenteredString 45 | String clickLabel = InvTweaksLocalization.get("invtweaks.help.shortcuts.click"); 46 | 47 | int y = obf.getWindowHeight(this) / 6 - 2; 48 | 49 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.onestack"), "LSHIFT " + InvTweaksLocalization.get("invtweaks.help.shortcuts.or") + " RSHIFT + " + clickLabel, 0x00FFFF00, y); 50 | y += 12; 51 | drawShortcutLine("", buildUpOrDownLabel(InvTweaksConfig.PROP_SHORTCUT_UP, obf.getKeyBindingForwardKeyCode(), InvTweaksLocalization.get("invtweaks.help.shortcuts.forward")) 52 | + " + " + clickLabel, 0x00FFFF00, y); 53 | y += 12; 54 | drawShortcutLine("", buildUpOrDownLabel(InvTweaksConfig.PROP_SHORTCUT_DOWN, obf.getKeyBindingBackKeyCode(), InvTweaksLocalization.get("invtweaks.help.shortcuts.backwards")) 55 | + " + " + clickLabel, 0x00FFFF00, y); 56 | y += 12; 57 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.oneitem"), 58 | config.getProperty(InvTweaksConfig.PROP_SHORTCUT_ONE_ITEM) + " + " + clickLabel, 59 | 0x00FFFF00, y); 60 | y += 12; 61 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.allitems"), 62 | config.getProperty(InvTweaksConfig.PROP_SHORTCUT_ALL_ITEMS) + " + " + clickLabel, 63 | 0x00FFFF00, y); 64 | y += 12; 65 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.everything"), 66 | config.getProperty(InvTweaksConfig.PROP_SHORTCUT_EVERYTHING) + " + " + clickLabel, 67 | 0x00FFFF00, y); 68 | y += 19; 69 | 70 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.hotbar"), "0-9 + " + clickLabel, 0x0000FF33, y); 71 | y += 12; 72 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.emptyslot"), InvTweaksLocalization.get("invtweaks.help.shortcuts.rightclick"), 0x0000FF33, y); 73 | y += 12; 74 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.drop"), 75 | config.getProperty(InvTweaksConfig.PROP_SHORTCUT_DROP) + " + " + clickLabel, 76 | 0x0000FF33, y); 77 | y += 19; 78 | 79 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.craftall"), "LSHIFT, RSHIFT + " + clickLabel, 0x00FF8800, y); 80 | y += 12; 81 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.craftone"), config.getProperty(InvTweaksConfig.PROP_SHORTCUT_ONE_ITEM) + " + " + clickLabel, 0x00FF8800, y); 82 | y += 19; 83 | 84 | String sortKeyName = getKeyName(config.getSortKeyCode(), "(Sort Key)"); 85 | drawShortcutLine(InvTweaksLocalization.get("invtweaks.help.shortcuts.selectconfig"), "0-9 + " +sortKeyName, 0x0088FFFF, y); 86 | 87 | super.drawScreen(i, j, f); 88 | } 89 | 90 | protected void actionPerformed(GuiButton guibutton) { 91 | switch (obf.getId(guibutton)) { 92 | case ID_DONE: 93 | obf.displayGuiScreen(parentScreen); 94 | break; 95 | } 96 | } 97 | 98 | protected void keyTyped(char c, int keyCode) { 99 | if (keyCode == Keyboard.KEY_ESCAPE) { 100 | obf.displayGuiScreen(parentScreen); 101 | } 102 | } 103 | 104 | private String buildUpOrDownLabel(String shortcutProp, int keyCode, String defaultKeyName) { 105 | String shortcutLabel = config.getProperty(shortcutProp); 106 | String keyLabel = getKeyName(keyCode, defaultKeyName); 107 | if (keyLabel.equals(shortcutLabel)) { 108 | return keyLabel; 109 | } 110 | else { 111 | return keyLabel + "/" + shortcutLabel; 112 | } 113 | } 114 | 115 | protected String getKeyName(int keyCode, String defaultValue) { 116 | try { 117 | return Keyboard.getKeyName(keyCode); 118 | } 119 | catch (Exception e) { 120 | return defaultValue; 121 | } 122 | } 123 | 124 | private void drawShortcutLine(String label, String value, int color, int y) { 125 | drawString(obf.getFontRenderer(), label, 30, y, -1); // drawString 126 | if (value != null) { 127 | drawString(obf.getFontRenderer(), value.contains("DEFAULT") ? "-" : value.replaceAll(", ", " " + InvTweaksLocalization.get("invtweaks.help.shortcuts.or") + " "), 128 | obf.getWindowWidth(this) / 2 - 30, y, color); // drawString 129 | } 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksItemTreeLoader.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.io.File; 4 | import java.util.ArrayList; 5 | import java.util.LinkedList; 6 | import java.util.List; 7 | 8 | import javax.xml.parsers.SAXParser; 9 | import javax.xml.parsers.SAXParserFactory; 10 | 11 | import org.xml.sax.Attributes; 12 | import org.xml.sax.SAXException; 13 | import org.xml.sax.helpers.DefaultHandler; 14 | 15 | /** 16 | * Loads the item tree by parsing the XML file. 17 | * @author Jimeo Wan 18 | * 19 | */ 20 | public class InvTweaksItemTreeLoader extends DefaultHandler { 21 | 22 | private final static String ATTR_ID = "id"; 23 | private final static String ATTR_DAMAGE = "damage"; 24 | private final static String ATTR_RANGE_MIN = "min"; // Item ranges 25 | private final static String ATTR_RANGE_MAX = "max"; 26 | private final static String ATTR_RANGE_DMIN = "dmin"; // Damage ranges 27 | private final static String ATTR_RANGE_DMAX = "dmax"; 28 | private final static String ATTR_TREE_VERSION = "treeVersion"; 29 | 30 | private static InvTweaksItemTree tree; 31 | 32 | private static String treeVersion; 33 | private static int itemOrder; 34 | private static LinkedList categoryStack; 35 | 36 | private static Boolean treeLoaded; 37 | private static List onLoadListeners = new ArrayList(); 38 | 39 | private static void init() { 40 | treeLoaded = false; 41 | treeVersion = null; 42 | tree = new InvTweaksItemTree(); 43 | itemOrder = 0; 44 | categoryStack = new LinkedList(); 45 | } 46 | 47 | public synchronized static InvTweaksItemTree load(String filePath) throws Exception { 48 | init(); 49 | 50 | SAXParserFactory parserFactory = SAXParserFactory.newInstance(); 51 | SAXParser parser = parserFactory.newSAXParser(); 52 | parser.parse(new File(filePath), new InvTweaksItemTreeLoader()); 53 | 54 | // Tree loaded event 55 | synchronized (onLoadListeners) { 56 | treeLoaded = true; 57 | for (InvTweaksItemTreeListener onLoadListener : onLoadListeners) { 58 | onLoadListener.onTreeLoaded(tree); 59 | } 60 | } 61 | 62 | return tree; 63 | } 64 | 65 | public synchronized static boolean isValidVersion(String filePath) throws Exception { 66 | init(); 67 | 68 | File file = new File(filePath); 69 | if (file.exists()) { 70 | treeVersion = null; 71 | SAXParserFactory parserFactory = SAXParserFactory.newInstance(); 72 | SAXParser parser = parserFactory.newSAXParser(); 73 | parser.parse(file, new InvTweaksItemTreeLoader()); 74 | return InvTweaksConst.TREE_VERSION.equals(treeVersion); 75 | } 76 | else { 77 | return false; 78 | } 79 | } 80 | 81 | public synchronized static void addOnLoadListener(InvTweaksItemTreeListener listener) { 82 | onLoadListeners.add(listener); 83 | if (treeLoaded) { 84 | // Late event triggering 85 | listener.onTreeLoaded(tree); 86 | } 87 | } 88 | 89 | public synchronized static boolean removeOnLoadListener(InvTweaksItemTreeListener listener) { 90 | return onLoadListeners.remove(listener); 91 | } 92 | 93 | 94 | @Override 95 | public synchronized void startElement(String uri, String localName, 96 | String name, Attributes attributes) throws SAXException { 97 | 98 | String rangeMinAttr = attributes.getValue(ATTR_RANGE_MIN); 99 | String rangeDMinAttr = attributes.getValue(ATTR_RANGE_DMIN); 100 | String newTreeVersion = attributes.getValue(ATTR_TREE_VERSION); 101 | 102 | // Category 103 | if (attributes.getLength() == 0 || treeVersion == null 104 | || rangeMinAttr != null || rangeDMinAttr != null) { 105 | 106 | // Tree version 107 | if (treeVersion == null) { 108 | treeVersion = newTreeVersion; 109 | } 110 | 111 | if (categoryStack.isEmpty()) { 112 | // Root category 113 | tree.setRootCategory(new InvTweaksItemTreeCategory(name)); 114 | } else { 115 | // Normal category 116 | tree.addCategory(categoryStack.getLast(), new InvTweaksItemTreeCategory(name)); 117 | } 118 | 119 | // Handle item ranges 120 | if (rangeMinAttr != null) { 121 | int rangeMin = Integer.parseInt(rangeMinAttr); 122 | int rangeMax = Integer.parseInt(attributes.getValue(ATTR_RANGE_MAX)); 123 | for (int id = rangeMin; id <= rangeMax; id++) { 124 | tree.addItem(name, new InvTweaksItemTreeItem((name + id).toLowerCase(), 125 | id, -1, itemOrder++)); 126 | } 127 | } 128 | else if (rangeDMinAttr != null) { 129 | int id = Integer.parseInt(attributes.getValue(ATTR_ID)); 130 | int rangeDMin = Integer.parseInt(rangeDMinAttr); 131 | int rangeDMax = Integer.parseInt(attributes.getValue(ATTR_RANGE_DMAX)); 132 | for (int damage = rangeDMin; damage <= rangeDMax; damage++) { 133 | tree.addItem(name, new InvTweaksItemTreeItem( 134 | (name + id + "-" + damage).toLowerCase(), 135 | id, damage, itemOrder++)); 136 | } 137 | } 138 | 139 | categoryStack.add(name); 140 | } 141 | 142 | // Item 143 | else if (attributes.getValue(ATTR_ID) != null) { 144 | int id = Integer.parseInt(attributes.getValue(ATTR_ID)); 145 | int damage = -1; 146 | if (attributes.getValue(ATTR_DAMAGE) != null) { 147 | damage = Integer.parseInt(attributes.getValue(ATTR_DAMAGE)); 148 | } 149 | tree.addItem(categoryStack.getLast(), new InvTweaksItemTreeItem(name.toLowerCase(), 150 | id, damage, itemOrder++)); 151 | } 152 | } 153 | 154 | @Override 155 | public synchronized void endElement(String uri, String localName, String name) throws SAXException { 156 | if (!categoryStack.isEmpty() && name.equals(categoryStack.getLast())) { 157 | categoryStack.removeLast(); 158 | } 159 | } 160 | 161 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksGuiSettingsAdvanced.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.awt.Desktop; 4 | import java.io.File; 5 | import java.util.List; 6 | import java.util.logging.Logger; 7 | 8 | import net.minecraft.client.Minecraft; 9 | import net.minecraft.src.GuiButton; 10 | import net.minecraft.src.GuiScreen; 11 | 12 | import org.lwjgl.util.Point; 13 | 14 | 15 | /** 16 | * The inventory and chest advanced settings menu. 17 | * 18 | * @author Jimeo Wan 19 | * 20 | */ 21 | public class InvTweaksGuiSettingsAdvanced extends InvTweaksGuiSettingsAbstract { 22 | 23 | private static final Logger log = Logger.getLogger("InvTweaks"); 24 | 25 | private final static int ID_SORT_ON_PICKUP = 1; 26 | private final static int ID_AUTO_EQUIP_ARMOR = 2; 27 | private final static int ID_ENABLE_SOUNDS = 3; 28 | private final static int ID_CHESTS_BUTTONS = 4; 29 | private final static int ID_EDITSHORTCUTS = 100; 30 | 31 | private static String labelChestButtons; 32 | private static String labelSortOnPickup; 33 | private static String labelEquipArmor; 34 | private static String labelEnableSounds; 35 | 36 | public InvTweaksGuiSettingsAdvanced(Minecraft mc, GuiScreen parentScreen, InvTweaksConfig config) { 37 | super(mc, parentScreen, config); 38 | 39 | labelSortOnPickup = InvTweaksLocalization.get("invtweaks.settings.advanced.sortonpickup"); 40 | labelEquipArmor = InvTweaksLocalization.get("invtweaks.settings.advanced.autoequip"); 41 | labelEnableSounds = InvTweaksLocalization.get("invtweaks.settings.advanced.sounds"); 42 | labelChestButtons = InvTweaksLocalization.get("invtweaks.settings.chestbuttons"); 43 | } 44 | 45 | public void initGui() { 46 | super.initGui(); 47 | 48 | List controlList = obf.getControlList(this); 49 | Point p = new Point(); 50 | int i = 0; 51 | 52 | // Create large buttons 53 | 54 | moveToButtonCoords(1, p); 55 | controlList.add(new GuiButton(ID_EDITSHORTCUTS, p.getX() + 55, obf.getWindowHeight(this) / 6 + 144, InvTweaksLocalization.get("invtweaks.settings.advanced.mappingsfile"))); 56 | 57 | // Create settings buttons 58 | 59 | i += 2; 60 | moveToButtonCoords(i++, p); 61 | InvTweaksGuiTooltipButton sortOnPickupBtn = new InvTweaksGuiTooltipButton(ID_SORT_ON_PICKUP, p.getX(), p.getY(), computeBooleanButtonLabel( 62 | InvTweaksConfig.PROP_ENABLE_SORTING_ON_PICKUP, labelSortOnPickup), InvTweaksLocalization.get("invtweaks.settings.advanced.sortonpickup.tooltip")); 63 | controlList.add(sortOnPickupBtn); 64 | 65 | moveToButtonCoords(i++, p); 66 | InvTweaksGuiTooltipButton enableSoundsBtn = new InvTweaksGuiTooltipButton(ID_ENABLE_SOUNDS, p.getX(), p.getY(), computeBooleanButtonLabel( 67 | InvTweaksConfig.PROP_ENABLE_SOUNDS, labelEnableSounds), 68 | InvTweaksLocalization.get("invtweaks.settings.advanced.sounds.tooltip")); 69 | controlList.add(enableSoundsBtn); 70 | 71 | moveToButtonCoords(i++, p); 72 | controlList.add(new InvTweaksGuiTooltipButton(ID_CHESTS_BUTTONS, p.getX(), p.getY(), computeBooleanButtonLabel( 73 | InvTweaksConfig.PROP_SHOW_CHEST_BUTTONS, labelChestButtons), InvTweaksLocalization.get("invtweaks.settings.chestbuttons.tooltip"))); 74 | 75 | moveToButtonCoords(i++, p); 76 | InvTweaksGuiTooltipButton autoEquipArmorBtn = new InvTweaksGuiTooltipButton(ID_AUTO_EQUIP_ARMOR, p.getX(), p.getY(), computeBooleanButtonLabel( 77 | InvTweaksConfig.PROP_ENABLE_AUTO_EQUIP_ARMOR, labelEquipArmor), InvTweaksLocalization.get("invtweaks.settings.advanced.autoequip.tooltip")); 78 | controlList.add(autoEquipArmorBtn); 79 | 80 | // Check if links to files are supported, if not disable the buttons 81 | if (!Desktop.isDesktopSupported()) { 82 | for (Object o : controlList) { 83 | if (obf.isGuiButton(o)) { 84 | GuiButton button = obf.asGuiButton(o); 85 | if (obf.getId(button) == ID_EDITSHORTCUTS) { 86 | obf.setEnabled(button, false); 87 | } 88 | } 89 | } 90 | } 91 | 92 | // Save control list 93 | obf.setControlList(this, controlList); 94 | 95 | } 96 | 97 | public void drawScreen(int i, int j, float f) { 98 | super.drawScreen(i, j, f); 99 | 100 | int x = obf.getWindowWidth(this) / 2; 101 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.settings.pvpwarning.pt1"), x, 40, 0x999999); 102 | drawCenteredString(obf.getFontRenderer(), InvTweaksLocalization.get("invtweaks.settings.pvpwarning.pt2"), x, 50, 0x999999); 103 | } 104 | 105 | protected void actionPerformed(GuiButton guibutton) { 106 | 107 | switch (obf.getId(guibutton)) { 108 | 109 | // Toggle auto-refill sound 110 | case ID_SORT_ON_PICKUP: 111 | toggleBooleanButton(guibutton, InvTweaksConfig.PROP_ENABLE_SORTING_ON_PICKUP, labelSortOnPickup); 112 | break; 113 | 114 | // Toggle shortcuts 115 | case ID_AUTO_EQUIP_ARMOR: 116 | toggleBooleanButton(guibutton, InvTweaksConfig.PROP_ENABLE_AUTO_EQUIP_ARMOR, labelEquipArmor); 117 | break; 118 | 119 | // Toggle sounds 120 | case ID_ENABLE_SOUNDS: 121 | toggleBooleanButton(guibutton, InvTweaksConfig.PROP_ENABLE_SOUNDS, labelEnableSounds); 122 | break; 123 | 124 | // Toggle chest buttons 125 | case ID_CHESTS_BUTTONS: 126 | toggleBooleanButton(guibutton, InvTweaksConfig.PROP_SHOW_CHEST_BUTTONS, labelChestButtons); 127 | break; 128 | 129 | // Open shortcuts mappings in external editor 130 | case ID_EDITSHORTCUTS: 131 | try { 132 | Desktop.getDesktop().open(new File(InvTweaksConst.CONFIG_PROPS_FILE)); 133 | } catch (Exception e) { 134 | InvTweaks.logInGameErrorStatic("invtweaks.settings.advanced.mappingsfile.error", e); 135 | } 136 | break; 137 | 138 | // Back to main settings screen 139 | case ID_DONE: 140 | obf.displayGuiScreen(new InvTweaksGuiSettings(mc, parentScreen, config)); 141 | 142 | } 143 | 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /conf/mcp.cfg: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | DirTemp = temp 3 | DirSrc = src 4 | DirLogs = logs 5 | DirBin = bin 6 | DirJars = jars 7 | DirReobf = reobf 8 | DirConf = conf 9 | DirRuntime = runtime 10 | DirLib = lib 11 | DirTempSrc = temp/src 12 | DirTempCls = temp/cls 13 | DirTempBin = temp/bin 14 | DirModSrc = modsrc 15 | DirEclipse = eclipse 16 | 17 | [CSV] 18 | Classes = %(DirConf)s/classes.csv 19 | Methods = %(DirConf)s/methods.csv 20 | Fields = %(DirConf)s/fields.csv 21 | Params = %(DirConf)s/params.csv 22 | NewIds = %(DirConf)s/newids.csv 23 | 24 | [SRGS] 25 | ConfClient = %(DirConf)s/client.srg 26 | ConfServer = %(DirConf)s/server.srg 27 | Client = %(DirTemp)s/client_rg.srg 28 | Server = %(DirTemp)s/server_rg.srg 29 | DeobfClient = %(DirTemp)s/client_deobf.srg 30 | DeobfServer = %(DirTemp)s/server_deobf.srg 31 | ReobfClient = %(DirTemp)s/client_ro.srg 32 | ReobfServer = %(DirTemp)s/server_ro.srg 33 | 34 | [JAR] 35 | DirNatives = %(DirJars)s/bin/natives 36 | Client = %(DirJars)s/bin/minecraft.jar 37 | Server = %(DirJars)s/minecraft_server.jar 38 | LWJGL = %(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar 39 | MD5Client = 48677dc4c2b98c29918722b5ab27b4fd 40 | MD5Server = b0700fa969dbf0ff085082cde87384d2 41 | 42 | [RETROGUARD] 43 | Location = %(DirRuntime)s/bin/retroguard.jar 44 | RetroConf = %(DirTemp)s/retroguard.cfg 45 | RetroReobConf = %(DirTemp)s/retroguard_ro.cfg 46 | ClientConf = %(DirTemp)s/client_rg.cfg 47 | ServerConf = %(DirTemp)s/server_rg.cfg 48 | ClientReobConf = %(DirTemp)s/client_ro.cfg 49 | ServerReobConf = %(DirTemp)s/server_ro.cfg 50 | ClientOut = %(DirTemp)s/minecraft_rg.jar 51 | ServerOut = %(DirTemp)s/minecraft_server_rg.jar 52 | ClientLog = %(DirLogs)s/client_rg.log 53 | ServerLog = %(DirLogs)s/server_rg.log 54 | ClientDeobLog = %(DirLogs)s/client_deob.log 55 | ServerDeobLog = %(DirLogs)s/server_deob.log 56 | NullPkg = net/minecraft/src 57 | 58 | [EXCEPTOR] 59 | XClientCfg = %(DirConf)s/joined.exc 60 | XServerCfg = %(DirConf)s/joined.exc 61 | XClientOut = %(DirTemp)s/minecraft_exc.jar 62 | XServerOut = %(DirTemp)s/minecraft_server_exc.jar 63 | XClientLog = %(DirLogs)s/client_exc.log 64 | XServerLog = %(DirLogs)s/server_exc.log 65 | 66 | [DECOMPILE] 67 | ClsClientTemp = %(DirTempCls)s/minecraft 68 | ClsServerTemp = %(DirTempCls)s/minecraft_server 69 | SrcClientTemp = %(DirTempSrc)s/minecraft 70 | SrcServerTemp = %(DirTempSrc)s/minecraft_server 71 | FFSource = net 72 | 73 | [OUTPUT] 74 | BinClientTemp = %(DirTempBin)s/minecraft 75 | BinServerTemp = %(DirTempBin)s/minecraft_server 76 | SrcClient = %(DirSrc)s/minecraft 77 | SrcServer = %(DirSrc)s/minecraft_server 78 | TestClient = net/minecraft/client/Minecraft 79 | TestServer = net/minecraft/server/MinecraftServer 80 | 81 | [PATCHES] 82 | PatchClient = %(DirConf)s/patches/minecraft.patch 83 | PatchServer = %(DirConf)s/patches/minecraft_server.patch 84 | PatchTemp = %(DirTemp)s/temp.patch 85 | FFPatchClient = %(DirConf)s/patches/minecraft_ff.patch 86 | FFPatchServer = %(DirConf)s/patches/minecraft_server_ff.patch 87 | PatchClient_osx = %(DirConf)s/patches/minecraft_osx.patch 88 | PatchServer_osx = %(DirConf)s/patches/minecraft_server_osx.patch 89 | 90 | [RECOMPILE] 91 | BinClient = %(DirBin)s/minecraft 92 | BinServer = %(DirBin)s/minecraft_server 93 | LogClient = %(DirLogs)s/client_compile.log 94 | LogServer = %(DirLogs)s/server_compile.log 95 | ClassPathClient = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/bin/minecraft.jar,%(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar 96 | ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.jar 97 | ClientFixes = %(DirConf)s/patches 98 | FixStart = Start 99 | IgnorePkg = paulscode,com/jcraft,isom,ibxm,de/matthiasmann/twl,org/xmlpull,javax/xml 100 | 101 | [REOBF] 102 | MD5Client = %(DirTemp)s/client.md5 103 | MD5Server = %(DirTemp)s/server.md5 104 | MD5PreReobfClient = %(DirTemp)s/client_reobf.md5 105 | MD5PreReobfServer = %(DirTemp)s/server_reobf.md5 106 | RecompJarClient = %(DirTemp)s/client_recomp.jar 107 | RecompJarServer = %(DirTemp)s/server_recomp.jar 108 | ObfJarClient = %(DirTemp)s/client_reobf.jar 109 | ObfJarServer = %(DirTemp)s/server_reobf.jar 110 | ReobfDirClient = %(DirReobf)s/minecraft 111 | ReobfDirServer = %(DirReobf)s/minecraft_server 112 | ClientRoLog = %(DirLogs)s/client_ro.log 113 | ServerRoLog = %(DirLogs)s/server_ro.log 114 | ReobfClientLog = %(DirLogs)s/client_reob.log 115 | ReobfServerLog = %(DirLogs)s/server_reob.log 116 | 117 | [GETMODSOURCE] 118 | OutSRCClient = %(DirModSrc)s/minecraft 119 | OutSRCServer = %(DirModSrc)s/minecraft_server 120 | 121 | [MCP] 122 | LogFile = %(DirLogs)s/mcp.log 123 | LogFileErr = %(DirLogs)s/mcperr.log 124 | UpdateUrl = http://mcp.ocean-labs.de/files/mcprolling_{version}/ 125 | IgnoreUpdate = %(DirBin)s,%(DirLib)s,%(DirLogs)s,%(DirModSrc)s,%(DirReobf)s,%(DirSrc)s,%(DirTemp)s,%(DirEclipse)s/Client/bin,%(DirEclipse)s/Server/bin,%(DirJars)s/world,%(DirJars)s/saves,%(DirJars)s/resources 126 | RGIndex = 92000 127 | ParamIndex = 8000 128 | 129 | [ASTYLE] 130 | AstyleConfig = %(DirConf)s/astyle.cfg 131 | 132 | [COMMANDS] 133 | Wine = wine 134 | Patcher_win = %(DirRuntime)s/bin/applydiff.exe 135 | Patcher_linux = patch 136 | Patcher_osx = patch 137 | Jad_win = %(DirRuntime)s/bin/jad.exe 138 | Jad_osx = %(DirRuntime)s/bin/jad-osx 139 | AStyle_win = %(DirRuntime)s/bin/astyle.exe 140 | AStyle_linux = astyle 141 | AStyle_osx = %(DirRuntime)s/bin/astyle-osx 142 | JadRetro = %(DirRuntime)s/bin/jadretro.jar 143 | Fernflower = %(DirRuntime)s/bin/fernflower.jar 144 | Exceptor = %(DirRuntime)s/bin/mcinjector.jar 145 | CmdPatch = %s -p1 -u -i {patchfile} -d {srcdir} 146 | CmdJad = %s -b -d {outdir} -dead -o -r -s .java -stat -ff {classes} 147 | CmdAStyle = %s --suffix=none --quiet --options={conffile} {classes} 148 | CmdRG = %s -cp "{classpath}" RetroGuard -searge {conffile} 149 | CmdRGReobf = %s -cp "{classpath}" RetroGuard -notch {conffile} 150 | CmdJadretro = %s -jar %s {targetdir} 151 | CmdFernflower = %s -jar %s -din=0 -rbr=0 -dgs=1 -asc=1 -log=WARN {indir} {outdir} 152 | CmdExceptor = %s -jar %s {input} {output} {conf} {log} 153 | CmdRecomp = %s -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs} 154 | CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" net.minecraft.server.MinecraftServer 155 | CmdStartClt = %s -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} Start 156 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksModCompatibility.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import invtweaks.InvTweaksConst; 4 | 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | import net.minecraft.src.Container; 10 | import net.minecraft.src.GuiContainer; 11 | import net.minecraft.src.GuiScreen; 12 | import net.minecraft.src.InvTweaksObfuscation; 13 | import net.minecraft.src.Slot; 14 | 15 | 16 | public class InvTweaksModCompatibility { 17 | 18 | private InvTweaksObfuscation obf; 19 | 20 | public InvTweaksModCompatibility(InvTweaksObfuscation obf) { 21 | this.obf = obf; 22 | } 23 | 24 | /** 25 | * Returns true if the screen is a chest/dispenser, 26 | * despite not being a GuiChest or a GuiDispenser. 27 | * @param guiContainer 28 | * @return 29 | */ 30 | public boolean isSpecialChest(GuiScreen guiScreen) { 31 | return is(guiScreen, "GuiAlchChest") // Equivalent Exchange 32 | || is(guiScreen, "GuiCondenser") // Equivalent Exchange 33 | || is(guiScreen, "GUIChest") // Iron chests (formerly IC2) 34 | || is(guiScreen, "GuiMultiPageChest") // Multi Page chest 35 | || is(guiScreen, "GuiGoldSafe") // More Storage 36 | || is(guiScreen, "GuiLocker") 37 | || is(guiScreen, "GuiDualLocker") 38 | || is(guiScreen, "GuiSafe") 39 | || is(guiScreen, "GuiCabinet") 40 | || is(guiScreen, "GuiTower") 41 | || is(guiScreen, "GuiBufferChest") // Red Power 2 42 | || is(guiScreen, "GuiRetriever") // Red Power 2 43 | || is(guiScreen, "GuiItemDetect") // Red Power 2 44 | || is(guiScreen, "GuiAlloyFurnace") // Red Power 2 45 | || is(guiScreen, "GuiDeploy") // Red Power 2 46 | || is(guiScreen, "GuiSorter") // Red Power 2 47 | || is(guiScreen, "GuiFilter") // Red Power 2 48 | || is(guiScreen, "GuiAdvBench") // Red Power 2 49 | || is(guiScreen, "GuiEject") // Red Power 2 50 | || is(guiScreen, "GuiBag") // Red Power 2 51 | || is(guiScreen, "GuiPersonalChest") 52 | || is(guiScreen, "GuiNuclearReactor") // IC2 53 | || is(guiScreen, "GuiEnderChest") // EnderChest 54 | || is(guiScreen, "GuiColorBox") 55 | || is(guiScreen, "GuiLinkedColorBox") // ColorBox 56 | || is(guiScreen, "FC_GuiChest") // Metallurgy 57 | || is(guiScreen, "FM_GuiMintStorage") // Metallurgy 58 | || is(guiScreen, "GuiChestTFC") // TerraFirmaCraft 59 | || is(guiScreen, "GuiBackpack") // Backpacks 60 | ; 61 | } 62 | 63 | /** 64 | * Returns a special chest row size. 65 | * Given guiContainer must be checked first with isSpecialChest(). 66 | * @param guiContainer 67 | * @param defaultValue 68 | * @return 69 | */ 70 | public int getSpecialChestRowSize(GuiContainer guiContainer, int defaultValue) { 71 | if (is(guiContainer, "GuiAlchChest") 72 | || is(guiContainer, "GuiCondenser")) { // Equivalent Exchange 73 | return 13; 74 | } else if (is(guiContainer, "GUIChest")) { // Iron chests (formerly IC2) 75 | try { 76 | return (Integer)guiContainer.getClass().getMethod("getRowLength").invoke(guiContainer); 77 | } catch (Exception e) { 78 | // Skip it 79 | } 80 | } else if (is(guiContainer, "GuiMultiPageChest")) { // Multi Page chest 81 | return 13; 82 | } else if (is(guiContainer, "GuiLocker") // More Storage 83 | || is(guiContainer, "GuiDualLocker") 84 | || is(guiContainer, "GuiTower")) { 85 | return 8; 86 | } else if (is(guiContainer, "GuiBufferChest")) { // Red Power 2 87 | return 4; 88 | } else if (is(guiContainer, "GuiSorter")) { 89 | return 8; 90 | } else if (is(guiContainer, "GuiRetriever") 91 | || is(guiContainer, "GuiItemDetect") 92 | || is(guiContainer, "GuiAlloyFurnace") 93 | || is(guiContainer, "GuiDeploy") 94 | || is(guiContainer, "GuiFilter") 95 | || is(guiContainer, "GuiEject")) { 96 | return 3; 97 | } else if (is(guiContainer, "GuiNuclearReactor")) { // IC2 98 | return (obf.getSlots(obf.getContainer(guiContainer)).size() - 36) / 6; 99 | } 100 | return defaultValue; 101 | } 102 | 103 | public boolean isChestWayTooBig(GuiScreen guiScreen) { 104 | return is(guiScreen, "GuiAlchChest") // Equivalent Exchange 105 | || is(guiScreen, "GuiMultiPageChest") // MultiPage Chest 106 | || is(guiScreen, "GUIChest") // IronChests 107 | || is(guiScreen, "FC_GuiChest") // Metallurgy 108 | ; 109 | } 110 | 111 | /** 112 | * Returns true if the screen is the inventory screen, despite not being a GuiInventory. 113 | * @param guiScreen 114 | * @return 115 | */ 116 | public boolean isSpecialInventory(GuiScreen guiScreen) { 117 | try { 118 | return obf.getSlots(obf.getContainer(obf.asGuiContainer(guiScreen))).size() > InvTweaksConst.INVENTORY_SIZE 119 | && !obf.isGuiInventoryCreative(guiScreen); 120 | } catch (Exception e) { 121 | return false; 122 | } 123 | } 124 | 125 | @SuppressWarnings("unchecked") 126 | public Map> getSpecialContainerSlots(GuiScreen guiScreen, Container container) { 127 | 128 | Map> result = new HashMap>(); 129 | List slots = (List) obf.getSlots(container); 130 | 131 | if (is(guiScreen, "GuiCondenser")) { // EE 132 | result.put(InvTweaksContainerSection.CHEST, slots.subList(1, slots.size() - 36)); 133 | } 134 | else if (is(guiScreen, "GuiAdvBench")) { // RedPower 2 135 | result.put(InvTweaksContainerSection.CRAFTING_IN, slots.subList(0, 9)); 136 | result.put(InvTweaksContainerSection.CRAFTING_OUT, slots.subList(10, 11)); 137 | result.put(InvTweaksContainerSection.CHEST, slots.subList(11, 29)); 138 | } else if(is(guiScreen, "GuiArcaneWorkbench") || is(guiScreen, "GuiInfusionWorkbench")) { // Thaumcraft 3 139 | result.put(InvTweaksContainerSection.CRAFTING_OUT, slots.subList(0, 1)); 140 | result.put(InvTweaksContainerSection.CRAFTING_IN, slots.subList(2, 11)); 141 | } 142 | 143 | return result; 144 | 145 | } 146 | 147 | private static final boolean is(GuiScreen guiScreen, String className) { 148 | try { 149 | return guiScreen.getClass().getSimpleName().contains(className); 150 | } 151 | catch (Exception e) { 152 | return false; 153 | } 154 | } 155 | 156 | 157 | } -------------------------------------------------------------------------------- /src/minecraft/invtweaks/lang/ja_JP.properties: -------------------------------------------------------------------------------- 1 | #X-Generator: crowdin.net 2 | invtweaks.loadconfig.enabled='%s' \u3092\u6709\u52b9\u3057\u305f 3 | invtweaks.loadconfig.refresh.error=[1] \u30d5\u30a1\u30a4\u30eb\u304b\u3089\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u66f4\u65b0\u306f\u5931\u6557\u3057\u307e\u3057\u305f 4 | invtweaks.loadconfig.invalidkeywords=\u7121\u52b9\u30ad\u30fc\u30ef\u30fc\u30c9\u767a\u898b 5 | invtweaks.loadconfig.filemissing=\u30b3\u30f3\u30d5\u30a3\u30b0\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059 6 | invtweaks.loadconfig.done=\u30b3\u30f3\u30d5\u30a3\u30b0\u304c\u30ed\u30fc\u30c9\u3055\u308c\u305f 7 | invtweaks.propsfile.loaded=Mod\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u30ed\u30fc\u30c9\u3055\u308c\u305f 8 | invtweaks.propsfile.error=[14] Mod\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f 9 | invtweaks.extract.find.error=[15] \u3053\u306eMod\u306f\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3001%s \u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f 10 | invtweaks.extract.create.error=[16] \u3053\u306eMod\u306f\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3001%s \u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f 11 | invtweaks.sort.inventory.error=[2] \u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u306e\u30bd\u30fc\u30c8\u306b\u5931\u6557\u3057\u307e\u3057\u305f 12 | invtweaks.sort.chest.error=[3] \u30b3\u30f3\u30c6\u30ca\u306e\u30bd\u30fc\u30c8\u306b\u5931\u6557\u3057\u307e\u3057\u305f 13 | invtweaks.sort.autorefill.error=[4] \u81ea\u52d5\u88dc\u5145\u306f\u5931\u6557\u3057\u307e\u3057\u305f 14 | invtweaks.sort.releaseitem.error=[5] \u30a2\u30a4\u30c6\u30e0\u306e\u958b\u653e\u306b\u5931\u6557\u3057\u307e\u3057\u305f 15 | invtweaks.shortcut.error=[6] \u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u306e\u5b9f\u884c\u306b\u5931\u6557\u3057\u307e\u3057\u305f 16 | invtweaks.pickup.error=[7] \u9078\u629e\u3057\u305f\u30b9\u30bf\u30c3\u30af\u306e\u79fb\u52d5\u306b\u5931\u6557\u3057\u307e\u3057\u305f 17 | invtweaks.button.settings.tooltip=\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u8a2d\u5b9a 18 | invtweaks.button.chest1.tooltip=\u30c7\u30d5\u30a9\u30eb\u30c8 \u30bd\u30fc\u30c8 19 | invtweaks.button.chest2.tooltip=\u5217\u3067\u30bd\u30fc\u30c8 20 | invtweaks.button.chest3.tooltip=\u884c\u3067\u30bd\u30fc\u30c8 21 | invtweaks.settings.title=\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u3068\u30c1\u30a7\u30b9\u30c8\u306e\u8a2d\u5b9a 22 | invtweaks.settings.on=\u958b 23 | invtweaks.settings.off=\u9589 24 | invtweaks.settings.disableci=CI\u3092\u7121\u52b9\u306b\u3059\u308b 25 | invtweaks.settings.disableci.tooltip=Convenient Inventory \u3068\u885d\u7a81\u3059\u308b 26 | invtweaks.settings.middleclick=\u30df\u30c9\u30eb\u30af\u30ea\u30c3\u30af 27 | invtweaks.settings.middleclick.tooltip=\u30df\u30c9\u30eb\u30af\u30ea\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3066\u30bd\u30fc\u30c8\u3059\u308b 28 | invtweaks.settings.chestbuttons=\u30c1\u30a7\u30b9\u30c8\u30dc\u30bf\u30f3 29 | invtweaks.settings.chestbuttons.tooltip=\u30c1\u30a7\u30b9\u30c8\u306b\u30bd\u30fc\u30c8\u3059\u308b\u306e\u305f\u3081\u306e\u30dc\u30bf\u30f3\u3092\uff13\u3064\u8ffd\u52a0\u3057\u307e\u3059 30 | invtweaks.settings.shortcuts=\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8 31 | invtweaks.settings.shortcuts.tooltip=\u30a2\u30a4\u30c6\u30e0\u3092\u79fb\u52d5\u3059\u308b\u305f\u3081\u306e\u69d8\u3005\u306a\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u3092\u6709\u52b9\u306b 32 | invtweaks.settings.autorefill=\u81ea\u52d5\u88dc\u5145 33 | invtweaks.settings.autorefill.tooltip=\u58ca\u308c\u305f\u5de5\u5177\uff06\u7a7a\u306e\u30b9\u30bf\u30c3\u30af\u3092\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u306e\u4ed6\u306e\u3082\u306e\u3068\u7f6e\u304d\u63db\u3048\u307e\u3059 34 | invtweaks.settings.moreoptions=\u305d\u306e\u4ed6\u306e\u30aa\u30d7\u30b7\u30e7\u30f3... 35 | invtweaks.settings.moreoptions.tooltip=\u3082\u3063\u3068\u591a\u304f\u30af\u30fc\u30eb\u306a\u3082\u306e 36 | invtweaks.settings.rulesfile=\u30bd\u30fc\u30c8\u30eb\u30fc\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f... 37 | invtweaks.settings.rulesfile.error=[8] \u30eb\u30fc\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u306e\u3092\u5931\u6557\u3057\u307e\u3057\u305f 38 | invtweaks.settings.treefile=\u30a2\u30a4\u30c6\u30e0\u30c4\u30ea\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f... 39 | invtweaks.settings.treefile.error=[9] \u30c4\u30ea\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u306e\u3092\u5931\u6557\u3057\u307e\u3057\u305f 40 | invtweaks.settings.onlinehelp=\u30d6\u30e9\u30a6\u30b6\u30fc\u3067\u30d8\u30eb\u30d7\u3092\u958b\u304f... 41 | invtweaks.settings.onlinehelp.error=[10] \u30d8\u30eb\u30d7\u3092\u958b\u304f\u306e\u3092\u5931\u6557\u3057\u307e\u3057\u305f 42 | invtweaks.settings.pvpwarning.pt1=\u6ce8\: PvP\u30b5\u30fc\u30d0\u30fc\u3067\u3001\u81ea\u52d5\u88dc\u5145 \uff06 \u93a7\u306e\u81ea\u52d5\u88c5\u5099 43 | invtweaks.settings.pvpwarning.pt2=\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u4e0d\u6b63\u884c\u70ba\u3068\u898b\u306a\u3055\u308c\u307e\u3059\uff01 44 | invtweaks.settings.exit=\u5b8c\u4e86 45 | invtweaks.settings.advanced.sortonpickup=\u30a2\u30a4\u30c6\u30e0\u3092\u62fe\u3046\u6642\u30bd\u30fc\u30c8\u3059\u308b 46 | invtweaks.settings.advanced.sortonpickup.soloonly=SP \u306e\u307f 47 | invtweaks.settings.advanced.sortonpickup.tooltip=\u30a2\u30a4\u30c6\u30e0\u53d6\u5f97\u6642\u3001\u30db\u30c3\u30c8\u30d0\u30fc\u3092\u57cb\u3081\u308b\u306e\u3092\u56de\u907f\u3059\u308b 48 | invtweaks.settings.advanced.sortonpickup.tooltip.soloonly=\u30b7\u30f3\u30b0\u30eb\u30d7\u30ec\u30a4\u30e4\u30fc\u30e2\u30fc\u30c9\u306e\u307f 49 | invtweaks.settings.advanced.autoequip=\u93a7\u3092\u81ea\u52d5\u88c5\u5099 50 | invtweaks.settings.advanced.autoequip.tooltip=\u30bd\u30fc\u30c8\u306e\u6642\u3001\u6700\u9ad8\u306e\u93a7\u3092\u88c5\u5099\u3057\u307e\u3059 51 | invtweaks.settings.advanced.sounds=\u30b5\u30a6\u30f3\u30c9\u3092\u6709\u52b9\u306b\u3057\u307e\u3059 52 | invtweaks.settings.advanced.sounds.tooltip=\u30bd\u30fc\u30c8\u304a\u3088\u3073\u81ea\u52d5\u88dc\u5145\u306e\u6642\u3001\u30b5\u30a6\u30f3\u30c9\u3092\u518d\u751f\u3057\u307e\u3059 53 | invtweaks.settings.advanced.mappingsfile=\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f... 54 | invtweaks.settings.advanced.mappingsfile.error=[11] \u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u306e\u3092\u5931\u6557\u3057\u307e\u3057\u305f 55 | invtweaks.help.shortcuts.title=\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8 \u30d8\u30eb\u30d7 56 | invtweaks.help.shortcuts.click=\u30af\u30ea\u30c3\u30af 57 | invtweaks.help.shortcuts.or=\u307e\u305f\u306f 58 | invtweaks.help.shortcuts.onestack=\uff11\u3064\u306e\u30b9\u30bf\u30c3\u30af\u3092\u79fb\u52d5\u3057\u307e\u3059 59 | invtweaks.help.shortcuts.oneitem=\uff11\u3064\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u79fb\u52d5\u3057\u307e\u3059 60 | invtweaks.help.shortcuts.allitems=\u540c\u3058\u7a2e\u985e\u306e\u5168\u3066\u30a2\u30a4\u30c6\u30e0\u3092\u79fb\u52d5\u3057\u307e\u3059 61 | invtweaks.help.shortcuts.everything=\u5168\u3066\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u79fb\u52d5\u3057\u307e\u3059 62 | invtweaks.help.shortcuts.hotbar=\u30db\u30c3\u30c8\u30d0\u30fc\u306b\u79fb\u52d5\u3057\u307e\u3059 63 | invtweaks.help.shortcuts.emptyslot=\u7a7a\u306e\u30b9\u30ed\u30c3\u30c8\u306b\u79fb\u52d5\u3057\u307e\u3059 64 | invtweaks.help.shortcuts.rightclick=(\u4efb\u610f\u306e\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8) + \u53f3\u30af\u30ea\u30c3\u30af 65 | invtweaks.help.shortcuts.drop=\u6368\u3066\u308b 66 | invtweaks.help.shortcuts.craftall=\u3059\u3079\u3066\u3092\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u306b\u30af\u30e9\u30d5\u30c8\u3059\u308b 67 | invtweaks.help.shortcuts.craftone=\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u306b\u30af\u30e9\u30d5\u30c8\u3059\u308b 68 | invtweaks.help.shortcuts.selectconfig=\u30bd\u30fc\u30c8\u8a2d\u5b9a\u3092\u9078\u629e\u3057\u307e\u3059 69 | invtweaks.help.shortcuts.forward=(\u524d\u9032) 70 | invtweaks.keyboardfix.error=[12] \u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u30c8\u30e9\u30d6\u30eb\u304c\u3042\u308a\u307e\u3059 71 | invtweaks.keyboardfix.recover=Ok \u4fee\u5fa9\u3055\u308c\u307e\u3057\u305f \u3054\u3081\u3093\u306a\u3055\u3044 72 | invtweaks.modcompat.ci.error=[13] Convenient Inventory \u3068\u306e\u4e92\u63db\u6027\u306e\u78ba\u4fdd\u306b\u5931\u6557\u3057\u307e\u3057\u305f 73 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksConfigInventoryRuleset.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import invtweaks.InvTweaksConst; 4 | import invtweaks.InvTweaksItemTree; 5 | 6 | import java.security.InvalidParameterException; 7 | import java.util.Collections; 8 | import java.util.Vector; 9 | import java.util.logging.Logger; 10 | 11 | 12 | 13 | /** 14 | * Stores a whole configuration defined by rules. 15 | * Several of them can be stored in the global configuration, 16 | * as the mod supports several rule configurations. 17 | * 18 | * @author Jimeo Wan 19 | * 20 | */ 21 | public class InvTweaksConfigInventoryRuleset { 22 | 23 | private static final Logger log = Logger.getLogger("InvTweaks"); 24 | 25 | private String name; 26 | private int[] lockPriorities; 27 | private boolean[] frozenSlots; 28 | private Vector lockedSlots; 29 | private Vector rules; 30 | private Vector autoReplaceRules; 31 | private boolean debugEnabled; 32 | 33 | private InvTweaksItemTree tree; 34 | 35 | /** 36 | * Creates a new configuration holder. 37 | * The configuration is not yet loaded. 38 | */ 39 | public InvTweaksConfigInventoryRuleset(InvTweaksItemTree tree, String name) { 40 | this.tree = tree; 41 | this.name = name.trim(); 42 | 43 | lockPriorities = new int[InvTweaksConst.INVENTORY_SIZE]; 44 | for (int i = 0; i < lockPriorities.length; i++) { 45 | lockPriorities[i] = 0; 46 | } 47 | frozenSlots = new boolean[InvTweaksConst.INVENTORY_SIZE]; 48 | for (int i = 0; i < frozenSlots.length; i++) { 49 | frozenSlots[i] = false; 50 | } 51 | 52 | lockedSlots = new Vector(); 53 | rules = new Vector(); 54 | autoReplaceRules = new Vector(); 55 | debugEnabled = false; 56 | } 57 | 58 | /** 59 | * 60 | * @param rawLine 61 | * @return If not null, returns the invalid keyword found 62 | * @throws InvalidParameterException 63 | */ 64 | public String registerLine(String rawLine) throws InvalidParameterException { 65 | 66 | InvTweaksConfigSortingRule newRule = null; 67 | String lineText = rawLine.replaceAll("[\\s]+", " ").toLowerCase(); 68 | String[] words = lineText.split(" "); 69 | 70 | // Parse valid lines only 71 | if (words.length == 2) { 72 | 73 | // Standard rules format 74 | if (lineText.matches("^([a-d]|[1-9]|[r]){1,2} [\\w]*$") 75 | || lineText.matches("^[a-d][1-9]-[a-d][1-9][rv]?[rv]? [\\w]*$")) { 76 | 77 | words[0] = words[0].toLowerCase(); 78 | words[1] = words[1]; 79 | 80 | // Locking rule 81 | if (words[1].equals(InvTweaksConfig.LOCKED)) { 82 | int[] newLockedSlots = InvTweaksConfigSortingRule 83 | .getRulePreferredPositions( 84 | words[0], InvTweaksConst.INVENTORY_SIZE, 85 | InvTweaksConst.INVENTORY_ROW_SIZE); 86 | int lockPriority = InvTweaksConfigSortingRule. 87 | getRuleType(words[0],InvTweaksConst.INVENTORY_ROW_SIZE).getLowestPriority() - 1; 88 | for (int i : newLockedSlots) { 89 | lockPriorities[i] = lockPriority; 90 | } 91 | return null; 92 | } 93 | 94 | // Freeze rule 95 | else if (words[1].equals(InvTweaksConfig.FROZEN)) { 96 | int[] newLockedSlots = InvTweaksConfigSortingRule 97 | .getRulePreferredPositions( 98 | words[0], InvTweaksConst.INVENTORY_SIZE, 99 | InvTweaksConst.INVENTORY_ROW_SIZE); 100 | for (int i : newLockedSlots) { 101 | frozenSlots[i] = true; 102 | } 103 | return null; 104 | } 105 | 106 | // Standard rule 107 | else { 108 | String keyword = words[1].toLowerCase(); 109 | boolean isValidKeyword = tree.isKeywordValid(keyword); 110 | 111 | // If invalid keyword, guess something similar, 112 | // but check first if it's not an item ID 113 | // (can be used to make rules for unknown items) 114 | if (!isValidKeyword) { 115 | if (keyword.matches("^[0-9-]*$")) { 116 | isValidKeyword = true; 117 | } 118 | else { 119 | Vector wordVariants = getKeywordVariants(keyword); 120 | for (String wordVariant : wordVariants) { 121 | if (tree.isKeywordValid(wordVariant.toLowerCase())) { 122 | isValidKeyword = true; 123 | keyword = wordVariant; 124 | break; 125 | } 126 | } 127 | } 128 | } 129 | 130 | if (isValidKeyword) { 131 | newRule = new InvTweaksConfigSortingRule(tree, words[0], 132 | keyword.toLowerCase(), InvTweaksConst.INVENTORY_SIZE, 133 | InvTweaksConst.INVENTORY_ROW_SIZE); 134 | rules.add(newRule); 135 | return null; 136 | } 137 | else { 138 | return keyword.toLowerCase(); 139 | } 140 | } 141 | } 142 | 143 | // Autoreplace rule 144 | else if (words[0].equals(InvTweaksConfig.AUTOREFILL) 145 | || words[0].equals("autoreplace")) { // Compatibility 146 | words[1] = words[1].toLowerCase(); 147 | if (tree.isKeywordValid(words[1]) || 148 | words[1].equals(InvTweaksConfig.AUTOREFILL_NOTHING)) { 149 | autoReplaceRules.add(words[1]); 150 | } 151 | return null; 152 | } 153 | 154 | } 155 | 156 | else if (words.length == 1) { 157 | 158 | if (words[0].equals(InvTweaksConfig.DEBUG)) { 159 | debugEnabled = true; 160 | return null; 161 | } 162 | 163 | } 164 | 165 | throw new InvalidParameterException(); 166 | 167 | } 168 | 169 | public void finalize() { 170 | 171 | // Default Autoreplace behavior 172 | if (autoReplaceRules.isEmpty()) { 173 | try { 174 | autoReplaceRules.add(tree.getRootCategory().getName()); 175 | } 176 | catch (NullPointerException e) { 177 | throw new NullPointerException("No root category is defined."); 178 | } 179 | } 180 | 181 | // Sort rules by priority, highest first 182 | Collections.sort(rules, Collections.reverseOrder()); 183 | 184 | // Compute ordered locked slots 185 | for (int i = 0; i < lockPriorities.length; i++) { 186 | if (lockPriorities[i] > 0) { 187 | lockedSlots.add(i); 188 | } 189 | } 190 | 191 | } 192 | 193 | /** 194 | * @return the name 195 | */ 196 | public String getName() { 197 | return name; 198 | } 199 | 200 | /** 201 | * @return the lockPriorities 202 | */ 203 | public int[] getLockPriorities() { 204 | return lockPriorities; 205 | } 206 | 207 | /** 208 | * @return the frozenSlots 209 | */ 210 | public boolean[] getFrozenSlots() { 211 | return frozenSlots; 212 | } 213 | 214 | /** 215 | * @return the lockedSlots 216 | */ 217 | public Vector getLockedSlots() { 218 | return lockedSlots; 219 | } 220 | 221 | /** 222 | * @return the rules 223 | */ 224 | public Vector getRules() { 225 | return rules; 226 | } 227 | 228 | /** 229 | * @return the autoReplaceRules 230 | */ 231 | public Vector getAutoReplaceRules() { 232 | return autoReplaceRules; 233 | } 234 | 235 | /** 236 | * @return the debugEnabled 237 | */ 238 | public boolean isDebugEnabled() { 239 | return debugEnabled; 240 | } 241 | 242 | /** 243 | * Compute keyword variants to also match bad keywords. 244 | * torches => torch 245 | * diamondSword => sworddiamond 246 | * woodenPlank => woodPlank plankwooden plankwood 247 | */ 248 | private Vector getKeywordVariants(String keyword) { 249 | Vector variants = new Vector(); 250 | 251 | if (keyword.endsWith("es")) { // ex: torches => torch 252 | variants.add(keyword.substring(0, keyword.length()-2)); 253 | } 254 | if (keyword.endsWith("s")) { // ex: wools => wool 255 | variants.add(keyword.substring(0, keyword.length()-1)); 256 | } 257 | 258 | if (keyword.contains("en")) { // ex: wooden => wood 259 | variants.add(keyword.replaceAll("en", "")); 260 | } 261 | else { 262 | if (keyword.contains("wood")) { 263 | variants.add(keyword.replaceAll("wood", "wooden")); 264 | } 265 | if (keyword.contains("gold")) { 266 | variants.add(keyword.replaceAll("gold", "golden")); 267 | } 268 | } 269 | 270 | // Swap words 271 | if (keyword.matches("\\w*[A-Z]\\w*")) { 272 | byte[] keywordBytes = keyword.getBytes(); 273 | for (int i = 0; i < keywordBytes.length; i++) { 274 | if (keywordBytes[i] >= 'A' && keywordBytes[i] <= 'Z') { 275 | String swapped = (keyword.substring(i) + 276 | keyword.substring(0, i)).toLowerCase(); 277 | variants.add(swapped); 278 | variants.addAll(getKeywordVariants(swapped)); 279 | } 280 | } 281 | } 282 | 283 | return variants; 284 | } 285 | } 286 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksHandlerAutoRefill.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import invtweaks.InvTweaksConst; 4 | import invtweaks.InvTweaksItemTree; 5 | import invtweaks.InvTweaksItemTreeItem; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.concurrent.TimeoutException; 10 | import java.util.logging.Logger; 11 | 12 | 13 | import net.minecraft.client.Minecraft; 14 | import net.minecraft.src.InvTweaksObfuscation; 15 | import net.minecraft.src.ItemStack; 16 | 17 | /** 18 | * Handles the auto-refilling of the hotbar. 19 | * 20 | * @author Jimeo Wan 21 | * 22 | */ 23 | public class InvTweaksHandlerAutoRefill extends InvTweaksObfuscation { 24 | 25 | private static final Logger log = Logger.getLogger("InvTweaks"); 26 | 27 | private InvTweaksConfig config = null; 28 | 29 | public InvTweaksHandlerAutoRefill(Minecraft mc, InvTweaksConfig config) { 30 | super(mc); 31 | setConfig(config); 32 | } 33 | 34 | public void setConfig(InvTweaksConfig config) { 35 | this.config = config; 36 | } 37 | 38 | /** 39 | * Auto-refill 40 | * @throws Exception 41 | */ 42 | public void autoRefillSlot(int slot, int wantedId, int wantedDamage) throws Exception { 43 | 44 | InvTweaksContainerSectionManager container = new InvTweaksContainerSectionManager( 45 | mc, InvTweaksContainerSection.INVENTORY); 46 | ItemStack candidateStack, replacementStack = null; 47 | int replacementStackSlot = -1; 48 | boolean refillBeforeBreak = config.getProperty(InvTweaksConfig.PROP_AUTO_REFILL_BEFORE_BREAK) 49 | .equals(InvTweaksConfig.VALUE_TRUE); 50 | 51 | List matchingRules = new ArrayList(); 52 | List rules = config.getRules(); 53 | InvTweaksItemTree tree = config.getTree(); 54 | 55 | // Check that the item is in the tree 56 | if (!tree.isItemUnknown(wantedId, wantedDamage)) { 57 | 58 | //// Search replacement 59 | 60 | List items = tree.getItems(wantedId, wantedDamage); 61 | 62 | // Find rules that match the slot 63 | for (InvTweaksItemTreeItem item : items) { 64 | // Since we search a matching item using rules, 65 | // create a fake one that matches the exact item first 66 | matchingRules.add(new InvTweaksConfigSortingRule( 67 | tree, "D"+(slot-27), item.getName(), 68 | InvTweaksConst.INVENTORY_SIZE, InvTweaksConst.INVENTORY_ROW_SIZE)); 69 | } 70 | for (InvTweaksConfigSortingRule rule : rules) { 71 | if (rule.getType() == InvTweaksConfigSortingRuleType.SLOT 72 | || rule.getType() == InvTweaksConfigSortingRuleType.COLUMN) { 73 | for (int preferredSlot : rule.getPreferredSlots()) { 74 | if (slot == preferredSlot) { 75 | matchingRules.add(rule); 76 | break; 77 | } 78 | } 79 | } 80 | } 81 | 82 | // Look only for a matching stack 83 | // First, look for the same item, 84 | // else one that matches the slot's rules 85 | for (InvTweaksConfigSortingRule rule : matchingRules) { 86 | for (int i = 0; i < InvTweaksConst.INVENTORY_SIZE; i++) { 87 | candidateStack = container.getItemStack(i); 88 | if (candidateStack != null) { 89 | List candidateItems = tree.getItems( 90 | getItemID(candidateStack), 91 | getItemDamage(candidateStack)); 92 | if (tree.matches(candidateItems, rule.getKeyword())) { 93 | // Choose tool of highest damage value 94 | if (getMaxStackSize(candidateStack) == 1) { 95 | if ((replacementStack == null || getItemDamage(candidateStack) > getItemDamage(replacementStack)) && 96 | (!refillBeforeBreak || getMaxDamage(getItem(candidateStack)) - getItemDamage(candidateStack) 97 | > InvTweaksConst.AUTO_REFILL_DAMAGE_TRESHOLD)) { 98 | replacementStack = candidateStack; 99 | replacementStackSlot = i; 100 | } 101 | } 102 | // Choose stack of lowest size 103 | else if (replacementStack == null || getStackSize(candidateStack) < getStackSize(replacementStack)) { 104 | replacementStack = candidateStack; 105 | replacementStackSlot = i; 106 | } 107 | } 108 | } 109 | } 110 | } 111 | } 112 | 113 | // If item is unknown, look for exact same item 114 | else { 115 | for (int i = 0; i < InvTweaksConst.INVENTORY_SIZE; i++) { 116 | candidateStack = container.getItemStack(i); 117 | if (candidateStack != null && 118 | getItemID(candidateStack) == wantedId && 119 | getItemDamage(candidateStack) == wantedDamage) { 120 | replacementStack = candidateStack; 121 | replacementStackSlot = i; 122 | break; 123 | } 124 | } 125 | } 126 | 127 | //// Proceed to replacement 128 | 129 | if (replacementStack != null || (refillBeforeBreak && getStack(container.getSlot(slot)) != null)) { 130 | 131 | log.info("Automatic stack replacement."); 132 | 133 | /* 134 | * This allows to have a short feedback 135 | * that the stack/tool is empty/broken. 136 | */ 137 | new Thread(new Runnable() { 138 | 139 | private InvTweaksContainerSectionManager containerMgr; 140 | private int targetedSlot; 141 | private int i, expectedItemId; 142 | private boolean refillBeforeBreak; 143 | 144 | public Runnable init(Minecraft mc, 145 | int i, int currentItem, boolean refillBeforeBreak) throws Exception { 146 | this.containerMgr = new InvTweaksContainerSectionManager( 147 | mc, InvTweaksContainerSection.INVENTORY); 148 | this.targetedSlot = currentItem; 149 | if (i != -1) { 150 | this.i = i; 151 | this.expectedItemId = getItemID(containerMgr.getItemStack(i)); 152 | } 153 | else { 154 | this.i = containerMgr.getFirstEmptyIndex(); 155 | this.expectedItemId = -1; 156 | } 157 | this.refillBeforeBreak = refillBeforeBreak; 158 | return this; 159 | } 160 | 161 | public void run() { 162 | 163 | // Wait for the server to confirm that the 164 | // slot is now empty 165 | int pollingTime = 0; 166 | setHasInventoryChanged(false); 167 | while(getThePlayer() != null && !hasInventoryChanged() 168 | && pollingTime < InvTweaksConst.POLLING_TIMEOUT) { 169 | trySleep(InvTweaksConst.POLLING_DELAY); 170 | } 171 | if (getThePlayer() == null) { 172 | return; // Game closed 173 | } 174 | if (pollingTime < InvTweaksConst.AUTO_REFILL_DELAY) 175 | trySleep(InvTweaksConst.AUTO_REFILL_DELAY - pollingTime); 176 | if (pollingTime >= InvTweaksConst.POLLING_TIMEOUT) 177 | log.warning("Autoreplace timout"); 178 | 179 | // In POLLING_DELAY ms, things might have changed 180 | try { 181 | ItemStack stack = containerMgr.getItemStack(i); 182 | if (stack != null && getItemID(stack) == expectedItemId || this.refillBeforeBreak) { 183 | if (containerMgr.move(targetedSlot, i) || containerMgr.move(i, targetedSlot)) { 184 | if (!config.getProperty(InvTweaksConfig.PROP_ENABLE_SOUNDS).equals(InvTweaksConfig.VALUE_FALSE)) { 185 | playSound("mob.chickenplop", 1.4F, 0.5F); 186 | } 187 | // If item are swapped (like for mushroom soups), 188 | // put the item back in the inventory if it is in the hotbar 189 | if (containerMgr.getItemStack(i) != null && i >= 27) { 190 | for (int j = 0; j < InvTweaksConst.INVENTORY_SIZE; j++) { 191 | if (containerMgr.getItemStack(j) == null) { 192 | containerMgr.move(i, j); 193 | break; 194 | } 195 | } 196 | } 197 | } 198 | else { 199 | log.warning("Failed to move stack for autoreplace, despite of prior tests."); 200 | } 201 | } 202 | } 203 | catch (NullPointerException e) { 204 | // Nothing: Due to multithreading + 205 | // unsafe accesses, NPE may (very rarely) occur (?). 206 | } catch (TimeoutException e) { 207 | log.severe("Failed to trigger autoreplace: "+e.getMessage()); 208 | } 209 | 210 | } 211 | 212 | }.init(mc, replacementStackSlot, slot, refillBeforeBreak)).start(); 213 | 214 | } 215 | } 216 | 217 | private static void trySleep(int delay) { 218 | try { 219 | Thread.sleep(delay); 220 | } catch (InterruptedException e) { 221 | // Do nothing 222 | } 223 | } 224 | 225 | } -------------------------------------------------------------------------------- /invtweaks_docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Inventory Tweaks documentation build configuration file, created by 4 | # sphinx-quickstart on Sat May 12 12:32:31 2012. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys, os 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | #sys.path.insert(0, os.path.abspath('.')) 20 | 21 | # -- General configuration ----------------------------------------------------- 22 | 23 | # INVENTORY TWEAKS VERSION 24 | invtweaks_version = '1.50' 25 | 26 | 27 | 28 | 29 | # If your documentation needs a minimal Sphinx version, state it here. 30 | #needs_sphinx = '1.0' 31 | 32 | # Add any Sphinx extension module names here, as strings. They can be extensions 33 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 34 | extensions = [] 35 | 36 | # Add any paths that contain templates here, relative to this directory. 37 | templates_path = ['_templates'] 38 | 39 | # The suffix of source filenames. 40 | source_suffix = '.txt' 41 | 42 | # The encoding of source files. 43 | #source_encoding = 'utf-8-sig' 44 | 45 | # The master toctree document. 46 | master_doc = 'index' 47 | 48 | # General information about the project. 49 | project = u'Inventory Tweaks' 50 | copyright = u'2012, Jimeo Wan' 51 | 52 | # The version info for the project you're documenting, acts as replacement for 53 | # |version| and |release|, also used in various other places throughout the 54 | # built documents. 55 | # 56 | # The short X.Y version. 57 | version = invtweaks_version 58 | # The full version, including alpha/beta/rc tags. 59 | release = invtweaks_version 60 | 61 | # The language for content autogenerated by Sphinx. Refer to documentation 62 | # for a list of supported languages. 63 | #language = None 64 | 65 | # There are two options for replacing |today|: either, you set today to some 66 | # non-false value, then it is used: 67 | #today = '' 68 | # Else, today_fmt is used as the format for a strftime call. 69 | #today_fmt = '%B %d, %Y' 70 | 71 | # List of patterns, relative to source directory, that match files and 72 | # directories to ignore when looking for source files. 73 | exclude_patterns = ['_build'] 74 | 75 | # The reST default role (used for this markup: `text`) to use for all documents. 76 | #default_role = None 77 | 78 | # If true, '()' will be appended to :func: etc. cross-reference text. 79 | #add_function_parentheses = True 80 | 81 | # If true, the current module name will be prepended to all description 82 | # unit titles (such as .. function::). 83 | #add_module_names = True 84 | 85 | # If true, sectionauthor and moduleauthor directives will be shown in the 86 | # output. They are ignored by default. 87 | #show_authors = False 88 | 89 | # The name of the Pygments (syntax highlighting) style to use. 90 | pygments_style = 'sphinx' 91 | 92 | # A list of ignored prefixes for module index sorting. 93 | #modindex_common_prefix = [] 94 | 95 | 96 | # -- Options for HTML output --------------------------------------------------- 97 | 98 | # The theme to use for HTML and HTML Help pages. See the documentation for 99 | # a list of builtin themes. 100 | html_theme = 'nature-custom' 101 | 102 | # Theme options are theme-specific and customize the look and feel of a theme 103 | # further. For a list of options available for each theme, see the 104 | # documentation. 105 | #html_theme_options = {} 106 | 107 | # Add any paths that contain custom themes here, relative to this directory. 108 | html_theme_path = ['_themes'] 109 | 110 | # The name for this set of Sphinx documents. If None, it defaults to 111 | # " v documentation". 112 | #html_title = None 113 | 114 | # A shorter title for the navigation bar. Default is the same as html_title. 115 | #html_short_title = None 116 | 117 | # The name of an image file (relative to this directory) to place at the top 118 | # of the sidebar. 119 | #html_logo = None 120 | 121 | # The name of an image file (within the static path) to use as favicon of the 122 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 123 | # pixels large. 124 | #html_favicon = None 125 | 126 | # Add any paths that contain custom static files (such as style sheets) here, 127 | # relative to this directory. They are copied after the builtin static files, 128 | # so a file named "default.css" will overwrite the builtin "default.css". 129 | html_static_path = ['_static'] 130 | 131 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 132 | # using the given strftime format. 133 | #html_last_updated_fmt = '%b %d, %Y' 134 | 135 | # If true, SmartyPants will be used to convert quotes and dashes to 136 | # typographically correct entities. 137 | #html_use_smartypants = True 138 | 139 | # Custom sidebar templates, maps document names to template names. 140 | #html_sidebars = {} 141 | 142 | # Additional templates that should be rendered to pages, maps page names to 143 | # template names. 144 | #html_additional_pages = {} 145 | 146 | # If false, no module index is generated. 147 | #html_domain_indices = True 148 | 149 | # If false, no index is generated. 150 | #html_use_index = True 151 | 152 | # If true, the index is split into individual pages for each letter. 153 | #html_split_index = False 154 | 155 | # If true, links to the reST sources are added to the pages. 156 | #html_show_sourcelink = True 157 | 158 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 159 | #html_show_sphinx = True 160 | 161 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 162 | #html_show_copyright = True 163 | 164 | # If true, an OpenSearch description file will be output, and all pages will 165 | # contain a tag referring to it. The value of this option must be the 166 | # base URL from which the finished HTML is served. 167 | #html_use_opensearch = '' 168 | 169 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 170 | #html_file_suffix = None 171 | 172 | # Output file base name for HTML help builder. 173 | htmlhelp_basename = 'InventoryTweaksdoc' 174 | 175 | 176 | # -- Options for LaTeX output -------------------------------------------------- 177 | 178 | latex_elements = { 179 | # The paper size ('letterpaper' or 'a4paper'). 180 | #'papersize': 'letterpaper', 181 | 182 | # The font size ('10pt', '11pt' or '12pt'). 183 | #'pointsize': '10pt', 184 | 185 | # Additional stuff for the LaTeX preamble. 186 | #'preamble': '', 187 | } 188 | 189 | # Grouping the document tree into LaTeX files. List of tuples 190 | # (source start file, target name, title, author, documentclass [howto/manual]). 191 | latex_documents = [ 192 | ('index', 'InventoryTweaks.tex', u'Inventory Tweaks Documentation', 193 | u'Jimeo Wan', 'manual'), 194 | ] 195 | 196 | # The name of an image file (relative to this directory) to place at the top of 197 | # the title page. 198 | #latex_logo = None 199 | 200 | # For "manual" documents, if this is true, then toplevel headings are parts, 201 | # not chapters. 202 | #latex_use_parts = False 203 | 204 | # If true, show page references after internal links. 205 | #latex_show_pagerefs = False 206 | 207 | # If true, show URL addresses after external links. 208 | #latex_show_urls = False 209 | 210 | # Documents to append as an appendix to all manuals. 211 | #latex_appendices = [] 212 | 213 | # If false, no module index is generated. 214 | #latex_domain_indices = True 215 | 216 | 217 | # -- Options for manual page output -------------------------------------------- 218 | 219 | # One entry per manual page. List of tuples 220 | # (source start file, name, description, authors, manual section). 221 | man_pages = [ 222 | ('index', 'inventorytweaks', u'Inventory Tweaks Documentation', 223 | [u'Jimeo Wan'], 1) 224 | ] 225 | 226 | # If true, show URL addresses after external links. 227 | #man_show_urls = False 228 | 229 | 230 | # -- Options for Texinfo output ------------------------------------------------ 231 | 232 | # Grouping the document tree into Texinfo files. List of tuples 233 | # (source start file, target name, title, author, 234 | # dir menu entry, description, category) 235 | texinfo_documents = [ 236 | ('index', 'InventoryTweaks', u'Inventory Tweaks Documentation', 237 | u'Jimeo Wan', 'InventoryTweaks', 'One line description of project.', 238 | 'Miscellaneous'), 239 | ] 240 | 241 | # Documents to append as an appendix to all manuals. 242 | #texinfo_appendices = [] 243 | 244 | # If false, no module index is generated. 245 | #texinfo_domain_indices = True 246 | 247 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 248 | #texinfo_show_urls = 'footnote' 249 | -------------------------------------------------------------------------------- /src/minecraft/invtweaks/InvTweaksConfigSortingRule.java: -------------------------------------------------------------------------------- 1 | package invtweaks; 2 | 3 | import java.awt.Point; 4 | import java.util.logging.Logger; 5 | 6 | 7 | /** 8 | * Stores a sorting rule, as a target plus a keyword. 9 | * The target is provided as an array of preferred slots 10 | * (ex: target "1", i.e. first column, is stored as [0, 9, 18, 27]) 11 | * 12 | * @author Jimeo Wan 13 | * 14 | */ 15 | public class InvTweaksConfigSortingRule implements Comparable { 16 | 17 | private static final Logger log = Logger.getLogger("InvTweaks"); 18 | 19 | private String constraint; 20 | private int[] preferredPositions; 21 | private String keyword; 22 | private InvTweaksConfigSortingRuleType type; 23 | private int priority; 24 | private int containerSize; 25 | private int containerRowSize; 26 | 27 | public InvTweaksConfigSortingRule(InvTweaksItemTree tree, String constraint, 28 | String keyword, int containerSize, int containerRowSize) { 29 | 30 | this.keyword = keyword; 31 | this.constraint = constraint; 32 | this.containerSize = containerSize; 33 | this.containerRowSize = containerRowSize; 34 | this.type = getRuleType(constraint,containerRowSize); 35 | this.preferredPositions = getRulePreferredPositions(constraint); 36 | 37 | // Compute priority 38 | // 1st criteria : the rule type 39 | // 2st criteria : the keyword category depth 40 | // 3st criteria : the item order in a same category 41 | 42 | priority = type.getLowestPriority() + 100000 + 43 | tree.getKeywordDepth(keyword) * 1000 - tree.getKeywordOrder(keyword); 44 | 45 | } 46 | 47 | public InvTweaksConfigSortingRuleType getType() { 48 | return type; 49 | } 50 | 51 | /** 52 | * An array of preferred positions (from the most to the less preferred). 53 | * 54 | * @return 55 | */ 56 | public int[] getPreferredSlots() { 57 | return preferredPositions; 58 | } 59 | 60 | public String getKeyword() { 61 | return keyword; 62 | } 63 | 64 | /** 65 | * Raw constraint name, for debug purposes 66 | */ 67 | public String getRawConstraint() { 68 | return constraint; 69 | } 70 | 71 | /** 72 | * Returns rule priority (for rule sorting) 73 | * 74 | * @return 75 | */ 76 | public int getPriority() { 77 | return priority; 78 | } 79 | 80 | /** 81 | * Compares rules priority : positive value means 'this' is of greater 82 | * priority than o 83 | */ 84 | public int compareTo(InvTweaksConfigSortingRule o) { 85 | return getPriority() - o.getPriority(); 86 | } 87 | 88 | public int[] getRulePreferredPositions(String constraint) { 89 | // TODO Caching 90 | return InvTweaksConfigSortingRule.getRulePreferredPositions( 91 | constraint, containerSize, containerRowSize); 92 | } 93 | 94 | public static int[] getRulePreferredPositions(String constraint, 95 | int containerSize, int containerRowSize) { 96 | 97 | int[] result = null; 98 | int containerColumnSize = containerSize / containerRowSize; 99 | 100 | // Rectangle rules 101 | if (constraint.length() >= 5) { 102 | 103 | boolean vertical = false; 104 | if (constraint.contains("v")) { 105 | vertical = true; 106 | constraint = constraint.replaceAll("v", ""); 107 | } 108 | String[] elements = constraint.split("-"); 109 | if (elements.length == 2) { 110 | 111 | int[] slots1 = getRulePreferredPositions(elements[0], 112 | containerSize, containerRowSize); 113 | int[] slots2 = getRulePreferredPositions(elements[1], 114 | containerSize, containerRowSize); 115 | if (slots1.length == 1 && slots2.length == 1) { 116 | 117 | int slot1 = slots1[0], slot2 = slots2[0]; 118 | 119 | Point point1 = new Point(slot1 % containerRowSize, slot1 / containerRowSize), 120 | point2 = new Point(slot2 % containerRowSize, slot2 / containerRowSize); 121 | 122 | result = new int[(Math.abs(point2.y - point1.y) + 1) * 123 | (Math.abs(point2.x - point1.x) + 1)]; 124 | int resultIndex = 0; 125 | 126 | // Swap coordinates for vertical ordering 127 | if (vertical) { 128 | for (Point p : new Point[] { point1, point2 }) { 129 | int buffer = p.x; 130 | p.x = p.y; 131 | p.y = buffer; 132 | } 133 | } 134 | 135 | int y = point1.y; 136 | while ((point1.y < point2.y) ? y <= point2.y : y >= point2.y) { 137 | int x = point1.x; 138 | while ((point1.x < point2.x) ? x <= point2.x : x >= point2.x) { 139 | result[resultIndex++] = (vertical) 140 | ? index(containerRowSize, x, y) : index(containerRowSize, y, x); 141 | x += (point1.x < point2.x) ? 1 : -1; 142 | } 143 | y += (point1.y < point2.y) ? 1 : -1; 144 | } 145 | 146 | if (constraint.contains("r")) { 147 | reverseArray(result); 148 | } 149 | 150 | } 151 | } 152 | } 153 | 154 | else { 155 | 156 | // Default values 157 | int column = -1, row = -1; 158 | boolean reverse = false; 159 | 160 | // Extract chars 161 | for (int i = 0; i < constraint.length(); i++) { 162 | char c = constraint.charAt(i); 163 | if ( c >= '1' && c - '1'<=containerRowSize) { 164 | // 1 column = 0, 9 column = 8 165 | column = c - '1'; 166 | } else if ( c >='a' && c - 'a' <=containerColumnSize ) { 167 | // A row = 0, D row = 3, H row = 7 168 | row = c - 'a'; 169 | } else if (c == 'r') { 170 | reverse = true; 171 | } 172 | } 173 | 174 | // Tile case 175 | if (column != -1 && row != -1) { 176 | result = new int[] { index(containerRowSize, row, column) }; 177 | } 178 | // Row case 179 | else if (row != -1) { 180 | result = new int[containerRowSize]; 181 | for (int i = 0; i < containerRowSize; i++) { 182 | result[i] = index(containerRowSize, row, 183 | reverse ? containerRowSize - 1 - i : i); 184 | } 185 | } 186 | // Column case 187 | else { 188 | result = new int[containerColumnSize]; 189 | for (int i = 0; i < containerColumnSize; i++) { 190 | result[i] = index(containerRowSize, 191 | reverse ? i : containerColumnSize - 1 - i, column); 192 | } 193 | } 194 | } 195 | 196 | return result; 197 | } 198 | 199 | public static InvTweaksConfigSortingRuleType getRuleType(String constraint, int rowSize) { 200 | 201 | InvTweaksConfigSortingRuleType result = InvTweaksConfigSortingRuleType.SLOT; 202 | 203 | if (constraint.length() == 1 || (constraint.length() == 2 && constraint.contains("r"))) { 204 | constraint = constraint.replace("r", ""); 205 | // Column rule 206 | if (constraint.charAt(0)-'1' <= rowSize && constraint.charAt(0)>='1') { 207 | result = InvTweaksConfigSortingRuleType.COLUMN; 208 | } 209 | // Row rule 210 | else { 211 | result = InvTweaksConfigSortingRuleType.ROW; 212 | } 213 | } 214 | // Rectangle rule 215 | else if (constraint.length() > 4) { 216 | // Special case: rectangle rule on a single column 217 | if (constraint.charAt(1) == constraint.charAt(4)) { 218 | result = InvTweaksConfigSortingRuleType.COLUMN; 219 | } 220 | // Special case: rectangle rule on a single row 221 | else if (constraint.charAt(0) == constraint.charAt(3)) { 222 | result = InvTweaksConfigSortingRuleType.ROW; 223 | } 224 | // Usual case 225 | else { 226 | result = InvTweaksConfigSortingRuleType.RECTANGLE; 227 | } 228 | } 229 | 230 | return result; 231 | 232 | } 233 | 234 | public String toString() { 235 | return constraint + " " + keyword; 236 | } 237 | 238 | private static int index(int rowSize, int row, int column) { 239 | return row * rowSize + column; 240 | } 241 | 242 | private static void reverseArray(int[] data) { 243 | int left = 0; 244 | int right = data.length - 1; 245 | while( left < right ) { 246 | int temp = data[left]; 247 | data[left] = data[right]; 248 | data[right] = temp; 249 | left++; 250 | right--; 251 | } 252 | } 253 | 254 | 255 | } 256 | --------------------------------------------------------------------------------