Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Item[] GivePlayersMoneyLolol(Location location, int amount)
- {
- if (amount <= 0)
- return null;
- Material mat = Material.getMaterial(getConfig().getInt("Dropped Material ID", 266));
- if (mat == null) {
- System.err.println("[StoneharryLoot] Material not found, what is this madness?!");
- return null;
- }
- int stack = mat.getMaxStackSize();
- int loops = amount / stack;
- if (amount % stack != 0) {
- loops++;
- }
- Item[] items = new Item[loops];
- World w = location.getWorld();
- WorldSettings s = (WorldSettings)worldconfigs.get(w);
- for (int i = 0; i < loops; i++) {
- if (i == loops - 1) {
- items[i] = w.dropItemNaturally(location, new ItemStack(s.getMaterialID(), amount, 9001));
- }
- else {
- items[i] = w.dropItemNaturally(location, new ItemStack(s.getMaterialID(), stack, 9001));
- amount -= stack;
- }
- }
- return items;
- }
Advertisement
Add Comment
Please, Sign In to add comment