Advertisement
nyapoleon_legionary

RTMEntity.Class

Nov 18th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.48 KB | None | 0 0
  1. package jp.ngt.rtm;
  2.  
  3. import jp.ngt.ngtlib.util.IMod;
  4. import jp.ngt.ngtlib.util.NGTRegHandler;
  5. import jp.ngt.ngtlib.util.NGTUtilClient;
  6. import jp.ngt.rtm.entity.EntityATC;
  7. import jp.ngt.rtm.entity.EntityBullet;
  8. import jp.ngt.rtm.entity.EntityBumpingPost;
  9. import jp.ngt.rtm.entity.EntityMMBoundingBox;
  10. import jp.ngt.rtm.entity.EntityTrainDetector;
  11. import jp.ngt.rtm.entity.RenderBullet;
  12. import jp.ngt.rtm.entity.RenderEntityInstalledObject;
  13. import jp.ngt.rtm.entity.RenderMMBB;
  14. import jp.ngt.rtm.entity.fluid.EntityFluid;
  15. import jp.ngt.rtm.entity.fluid.RenderFluid;
  16. import jp.ngt.rtm.entity.npc.EntityMotorman;
  17. import jp.ngt.rtm.entity.npc.EntityNPC;
  18. import jp.ngt.rtm.entity.npc.RenderNPC;
  19. import jp.ngt.rtm.entity.train.EntityBogie;
  20. import jp.ngt.rtm.entity.train.EntityFreightCar;
  21. import jp.ngt.rtm.entity.train.EntityTanker;
  22. import jp.ngt.rtm.entity.train.EntityTrainBase;
  23. import jp.ngt.rtm.entity.train.EntityTrainDieselCar;
  24. import jp.ngt.rtm.entity.train.EntityTrainElectricCar;
  25. import jp.ngt.rtm.entity.train.EntityTrainTest;
  26. import jp.ngt.rtm.entity.train.RenderBogie;
  27. import jp.ngt.rtm.entity.train.parts.EntityArtillery;
  28. import jp.ngt.rtm.entity.train.parts.EntityContainer;
  29. import jp.ngt.rtm.entity.train.parts.EntityFloor;
  30. import jp.ngt.rtm.entity.train.parts.EntityTie;
  31. import jp.ngt.rtm.entity.train.parts.RenderArtillery;
  32. import jp.ngt.rtm.entity.train.parts.RenderContainer;
  33. import jp.ngt.rtm.entity.train.parts.RenderSeat;
  34. import jp.ngt.rtm.entity.train.parts.RenderTie;
  35. import jp.ngt.rtm.entity.vehicle.EntityCar;
  36. import jp.ngt.rtm.entity.vehicle.EntityLift;
  37. import jp.ngt.rtm.entity.vehicle.EntityPlane;
  38. import jp.ngt.rtm.entity.vehicle.EntityShip;
  39. import jp.ngt.rtm.entity.vehicle.EntityTrolley;
  40. import jp.ngt.rtm.entity.vehicle.EntityVehicle;
  41. import jp.ngt.rtm.entity.vehicle.RenderTrolley;
  42. import jp.ngt.rtm.entity.vehicle.RenderVehicleBase;
  43. import jp.ngt.rtm.entity.vehicle.RenderWeatherEffectDummy;
  44. import jp.ngt.rtm.entity.vehicle.WeatherEffectDummy;
  45. import net.minecraftforge.fml.relauncher.Side;
  46. import net.minecraftforge.fml.relauncher.SideOnly;
  47.  
  48. public final class RTMEntity {
  49.    public static final byte FREQ_VEHICLE = 3;
  50.    public static final byte FREQ_INSTALLED = 10;
  51.    private static short nextId;
  52.    private static final short RANGE = 1024;
  53.  
  54.    public static void init(IMod mod) {
  55.       NGTRegHandler.register(EntityBullet.class, "bullet", "RTM.E.Bullet", getNextId(), 256, 3, true, mod);
  56.       NGTRegHandler.register(EntityMMBoundingBox.class, "mmbb", "RTM.E.MMBB", getNextId(), 160, Integer.MAX_VALUE, false, mod);
  57.       NGTRegHandler.register(EntityFluid.class, "fluid", "RTM.E.Fluid", getNextId(), 256, 3, true, mod);
  58.       NGTRegHandler.register(EntityMotorman.class, "motorman", "RTM.E.Motorman", getNextId(), 1024, 3, true, mod);
  59.       NGTRegHandler.register(EntityNPC.class, "npc", "RTM.E.NPC", getNextId(), 1024, 3, true, mod);
  60.       NGTRegHandler.register(EntityATC.class, "atc", "RTM.E.ATC", getNextId(), 160, 10, false, mod);
  61.       NGTRegHandler.register(EntityTrainDetector.class, "train_detector", "RTM.E.TrainDetector", getNextId(), 160, 10, false, mod);
  62.       NGTRegHandler.register(EntityBumpingPost.class, "bumping_post", "RTM.E.BumpingPost", getNextId(), 160, 10, false, mod);
  63.       NGTRegHandler.register(EntityFloor.class, "floor", "RTM.E.Floor", getNextId(), 1024, 3, false, mod);
  64.       NGTRegHandler.register(EntityBogie.class, "bogie", "RTM.E.Bogie", getNextId(), 1024, 3, false, mod);
  65.       NGTRegHandler.register(EntityContainer.class, "container", "RTM.E.Container", getNextId(), 160, 3, false, mod);
  66.       NGTRegHandler.register(EntityArtillery.class, "artillery", "RTM.E.Artillery", getNextId(), 160, 3, false, mod);
  67.       NGTRegHandler.register(EntityTie.class, "tie", "RTM.E.Tie", getNextId(), 160, 3, false, mod);
  68.       NGTRegHandler.register(EntityCar.class, "car", "RTM.E.Car", getNextId(), 160, 3, true, mod);
  69.       NGTRegHandler.register(EntityShip.class, "ship", "RTM.E.Ship", getNextId(), 160, 3, true, mod);
  70.       NGTRegHandler.register(EntityPlane.class, "plane", "RTM.E.Plane", getNextId(), 160, 3, true, mod);
  71.       NGTRegHandler.register(EntityTrolley.class, "trolley", "RTM.E.Trolley", getNextId(), 160, 3, true, mod);
  72.       NGTRegHandler.register(EntityLift.class, "lift", "RTM.E.Lift", getNextId(), 160, 3, true, mod);
  73.       registerTrain(EntityTrainElectricCar.class, "electric_car", "RTM.E.ElectricCar", mod);
  74.       registerTrain(EntityTrainDieselCar.class, "diesel_car", "RTM.E.DieselCar", mod);
  75.       registerTrain(EntityTrainTest.class, "test_car", "RTM.E.TrainTest", mod);
  76.       registerTrain(EntityFreightCar.class, "freight_car", "RTM.E.FreightCar", mod);
  77.       registerTrain(EntityTanker.class, "tanker", "RTM.E.Tanker", mod);
  78.    }
  79.  
  80.    private static void registerTrain(Class<? extends EntityTrainBase> clazz, String regName, String name, IMod mod) {
  81.       NGTRegHandler.register(clazz, regName, name, getNextId(), 1024, 3, false, mod);
  82.    }
  83.  
  84.    @SideOnly(Side.CLIENT)
  85.    public static void initClient() {
  86.       NGTUtilClient.registerEntityRender(EntityVehicle.class, RenderVehicleBase.class);
  87.       NGTUtilClient.registerEntityRender(EntityTrainBase.class, RenderVehicleBase.class);
  88.       NGTUtilClient.registerEntityRender(WeatherEffectDummy.class, RenderWeatherEffectDummy.class);
  89.       NGTUtilClient.registerEntityRender(EntityBogie.class, RenderBogie.class);
  90.       NGTUtilClient.registerEntityRender(EntityFloor.class, RenderSeat.class);
  91.       NGTUtilClient.registerEntityRender(EntityATC.class, RenderEntityInstalledObject.class);
  92.       NGTUtilClient.registerEntityRender(EntityTrainDetector.class, RenderEntityInstalledObject.class);
  93.       NGTUtilClient.registerEntityRender(EntityBumpingPost.class, RenderEntityInstalledObject.class);
  94.       NGTUtilClient.registerEntityRender(EntityContainer.class, RenderContainer.class);
  95.       NGTUtilClient.registerEntityRender(EntityArtillery.class, RenderArtillery.class);
  96.       NGTUtilClient.registerEntityRender(EntityBullet.class, RenderBullet.class);
  97.       NGTUtilClient.registerEntityRender(EntityTie.class, RenderTie.class);
  98.       NGTUtilClient.registerEntityRender(EntityMMBoundingBox.class, RenderMMBB.class);
  99.       NGTUtilClient.registerEntityRender(EntityNPC.class, RenderNPC.class);
  100.       NGTUtilClient.registerEntityRender(EntityFluid.class, RenderFluid.class);
  101.       NGTUtilClient.registerEntityRender(EntityTrolley.class, RenderTrolley.class);
  102.    }
  103.  
  104.    public static int getNextId() {
  105.       short var10000 = nextId;
  106.       nextId = (short)(var10000 + 1);
  107.       return var10000;
  108.    }
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement