Skip to content

Commit e8749ee

Browse files
committed
Make some fields public for HMF
1 parent 179a83d commit e8749ee

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

patching/src/main/java/com/fox2code/foxloader/patching/game/GamePatches.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ private static void addGamePatch(GamePatch gamePatch) {
9393
addGamePatch(new EditTextPatch());
9494
addGamePatch(new PlayerSelectionPatch());
9595
addGamePatch(new MovementPatch());
96+
addGamePatch(new LootPatch());
9697
// Debug & cosmetic stuff
9798
addGamePatch(new VarNamePatch());
9899
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.fox2code.foxloader.patching.game;
2+
3+
import com.fox2code.foxloader.patching.TransformerUtils;
4+
import org.objectweb.asm.tree.ClassNode;
5+
6+
final class LootPatch extends GamePatch {
7+
private static final String TileEntityDungeonChest = "net/minecraft/common/block/tileentity/TileEntityDungeonChest";
8+
private static final String EntityCucurboo = "net/minecraft/common/entity/animals/EntityCucurboo";
9+
10+
LootPatch() {
11+
super(new String[]{TileEntityDungeonChest, EntityCucurboo});
12+
}
13+
14+
@Override
15+
public ClassNode transform(ClassNode classNode) {
16+
switch (classNode.name) {
17+
case TileEntityDungeonChest: {
18+
TransformerUtils.makeFieldPublic(classNode, "DUNGEON_LOOT_TABLE");
19+
break;
20+
}
21+
case EntityCucurboo: {
22+
TransformerUtils.makeFieldPublic(classNode, "CUCURBOO_LOOT_TABLE");
23+
break;
24+
}
25+
}
26+
return classNode;
27+
}
28+
}

0 commit comments

Comments
 (0)