Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
cache
Browse files Browse the repository at this point in the history
  • Loading branch information
GlodBlock committed Feb 15, 2022
1 parent d7d0279 commit e199b68
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public LargeFusionComputer4(String name) {
super(name);
}

//Some hacky shit
public static Block mMK4Casing = null;
public static int mMK4CasingMeta;

@Override
public String[] getDescription() {
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
Expand Down Expand Up @@ -82,21 +86,26 @@ public long maxEUStore() {

@Override
public Block getCasingBlock() {
try {
Field f = ModBlocks.class.getDeclaredField("blockCasings6Misc");
return (Block) f.get(null);
} catch (NoSuchFieldException | IllegalAccessException e) {
return ModBlocks.blockCasings3Misc;
}
if (mMK4Casing == null)
doCasingInit();
return mMK4Casing;
}

@Override
public int getCasingMeta() {
if (mMK4Casing == null)
doCasingInit();
return mMK4CasingMeta;
}

private void doCasingInit() {
try {
Field f = ModBlocks.class.getDeclaredField("blockCasings6Misc");
return 0;
} catch (NoSuchFieldException e) {
return 12;
mMK4Casing = (Block) f.get(null);
mMK4CasingMeta = 0;
} catch (NoSuchFieldException | IllegalAccessException e) {
mMK4Casing = ModBlocks.blockCasings3Misc;
mMK4CasingMeta = 12;
}
}

Expand Down

0 comments on commit e199b68

Please sign in to comment.