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

Commit 8d64988

Browse files
committed
Dispatch from the god classes for the events added in this PR
1 parent ea17e00 commit 8d64988

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
@@ -5,4 +5,5 @@ dependencies {
55
compile project(path: ':patchwork-fml', configuration: 'dev')
66
compile project(path: ':patchwork-capabilities', configuration: 'dev')
77
compile project(path: ':patchwork-events-lifecycle', configuration: 'dev')
8+
compile project(path: ':patchwork-loot', configuration: 'dev')
89
}

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
@@ -24,7 +24,12 @@
2424
import net.minecraftforge.common.capabilities.CapabilityDispatcher;
2525
import net.minecraftforge.common.capabilities.ICapabilityProvider;
2626

27+
import net.minecraft.loot.LootManager;
28+
import net.minecraft.loot.LootTable;
29+
import net.minecraft.util.Identifier;
30+
2731
import net.patchworkmc.impl.capability.CapabilityEvents;
32+
import net.patchworkmc.impl.event.loot.LootEvents;
2833

2934
/*
3035
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
@@ -40,4 +45,8 @@ public static <T> CapabilityDispatcher gatherCapabilities(Class<? extends T> typ
4045
public static <T> CapabilityDispatcher gatherCapabilities(Class<? extends T> type, T provider, @Nullable ICapabilityProvider parent) {
4146
return CapabilityEvents.gatherCapabilities(type, provider, parent);
4247
}
48+
49+
public static LootTable loadLootTable(Identifier name, LootTable table, LootManager lootTableManager) {
50+
return LootEvents.loadLootTable(name, table, lootTableManager);
51+
}
4352
}

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

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

0 commit comments

Comments
 (0)