File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
patching/src/main/java/com/fox2code/foxloader/patching/game Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments