|
30 | 30 | import com.google.gson.JsonElement; |
31 | 31 | import com.google.gson.JsonObject; |
32 | 32 | import com.google.gson.JsonParseException; |
33 | | -import org.spongepowered.asm.mixin.Unique; |
34 | 33 |
|
35 | 34 | import net.minecraft.loot.LootManager; |
36 | 35 | import net.minecraft.loot.LootTable; |
|
41 | 40 |
|
42 | 41 | // NOTE: this class is more or less a direct copy of parts of Forge's ForgeHooks. |
43 | 42 | public class LootHooks { |
44 | | - @Unique |
45 | | - private static ThreadLocal<Deque<LootTableContext>> lootContext = new ThreadLocal<Deque<LootTableContext>>(); |
| 43 | + // Made public for Patchwork's own use |
| 44 | + public static ThreadLocal<Deque<LootTableContext>> lootContext = new ThreadLocal<Deque<LootTableContext>>(); |
46 | 45 |
|
47 | 46 | public static LootTable loadLootTable(Gson gson, Identifier name, JsonElement data, boolean custom, LootManager lootTableManager) { |
48 | 47 | Deque<LootTableContext> que = lootContext.get(); |
@@ -105,15 +104,16 @@ public static String readPoolName(JsonObject json) { |
105 | 104 | return ctx.poolCount == 1 ? "main" : "pool" + (ctx.poolCount - 1); |
106 | 105 | } |
107 | 106 |
|
108 | | - private static class LootTableContext { |
| 107 | + // Made public for Patchwork's own use |
| 108 | + public static class LootTableContext { |
109 | 109 | public final Identifier name; |
110 | 110 | public final boolean custom; |
111 | 111 | private final boolean vanilla; |
112 | 112 | public int poolCount = 0; |
113 | 113 | public int entryCount = 0; |
114 | 114 | private HashSet<String> entryNames = Sets.newHashSet(); |
115 | 115 |
|
116 | | - private LootTableContext(Identifier name, boolean custom) { |
| 116 | + protected LootTableContext(Identifier name, boolean custom) { |
117 | 117 | this.name = name; |
118 | 118 | this.custom = custom; |
119 | 119 | this.vanilla = "minecraft".equals(this.name.getNamespace()); |
|
0 commit comments