ChoiceIsMe

WeatherMod (java main)

Aug 3rd, 2021
31
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package io.github.choiceisme;
  2.  
  3. import org.apache.logging.log4j.LogManager;
  4. import org.apache.logging.log4j.Logger;
  5.  
  6. import io.github.choiceisme.common.entity.ExampleEntity;
  7. import io.github.choiceisme.core.init.BlockInit;
  8. import io.github.choiceisme.core.init.EntityTypeInit;
  9. import io.github.choiceisme.core.init.FeatureInit;
  10. import io.github.choiceisme.core.init.ItemInit;
  11. import net.minecraft.entity.ai.attributes.GlobalEntityTypeAttributes;
  12. import net.minecraftforge.common.MinecraftForge;
  13. import net.minecraftforge.eventbus.api.EventPriority;
  14. import net.minecraftforge.eventbus.api.IEventBus;
  15. import net.minecraftforge.fml.DeferredWorkQueue;
  16. import net.minecraftforge.fml.common.Mod;
  17. import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
  18. import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
  19.  
  20.  
  21. @Mod(WeatherMod.MOD_ID)
  22. public class WeatherMod {
  23. public static final Logger LOGGER = LogManager.getLogger();
  24. public static final String MOD_ID = "choiceismemods";
  25.  
  26. public WeatherMod() {
  27. IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
  28.  
  29. bus.addListener(this::setup);
  30.  
  31. EntityTypeInit.ENTITY_TYPES.register(bus);
  32. BlockInit.BLOCKS.register(bus);
  33. ItemInit.ITEMS.register(bus);
  34.  
  35. MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, FeatureInit::addOres);
  36. MinecraftForge.EVENT_BUS.register(this);
  37.  
  38. }
  39.  
  40. @SuppressWarnings("deprecation")
  41. private void setup(final FMLCommonSetupEvent event) {
  42.  
  43. DeferredWorkQueue.runLater(() -> {
  44.  
  45. GlobalEntityTypeAttributes.put(EntityTypeInit.EXAMPLE.get(), ExampleEntity.setAttributes().build());
  46.  
  47. });
  48. }
  49. }
RAW Paste Data