Advertisement
Guest User

DirtBucket

a guest
Dec 14th, 2011
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import net.minecraft.src.forge.*;
  4.  
  5. public class DirtBucket extends ItemBucket implements IBucketHandler, ITextureProvider {
  6.     public DirtBucket(int id, int blockId, int icon) {
  7.         super(id, blockId);
  8.         setIconIndex(icon);
  9.     }
  10.  
  11.     @Override
  12.     public ItemStack fillCustomBucket(World w, int i, int j, int k) {
  13.         if (w.getBlockId(i, j, k) == Block.grass.blockID ||
  14.                 w.getBlockId(i, j, k) == Block.dirt.blockID) {
  15.             w.setBlockWithNotify(i, j, k, 0);
  16.             return new ItemStack(this);
  17.         }
  18.         return null;
  19.     }
  20.  
  21.     public String getTextureFile()
  22.     {
  23.         return mod_ForgeTutBuckets.itemsPng;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement