Wand
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "acesbs:item/wand"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.acethewildfire.acesbs;
|
package com.acethewildfire.acesbs;
|
||||||
|
|
||||||
import com.acethewildfire.acesbs.block.ModBlocks;
|
import com.acethewildfire.acesbs.block.ModBlocks;
|
||||||
|
import com.acethewildfire.acesbs.component.ModDataComponentTypes;
|
||||||
import com.acethewildfire.acesbs.item.ModItemGroups;
|
import com.acethewildfire.acesbs.item.ModItemGroups;
|
||||||
import com.acethewildfire.acesbs.item.ModItems;
|
import com.acethewildfire.acesbs.item.ModItems;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
@@ -26,5 +27,7 @@ public class AcesBS implements ModInitializer {
|
|||||||
ModItemGroups.registerItemGroups();
|
ModItemGroups.registerItemGroups();
|
||||||
ModItems.registerModItems();
|
ModItems.registerModItems();
|
||||||
ModBlocks.registerModBlocks();
|
ModBlocks.registerModBlocks();
|
||||||
|
|
||||||
|
ModDataComponentTypes.registerDataComponentsTypes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
@@ -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<BlockPos> COORDINATES =
|
||||||
|
register("coordinates", blockPosBuilder -> blockPosBuilder.codec(BlockPos.CODEC));
|
||||||
|
|
||||||
|
private static <T>ComponentType<T> register(String name, UnaryOperator<ComponentType.Builder<T>> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,5 +51,6 @@ public class ModModelProvider extends FabricModelProvider {
|
|||||||
itemModelGenerator.register(ModItems.ORACLE_LEMON, Models.GENERATED);
|
itemModelGenerator.register(ModItems.ORACLE_LEMON, Models.GENERATED);
|
||||||
itemModelGenerator.register(ModItems.GREEN_BRICKS, Models.GENERATED);
|
itemModelGenerator.register(ModItems.GREEN_BRICKS, Models.GENERATED);
|
||||||
itemModelGenerator.register(ModItems.STABLE_ENTROPY, Models.GENERATED);
|
itemModelGenerator.register(ModItems.STABLE_ENTROPY, Models.GENERATED);
|
||||||
|
itemModelGenerator.register(ModItems.WAND, Models.GENERATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public class ModItemGroups {
|
|||||||
entries.add(ModItems.RAW_ENTROPY);
|
entries.add(ModItems.RAW_ENTROPY);
|
||||||
entries.add(ModItems.STABLE_ENTROPY);
|
entries.add(ModItems.STABLE_ENTROPY);
|
||||||
entries.add(ModItems.GREEN_BRICKS);
|
entries.add(ModItems.GREEN_BRICKS);
|
||||||
|
entries.add(ModItems.WAND);
|
||||||
})
|
})
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.acethewildfire.acesbs.item;
|
|||||||
|
|
||||||
import com.acethewildfire.acesbs.AcesBS;
|
import com.acethewildfire.acesbs.AcesBS;
|
||||||
import com.acethewildfire.acesbs.item.custom.OracleLemon;
|
import com.acethewildfire.acesbs.item.custom.OracleLemon;
|
||||||
|
import com.acethewildfire.acesbs.item.custom.Wand;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.component.DataComponentTypes;
|
import net.minecraft.component.DataComponentTypes;
|
||||||
import net.minecraft.component.type.PotionContentsComponent;
|
import net.minecraft.component.type.PotionContentsComponent;
|
||||||
@@ -23,6 +24,7 @@ public class ModItems {
|
|||||||
|
|
||||||
private static final RegistryEntry<Potion> BLINDNESS = registerPotion("blindness", new Potion(new StatusEffectInstance(StatusEffects.BLINDNESS, 200)));
|
private static final RegistryEntry<Potion> 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 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 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 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)));
|
public static final Item LEMON = registerItem("lemon", new Item(new Item.Settings().food(ModFoodComponent.LEMON)));
|
||||||
|
|||||||
@@ -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<Block, Block> 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<Text> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
"item.acesbs.lemon": "Odd Lemon",
|
"item.acesbs.lemon": "Odd Lemon",
|
||||||
"item.acesbs.cooked_lemon": "Cooked Odd Lemon",
|
"item.acesbs.cooked_lemon": "Cooked Odd Lemon",
|
||||||
"item.acesbs.green_bricks": "Green Bricks",
|
"item.acesbs.green_bricks": "Green Bricks",
|
||||||
|
"item.acesbs.wand": "Entropy Wand",
|
||||||
|
|
||||||
"item.minecraft.potion.effect.blindness": "Potion of Blindness",
|
"item.minecraft.potion.effect.blindness": "Potion of Blindness",
|
||||||
"item.minecraft.splash_potion.effect.blindness": "Splash 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.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.shift_down": "§o§7Useless Item§r",
|
||||||
"tooltip.acesbs.green_bricks": "Hold §eShift§r for item description.",
|
"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."
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Reference in New Issue
Block a user