Fix most non rendering issues

This commit is contained in:
Vincent Lee committed 2020-01-09 21:49:02 -06:00
1 parent bafd2bfa6d
commit 24e777cab5
88 files changed
+397 -454

No files matched your search

@@ -17,6 +17,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.HoeItem;
import net.minecraft.item.ItemStack;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
@@ -57,15 +58,15 @@ public class BlockAltGrass extends BlockMod {
}
@Override
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack held = player.getHeldItem(hand);
if(held.getItem() instanceof HoeItem && world.isAirBlock(pos.up())) {
held.damageItem(1, player, e -> e.sendBreakAnimation(hand));
world.setBlockState(pos, Blocks.FARMLAND.getDefaultState(), 1 | 2);
return true;
return ActionResultType.SUCCESS;
}
return false;
return ActionResultType.PASS;
}
@Override