From 693f903eadb15c5edfe4977c2433904a5342a528 Mon Sep 17 00:00:00 2001 From: Vos Date: Thu, 6 Nov 2025 20:14:30 -0600 Subject: [PATCH] Wand --- .../assets/acesbs/models/item/wand.json | 6 ++ .../com/acethewildfire/acesbs/AcesBS.java | 3 + .../java/com/acethewildfire/acesbs/TODO.txt | 62 +++++++++++++++ .../component/ModDataComponentTypes.java | 25 ++++++ .../acesbs/datagen/ModModelProvider.java | 1 + .../acesbs/item/ModItemGroups.java | 1 + .../acethewildfire/acesbs/item/ModItems.java | 2 + .../acesbs/item/custom/Wand.java | 72 ++++++++++++++++++ .../resources/assets/acesbs/lang/en_us.json | 5 +- .../assets/acesbs/textures/item/wand.png | Bin 0 -> 4480 bytes 10 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 src/main/generated/assets/acesbs/models/item/wand.json create mode 100644 src/main/java/com/acethewildfire/acesbs/TODO.txt create mode 100644 src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java create mode 100644 src/main/java/com/acethewildfire/acesbs/item/custom/Wand.java create mode 100644 src/main/resources/assets/acesbs/textures/item/wand.png diff --git a/src/main/generated/assets/acesbs/models/item/wand.json b/src/main/generated/assets/acesbs/models/item/wand.json new file mode 100644 index 0000000..9632234 --- /dev/null +++ b/src/main/generated/assets/acesbs/models/item/wand.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "acesbs:item/wand" + } +} \ No newline at end of file diff --git a/src/main/java/com/acethewildfire/acesbs/AcesBS.java b/src/main/java/com/acethewildfire/acesbs/AcesBS.java index dcd8701..ad319ce 100644 --- a/src/main/java/com/acethewildfire/acesbs/AcesBS.java +++ b/src/main/java/com/acethewildfire/acesbs/AcesBS.java @@ -1,6 +1,7 @@ package com.acethewildfire.acesbs; import com.acethewildfire.acesbs.block.ModBlocks; +import com.acethewildfire.acesbs.component.ModDataComponentTypes; import com.acethewildfire.acesbs.item.ModItemGroups; import com.acethewildfire.acesbs.item.ModItems; import net.fabricmc.api.ModInitializer; @@ -26,5 +27,7 @@ public class AcesBS implements ModInitializer { ModItemGroups.registerItemGroups(); ModItems.registerModItems(); ModBlocks.registerModBlocks(); + + ModDataComponentTypes.registerDataComponentsTypes(); } } \ No newline at end of file diff --git a/src/main/java/com/acethewildfire/acesbs/TODO.txt b/src/main/java/com/acethewildfire/acesbs/TODO.txt new file mode 100644 index 0000000..2620a65 --- /dev/null +++ b/src/main/java/com/acethewildfire/acesbs/TODO.txt @@ -0,0 +1,62 @@ +Resources +- Infernal Ashes +- Raw End-tropy +- Stable End-tropy +- Prisma Steel (Stable Entropy + Iron) +- Chaos Silver (Stable Entropy + Gold) +- Fractal Diamond (Stable Entropy + Diamond) +- Ashen Steel (Ashes + Iron) +- Everburn Gold (Ashes + Gold) +- Infernal Diamond (Ashes + Diamond) +- Endtropite (Stable End-tropy + Netherite) +- Faerie Shard (Amethyst + Stable Entropy) +- Hyper Sugar (Stable Entropy + Sugar) +- Triangle (We are not sure what it does) + +Food +- Aquarium Gravel +- Bricked Up +- Infernal Beef (Mob/ Ashes + Cooked Beef) +- Hyper Stimulants (Hyper Sugar) +- Narcan + +Armor +- Beserker Pauldron +- Wildfire Boots +- Sov's Plate Carrier +- (Headlamp Armors using Everburn Gold) +- Eternal Armor (Binding and mending) + +Potions +- Lemon (Yellow Blindness) +- Faerie Size (Small and Light) +- Bottle o' Drunken Sailor +- Energy Drink (Hyper Sugar) + +Weapons +- Big Iron +- Thot Begon +- Ahab's Harpoon +- Soul Crusher (Removes Eternal Armor) + +Blocks +- Deep Slate Entropy Ore +- Infernal Ashes Block +- End-tropy Ore +- (Rename) Block of Raw Entropy +- Block of Raw End-tropy +- Stable End-tropy Block + +Workstations +- Entropic Accumulator (For Metals and Stones) +- Entropic Stabilizer (For making Stable Entropy) + +Mobs +- Fren (Stable Entropy on a Creeper) +- Burning Wizard (Infernal Ashes on a Witch) +- Wildfire Iskat (Infernal Ashes on a tamed cat) +- Rat Bastard (Stable Entropy on a cat) + +Music Disk +- Crab Rave +- Lizard \ No newline at end of file diff --git a/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java b/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java new file mode 100644 index 0000000..0f55498 --- /dev/null +++ b/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java @@ -0,0 +1,25 @@ +package com.acethewildfire.acesbs.component; + +import com.acethewildfire.acesbs.AcesBS; +import net.minecraft.component.ComponentType; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; + +import java.util.function.UnaryOperator; + +public class ModDataComponentTypes { + + public static final ComponentType COORDINATES = + register("coordinates", blockPosBuilder -> blockPosBuilder.codec(BlockPos.CODEC)); + + private static ComponentType register(String name, UnaryOperator> builderOperator){ + return Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of(AcesBS.MOD_ID, name), + builderOperator.apply(ComponentType.builder()).build()); + } + + public static void registerDataComponentsTypes(){ + AcesBS.LOGGER.info("Registering Data Components Types for" + AcesBS.MOD_ID); + } +} diff --git a/src/main/java/com/acethewildfire/acesbs/datagen/ModModelProvider.java b/src/main/java/com/acethewildfire/acesbs/datagen/ModModelProvider.java index c8c38c3..af0590e 100644 --- a/src/main/java/com/acethewildfire/acesbs/datagen/ModModelProvider.java +++ b/src/main/java/com/acethewildfire/acesbs/datagen/ModModelProvider.java @@ -51,5 +51,6 @@ public class ModModelProvider extends FabricModelProvider { itemModelGenerator.register(ModItems.ORACLE_LEMON, Models.GENERATED); itemModelGenerator.register(ModItems.GREEN_BRICKS, Models.GENERATED); itemModelGenerator.register(ModItems.STABLE_ENTROPY, Models.GENERATED); + itemModelGenerator.register(ModItems.WAND, Models.GENERATED); } } diff --git a/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java b/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java index 2ba1816..d366794 100644 --- a/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java +++ b/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java @@ -23,6 +23,7 @@ public class ModItemGroups { entries.add(ModItems.RAW_ENTROPY); entries.add(ModItems.STABLE_ENTROPY); entries.add(ModItems.GREEN_BRICKS); + entries.add(ModItems.WAND); }) .build()); diff --git a/src/main/java/com/acethewildfire/acesbs/item/ModItems.java b/src/main/java/com/acethewildfire/acesbs/item/ModItems.java index 740a82b..d6646ac 100644 --- a/src/main/java/com/acethewildfire/acesbs/item/ModItems.java +++ b/src/main/java/com/acethewildfire/acesbs/item/ModItems.java @@ -2,6 +2,7 @@ package com.acethewildfire.acesbs.item; import com.acethewildfire.acesbs.AcesBS; import com.acethewildfire.acesbs.item.custom.OracleLemon; +import com.acethewildfire.acesbs.item.custom.Wand; import net.minecraft.client.gui.screen.Screen; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.PotionContentsComponent; @@ -23,6 +24,7 @@ public class ModItems { private static final RegistryEntry BLINDNESS = registerPotion("blindness", new Potion(new StatusEffectInstance(StatusEffects.BLINDNESS, 200))); public static final Item ORACLE_LEMON = registerItem("oracle_lemon", new OracleLemon(new Item.Settings().component(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(BLINDNESS)))); + public static final Item WAND = registerItem("wand", new Wand(new Item.Settings().maxDamage(32))); public static final Item RAW_ENTROPY = registerItem("raw_entropy", new Item(new Item.Settings())); public static final Item STABLE_ENTROPY = registerItem("stable_entropy", new Item(new Item.Settings())); public static final Item LEMON = registerItem("lemon", new Item(new Item.Settings().food(ModFoodComponent.LEMON))); diff --git a/src/main/java/com/acethewildfire/acesbs/item/custom/Wand.java b/src/main/java/com/acethewildfire/acesbs/item/custom/Wand.java new file mode 100644 index 0000000..a70932b --- /dev/null +++ b/src/main/java/com/acethewildfire/acesbs/item/custom/Wand.java @@ -0,0 +1,72 @@ +package com.acethewildfire.acesbs.item.custom; + +import com.acethewildfire.acesbs.block.ModBlocks; +import com.acethewildfire.acesbs.component.ModDataComponentTypes; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.item.tooltip.TooltipType; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.text.Text; +import net.minecraft.util.ActionResult; +import net.minecraft.world.World; + +import java.util.List; +import java.util.Map; + +public class Wand extends Item { + private static final Map WAND_MAP = + Map.of( + Blocks.IRON_ORE, ModBlocks.ENTROPY_ORE, + Blocks.BIRCH_PLANKS, ModBlocks.LEMONWOOD_PLANKS, + ModBlocks.STABLE_ENTROPY_BLOCK, ModBlocks.EVIL_BLOCK, + ModBlocks.EVIL_BLOCK, ModBlocks.STABLE_ENTROPY_BLOCK + ); + + public Wand(Settings settings) { + super(settings); + } + + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + Block clickedBlock = world.getBlockState(context.getBlockPos()).getBlock(); + + if(WAND_MAP.containsKey(clickedBlock)) { + if(!world.isClient()) { + world.setBlockState(context.getBlockPos(), WAND_MAP.get(clickedBlock).getDefaultState()); + + context.getStack().damage(1, ((ServerWorld) world), ((ServerPlayerEntity) context.getPlayer()), + item -> context.getPlayer().sendEquipmentBreakStatus(item, EquipmentSlot.MAINHAND)); + + world.playSound(null, context.getBlockPos(), SoundEvents.BLOCK_GRINDSTONE_USE, SoundCategory.BLOCKS); + + context.getStack().set(ModDataComponentTypes.COORDINATES, context.getBlockPos()); + } + } + + return ActionResult.SUCCESS; + } + + @Override + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + if(Screen.hasShiftDown()) { + tooltip.add(Text.translatable("tooltip.acesbs.wand.shift_down")); + } else { + tooltip.add(Text.translatable("tooltip.acesbs.wand")); + } + + if(stack.get(ModDataComponentTypes.COORDINATES) != null) { + tooltip.add(Text.literal("Last Block Changed at " + stack.get(ModDataComponentTypes.COORDINATES))); + } + + super.appendTooltip(stack, context, tooltip, type); + } +} diff --git a/src/main/resources/assets/acesbs/lang/en_us.json b/src/main/resources/assets/acesbs/lang/en_us.json index 75f836a..38d95e0 100644 --- a/src/main/resources/assets/acesbs/lang/en_us.json +++ b/src/main/resources/assets/acesbs/lang/en_us.json @@ -5,6 +5,7 @@ "item.acesbs.lemon": "Odd Lemon", "item.acesbs.cooked_lemon": "Cooked Odd Lemon", "item.acesbs.green_bricks": "Green Bricks", + "item.acesbs.wand": "Entropy Wand", "item.minecraft.potion.effect.blindness": "Potion of Blindness", "item.minecraft.splash_potion.effect.blindness": "Splash Potion of Blindness", @@ -35,5 +36,7 @@ "tooltip.acesbs.stable_entropy_block.tooltip": "Exerts an §o§2upward force§r when stepped on.", "tooltip.acesbs.green_bricks.shift_down": "§o§7Useless Item§r", "tooltip.acesbs.green_bricks": "Hold §eShift§r for item description.", - "tooltip.acesbs.entropy_block.tooltip2": "Has a 1/20 chance of turning an apple into a lemon." + "tooltip.acesbs.entropy_block.tooltip2": "Has a 1/20 chance of turning an apple into a lemon.", + "tooltip.acesbs.wand.shift_down": "Changes blocks using Entropy", + "tooltip.acesbs.wand": "Hold §eShift§r for item description." } \ No newline at end of file diff --git a/src/main/resources/assets/acesbs/textures/item/wand.png b/src/main/resources/assets/acesbs/textures/item/wand.png new file mode 100644 index 0000000000000000000000000000000000000000..f54e9805d8ef22f178572118c328f2a58686d8ea GIT binary patch literal 4480 zcmeHKeNYo;8V`bEL$xXjw$QQ!t1Xc1Zpi0KL_#8@8VC>(5L!0b4Xh;DCA*NwSk95! zJ8VHLEmHOH>fw1)tL08xWhy5OqCM?Zq4+@yRD0Z2+e5h4vEESS-VNW=&fG9_{g2FS zcK3aM&+mPn-}5~0>|0?UVSdp*L4FZJ`ctkKZTzX64e*hk1T#l~C2*nG#n1UVF)jz1d$4pV-~F0$08T$Co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