add missing assets

This commit is contained in:
Jörg Henke 2022-01-02 13:37:35 +01:00
parent b3bfafc38e
commit 130d258ada
4 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,43 @@
package de.jottyfan.minecraft.quickiefabric.tools;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
*
* @author jotty
*
*/
public class ToolSpeedpowderWaterHoe extends ToolSpeedpowderHoe {
public static final Integer DEFAULT_PLOW_RANGE = 4;
public HarvestRange range;
public ToolSpeedpowderWaterHoe() {
super();
this.range = new HarvestRange(DEFAULT_PLOW_RANGE);
}
@Override
public ActionResult useOnBlock(ItemUsageContext context) {
ActionResult res = super.useOnBlock(context);
if (!ActionResult.PASS.equals(res)) {
BlockPos pos = context.getBlockPos();
World world = context.getWorld();
world.setBlockState(pos, Blocks.WATER.getDefaultState());
Hand hand = context.getHand();
PlayerEntity player = context.getPlayer();
ItemStack oldTool = player.getStackInHand(hand);
ItemStack newTool = new ItemStack(QuickieTools.SPEEDPOWDERHOE);
newTool.setDamage(oldTool.getDamage());
player.setStackInHand(hand, newTool);
}
return res;
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/wooden_hoe",
"textures": {
"layer0": "quickiefabric:item/speedpowderwaterhoe"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:water_bucket"
},
{
"item": "quickiefabric:speedpowderhoe"
}
],
"result": {
"item": "quickiefabric:speedpowderwaterhoe",
"count": 1
}
}