Add scraper tool, tweak existing materials

This commit is contained in:
Agatha Lovelace 2020-11-15 00:05:49 +02:00
parent 9128923bba
commit f58a2f76f5
No known key found for this signature in database
GPG Key ID: 2DB18BA2E0A80BC3
1 changed files with 16 additions and 7 deletions

View File

@ -1,33 +1,42 @@
package dev.agatharose.asbestos; package dev.agatharose.asbestos;
import dev.agatharose.asbestos.item.ScraperItem;
import dev.agatharose.asbestos.item.ScraperToolMaterial;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ToolItem;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
public class Asbestos implements ModInitializer { public class Asbestos implements ModInitializer {
public static final Item ASBESTOS_FIBERS = new Item(new FabricItemSettings().group(ItemGroup.MATERIALS)); public static final Item ASBESTOS_FIBERS = new Item(
new FabricItemSettings().group(ItemGroup.MATERIALS).fireproof());
public static final Block ASBESTOS_BLOCK = new Block(FabricBlockSettings.of(Material.WOOL) public static final Block ASBESTOS_BLOCK = new Block(
.breakByTool(FabricToolTags.AXES).hardness(0.3f).sounds(BlockSoundGroup.WOOL)); FabricBlockSettings.of(Material.WOOL).hardness(1.0f).sounds(BlockSoundGroup.WOOL));
public static ToolItem IRON_SCRAPER = new ScraperItem(ScraperToolMaterial.INSTANCE, 0.0f, -3.0f,
new Item.Settings().group(ItemGroup.TOOLS));
@Override @Override
public void onInitialize() { public void onInitialize() {
// asbestos fibers item registration // asbestos fibers item
Registry.register(Registry.ITEM, new Identifier("asbestos", "asbestos_fibers"), ASBESTOS_FIBERS); Registry.register(Registry.ITEM, new Identifier("asbestos", "asbestos_fibers"), ASBESTOS_FIBERS);
// asbestos block registration // asbestos block
Registry.register(Registry.BLOCK, new Identifier("asbestos", "asbestos_block"), ASBESTOS_BLOCK); Registry.register(Registry.BLOCK, new Identifier("asbestos", "asbestos_block"), ASBESTOS_BLOCK);
Registry.register(Registry.ITEM, new Identifier("asbestos", "asbestos_block"), Registry.register(Registry.ITEM, new Identifier("asbestos", "asbestos_block"),
new BlockItem(ASBESTOS_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS))); new BlockItem(ASBESTOS_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS).fireproof()));
// scraper tool
Registry.register(Registry.ITEM, new Identifier("asbestos", "iron_scraper"), IRON_SCRAPER);
} }
} }