mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Added a new useless feature
This commit is contained in:
parent
276a99d7cf
commit
466053be4e
1 changed files with 17 additions and 0 deletions
|
@ -8,11 +8,17 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemLead;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
|
||||
|
@ -65,6 +71,17 @@ public class BlockStick extends Block implements IPlantable {
|
|||
return UItems.stick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float x, float y, float z) {
|
||||
if (!world.isRemote) {
|
||||
return ItemLead.attachToFence(player, world, pos);
|
||||
}
|
||||
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
|
||||
return stack.getItem() == Items.LEAD || stack.isEmpty();
|
||||
}
|
||||
|
||||
public boolean canSustainPlant(IBlockAccess world, BlockPos pos, IPlantable plantable) {
|
||||
|
||||
pos = pos.down();
|
||||
|
|
Loading…
Reference in a new issue