Skip to content

Commit

Permalink
Upgrade sources to 1.4.4 (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwane Kalam-Alami committed Nov 15, 2012
1 parent cfe55b5 commit 58fa07f
Show file tree
Hide file tree
Showing 22 changed files with 349 additions and 255 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img src="http://modding.kalam-alami.net/site/img/invtweaks.png" />

* Matching Minecraft version: **1.4.2**
* Matching Minecraft version: **1.4.4**

## What's this project about

Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Latest changes
==============

`[11.15.2012] 1.45 (1.4.4) <???>`_
* Added Beta option to make the mod work on anti-cheat servers
* Fixed the potato IDs in the item tree (delete config/InvTweaksTree.txt to refresh it)
* Added Norwegian translation (thanks to mymusicmanager)

`[10.26.2012] 1.44 (1.4.2) <http://adf.ly/E3TGa>`_
* Updated mod and item list to Minecraft 1.4.2
* Added option to replace tools just before they break
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '1.44'
version = '1.45'
# The full version, including alpha/beta/rc tags.
release = '1.44'
release = '1.45'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 5 additions & 0 deletions docs/download.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. image:: _static/img/dl.png
:align: left

`Inventory Tweaks 1.45 <???>`_ for **Minecraft 1.4.4** (requires `Forge <http://www.minecraftforge.net/forum/index.php/board,3.0.html>`_ or `ModLoader <http://www.minecraftforum.net/topic/75440->`_) | `Mirror <http://dl.dropbox.com/u/7592975/InvTweaks/InvTweaks-1.45-1.4.4.zip>`_

.. image:: _static/img/dl.png
:align: left

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>net.jimeowan</groupId>
<artifactId>inventory-tweaks</artifactId>
<version>1.44-1.4.2</version>
<version>1.45-1.4.4</version>
<packaging>jar</packaging>
<name>Inventory Tweaks</name>

Expand Down
7 changes: 4 additions & 3 deletions src/DefaultTree.dat
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
<cookedFish id="350" />
<steak id="364" />
<cookedChicken id="366" />
<bakedPotato id="392" />
<bakedPotato id="393" />
</cookedFood>
<bread id="297" />
<pumpkinPie id="400" />
Expand All @@ -490,13 +490,14 @@
<rawFish id="349" />
<rawBeef id="363" />
<rawChicken id="365" />
<potato id="392" />
<potato id="392" />
</rawFood>
</edibleFood>
<poisonedFood>
<rottenFlesh id="367" />
<spiderEye id="375" />
<poisonedPotato id="392" />
<poisonedPotato id="394" />
<poisonousPotato id="394" />
</poisonedFood>
<unedibleFood>
<cake id="354" />
Expand Down
46 changes: 23 additions & 23 deletions src/InvTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class InvTweaks extends InvTweaksObfuscation {
* sorting on pick up...)
*/
private int storedStackId = 0, storedStackDamage = -1, storedFocusedSlot = -1;
private tv[] hotbarClone = new tv[InvTweaksConst.INVENTORY_HOTBAR_SIZE];
private um[] hotbarClone = new um[InvTweaksConst.INVENTORY_HOTBAR_SIZE];
private boolean hadFocus = true, mouseWasDown = false;;

/**
Expand Down Expand Up @@ -114,9 +114,9 @@ public void onTickInGame() {
/**
* To be called on each tick when a menu is open.
* Handles the GUI additions and the middle clicking.
* @param guiScreen
* @param aue
*/
public void onTickInGUI(asw guiScreen) {
public void onTickInGUI(aue guiScreen) {
synchronized (this) {
handleMiddleClick(guiScreen); // Called before the rest to be able to trigger config reload
if (!onTick()) {
Expand All @@ -129,7 +129,7 @@ public void onTickInGUI(asw guiScreen) {
handleShortcuts(guiScreen);

// Copy some info about current selected stack for auto-refill
tv currentStack = getFocusedStack();
um currentStack = getFocusedStack();
storedStackId = (currentStack == null) ? 0 : getItemID(currentStack);
storedStackDamage = (currentStack == null) ? 0 : getItemDamage(currentStack);
}
Expand All @@ -148,7 +148,7 @@ public final void onSortingKeyPressed() {
}

// Check current GUI
asw guiScreen = getCurrentScreen();
aue guiScreen = getCurrentScreen();
if (guiScreen == null || (isValidChest(guiScreen) || isValidInventory(guiScreen))) {
// Sorting!
handleSorting(guiScreen);
Expand Down Expand Up @@ -180,7 +180,7 @@ public void onItemPickup() {
// (not an existing stack whose amount has been increased)
int currentSlot = -1;
for (int i = 0; i < InvTweaksConst.INVENTORY_HOTBAR_SIZE; i++) {
tv currentHotbarStack = containerMgr.getItemStack(i + 27);
um currentHotbarStack = containerMgr.getItemStack(i + 27);
// Don't move already started stacks
if (currentHotbarStack != null && getAnimationsToGo(currentHotbarStack) == 5 && hotbarClone[i] == null) {
currentSlot = i + 27;
Expand All @@ -193,7 +193,7 @@ public void onItemPickup() {
// Find preffered slots
List<Integer> prefferedPositions = new LinkedList<Integer>();
InvTweaksItemTree tree = config.getTree();
tv stack = containerMgr.getItemStack(currentSlot);
um stack = containerMgr.getItemStack(currentSlot);
List<InvTweaksItemTreeItem> items = tree.getItems(getItemID(stack),
getItemDamage(stack));
for (InvTweaksConfigSortingRule rule : config.getRules()) {
Expand Down Expand Up @@ -311,7 +311,7 @@ private boolean onTick() {
if (itemPickupPending) {
onItemPickup();
}
asw currentScreen = getCurrentScreen();
aue currentScreen = getCurrentScreen();
if (currentScreen == null || isGuiInventory(currentScreen)) {
cloneHotbar();
}
Expand All @@ -337,7 +337,7 @@ private boolean onTick() {
private void handleConfigSwitch() {

InvTweaksConfig config = cfgManager.getConfig();
asw currentScreen = getCurrentScreen();
aue currentScreen = getCurrentScreen();

// Switch between configurations (shortcut)
InvTweaksShortcutMapping switchMapping = cfgManager.getShortcutsHandler()
Expand Down Expand Up @@ -391,11 +391,11 @@ private void handleConfigSwitch() {

}

private void handleSorting(asw guiScreen) {
private void handleSorting(aue guiScreen) {

tv selectedItem = null;
um selectedItem = null;
int focusedSlot = getFocusedSlot();
tv[] mainInventory = getMainInventory();
um[] mainInventory = getMainInventory();
if (focusedSlot < mainInventory.length && focusedSlot >= 0) {
selectedItem = mainInventory[focusedSlot];
}
Expand Down Expand Up @@ -423,7 +423,7 @@ private void handleSorting(asw guiScreen) {

private void handleAutoRefill() {

tv currentStack = getFocusedStack();
um currentStack = getFocusedStack();
int currentStackId = (currentStack == null) ? 0 : getItemID(currentStack);
int currentStackDamage = (currentStack == null) ? 0 : getItemDamage(currentStack);
int focusedSlot = getFocusedSlot() + 27; // Convert to container slots index
Expand Down Expand Up @@ -469,7 +469,7 @@ else if ((currentStack == null || getItemID(currentStack) == 281 && storedStackI

}

private void handleMiddleClick(asw guiScreen) {
private void handleMiddleClick(aue guiScreen) {

if (Mouse.isButtonDown(2)) {

Expand All @@ -487,7 +487,7 @@ private void handleMiddleClick(asw guiScreen) {

InvTweaksContainerManager containerMgr = new InvTweaksContainerManager(mc);
containerMgr.setClickDelay(config.getClickDelay());
rz slotAtMousePosition = containerMgr.getSlotAtMousePosition();
sq slotAtMousePosition = containerMgr.getSlotAtMousePosition();
InvTweaksContainerSection target = null;
if (slotAtMousePosition != null) {
target = containerMgr.getSlotSection(getSlotNumber(slotAtMousePosition));
Expand All @@ -497,7 +497,7 @@ private void handleMiddleClick(asw guiScreen) {

// Check if the middle click target the chest or the inventory
// (copied GuiContainer.getSlotAtPosition algorithm)
atq guiContainer = asGuiContainer(guiScreen);
auy guiContainer = asGuiContainer(guiScreen);

if (InvTweaksContainerSection.CHEST.equals(target)) {

Expand Down Expand Up @@ -552,22 +552,22 @@ private void handleMiddleClick(asw guiScreen) {
}
}

private void handleGUILayout(asw guiScreen) {
private void handleGUILayout(aue guiScreen) {

InvTweaksConfig config = cfgManager.getConfig();
boolean isValidChest = isValidChest(guiScreen);

if (isValidChest || (isStandardInventory(guiScreen) && !isGuiEnchantmentTable(guiScreen))) {

atq guiContainer = asGuiContainer(guiScreen);
auy guiContainer = asGuiContainer(guiScreen);
int w = 10, h = 10;

// Look for the mods buttons
boolean customButtonsAdded = false;
List<Object> controlList = getControlList(guiScreen);
for (Object o : controlList) {
if (isGuiButton(o)) {
arl button = asGuiButton(o);
ast button = asGuiButton(o);
if (getId(button) == InvTweaksConst.JIMEOWAN_ID) {
customButtonsAdded = true;
break;
Expand Down Expand Up @@ -662,7 +662,7 @@ private void handleGUILayout(asw guiScreen) {
// Remove "..." button from non-survival tabs of the creative screen
if (isGuiInventoryCreative(guiScreen)) {
List<Object> controlList = getControlList(guiScreen);
arl buttonToRemove = null;
ast buttonToRemove = null;
for (Object o : controlList) {
if (isGuiButton(o)) {
if (getId(asGuiButton(o)) == InvTweaksConst.JIMEOWAN_ID) {
Expand Down Expand Up @@ -708,7 +708,7 @@ private boolean isNotEnoughItemsEnabled() {
}
}

private void handleShortcuts(asw guiScreen) {
private void handleShortcuts(aue guiScreen) {

// Check open GUI
if (!(isValidChest(guiScreen) || isStandardInventory(guiScreen))) {
Expand Down Expand Up @@ -739,7 +739,7 @@ private void handleShortcuts(asw guiScreen) {

}

private int getContainerRowSize(atq guiContainer) {
private int getContainerRowSize(auy guiContainer) {
if (isGuiChest(guiContainer)) {
return InvTweaksConst.CHEST_ROW_SIZE;
}
Expand Down Expand Up @@ -798,7 +798,7 @@ private void unlockKeysIfNecessary() {
* (especially needed by the "on pickup" features).
*/
private void cloneHotbar() {
tv[] mainInventory = getMainInventory();
um[] mainInventory = getMainInventory();
for (int i = 0; i < 9; i++) {
if (mainInventory[i] != null) {
hotbarClone[i] = copy(mainInventory[i]);
Expand Down
Loading

0 comments on commit 58fa07f

Please sign in to comment.