mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Assorted cleanup.
This commit is contained in:
@ -17,10 +17,6 @@ public abstract class SkillManager {
|
||||
this.skill = skill;
|
||||
}
|
||||
|
||||
public McMMOPlayer getMcMMOPlayer() {
|
||||
return mcMMOPlayer;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return mcMMOPlayer.getPlayer();
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.gmail.nossr50.skills.alchemy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
|
@ -124,25 +124,24 @@ public final class AlchemyPotionBrewer {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean transferItems(InventoryView view, int fromSlot, int toSlot, ClickType click) {
|
||||
public static boolean transferItems(InventoryView view, int fromSlot, ClickType click) {
|
||||
boolean success = false;
|
||||
|
||||
if (click.isLeftClick()) {
|
||||
success = transferItems(view, fromSlot, toSlot);
|
||||
success = transferItems(view, fromSlot);
|
||||
}
|
||||
else if (click.isRightClick()) {
|
||||
success = transferOneItem(view, fromSlot, toSlot);
|
||||
success = transferOneItem(view, fromSlot);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
private static boolean transferOneItem(InventoryView view, int fromSlot, int toSlot) {
|
||||
private static boolean transferOneItem(InventoryView view, int fromSlot) {
|
||||
ItemStack from = view.getItem(fromSlot).clone();
|
||||
ItemStack to = view.getItem(toSlot).clone();
|
||||
boolean emptyFrom = isEmpty(from);
|
||||
ItemStack to = view.getItem(Alchemy.INGREDIENT_SLOT).clone();
|
||||
|
||||
if (emptyFrom) {
|
||||
if (isEmpty(from)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -162,8 +161,8 @@ public final class AlchemyPotionBrewer {
|
||||
}
|
||||
|
||||
from.setAmount(fromAmount - 1);
|
||||
view.setItem(toSlot, emptyTo ? null : to);
|
||||
view.setItem(fromSlot, emptyFrom ? null : from);
|
||||
view.setItem(Alchemy.INGREDIENT_SLOT, emptyTo ? null : to);
|
||||
view.setItem(fromSlot, from);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -174,15 +173,15 @@ public final class AlchemyPotionBrewer {
|
||||
/**
|
||||
* Transfer items between two ItemStacks, returning the leftover status
|
||||
*/
|
||||
private static boolean transferItems(InventoryView view, int fromSlot, int toSlot) {
|
||||
private static boolean transferItems(InventoryView view, int fromSlot) {
|
||||
ItemStack from = view.getItem(fromSlot).clone();
|
||||
ItemStack to = view.getItem(toSlot).clone();
|
||||
ItemStack to = view.getItem(Alchemy.INGREDIENT_SLOT).clone();
|
||||
|
||||
if (isEmpty(from)) {
|
||||
return false;
|
||||
}
|
||||
else if (isEmpty(to)) {
|
||||
view.setItem(toSlot, from);
|
||||
view.setItem(Alchemy.INGREDIENT_SLOT, from);
|
||||
view.setItem(fromSlot, null);
|
||||
|
||||
return true;
|
||||
@ -196,7 +195,7 @@ public final class AlchemyPotionBrewer {
|
||||
int left = fromAmount + toAmount - maxSize;
|
||||
|
||||
to.setAmount(maxSize);
|
||||
view.setItem(toSlot, to);
|
||||
view.setItem(Alchemy.INGREDIENT_SLOT, to);
|
||||
|
||||
from.setAmount(left);
|
||||
view.setItem(fromSlot, from);
|
||||
@ -206,7 +205,7 @@ public final class AlchemyPotionBrewer {
|
||||
|
||||
to.setAmount(fromAmount + toAmount);
|
||||
view.setItem(fromSlot, null);
|
||||
view.setItem(toSlot, to);
|
||||
view.setItem(Alchemy.INGREDIENT_SLOT, to);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -54,8 +54,6 @@ public final class Fishing {
|
||||
public static int fishermansDietRankLevel2 = fishermansDietRankLevel1 * 2;
|
||||
public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5;
|
||||
|
||||
public static final double STORM_MODIFIER = 0.909;
|
||||
|
||||
private Fishing() {}
|
||||
|
||||
/**
|
||||
|
@ -115,8 +115,8 @@ public class MiningManager extends SkillManager {
|
||||
/**
|
||||
* Handler for explosion drops and XP gain.
|
||||
*
|
||||
* @param yield
|
||||
* @param blockList
|
||||
* @param yield The % of blocks to drop
|
||||
* @param blockList The list of blocks to drop
|
||||
*/
|
||||
public void blastMiningDropProcessing(float yield, List<Block> blockList) {
|
||||
List<BlockState> ores = new ArrayList<BlockState>();
|
||||
|
Reference in New Issue
Block a user