Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit b3901ad

Browse files
committed
Dispatch from the god classes for the events added in this PR
1 parent 5fbdbe6 commit b3901ad

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

patchwork-events-lifecycle/src/main/java/net/minecraftforge/fml/server/ServerLifecycleHooks.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@ public static boolean handleServerStarting(final MinecraftServer server) {
5151
public static void handleServerStarted(final MinecraftServer server) {
5252
LifecycleEvents.handleServerStarted(server);
5353
}
54+
55+
public static void handleServerStopped(final MinecraftServer server) {
56+
LifecycleEvents.handleServerStopped(server);
57+
}
5458
}

patchwork-god-classes/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ version = getSubprojectVersion(project, "0.1.0")
44
dependencies {
55
compile project(path: ':patchwork-fml', configuration: 'dev')
66
compile project(path: ':patchwork-events-lifecycle', configuration: 'dev')
7+
compile project(path: ':patchwork-loot', configuration: 'dev')
78
}

patchwork-god-classes/src/main/java/net/minecraftforge/common/ForgeHooks.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,28 @@
1919

2020
package net.minecraftforge.common;
2121

22+
import javax.annotation.Nullable;
23+
24+
import com.google.gson.Gson;
25+
import com.google.gson.JsonObject;
26+
27+
import net.minecraft.loot.LootManager;
28+
import net.minecraft.loot.LootTable;
29+
import net.minecraft.util.Identifier;
30+
31+
import net.patchworkmc.impl.loot.LootHooks;
32+
2233
/*
2334
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
2435
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
2536
*/
2637
public class ForgeHooks {
38+
@Nullable
39+
public static LootTable loadLootTable(Gson gson, Identifier name, JsonObject data, boolean custom, LootManager lootTableManager) {
40+
return LootHooks.loadLootTable(gson, name, data, custom, lootTableManager);
41+
}
42+
43+
public static String readPoolName(JsonObject json) {
44+
return LootHooks.readPoolName(json);
45+
}
2746
}

patchwork-god-classes/src/main/java/net/minecraftforge/event/ForgeEventFactory.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@
1919

2020
package net.minecraftforge.event;
2121

22+
import net.minecraft.loot.LootManager;
23+
import net.minecraft.loot.LootTable;
24+
import net.minecraft.util.Identifier;
25+
26+
import net.patchworkmc.impl.event.loot.LootEvents;
27+
2228
/*
2329
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
2430
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
2531
*/
2632
public class ForgeEventFactory {
33+
public static LootTable loadLootTable(Identifier name, LootTable table, LootManager lootTableManager) {
34+
return LootEvents.loadLootTable(name, table, lootTableManager);
35+
}
2736
}

patchwork-god-classes/src/main/resources/fabric.mod.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"depends": {
1818
"fabricloader": ">=0.8.4",
1919
"patchwork-fml": "*",
20-
"patchwork-events-lifecycle": "*"
20+
"patchwork-events-lifecycle": "*",
21+
"patchwork-loot": "*"
2122
},
2223
"custom": {
2324
"modmenu:api": true,

0 commit comments

Comments
 (0)