-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
woopsie i forgot to delete some files so now it wont build
- Loading branch information
Showing
42 changed files
with
396 additions
and
371 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/2a6c4893c768bc43ca87ea7d6ecdcaba130270b1
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
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/7adfc799bc63aad7dbb4040c11e8b499fd3b945b
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 |
---|---|---|
@@ -1 +1 @@ | ||
// 1.20.4 2024-02-09T19:55:16.426504133 TutorialMod/Tags for minecraft:item | ||
// 1.20.4 2024-02-09T19:56:31.485153601 TutorialMod/Tags for minecraft:item |
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/8e5d61690f39401af1a249ac7756b56399634be2
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
2 changes: 1 addition & 1 deletion
2
src/main/generated/.cache/e5f44278c047a3c549db4d1e452a7777839a2e19
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
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
41 changes: 40 additions & 1 deletion
41
src/main/java/net/fugimii/tutorial/block/custom/SoundBlock.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 |
---|---|---|
@@ -1,2 +1,41 @@ | ||
package net.fugimii.tutorial.block.custom;public class SoundBlock { | ||
package net.fugimii.tutorial.block.custom; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.client.item.TooltipContext; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.sound.SoundCategory; | ||
import net.minecraft.sound.SoundEvent; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.ActionResult; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.BlockView; | ||
import net.minecraft.world.World; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
public class SoundBlock extends Block { | ||
public SoundBlock(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
@Override | ||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { | ||
|
||
world.playSound(player, pos, SoundEvents.BLOCK_NOTE_BLOCK_XYLOPHONE.value(), SoundCategory.BLOCKS, 1f, 1f); | ||
|
||
return ActionResult.SUCCESS; | ||
} | ||
|
||
@Override | ||
public void appendTooltip(ItemStack stack, @Nullable BlockView world, List<Text> tooltip, TooltipContext options) { | ||
tooltip.add(Text.translatable("tooltip.tutorialmod.soundblock")); | ||
|
||
super.appendTooltip(stack, world, tooltip, options); | ||
} | ||
} |
58 changes: 56 additions & 2 deletions
58
src/main/java/net/fugimii/tutorial/datagen/ModBlockTagProvider.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 |
---|---|---|
@@ -1,2 +1,56 @@ | ||
package net.fugimii.tutorial.datagen;public class ModBlockTagProvider { | ||
} | ||
package net.fugimii.tutorial.datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; | ||
import net.fugimii.tutorial.block.ModBlocks; | ||
import net.fugimii.tutorial.util.ModTags; | ||
import net.minecraft.registry.RegistryKey; | ||
import net.minecraft.registry.RegistryKeys; | ||
import net.minecraft.registry.RegistryWrapper; | ||
import net.minecraft.registry.tag.BlockTags; | ||
import net.minecraft.registry.tag.TagKey; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider { | ||
public ModBlockTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) { | ||
super(output, registriesFuture); | ||
} | ||
|
||
@Override | ||
protected void configure(RegistryWrapper.WrapperLookup arg) { | ||
getOrCreateTagBuilder(ModTags.Blocks.METAL_DETECTOR_DETECTABLE_BLOCKS) | ||
.add(ModBlocks.RUBY_ORE) | ||
.forceAddTag(BlockTags.GOLD_ORES) | ||
.forceAddTag(BlockTags.EMERALD_ORES) | ||
.forceAddTag(BlockTags.REDSTONE_ORES) | ||
.forceAddTag(BlockTags.LAPIS_ORES) | ||
.forceAddTag(BlockTags.DIAMOND_ORES) | ||
.forceAddTag(BlockTags.IRON_ORES) | ||
.forceAddTag(BlockTags.COPPER_ORES) | ||
.forceAddTag(BlockTags.COAL_ORES); | ||
|
||
getOrCreateTagBuilder(BlockTags.PICKAXE_MINEABLE) | ||
.add(ModBlocks.RAW_RUBY_BLOCK) | ||
.add(ModBlocks.RUBY_BLOCK) | ||
.add(ModBlocks.RUBY_ORE) | ||
.add(ModBlocks.DEEPSLATE_RUBY_ORE) | ||
.add(ModBlocks.NETHER_RUBY_ORE) | ||
.add(ModBlocks.END_STONE_RUBY_ORE) | ||
.add(ModBlocks.SOUND_BLOCK); | ||
|
||
getOrCreateTagBuilder(BlockTags.NEEDS_STONE_TOOL) | ||
.add(ModBlocks.RUBY_BLOCK); | ||
|
||
getOrCreateTagBuilder(BlockTags.NEEDS_IRON_TOOL) | ||
.add(ModBlocks.RAW_RUBY_BLOCK) | ||
.add(ModBlocks.RUBY_ORE); | ||
|
||
getOrCreateTagBuilder(BlockTags.NEEDS_DIAMOND_TOOL) | ||
.add(ModBlocks.DEEPSLATE_RUBY_ORE); | ||
|
||
getOrCreateTagBuilder(TagKey.of(RegistryKeys.BLOCK, new Identifier("fabric", "needs_tool_level_4"))) | ||
.add(ModBlocks.END_STONE_RUBY_ORE); | ||
} | ||
} |
18 changes: 17 additions & 1 deletion
18
src/main/java/net/fugimii/tutorial/datagen/ModItemTagProvider.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 |
---|---|---|
@@ -1,2 +1,18 @@ | ||
package net.fugimii.tutorial.datagen;public class ModItemTagProvider { | ||
package net.fugimii.tutorial.datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; | ||
import net.minecraft.registry.RegistryWrapper; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider { | ||
public ModItemTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) { | ||
super(output, completableFuture); | ||
} | ||
|
||
@Override | ||
protected void configure(RegistryWrapper.WrapperLookup arg) { | ||
|
||
} | ||
} |
48 changes: 46 additions & 2 deletions
48
src/main/java/net/fugimii/tutorial/datagen/ModLootTableProvider.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 |
---|---|---|
@@ -1,2 +1,46 @@ | ||
package net.fugimii.tutorial.datagen;public class ModLootTableProvider { | ||
} | ||
package net.fugimii.tutorial.datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; | ||
import net.fugimii.tutorial.block.ModBlocks; | ||
import net.fugimii.tutorial.item.ModItems; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.data.server.loottable.BlockLootTableGenerator; | ||
import net.minecraft.enchantment.Enchantments; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.loot.LootTable; | ||
import net.minecraft.loot.entry.ItemEntry; | ||
import net.minecraft.loot.entry.LeafEntry; | ||
import net.minecraft.loot.entry.LootPoolEntry; | ||
import net.minecraft.loot.function.ApplyBonusLootFunction; | ||
import net.minecraft.loot.function.SetCountLootFunction; | ||
import net.minecraft.loot.provider.number.UniformLootNumberProvider; | ||
|
||
public class ModLootTableProvider extends FabricBlockLootTableProvider { | ||
public ModLootTableProvider(FabricDataOutput dataOutput) { | ||
super(dataOutput); | ||
} | ||
|
||
@Override | ||
public void generate() { | ||
addDrop(ModBlocks.RUBY_BLOCK); | ||
addDrop(ModBlocks.RAW_RUBY_BLOCK); | ||
addDrop(ModBlocks.SOUND_BLOCK); | ||
|
||
addDrop(ModBlocks.RUBY_ORE, copperLikeOreDrops(ModBlocks.RUBY_ORE, ModItems.RAW_RUBY)); | ||
addDrop(ModBlocks.DEEPSLATE_RUBY_ORE, copperLikeOreDrops(ModBlocks.DEEPSLATE_RUBY_ORE, ModItems.RAW_RUBY)); | ||
addDrop(ModBlocks.NETHER_RUBY_ORE, copperLikeOreDrops(ModBlocks.NETHER_RUBY_ORE, ModItems.RAW_RUBY)); | ||
addDrop(ModBlocks.END_STONE_RUBY_ORE, copperLikeOreDrops(ModBlocks.END_STONE_RUBY_ORE, ModItems.RAW_RUBY)); | ||
} | ||
|
||
public LootTable.Builder copperLikeOreDrops(Block drop, Item item) { | ||
return BlockLootTableGenerator.dropsWithSilkTouch(drop, (LootPoolEntry.Builder)this.applyExplosionDecay(drop, | ||
((LeafEntry.Builder) | ||
ItemEntry.builder(item) | ||
.apply(SetCountLootFunction | ||
.builder(UniformLootNumberProvider | ||
.create(2.0f, 5.0f)))) | ||
.apply(ApplyBonusLootFunction.oreDrops(Enchantments.FORTUNE)))); | ||
} | ||
} |
38 changes: 36 additions & 2 deletions
38
src/main/java/net/fugimii/tutorial/datagen/ModModelProvider.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 |
---|---|---|
@@ -1,2 +1,36 @@ | ||
package net.fugimii.tutorial.datagen;public class ModModelProvider { | ||
} | ||
package net.fugimii.tutorial.datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; | ||
import net.fugimii.tutorial.block.ModBlocks; | ||
import net.fugimii.tutorial.item.ModItems; | ||
import net.minecraft.data.client.BlockStateModelGenerator; | ||
import net.minecraft.data.client.ItemModelGenerator; | ||
import net.minecraft.data.client.Models; | ||
|
||
public class ModModelProvider extends FabricModelProvider { | ||
public ModModelProvider(FabricDataOutput output) { | ||
super(output); | ||
} | ||
|
||
@Override | ||
public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.RUBY_BLOCK); | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.RAW_RUBY_BLOCK); | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.RUBY_ORE); | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.DEEPSLATE_RUBY_ORE); | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NETHER_RUBY_ORE); | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.END_STONE_RUBY_ORE); | ||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.SOUND_BLOCK); | ||
} | ||
|
||
@Override | ||
public void generateItemModels(ItemModelGenerator itemModelGenerator) { | ||
itemModelGenerator.register(ModItems.RUBY, Models.GENERATED); | ||
itemModelGenerator.register(ModItems.RAW_RUBY, Models.GENERATED); | ||
|
||
itemModelGenerator.register(ModItems.COAL_BRIQUETTE, Models.GENERATED); | ||
itemModelGenerator.register(ModItems.TOMATO, Models.GENERATED); | ||
itemModelGenerator.register(ModItems.METAL_DETECTOR, Models.GENERATED); | ||
} | ||
} |
40 changes: 39 additions & 1 deletion
40
src/main/java/net/fugimii/tutorial/datagen/ModRecipeProvider.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 |
---|---|---|
@@ -1,2 +1,40 @@ | ||
package net.fugimii.tutorial.datagen;public class ModRecipeProvider { | ||
package net.fugimii.tutorial.datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; | ||
import net.fugimii.tutorial.block.ModBlocks; | ||
import net.fugimii.tutorial.item.ModItems; | ||
import net.minecraft.data.server.recipe.RecipeExporter; | ||
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder; | ||
import net.minecraft.item.ItemConvertible; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.recipe.book.RecipeCategory; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.List; | ||
|
||
public class ModRecipeProvider extends FabricRecipeProvider { | ||
private static final List<ItemConvertible> RUBY_SMELTABLES = List.of(ModItems.RAW_RUBY, | ||
ModBlocks.RUBY_ORE, ModBlocks.END_STONE_RUBY_ORE, ModBlocks.NETHER_RUBY_ORE); | ||
public ModRecipeProvider(FabricDataOutput output) { | ||
super(output); | ||
} | ||
|
||
@Override | ||
public void generate(RecipeExporter exporter) { | ||
offerSmelting(exporter, RUBY_SMELTABLES, RecipeCategory.MISC, ModItems.RUBY, 0.7f, 200, "ruby"); | ||
offerBlasting(exporter, RUBY_SMELTABLES, RecipeCategory.MISC, ModItems.RUBY, 0.7f, 100, "ruby"); | ||
|
||
offerReversibleCompactingRecipes(exporter, RecipeCategory.BUILDING_BLOCKS, ModItems.RUBY, RecipeCategory.DECORATIONS, ModBlocks.RUBY_BLOCK); | ||
|
||
ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, ModItems.RAW_RUBY, 1) | ||
.pattern("SSS") | ||
.pattern("SRS") | ||
.pattern("SSS") | ||
.input('S', Items.STONE) | ||
.input('R', ModItems.RUBY) | ||
.criterion(hasItem(Items.STONE), conditionsFromItem(Items.STONE)) | ||
.criterion(hasItem(ModItems.RUBY), conditionsFromItem(ModItems.RUBY)) | ||
.offerTo(exporter, new Identifier(getRecipeName(ModItems.RAW_RUBY))); | ||
} | ||
} |
10 changes: 9 additions & 1 deletion
10
src/main/java/net/fugimii/tutorial/item/ModFoodComponents.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 |
---|---|---|
@@ -1,2 +1,10 @@ | ||
package net.fugimii.tutorial.item;public class ModFoodComponents { | ||
package net.fugimii.tutorial.item; | ||
|
||
import net.minecraft.entity.effect.StatusEffectInstance; | ||
import net.minecraft.entity.effect.StatusEffects; | ||
import net.minecraft.item.FoodComponent; | ||
|
||
public class ModFoodComponents { | ||
public static final FoodComponent TOMATO = new FoodComponent.Builder().hunger(3).saturationModifier(0.25f) | ||
.statusEffect(new StatusEffectInstance(StatusEffects.LUCK, 200), 0.25f).build(); | ||
} |
Oops, something went wrong.