Cleanup comments, formatting, etc

This commit is contained in:
Travis Watkins
2013-03-24 23:22:32 -05:00
parent 7c40a073d8
commit 5f089137ee
148 changed files with 420 additions and 470 deletions

View File

@@ -27,7 +27,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.Material;
public class CraftInventory implements Inventory {
protected IInventory inventory;
protected final IInventory inventory;
public CraftInventory(IInventory inventory) {
this.inventory = inventory;

View File

@@ -127,7 +127,7 @@ class CraftMetaEnchantedBook extends CraftMetaItem implements EnchantmentStorage
}
public boolean hasStoredEnchant(Enchantment ench) {
return hasStoredEnchants() ? enchantments.containsKey(ench) : false;
return hasStoredEnchants() && enchantments.containsKey(ench);
}
public int getStoredEnchantLevel(Enchantment ench) {
@@ -155,7 +155,7 @@ class CraftMetaEnchantedBook extends CraftMetaItem implements EnchantmentStorage
}
public boolean removeStoredEnchant(Enchantment ench) {
return hasStoredEnchants() ? enchantments.remove(ench) != null : false;
return hasStoredEnchants() && enchantments.remove(ench) != null;
}
public boolean hasStoredEnchants() {

View File

@@ -303,8 +303,8 @@ class CraftMetaItem implements ItemMeta, Repairable {
}
NBTTagList tagList = new NBTTagList(key.NBT);
for (int i = 0; i < list.size(); i++) {
tagList.add(new NBTTagString("", list.get(i)));
for (String value : list) {
tagList.add(new NBTTagString("", value));
}
return tagList;
@@ -370,7 +370,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
}
public boolean hasEnchant(Enchantment ench) {
return hasEnchants() ? enchantments.containsKey(ench) : false;
return hasEnchants() && enchantments.containsKey(ench);
}
public int getEnchantLevel(Enchantment ench) {
@@ -398,7 +398,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
}
public boolean removeEnchant(Enchantment ench) {
return hasEnchants() ? enchantments.remove(ench) != null : false;
return hasEnchants() && enchantments.remove(ench) != null;
}
public boolean hasEnchants() {

View File

@@ -11,11 +11,11 @@ import org.bukkit.inventory.ShapedRecipe;
public class CraftShapedRecipe extends ShapedRecipe implements CraftRecipe {
// TODO: Could eventually use this to add a matches() method or some such
private ShapedRecipes recipe;
public CraftShapedRecipe(ItemStack result) {
super(result);
}
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
this(result);
this.recipe = recipe;

View File

@@ -10,8 +10,8 @@ import net.minecraft.server.IRecipe;
import net.minecraft.server.RecipesFurnace;
public class RecipeIterator implements Iterator<Recipe> {
private Iterator<IRecipe> recipes;
private Iterator<Integer> smelting;
private final Iterator<IRecipe> recipes;
private final Iterator<Integer> smelting;
private Iterator<?> removeFrom = null;
public RecipeIterator() {
@@ -35,8 +35,8 @@ public class RecipeIterator implements Iterator<Recipe> {
removeFrom = smelting;
int id = smelting.next();
CraftItemStack stack = CraftItemStack.asCraftMirror(RecipesFurnace.getInstance().getResult(id));
CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(stack, new ItemStack(id, 1, (short) -1));
return recipe;
return new CraftFurnaceRecipe(stack, new ItemStack(id, 1, (short) -1));
}
}