Skip to content

Commit

Permalink
Uploaded 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
blat-blatnik authored Dec 19, 2020
1 parent 41b127f commit 5c18172
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/main/java/tfcquickpockets/ClientStuff.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.dunk.tfc.Entities.Mobs.EntityCowTFC;
import com.dunk.tfc.Entities.Mobs.EntityHorseTFC;
import com.dunk.tfc.Food.ItemFoodTFC;
import com.dunk.tfc.Food.ItemMeal;
import com.dunk.tfc.GUI.*;
import com.dunk.tfc.GUI.GuiHopper;
import com.dunk.tfc.Handlers.Client.RenderOverlayHandler;
Expand All @@ -23,6 +24,7 @@
import com.dunk.tfc.Items.ItemBlocks.ItemFlowers;
import com.dunk.tfc.Items.ItemBlocks.ItemSapling;
import com.dunk.tfc.Items.ItemCoal;
import com.dunk.tfc.Items.Pottery.ItemPotteryJug;
import com.dunk.tfc.Items.Pottery.ItemPotterySmallVessel;
import com.dunk.tfc.Items.Tools.*;
import com.dunk.tfc.Render.TESR.TESRChest;
Expand Down Expand Up @@ -842,7 +844,7 @@ public void playMeleeWeaponSound(AttackEntityEvent event) {
ItemStack weapon = player.inventory.getCurrentItem();
ItemCategory category = ItemCategory.OTHER;
if (weapon != null)
category = ItemCategory.get(weapon.getItem());
category = ItemCategory.get(weapon);

switch (category) {
case SWORD:
Expand Down Expand Up @@ -1132,7 +1134,7 @@ public static void checkIfNeedToDoAutoFill() {
}

if (!Config.clientOnlyMode) {
ItemCategory category = ItemCategory.get(lastHeldStack.getItem());
ItemCategory category = ItemCategory.get(lastHeldStack);
int broadCategory = category.getBroadCategoryFlags();

boolean doRefill = false;
Expand Down Expand Up @@ -1227,8 +1229,8 @@ public static int getStackSimilarity(ItemStack a, ItemStack b) {
else {
Item item1 = a.getItem();
Item item2 = b.getItem();
ItemCategory category1 = ItemCategory.get(item1);
ItemCategory category2 = ItemCategory.get(item2);
ItemCategory category1 = ItemCategory.get(a);
ItemCategory category2 = ItemCategory.get(b);

int similarity = 0;
if (item1 == item2 && item1.getUnlocalizedName(a).equals(item2.getUnlocalizedName(b)))
Expand Down Expand Up @@ -1831,7 +1833,8 @@ public enum ItemCategory {
public static int BLOCK_FLAG = 1 << 3;
public static int MISC_FLAG = 1 << 4;

public static ItemCategory get(Item item) {
public static ItemCategory get(ItemStack stack) {
Item item = stack.getItem();
if (item == null)
return ItemCategory.NONE;
else if (item instanceof ItemCustomSword) {
Expand All @@ -1843,9 +1846,9 @@ else if (item instanceof ItemCustomSword) {
return ItemCategory.BOW;
} else if (item instanceof ItemJavelin) {
return ItemCategory.JAVELIN;
} else if (item instanceof ItemFoodTFC || item instanceof ItemHoneyBowl) {
} else if (item instanceof ItemFoodTFC || item instanceof ItemHoneyBowl || item instanceof ItemMeal) {
return ItemCategory.FOOD;
} else if (item instanceof ItemDrink) {
} else if (item instanceof ItemDrink || (item instanceof ItemPotteryJug && stack.getItemDamage() == 2)) {
return ItemCategory.DRINK;
} else if (item instanceof ItemPickaxe) {
return ItemCategory.PICKAXE;
Expand Down Expand Up @@ -2033,7 +2036,7 @@ public int findMatchingSlotIndexInInventory(ItemStack[] slots, int startIdx) {
public boolean slotMatches(ItemStack slot) {
if (slot != null) {
Item item = slot.getItem();
ItemCategory slotCategory = ItemCategory.get(item);
ItemCategory slotCategory = ItemCategory.get(slot);
for (ItemCategory matchCategory : categories) {
if (matchCategory.matches(slotCategory)) {
if (filter == null || filter.test(item)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tfcquickpockets/QuickPockets.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class QuickPockets {

public static final String ID = "tfcquickpockets";
public static final String NAME = "TFC+ Quick Pockets";
public static final String VERSION = "1.1.3";
public static final String VERSION = "1.1.4";
public static final String DEPENDENCIES = "required-after:terrafirmacraftplus;";
public static final String GUI_FACTORY = ID + ".Config";
public static final String CLIENT_SIDE = ID + ".ClientStuff";
Expand Down

0 comments on commit 5c18172

Please sign in to comment.