CommonProxy.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package me.km;
  2. import me.km.blocks.BlockEvents;
  3. import me.km.entities.ModEntities;
  4. import me.km.events.CustomEventCaller;
  5. import me.km.playerbank.ModDedicatedPlayerList;
  6. import net.minecraft.client.model.ModelBiped;
  7. import net.minecraft.client.renderer.entity.Render;
  8. import net.minecraft.entity.Entity;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.server.MinecraftServer;
  11. import net.minecraft.server.dedicated.DedicatedServer;
  12. import net.minecraftforge.common.MinecraftForge;
  13. import net.minecraftforge.fluids.IFluidBlock;
  14. import net.minecraftforge.fml.relauncher.Side;
  15. import net.minecraftforge.fml.relauncher.SideOnly;
  16. public class CommonProxy
  17. {
  18. public void registerItemRenderer(Item item, int meta, String id, String variant)
  19. {
  20. }
  21. public void registerItemRenderer(Item item, int meta, String id)
  22. {
  23. }
  24. public void registerFluidModel(IFluidBlock fluidBlock)
  25. {
  26. }
  27. public void registerEntityRenderer(Class<? extends Entity> c, Render<? extends Entity> r)
  28. {
  29. }
  30. public void init()
  31. {
  32. ModEntities.initServer();
  33. MinecraftForge.EVENT_BUS.register(new BlockEvents());
  34. MinecraftForge.EVENT_BUS.register(new CustomEventCaller());
  35. }
  36. public void overloadPlayerList(MinecraftServer server)
  37. {
  38. // This prevents clients from crashing, the custom player list only loads on servers
  39. overloadPlayerListWorkaround(server);
  40. }
  41. @SideOnly(Side.SERVER)
  42. private void overloadPlayerListWorkaround(MinecraftServer server)
  43. {
  44. if(server instanceof DedicatedServer)
  45. {
  46. DedicatedServer dedi = (DedicatedServer) server;
  47. dedi.setPlayerList(new ModDedicatedPlayerList(dedi));
  48. }
  49. }
  50. public ModelBiped getCylinderModel()
  51. {
  52. return null;
  53. }
  54. public ModelBiped getStrawHatModel()
  55. {
  56. return null;
  57. }
  58. }