mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Expose ICondition$IContext to modded reload listeners. (#8596)
This commit is contained in:
1 parent
2fb8b2eb18
commit
168a3bc6fc
2 files changed
+32
-2
No files matched your search
@@ -11,6 +11,7 @@ import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.crafting.conditions.ICondition;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.ModLoader;
|
||||
|
||||
@@ -48,11 +49,23 @@ public class AddReloadListenerEvent extends Event
|
||||
return ImmutableList.copyOf(listeners);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The ReloableServerResources being reloaded.
|
||||
*/
|
||||
public ReloadableServerResources getServerResources()
|
||||
{
|
||||
return serverResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* This context object holds data relevant to the current reload, such as staged tags.
|
||||
* @return The condition context for the currently active reload.
|
||||
*/
|
||||
public ICondition.IContext getConditionContext()
|
||||
{
|
||||
return serverResources.getConditionContext();
|
||||
}
|
||||
|
||||
private static class WrappedStateAwareListener implements PreparableReloadListener {
|
||||
private final PreparableReloadListener wrapped;
|
||||
|
||||
|
||||
Reference in new issue
Block a user