Added the Swetty Ball ability base. Will be buffed in the future.

This commit is contained in:
KingPhygieBoo 2017-11-22 02:10:06 -06:00
parent d0b1cc370c
commit ffbf75a533
2 changed files with 49 additions and 1 deletions

View file

@ -0,0 +1,48 @@
package com.legacy.aether.common.items;
import com.legacy.aether.common.blocks.BlocksAether;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class ItemSwettyBall extends Item
{
public ItemSwettyBall(CreativeTabs tab)
{
this.setCreativeTab(tab);
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (worldIn.getBlockState(pos).getBlock() == BlocksAether.aether_dirt)
{
worldIn.setBlockState(pos, BlocksAether.aether_grass.getDefaultState());
}
else if (worldIn.getBlockState(pos).getBlock() == Blocks.DIRT)
{
worldIn.setBlockState(pos, Blocks.GRASS.getDefaultState());
}
else
{
return EnumActionResult.FAIL;
}
if (!playerIn.capabilities.isCreativeMode)
{
--stack.stackSize;
}
return EnumActionResult.SUCCESS;
}
}

View file

@ -116,7 +116,7 @@ public class ItemsAether
ambrosium_shard = register("ambrosium_shard", new ItemAmbrosiumShard()); ambrosium_shard = register("ambrosium_shard", new ItemAmbrosiumShard());
golden_amber = register("golden_amber", new ItemAether(AetherCreativeTabs.material)); golden_amber = register("golden_amber", new ItemAether(AetherCreativeTabs.material));
aechor_petal = register("aechor_petal", new ItemAether(AetherCreativeTabs.material)); aechor_petal = register("aechor_petal", new ItemAether(AetherCreativeTabs.material));
swetty_ball = register("swetty_ball", new ItemAether(AetherCreativeTabs.material)); swetty_ball = register("swetty_ball", new ItemSwettyBall(AetherCreativeTabs.material));
skyroot_pickaxe = register("skyroot_pickaxe", new ItemSkyrootTool(EnumAetherToolType.PICKAXE)); skyroot_pickaxe = register("skyroot_pickaxe", new ItemSkyrootTool(EnumAetherToolType.PICKAXE));
skyroot_axe = register("skyroot_axe", new ItemSkyrootTool(EnumAetherToolType.AXE)); skyroot_axe = register("skyroot_axe", new ItemSkyrootTool(EnumAetherToolType.AXE));