Compare commits

..
3 changed files with 8 additions and 9 deletions

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
dependencies {
api('com.github.GTNewHorizons:CodeChickenCore:1.4.1:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.6.2:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.6.1:dev')
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
}
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.31'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
}
@@ -1,6 +1,5 @@
package codechicken.nei;
import static codechicken.lib.inventory.InventoryUtils.actualDamage;
import static codechicken.lib.inventory.InventoryUtils.newItemStack;
import static net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE;
@@ -37,7 +36,7 @@ public class ItemStackMap<T> {
}
public StackMetaKey(ItemStack key) {
this(actualDamage(key), key.stackTagCompound);
this(key.getItemDamage(), key.stackTagCompound);
}
public int hashCode() {
@@ -75,7 +74,7 @@ public class ItemStackMap<T> {
if (wildcard != null) return wildcard;
if (damageMap != null) {
final T ret = damageMap.get(actualDamage(key));
final T ret = damageMap.get(key.getItemDamage());
if (ret != null) return ret;
}
if (tagMap != null) {
@@ -89,7 +88,7 @@ public class ItemStackMap<T> {
public T put(ItemStack key, T value) {
try {
switch (getKeyType(actualDamage(key), key.stackTagCompound)) {
switch (getKeyType(key.getItemDamage(), key.stackTagCompound)) {
case 0:
if (metaMap == null) metaMap = new HashMap<>();
return metaMap.put(new StackMetaKey(key), value);
@@ -98,7 +97,7 @@ public class ItemStackMap<T> {
return tagMap.put(key.stackTagCompound, value);
case 2:
if (damageMap == null) damageMap = new HashMap<>();
return damageMap.put(actualDamage(key), value);
return damageMap.put(key.getItemDamage(), value);
case 3:
T ret = wildcard;
wildcard = value;
@@ -113,13 +112,13 @@ public class ItemStackMap<T> {
public T remove(ItemStack key) {
try {
switch (getKeyType(actualDamage(key), key.stackTagCompound)) {
switch (getKeyType(key.getItemDamage(), key.stackTagCompound)) {
case 0:
return metaMap != null ? metaMap.remove(new StackMetaKey(key)) : null;
case 1:
return tagMap != null ? tagMap.remove(key.stackTagCompound) : null;
case 2:
return damageMap != null ? damageMap.remove(actualDamage(key)) : null;
return damageMap != null ? damageMap.remove(key.getItemDamage()) : null;
case 3:
T ret = wildcard;
wildcard = null;