Compare commits

..
Author SHA1 Message Date
slprimeandslprime 39578a4419 Update Render Cache after window resize (#592)
Co-authored-by: slprime <[email protected]>
2025-01-19 11:33:26 -06:00
e3574800c0 Subset Widget Improvement (#577)
Co-authored-by: slprime <[email protected]>
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Caedis <[email protected]>
Co-authored-by: Maya <[email protected]>
2025-01-16 21:12:26 +01:00
Martin Robertz 5cd7556e6a update 2025-01-16 12:44:42 +01:00
80c2cba778 Created Grid Rendering Cache Mode (#573)
Co-authored-by: slprime <[email protected]>
Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Caedis <[email protected]>
2025-01-15 23:23:16 -06:00
4 changed files with 12 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.1:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.6.2: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.30'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.31'
}
@@ -1,5 +1,6 @@
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;
@@ -36,7 +37,7 @@ public class ItemStackMap<T> {
}
public StackMetaKey(ItemStack key) {
this(key.getItemDamage(), key.stackTagCompound);
this(actualDamage(key), key.stackTagCompound);
}
public int hashCode() {
@@ -74,7 +75,7 @@ public class ItemStackMap<T> {
if (wildcard != null) return wildcard;
if (damageMap != null) {
final T ret = damageMap.get(key.getItemDamage());
final T ret = damageMap.get(actualDamage(key));
if (ret != null) return ret;
}
if (tagMap != null) {
@@ -88,7 +89,7 @@ public class ItemStackMap<T> {
public T put(ItemStack key, T value) {
try {
switch (getKeyType(key.getItemDamage(), key.stackTagCompound)) {
switch (getKeyType(actualDamage(key), key.stackTagCompound)) {
case 0:
if (metaMap == null) metaMap = new HashMap<>();
return metaMap.put(new StackMetaKey(key), value);
@@ -97,7 +98,7 @@ public class ItemStackMap<T> {
return tagMap.put(key.stackTagCompound, value);
case 2:
if (damageMap == null) damageMap = new HashMap<>();
return damageMap.put(key.getItemDamage(), value);
return damageMap.put(actualDamage(key), value);
case 3:
T ret = wildcard;
wildcard = value;
@@ -112,13 +113,13 @@ public class ItemStackMap<T> {
public T remove(ItemStack key) {
try {
switch (getKeyType(key.getItemDamage(), key.stackTagCompound)) {
switch (getKeyType(actualDamage(key), 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(key.getItemDamage()) : null;
return damageMap != null ? damageMap.remove(actualDamage(key)) : null;
case 3:
T ret = wildcard;
wildcard = null;
+3 -1
View File
@@ -43,7 +43,9 @@ public class ItemsGrid {
}
public boolean needRefresh(int mode) {
return this.nextCacheRefresh == 0
final Minecraft minecraft = Minecraft.getMinecraft();
return this.nextCacheRefresh == 0 || this.framebuffer.framebufferWidth != minecraft.displayWidth
|| framebuffer.framebufferHeight != minecraft.displayHeight
|| getGridRenderingCacheFPS(mode) > 0 && this.nextCacheRefresh < System.currentTimeMillis();
}