Draco18s

WeightedRanomExample RandomSizeStackDrop

Jun 29th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1.     public class RandomSizeStackDrop extends WeightedItem {
  2.         public readonly int weight;
  3.         public readonly Item drop;
  4.         public WeightedItem(Item i, int w) {
  5.             drop = i;
  6.             weight = w;
  7.         }
  8.        
  9.         public ItemStack GetStackFromDrop() {
  10.             return new ItemStack(drop, Random.Next(1,5));
  11.         }
  12.     }
Add Comment
Please, Sign In to add comment