-
-
Save anonymous/d59fc12ec923e7d018c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.koopamillion.item; | |
import java.util.Set; | |
import com.google.common.collect.ImmutableSet; | |
import com.google.common.collect.Sets; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.BlockDirt; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.entity.Entity; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.init.Blocks; | |
import net.minecraft.item.ItemPickaxe; | |
import net.minecraft.item.ItemStack; | |
import net.minecraft.world.World; | |
public class EPick extends ItemPickaxe{ | |
protected EPick(ToolMaterial p_i45347_1_) { | |
super(p_i45347_1_); | |
this.setHarvestLevel("pickaxe", 2); | |
} | |
@Override | |
public void onUpdate(ItemStack Stack, World world, Entity entity, int par4, boolean par5) | |
{ | |
if(entity instanceof EntityPlayer){ | |
EntityPlayer Player = (EntityPlayer)entity; | |
Stack = Player.inventory.getCurrentItem(); // && Stack.getItemDamage() == 255 | |
if(Stack != null && Stack.getItem() == Mitems.ePick){ | |
int slot = Player.inventory.currentItem; | |
Player.inventory.setInventorySlotContents(slot, new ItemStack(Mitems.ePickDead)); | |
}else{ | |
}} | |
} | |
@Override | |
public Set<String> getToolClasses(ItemStack stack) { | |
return ImmutableSet.of("pickaxe", "shovel"); | |
} | |
private static Set effectiveAgainst = Sets.newHashSet(new Block[] { | |
Blocks.grass, Blocks.dirt, Blocks.sand, Blocks.gravel, | |
Blocks.snow_layer, Blocks.snow, Blocks.clay, Blocks.farmland, | |
Blocks.soul_sand, Blocks.mycelium}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment