mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Fix some test mods crashing server caused by model loading (#4225)
This commit is contained in:
1 parent
7d0a8524aa
commit
e59b979e1b
8 files changed
+231
-215
No files matched your search
@@ -60,6 +60,7 @@ import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -196,6 +197,24 @@ public class ModelAnimationDebug
|
||||
}.setRegistryName(TEST_BLOCK.getRegistryName())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class CommonProxy
|
||||
{
|
||||
@Nullable
|
||||
public IAnimationStateMachine load(ResourceLocation location, ImmutableMap<String, ITimeValue> parameters){ return null; };
|
||||
}
|
||||
|
||||
public static class ServerProxy extends CommonProxy {}
|
||||
|
||||
@Mod.EventBusSubscriber(value = Side.CLIENT, modid = MODID)
|
||||
public static class ClientProxy extends CommonProxy
|
||||
{
|
||||
|
||||
public IAnimationStateMachine load(ResourceLocation location, ImmutableMap<String, ITimeValue> parameters)
|
||||
{
|
||||
return ModelLoaderRegistry.loadASM(location, parameters);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerModels(ModelRegistryEvent event)
|
||||
@@ -247,24 +266,6 @@ public class ModelAnimationDebug
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class CommonProxy
|
||||
{
|
||||
@Nullable
|
||||
public IAnimationStateMachine load(ResourceLocation location, ImmutableMap<String, ITimeValue> parameters){ return null; };
|
||||
}
|
||||
|
||||
public static class ServerProxy extends CommonProxy {}
|
||||
|
||||
public static class ClientProxy extends CommonProxy
|
||||
{
|
||||
|
||||
public IAnimationStateMachine load(ResourceLocation location, ImmutableMap<String, ITimeValue> parameters)
|
||||
{
|
||||
return ModelLoaderRegistry.loadASM(location, parameters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class ItemAnimationHolder implements ICapabilityProvider
|
||||
{
|
||||
private final VariableValue cycleLength = new VariableValue(4);
|
||||
|
||||
Reference in new issue
Block a user