Compare commits
3 Commits
23-village
...
26-musicDi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3df4bc942e | ||
|
|
23db75e368 | ||
|
|
d59ec7e69b |
@@ -1,4 +1,5 @@
|
||||
// 1.20.1 2023-08-25T20:00:29.1439601 Item Models: tutorialmod
|
||||
// 1.20.1 2023-08-28T16:11:02.6585535 Item Models: tutorialmod
|
||||
f746b64540daf2ab6302b3ec01a78490c48fc10b assets/tutorialmod/models/item/bar_brawl_music_disc.json
|
||||
d3e9cad00ae44c9319dfbb411667eb4a09a63e57 assets/tutorialmod/models/item/catmint.json
|
||||
6126e26da373f9113d9e9be875b14a0d13857444 assets/tutorialmod/models/item/corn.json
|
||||
4c5c277fa6360b149d6c3ab20584fcc4450cda27 assets/tutorialmod/models/item/corn_seeds.json
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
// 1.20.1 2023-08-07T09:00:54.5654219 Tags for minecraft:item mod id tutorialmod
|
||||
// 1.20.1 2023-08-28T16:11:02.6575435 Tags for minecraft:item mod id tutorialmod
|
||||
526ec127a145db02975e7ec564384fa0a5389523 data/minecraft/tags/items/creeper_drop_music_discs.json
|
||||
526ec127a145db02975e7ec564384fa0a5389523 data/minecraft/tags/items/music_discs.json
|
||||
2514998bb25494de346fa0d088b7e216d8165efd data/minecraft/tags/items/trimmable_armor.json
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// 1.20.1 2023-08-28T12:32:21.1985044 Tags for minecraft:point_of_interest_type mod id tutorialmod
|
||||
83f1c4f1a14965cf8c4c3a99edb0f816c3115ee6 data/minecraft/tags/point_of_interest_type/acquirable_job_site.json
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "tutorialmod:item/bar_brawl_music_disc"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"values": [
|
||||
"tutorialmod:bar_brawl_music_disc"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"values": [
|
||||
"tutorialmod:bar_brawl_music_disc"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"values": [
|
||||
{
|
||||
"id": "tutorialmod:sound_poi",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import net.kaupenjoe.tutorialmod.block.ModBlocks;
|
||||
import net.kaupenjoe.tutorialmod.item.ModCreativeModTabs;
|
||||
import net.kaupenjoe.tutorialmod.item.ModItems;
|
||||
import net.kaupenjoe.tutorialmod.loot.ModLootModifiers;
|
||||
import net.kaupenjoe.tutorialmod.sound.ModSounds;
|
||||
import net.kaupenjoe.tutorialmod.villager.ModVillagers;
|
||||
import net.minecraft.world.item.CreativeModeTabs;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.FlowerPotBlock;
|
||||
@@ -35,6 +37,9 @@ public class TutorialMod {
|
||||
ModBlocks.register(modEventBus);
|
||||
|
||||
ModLootModifiers.register(modEventBus);
|
||||
ModVillagers.register(modEventBus);
|
||||
|
||||
ModSounds.register(modEventBus);
|
||||
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.kaupenjoe.tutorialmod.block.custom.CornCropBlock;
|
||||
import net.kaupenjoe.tutorialmod.block.custom.SoundBlock;
|
||||
import net.kaupenjoe.tutorialmod.block.custom.StrawberryCropBlock;
|
||||
import net.kaupenjoe.tutorialmod.item.ModItems;
|
||||
import net.kaupenjoe.tutorialmod.sound.ModSounds;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.util.valueproviders.UniformInt;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
@@ -43,7 +44,7 @@ public class ModBlocks {
|
||||
.strength(5f).requiresCorrectToolForDrops(), UniformInt.of(3, 7)));
|
||||
|
||||
public static final RegistryObject<Block> SOUND_BLOCK = registerBlock("sound_block",
|
||||
() -> new SoundBlock(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK)));
|
||||
() -> new SoundBlock(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).sound(ModSounds.SOUND_BLOCK_SOUNDS)));
|
||||
|
||||
public static final RegistryObject<Block> SAPPHIRE_STAIRS = registerBlock("sapphire_stairs",
|
||||
() -> new StairBlock(() -> ModBlocks.SAPPHIRE_BLOCK.get().defaultBlockState(),
|
||||
|
||||
@@ -31,5 +31,6 @@ public class DataGenerators {
|
||||
generator.addProvider(event.includeServer(), new ModItemTagGenerator(packOutput, lookupProvider, blockTagGenerator.contentsGetter(), existingFileHelper));
|
||||
|
||||
generator.addProvider(event.includeServer(), new ModGlobalLootModifiersProvider(packOutput));
|
||||
generator.addProvider(event.includeServer(), new ModPoiTypeTagsProvider(packOutput, lookupProvider, existingFileHelper));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ public class ModItemModelProvider extends ItemModelProvider {
|
||||
simpleItem(ModItems.CORN);
|
||||
simpleItem(ModItems.CORN_SEEDS);
|
||||
|
||||
simpleItem(ModItems.BAR_BRAWL_MUSIC_DISC);
|
||||
|
||||
simpleBlockItem(ModBlocks.SAPPHIRE_DOOR);
|
||||
|
||||
fenceItem(ModBlocks.SAPPHIRE_FENCE, ModBlocks.SAPPHIRE_BLOCK);
|
||||
|
||||
@@ -25,5 +25,11 @@ public class ModItemTagGenerator extends ItemTagsProvider {
|
||||
ModItems.SAPPHIRE_CHESTPLATE.get(),
|
||||
ModItems.SAPPHIRE_LEGGINGS.get(),
|
||||
ModItems.SAPPHIRE_BOOTS.get());
|
||||
|
||||
this.tag(ItemTags.MUSIC_DISCS)
|
||||
.add(ModItems.BAR_BRAWL_MUSIC_DISC.get());
|
||||
|
||||
this.tag(ItemTags.CREEPER_DROP_MUSIC_DISCS)
|
||||
.add(ModItems.BAR_BRAWL_MUSIC_DISC.get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package net.kaupenjoe.tutorialmod.datagen;
|
||||
|
||||
import net.kaupenjoe.tutorialmod.TutorialMod;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.tags.PoiTypeTagsProvider;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.PoiTypeTags;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModPoiTypeTagsProvider extends PoiTypeTagsProvider {
|
||||
public ModPoiTypeTagsProvider(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pProvider, @Nullable ExistingFileHelper existingFileHelper) {
|
||||
super(pOutput, pProvider, TutorialMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTags(HolderLookup.Provider pProvider) {
|
||||
tag(PoiTypeTags.ACQUIRABLE_JOB_SITE)
|
||||
.addOptional(new ResourceLocation(TutorialMod.MOD_ID, "sound_poi"));
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,9 @@ package net.kaupenjoe.tutorialmod.event;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.kaupenjoe.tutorialmod.TutorialMod;
|
||||
import net.kaupenjoe.tutorialmod.block.ModBlocks;
|
||||
import net.kaupenjoe.tutorialmod.item.ModItems;
|
||||
import net.kaupenjoe.tutorialmod.villager.ModVillagers;
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
import net.minecraft.world.entity.npc.VillagerTrades;
|
||||
import net.minecraft.world.item.EnchantedBookItem;
|
||||
@@ -56,6 +58,20 @@ public class ModEvents {
|
||||
enchantedBook,
|
||||
2, 8, 0.02f));
|
||||
}
|
||||
|
||||
if(event.getType() == ModVillagers.SOUND_MASTER.get()) {
|
||||
Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades();
|
||||
|
||||
trades.get(1).add((pTrader, pRandom) -> new MerchantOffer(
|
||||
new ItemStack(Items.EMERALD, 16),
|
||||
new ItemStack(ModBlocks.SOUND_BLOCK.get(), 1),
|
||||
16, 8, 0.02f));
|
||||
|
||||
trades.get(2).add((pTrader, pRandom) -> new MerchantOffer(
|
||||
new ItemStack(Items.EMERALD, 6),
|
||||
new ItemStack(ModBlocks.SAPPHIRE_ORE.get(), 2),
|
||||
5, 12, 0.02f));
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -46,6 +46,8 @@ public class ModCreativeModTabs {
|
||||
pOutput.accept(ModItems.CORN.get());
|
||||
pOutput.accept(ModItems.CORN_SEEDS.get());
|
||||
|
||||
pOutput.accept(ModItems.BAR_BRAWL_MUSIC_DISC.get());
|
||||
|
||||
pOutput.accept(ModBlocks.SAPPHIRE_BLOCK.get());
|
||||
pOutput.accept(ModBlocks.RAW_SAPPHIRE_BLOCK.get());
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.kaupenjoe.tutorialmod.block.ModBlocks;
|
||||
import net.kaupenjoe.tutorialmod.item.custom.FuelItem;
|
||||
import net.kaupenjoe.tutorialmod.item.custom.MetalDetectorItem;
|
||||
import net.kaupenjoe.tutorialmod.item.custom.ModArmorItem;
|
||||
import net.kaupenjoe.tutorialmod.sound.ModSounds;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
@@ -61,6 +62,8 @@ public class ModItems {
|
||||
public static final RegistryObject<Item> CORN = ITEMS.register("corn",
|
||||
() -> new Item(new Item.Properties()));
|
||||
|
||||
public static final RegistryObject<Item> BAR_BRAWL_MUSIC_DISC = ITEMS.register("bar_brawl_music_disc",
|
||||
() -> new RecordItem(6, ModSounds.BAR_BRAWL, new Item.Properties().stacksTo(1), 2440));
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
ITEMS.register(eventBus);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package net.kaupenjoe.tutorialmod.item.custom;
|
||||
|
||||
import net.kaupenjoe.tutorialmod.sound.ModSounds;
|
||||
import net.kaupenjoe.tutorialmod.util.ModTags;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
@@ -37,6 +39,9 @@ public class MetalDetectorItem extends Item {
|
||||
outputValuableCoordinates(positionClicked.below(i), player, state.getBlock());
|
||||
foundBlock = true;
|
||||
|
||||
pContext.getLevel().playSeededSound(null, positionClicked.getX(), positionClicked.getY(), positionClicked.getZ(),
|
||||
ModSounds.METAL_DETECTOR_FOUND_ORE.get(), SoundSource.BLOCKS, 1f, 1f, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
39
src/main/java/net/kaupenjoe/tutorialmod/sound/ModSounds.java
Normal file
39
src/main/java/net/kaupenjoe/tutorialmod/sound/ModSounds.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package net.kaupenjoe.tutorialmod.sound;
|
||||
|
||||
import net.kaupenjoe.tutorialmod.TutorialMod;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraftforge.common.util.ForgeSoundType;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ModSounds {
|
||||
public static final DeferredRegister<SoundEvent> SOUND_EVENTS =
|
||||
DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, TutorialMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<SoundEvent> METAL_DETECTOR_FOUND_ORE = registerSoundEvents("metal_detector_found_ore");
|
||||
|
||||
public static final RegistryObject<SoundEvent> SOUND_BLOCK_BREAK = registerSoundEvents("sound_block_break");
|
||||
public static final RegistryObject<SoundEvent> SOUND_BLOCK_STEP = registerSoundEvents("sound_block_step");
|
||||
public static final RegistryObject<SoundEvent> SOUND_BLOCK_FALL = registerSoundEvents("sound_block_fall");
|
||||
public static final RegistryObject<SoundEvent> SOUND_BLOCK_PLACE = registerSoundEvents("sound_block_place");
|
||||
public static final RegistryObject<SoundEvent> SOUND_BLOCK_HIT = registerSoundEvents("sound_block_hit");
|
||||
|
||||
public static final RegistryObject<SoundEvent> BAR_BRAWL = registerSoundEvents("bar_brawl");
|
||||
|
||||
|
||||
public static final ForgeSoundType SOUND_BLOCK_SOUNDS = new ForgeSoundType(1f, 1f,
|
||||
ModSounds.SOUND_BLOCK_BREAK, ModSounds.SOUND_BLOCK_STEP, ModSounds.SOUND_BLOCK_PLACE,
|
||||
ModSounds.SOUND_BLOCK_HIT, ModSounds.SOUND_BLOCK_FALL);
|
||||
|
||||
|
||||
private static RegistryObject<SoundEvent> registerSoundEvents(String name) {
|
||||
return SOUND_EVENTS.register(name, () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(TutorialMod.MOD_ID, name)));
|
||||
}
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
SOUND_EVENTS.register(eventBus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.kaupenjoe.tutorialmod.villager;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import net.kaupenjoe.tutorialmod.TutorialMod;
|
||||
import net.kaupenjoe.tutorialmod.block.ModBlocks;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.entity.ai.village.poi.PoiType;
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ModVillagers {
|
||||
public static final DeferredRegister<PoiType> POI_TYPES =
|
||||
DeferredRegister.create(ForgeRegistries.POI_TYPES, TutorialMod.MOD_ID);
|
||||
public static final DeferredRegister<VillagerProfession> VILLAGER_PROFESSIONS =
|
||||
DeferredRegister.create(ForgeRegistries.VILLAGER_PROFESSIONS, TutorialMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<PoiType> SOUND_POI = POI_TYPES.register("sound_poi",
|
||||
() -> new PoiType(ImmutableSet.copyOf(ModBlocks.SOUND_BLOCK.get().getStateDefinition().getPossibleStates()),
|
||||
1, 1));
|
||||
|
||||
public static final RegistryObject<VillagerProfession> SOUND_MASTER =
|
||||
VILLAGER_PROFESSIONS.register("soundmaster", () -> new VillagerProfession("soundmaster",
|
||||
holder -> holder.get() == SOUND_POI.get(), holder -> holder.get() == SOUND_POI.get(),
|
||||
ImmutableSet.of(), ImmutableSet.of(), SoundEvents.VILLAGER_WORK_ARMORER));
|
||||
|
||||
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
POI_TYPES.register(eventBus);
|
||||
VILLAGER_PROFESSIONS.register(eventBus);
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,9 @@
|
||||
"item.tutorialmod.corn": "Corn",
|
||||
"item.tutorialmod.corn_seeds": "Corn Seeds",
|
||||
|
||||
"item.tutorialmod.bar_brawl_music_disc": "Bar Brawl Music Disc",
|
||||
"item.tutorialmod.bar_brawl_music_disc.desc": "Bryan Tech - Bar Brawl (CC0)",
|
||||
|
||||
"block.tutorialmod.sapphire_block": "Block of Sapphire",
|
||||
"block.tutorialmod.raw_sapphire_block": "Block of Raw Sapphire",
|
||||
|
||||
@@ -47,6 +50,10 @@
|
||||
|
||||
"tooltip.tutorialmod.metal_detector.tooltip": "Finds valuables underground!",
|
||||
|
||||
"entity.minecraft.villager.tutorialmod.soundmaster": "Sound Master",
|
||||
|
||||
"sounds.tutorialmod.metal_detector_found_ore": "Metal Detector Jingle",
|
||||
|
||||
|
||||
"creativetab.tutorial_tab": "Sapphire Tutorial Tab"
|
||||
}
|
||||
46
src/main/resources/assets/tutorialmod/sounds.json
Normal file
46
src/main/resources/assets/tutorialmod/sounds.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"metal_detector_found_ore": {
|
||||
"subtitles": "sounds.tutorialmod.metal_detector_found_ore",
|
||||
"sounds": [
|
||||
"tutorialmod:metal_detector_found_ore"
|
||||
]
|
||||
},
|
||||
"sound_block_break": {
|
||||
"subtitle": "sounds.tutorialmod.sound_block_break",
|
||||
"sounds": [
|
||||
"tutorialmod:sound_block_break"
|
||||
]
|
||||
},
|
||||
"sound_block_step": {
|
||||
"subtitle": "sounds.tutorialmod.sound_block_step",
|
||||
"sounds": [
|
||||
"tutorialmod:sound_block_step"
|
||||
]
|
||||
},
|
||||
"sound_block_place": {
|
||||
"subtitle": "sounds.tutorialmod.sound_block_place",
|
||||
"sounds": [
|
||||
"tutorialmod:sound_block_place"
|
||||
]
|
||||
},
|
||||
"sound_block_hit": {
|
||||
"subtitle": "sounds.tutorialmod.sound_block_hit",
|
||||
"sounds": [
|
||||
"tutorialmod:sound_block_hit"
|
||||
]
|
||||
},
|
||||
"sound_block_fall": {
|
||||
"subtitle": "sounds.tutorialmod.sound_block_fall",
|
||||
"sounds": [
|
||||
"tutorialmod:sound_block_fall"
|
||||
]
|
||||
},
|
||||
"bar_brawl": {
|
||||
"sounds": [
|
||||
{
|
||||
"name": "tutorialmod:bar_brawl",
|
||||
"stream": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/tutorialmod/sounds/bar_brawl.ogg
Normal file
BIN
src/main/resources/assets/tutorialmod/sounds/bar_brawl.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/main/resources/assets/tutorialmod/sounds/sound_block_hit.ogg
Normal file
BIN
src/main/resources/assets/tutorialmod/sounds/sound_block_hit.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 392 B |
Reference in New Issue
Block a user