generated from NeoForgeMDKs/MDK-1.21-ModDevGradle
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/net/kaupenjoe/tutorialmod/villager/ModVillagers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package net.kaupenjoe.tutorialmod.villager; | ||
|
||
import com.google.common.collect.ImmutableSet; | ||
import net.kaupenjoe.tutorialmod.TutorialMod; | ||
import net.kaupenjoe.tutorialmod.block.ModBlocks; | ||
import net.kaupenjoe.tutorialmod.sound.ModSounds; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.world.entity.ai.village.poi.PoiType; | ||
import net.minecraft.world.entity.npc.VillagerProfession; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
public class ModVillagers { | ||
public static final DeferredRegister<PoiType> POI_TYPES = | ||
DeferredRegister.create(BuiltInRegistries.POINT_OF_INTEREST_TYPE, TutorialMod.MOD_ID); | ||
public static final DeferredRegister<VillagerProfession> VILLAGER_PROFESSIONS = | ||
DeferredRegister.create(BuiltInRegistries.VILLAGER_PROFESSION, TutorialMod.MOD_ID); | ||
|
||
public static final Holder<PoiType> KAUPEN_POI = POI_TYPES.register("kaupen_poi", | ||
() -> new PoiType(ImmutableSet.copyOf(ModBlocks.CHAIR.get().getStateDefinition().getPossibleStates()), 1, 1)); | ||
|
||
public static final Holder<VillagerProfession> KAUPENGER = VILLAGER_PROFESSIONS.register("kaupenger", | ||
() -> new VillagerProfession("kaupenger", holder -> holder.value() == KAUPEN_POI.value(), | ||
poiTypeHolder -> poiTypeHolder.value() == KAUPEN_POI.value(), ImmutableSet.of(), ImmutableSet.of(), | ||
ModSounds.MAGIC_BLOCK_HIT.get())); | ||
|
||
|
||
public static void register(IEventBus eventBus) { | ||
POI_TYPES.register(eventBus); | ||
VILLAGER_PROFESSIONS.register(eventBus); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.07 KB
.../resources/assets/tutorialmod/textures/entity/villager/profession/kaupenger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
src/main/resources/data/minecraft/tags/point_of_interest_type/acquirable_job_site.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"replace": false, | ||
"values": [ | ||
{ | ||
"id": "tutorialmod:kaupen_poi", | ||
"required": false | ||
} | ||
] | ||
} |