|
9 | 9 | import galena.oreganized.compat.supplementaries.AmendmentsCompat;
|
10 | 10 | import galena.oreganized.content.block.LeadOreBlock;
|
11 | 11 | import galena.oreganized.content.block.MoltenLeadCauldronBlock;
|
| 12 | +import galena.oreganized.content.entity.holler.Holler; |
12 | 13 | import galena.oreganized.content.entity.LeadBoltEntity;
|
13 | 14 | import galena.oreganized.data.OAdvancements;
|
14 | 15 | import galena.oreganized.data.OBiomeTags;
|
|
53 | 54 | import net.minecraft.server.packs.PackType;
|
54 | 55 | import net.minecraft.server.packs.metadata.pack.PackMetadataSection;
|
55 | 56 | import net.minecraft.tags.FluidTags;
|
| 57 | +import net.minecraft.world.entity.SpawnPlacements; |
56 | 58 | import net.minecraft.world.entity.npc.VillagerProfession;
|
57 | 59 | import net.minecraft.world.entity.projectile.AbstractArrow;
|
58 | 60 | import net.minecraft.world.entity.projectile.Projectile;
|
|
69 | 71 | import net.minecraft.world.level.block.Blocks;
|
70 | 72 | import net.minecraft.world.level.block.DispenserBlock;
|
71 | 73 | import net.minecraft.world.level.block.FireBlock;
|
| 74 | +import net.minecraft.world.level.levelgen.Heightmap; |
72 | 75 | import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
|
73 | 76 | import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
|
74 | 77 | import net.minecraftforge.common.BasicItemListing;
|
|
79 | 82 | import net.minecraftforge.common.util.MutableHashedLinkedMap;
|
80 | 83 | import net.minecraftforge.data.event.GatherDataEvent;
|
81 | 84 | import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
| 85 | +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; |
| 86 | +import net.minecraftforge.event.entity.SpawnPlacementRegisterEvent; |
82 | 87 | import net.minecraftforge.event.village.VillagerTradesEvent;
|
83 | 88 | import net.minecraftforge.eventbus.api.IEventBus;
|
84 | 89 | import net.minecraftforge.eventbus.api.SubscribeEvent;
|
@@ -131,6 +136,8 @@ public Oreganized() {
|
131 | 136 | modBus.addListener(this::clientSetup);
|
132 | 137 | modBus.addListener(this::gatherData);
|
133 | 138 | modBus.addListener(this::buildCreativeModeTabContents);
|
| 139 | + modBus.addListener(this::registerAttributes); |
| 140 | + modBus.addListener(this::registerSpawnPlacements); |
134 | 141 | forgeBus.addListener(this::injectVillagerTrades);
|
135 | 142 |
|
136 | 143 | LOOT_MODIFIERS.register("add_item", () -> AddItemLootModifier.CODEC);
|
@@ -171,6 +178,15 @@ public Oreganized() {
|
171 | 178 | //context.registerConfig(ModConfig.Type.CLIENT, OreganizedConfig.CLIENT_SPEC);
|
172 | 179 | }
|
173 | 180 |
|
| 181 | + private void registerAttributes(EntityAttributeCreationEvent event) { |
| 182 | + event.put(OEntityTypes.HOLLER.get(), Holler.createAttributes().build()); |
| 183 | + } |
| 184 | + |
| 185 | + private void registerSpawnPlacements(SpawnPlacementRegisterEvent event) { |
| 186 | + event.register(OEntityTypes.HOLLER.get(), SpawnPlacements.Type.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Holler::checkHollerSpawnRules, SpawnPlacementRegisterEvent.Operation.REPLACE); |
| 187 | + } |
| 188 | + |
| 189 | + |
174 | 190 | private void injectVillagerTrades(VillagerTradesEvent event) {
|
175 | 191 | if (event.getType() == VillagerProfession.MASON) {
|
176 | 192 | event.getTrades().get(5).add(new BasicItemListing(14, new ItemStack(OBlocks.GARGOYLE.get()), 5, 30, 0.05F));
|
@@ -381,6 +397,7 @@ public void buildCreativeModeTabContents(BuildCreativeModeTabContentsEvent event
|
381 | 397 | putAfter(entries, Blocks.ICE, OBlocks.GROOVED_ICE);
|
382 | 398 | putAfter(entries, Blocks.PACKED_ICE, OBlocks.GROOVED_PACKED_ICE);
|
383 | 399 | putAfter(entries, Blocks.BLUE_ICE, OBlocks.GROOVED_BLUE_ICE);
|
| 400 | + putAfter(entries, Blocks.FARMLAND, OBlocks.BURIAL_DIRT); |
384 | 401 | putAfter(entries, Blocks.BONE_BLOCK, OBlocks.BONE_PILE);
|
385 | 402 | }
|
386 | 403 | if (tab == CreativeModeTabs.REDSTONE_BLOCKS) {
|
|
0 commit comments