mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-24 10:34:29 +00:00
modernize ASM
This commit is contained in:
15 files changed
+475
-394
No files matched your search
@@ -12,6 +12,8 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.Collections;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
//Used by ASM
|
||||
@SuppressWarnings("unused")
|
||||
public class GameDataHooks {
|
||||
private static WeakIdentityHashMap<Block, WeakReference<ItemBlock>> forGameData(GameData gameData) {
|
||||
if (gameData.endlessIDsItemBlockCache == null) {
|
||||
@@ -20,14 +22,10 @@ public class GameDataHooks {
|
||||
return gameData.endlessIDsItemBlockCache;
|
||||
}
|
||||
|
||||
//Called by ASM
|
||||
@SuppressWarnings("unused")
|
||||
public static void cacheItemBlock(ItemBlock itemBlock, GameData gameData) {
|
||||
forGameData(gameData).put(itemBlock.field_150939_a, new WeakReference<>(itemBlock));
|
||||
}
|
||||
|
||||
//Called by ASM
|
||||
@SuppressWarnings("unused")
|
||||
public static ItemBlock fetchCachedItemBlock(Block block, GameData gameData) {
|
||||
var weakItem = forGameData(gameData).get(block);
|
||||
if (weakItem != null) {
|
||||
@@ -36,8 +34,6 @@ public class GameDataHooks {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Called by ASM
|
||||
@SuppressWarnings("unused")
|
||||
public static Iterable<Item> fakeIterable() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user