diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/BlockDirtSalpeter.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/BlockDirtSalpeter.java new file mode 100644 index 0000000..552eda6 --- /dev/null +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/blocks/BlockDirtSalpeter.java @@ -0,0 +1,39 @@ +package de.jottyfan.minecraft.quickiefabric.blocks; + +import java.util.Arrays; +import java.util.List; +import java.util.Random; + +import de.jottyfan.minecraft.quickiefabric.items.QuickieItems; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.GravelBlock; +import net.minecraft.block.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.loot.context.LootContext.Builder; + +/** + * + * @author jotty + * + */ +public class BlockDirtSalpeter extends GravelBlock { + + public BlockDirtSalpeter() { + super(FabricBlockSettings.of(Material.STONE).hardness(3.1f)); + } + + @Override + public List getDroppedStacks(BlockState blockState, Builder builder) { + Integer count = (Double.valueOf(new Random().nextDouble() * 10).intValue() / 4) + 1; + boolean spawnBoneMeal = new Random().nextDouble() > 0.5f; + ItemStack boneMealStack = new ItemStack(Items.BONE_MEAL); + ItemStack salpeterStack = new ItemStack(QuickieItems.SALPETER, count); + ItemStack dirtStack = new ItemStack(Blocks.DIRT); + ItemStack[] spawnies = spawnBoneMeal ? new ItemStack[] { boneMealStack, salpeterStack, dirtStack } + : new ItemStack[] { salpeterStack, dirtStack }; + return Arrays.asList(spawnies); + } +} diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolSpeedpowderPickaxe.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolSpeedpowderPickaxe.java new file mode 100644 index 0000000..defbcf7 --- /dev/null +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolSpeedpowderPickaxe.java @@ -0,0 +1,54 @@ +package de.jottyfan.minecraft.quickiefabric.tools; + +import java.util.List; + +import com.google.common.collect.Lists; + +import de.jottyfan.minecraft.quickiefabric.init.RegistryManager; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.Item; +import net.minecraft.item.PickaxeItem; +import net.minecraft.item.ToolMaterials; + +/** + * + * @author jotty + * + */ +public class ToolSpeedpowderPickaxe extends PickaxeItem implements ToolRangeable { + + private HarvestRange range; + + public ToolSpeedpowderPickaxe() { + super(ToolMaterials.DIAMOND, 4, 2.0f, new Item.Settings().group(RegistryManager.QUICKIEFABRIC_GROUP)); + this.range = new HarvestRange(2); + } + + @Override + public HarvestRange getRange() { + return range; + } + + @Override + public boolean canBreakNeigbbors(BlockState blockIn) { + return super.isEffectiveOn(blockIn) || PICKAXE_EFFECTIVE_ON.contains(blockIn.getBlock()); + } + + @Override + public List getBlockList(Block block) { + return Lists.newArrayList(block); + } + +// @Override +// public ActionResult onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { +// CommonToolCode.onItemRightClick(worldIn, playerIn, handIn); +// return super.onItemRightClick(worldIn, playerIn, handIn); +// } +// +// @Override +// public void addInformation(ItemStack stack, World worldIn, List tooltip, ITooltipFlag flagIn) { +// CommonToolCode.addInformation(stack, worldIn, tooltip, flagIn); +// super.addInformation(stack, worldIn, tooltip, flagIn); +// } +} diff --git a/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolSpeedpowderShovel.java b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolSpeedpowderShovel.java new file mode 100644 index 0000000..81d3152 --- /dev/null +++ b/src/main/java/de/jottyfan/minecraft/quickiefabric/tools/ToolSpeedpowderShovel.java @@ -0,0 +1,54 @@ +package de.jottyfan.minecraft.quickiefabric.tools; + +import java.util.List; + +import com.google.common.collect.Lists; + +import de.jottyfan.minecraft.quickiefabric.init.RegistryManager; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.Item; +import net.minecraft.item.ShovelItem; +import net.minecraft.item.ToolMaterials; + +/** + * + * @author jotty + * + */ +public class ToolSpeedpowderShovel extends ShovelItem implements ToolRangeable { + + public HarvestRange range; + + public ToolSpeedpowderShovel() { + super(ToolMaterials.DIAMOND, 4, 2.0f, new Item.Settings().group(RegistryManager.QUICKIEFABRIC_GROUP)); + this.range = new HarvestRange(2); + } + + @Override + public HarvestRange getRange() { + return range; + } + + @Override + public boolean canBreakNeigbbors(BlockState blockIn) { + return SHOVEL_EFFECTIVE_ON.contains(blockIn.getBlock()); + } + + @Override + public List getBlockList(Block block) { + return Lists.newArrayList(block); + } + +// @Override +// public ActionResult onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { +// CommonToolCode.onItemRightClick(worldIn, playerIn, handIn); +// return super.onItemRightClick(worldIn, playerIn, handIn); +// } +// +// @Override +// public void addInformation(ItemStack stack, World worldIn, List tooltip, ITooltipFlag flagIn) { +// CommonToolCode.addInformation(stack, worldIn, tooltip, flagIn); +// super.addInformation(stack, worldIn, tooltip, flagIn); +// } +} diff --git a/src/main/resources/assets/quickiefabric/blockstates/dirtsalpeter.json b/src/main/resources/assets/quickiefabric/blockstates/dirtsalpeter.json new file mode 100644 index 0000000..9b9f21e --- /dev/null +++ b/src/main/resources/assets/quickiefabric/blockstates/dirtsalpeter.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "quickiefabric:block/dirtsalpeter" + } + } +} diff --git a/src/main/resources/assets/quickiefabric/models/block/dirtsalpeter.json b/src/main/resources/assets/quickiefabric/models/block/dirtsalpeter.json new file mode 100644 index 0000000..255ca03 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/block/dirtsalpeter.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "quickiefabric:block/dirtsalpeter" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/dirtsalpeter.json b/src/main/resources/assets/quickiefabric/models/item/dirtsalpeter.json new file mode 100644 index 0000000..99c70ad --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/dirtsalpeter.json @@ -0,0 +1,10 @@ +{ + "parent": "quickiefabric:block/dirtsalpeter", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/orenethersulphor.json b/src/main/resources/assets/quickiefabric/models/item/orenethersulphor.json new file mode 100644 index 0000000..5cf0d40 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/orenethersulphor.json @@ -0,0 +1,10 @@ +{ + "parent": "quickiefabric:block/orenethersulphor", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/oresalpeter.json b/src/main/resources/assets/quickiefabric/models/item/oresalpeter.json new file mode 100644 index 0000000..c5b72a2 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/oresalpeter.json @@ -0,0 +1,10 @@ +{ + "parent": "quickiefabric:block/oresalpeter", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/oresandsalpeter.json b/src/main/resources/assets/quickiefabric/models/item/oresandsalpeter.json new file mode 100644 index 0000000..49975c6 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/oresandsalpeter.json @@ -0,0 +1,10 @@ +{ + "parent": "quickiefabric:block/oresandsalpeter", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/oresulphor.json b/src/main/resources/assets/quickiefabric/models/item/oresulphor.json new file mode 100644 index 0000000..c3243b2 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/oresulphor.json @@ -0,0 +1,10 @@ +{ + "parent": "quickiefabric:block/oresulphor", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/sandsalpeter.json b/src/main/resources/assets/quickiefabric/models/item/sandsalpeter.json new file mode 100644 index 0000000..f152295 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/sandsalpeter.json @@ -0,0 +1,10 @@ +{ + "parent": "quickiefabric:block/sandsalpeter", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/speedpowderpickaxe.json b/src/main/resources/assets/quickiefabric/models/item/speedpowderpickaxe.json new file mode 100644 index 0000000..bd232e0 --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/speedpowderpickaxe.json @@ -0,0 +1,6 @@ +{ + "parent": "item/wooden_pickaxe", + "textures": { + "layer0": "quickiefabric:item/speedpowderpickaxe" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/models/item/speedpowdershovel.json b/src/main/resources/assets/quickiefabric/models/item/speedpowdershovel.json new file mode 100644 index 0000000..11cf49a --- /dev/null +++ b/src/main/resources/assets/quickiefabric/models/item/speedpowdershovel.json @@ -0,0 +1,6 @@ +{ + "parent": "item/wooden_shovel", + "textures": { + "layer0": "quickiefabric:item/speedpowdershovel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiefabric/textures/block/dirtsalpeter.png b/src/main/resources/assets/quickiefabric/textures/block/dirtsalpeter.png new file mode 100644 index 0000000..c4ab012 Binary files /dev/null and b/src/main/resources/assets/quickiefabric/textures/block/dirtsalpeter.png differ diff --git a/src/main/resources/assets/quickiefabric/textures/item/speedpowderpickaxe.png b/src/main/resources/assets/quickiefabric/textures/item/speedpowderpickaxe.png new file mode 100644 index 0000000..688ffee Binary files /dev/null and b/src/main/resources/assets/quickiefabric/textures/item/speedpowderpickaxe.png differ diff --git a/src/main/resources/assets/quickiefabric/textures/item/speedpowdershovel.png b/src/main/resources/assets/quickiefabric/textures/item/speedpowdershovel.png new file mode 100644 index 0000000..52926a0 Binary files /dev/null and b/src/main/resources/assets/quickiefabric/textures/item/speedpowdershovel.png differ diff --git a/src/main/resources/data/quickiefabric/recipes/speedpowderpickaxe.json b/src/main/resources/data/quickiefabric/recipes/speedpowderpickaxe.json new file mode 100644 index 0000000..583383f --- /dev/null +++ b/src/main/resources/data/quickiefabric/recipes/speedpowderpickaxe.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "sss", + " | ", + " | " + ], + "key": { + "s": { + "item": "quickiefabric:speedpowder" + }, + "|": { + "item": "minecraft:stick" + } + }, + "result": { + "item": "quickiefabric:speedpowderpickaxe", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/quickiefabric/recipes/speedpowdershovel.json b/src/main/resources/data/quickiefabric/recipes/speedpowdershovel.json new file mode 100644 index 0000000..9cd51db --- /dev/null +++ b/src/main/resources/data/quickiefabric/recipes/speedpowdershovel.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " s ", + " | ", + " | " + ], + "key": { + "s": { + "item": "quickiefabric:speedpowder" + }, + "|": { + "item": "minecraft:stick" + } + }, + "result": { + "item": "quickiefabric:speedpowdershovel", + "count": 1 + } +} \ No newline at end of file