From 2556140901d1d9654bdb3d2b14b57a63870d6970 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 25 Apr 2011 13:24:32 +0200 Subject: [PATCH] Updated README for line-ending demands, also fixed line-endigs. By: Erik Broes --- paper-api/README.md | 1 + .../src/main/java/org/bukkit/TreeType.java | 28 +- .../src/main/java/org/bukkit/block/Chest.java | 18 +- .../java/org/bukkit/block/ContainerBlock.java | 34 +- .../org/bukkit/block/CreatureSpawner.java | 108 ++--- .../main/java/org/bukkit/block/Dispenser.java | 34 +- .../main/java/org/bukkit/block/Furnace.java | 72 ++-- .../main/java/org/bukkit/block/NoteBlock.java | 60 +-- .../main/java/org/bukkit/entity/Animals.java | 22 +- .../main/java/org/bukkit/entity/Arrow.java | 18 +- .../src/main/java/org/bukkit/entity/Boat.java | 44 +- .../main/java/org/bukkit/entity/Chicken.java | 28 +- .../src/main/java/org/bukkit/entity/Cow.java | 28 +- .../main/java/org/bukkit/entity/Creature.java | 46 +- .../src/main/java/org/bukkit/entity/Egg.java | 18 +- .../java/org/bukkit/entity/FallingSand.java | 28 +- .../main/java/org/bukkit/entity/Fireball.java | 18 +- .../src/main/java/org/bukkit/entity/Fish.java | 18 +- .../main/java/org/bukkit/entity/Flying.java | 28 +- .../main/java/org/bukkit/entity/Ghast.java | 28 +- .../main/java/org/bukkit/entity/Giant.java | 28 +- .../src/main/java/org/bukkit/entity/Item.java | 52 +-- .../main/java/org/bukkit/entity/Minecart.java | 166 +++---- .../main/java/org/bukkit/entity/Monster.java | 28 +- .../main/java/org/bukkit/entity/Painting.java | 28 +- .../src/main/java/org/bukkit/entity/Pig.java | 28 +- .../java/org/bukkit/entity/PigZombie.java | 28 +- .../org/bukkit/entity/PoweredMinecart.java | 20 +- .../main/java/org/bukkit/entity/Skeleton.java | 28 +- .../main/java/org/bukkit/entity/Snowball.java | 18 +- .../main/java/org/bukkit/entity/Spider.java | 28 +- .../main/java/org/bukkit/entity/Squid.java | 28 +- .../org/bukkit/entity/StorageMinecart.java | 34 +- .../java/org/bukkit/entity/TNTPrimed.java | 28 +- .../main/java/org/bukkit/entity/WaterMob.java | 26 +- .../main/java/org/bukkit/entity/Zombie.java | 22 +- .../org/bukkit/event/block/BlockEvent.java | 48 +-- .../org/bukkit/event/player/PlayerEvent.java | 50 +-- .../event/vehicle/VehicleCollisionEvent.java | 28 +- .../bukkit/event/vehicle/VehicleEvent.java | 54 +-- .../java/org/bukkit/inventory/ItemStack.java | 408 +++++++++--------- .../org/bukkit/inventory/PlayerInventory.java | 186 ++++---- .../java/org/bukkit/material/Colorable.java | 54 +-- .../plugin/InvalidDescriptionException.java | 124 +++--- .../java/org/bukkit/util/BlockVector.java | 222 +++++----- .../util/config/ConfigurationException.java | 36 +- 46 files changed, 1240 insertions(+), 1239 deletions(-) diff --git a/paper-api/README.md b/paper-api/README.md index f6f55ad21d..c32d82513f 100644 --- a/paper-api/README.md +++ b/paper-api/README.md @@ -21,6 +21,7 @@ Coding and Pull Request Conventions * No tabs; use 4 spaces instead. * No trailing whitespaces. * No 80 column limit or midstatement newlines. +* No CRLF lineendigs, LF only, put your gits 'core.autocrlf' on 'true' * Proper javadoc for each method added/changed to describe what it does. * The number of commits in a pull request should be kept to a minimum (squish them into one most of the time - use common sense!). * No merges should be included in pull requests unless the pull request's purpose is a merge. diff --git a/paper-api/src/main/java/org/bukkit/TreeType.java b/paper-api/src/main/java/org/bukkit/TreeType.java index 489b1d96dc..76916f7722 100644 --- a/paper-api/src/main/java/org/bukkit/TreeType.java +++ b/paper-api/src/main/java/org/bukkit/TreeType.java @@ -1,14 +1,14 @@ -package org.bukkit; - -/** - * Tree type. - * - * @author sk89q - */ -public enum TreeType { - TREE, - BIG_TREE, - REDWOOD, - TALL_REDWOOD, - BIRCH -} +package org.bukkit; + +/** + * Tree type. + * + * @author sk89q + */ +public enum TreeType { + TREE, + BIG_TREE, + REDWOOD, + TALL_REDWOOD, + BIRCH +} diff --git a/paper-api/src/main/java/org/bukkit/block/Chest.java b/paper-api/src/main/java/org/bukkit/block/Chest.java index 8d2af5d9ae..9c12854fe7 100644 --- a/paper-api/src/main/java/org/bukkit/block/Chest.java +++ b/paper-api/src/main/java/org/bukkit/block/Chest.java @@ -1,9 +1,9 @@ -package org.bukkit.block; - -/** - * Represents a chest. - * - * @author sk89q - */ -public interface Chest extends BlockState, ContainerBlock { -} +package org.bukkit.block; + +/** + * Represents a chest. + * + * @author sk89q + */ +public interface Chest extends BlockState, ContainerBlock { +} diff --git a/paper-api/src/main/java/org/bukkit/block/ContainerBlock.java b/paper-api/src/main/java/org/bukkit/block/ContainerBlock.java index 6c271ffa3a..c6e83140db 100644 --- a/paper-api/src/main/java/org/bukkit/block/ContainerBlock.java +++ b/paper-api/src/main/java/org/bukkit/block/ContainerBlock.java @@ -1,17 +1,17 @@ -package org.bukkit.block; - -import org.bukkit.inventory.Inventory; - -/** - * Indicates a block type that has inventory. - * - * @author sk89q - */ -public interface ContainerBlock { - /** - * Get the block's inventory. - * - * @return - */ - public Inventory getInventory(); -} +package org.bukkit.block; + +import org.bukkit.inventory.Inventory; + +/** + * Indicates a block type that has inventory. + * + * @author sk89q + */ +public interface ContainerBlock { + /** + * Get the block's inventory. + * + * @return + */ + public Inventory getInventory(); +} diff --git a/paper-api/src/main/java/org/bukkit/block/CreatureSpawner.java b/paper-api/src/main/java/org/bukkit/block/CreatureSpawner.java index 607a313293..7981c244fb 100644 --- a/paper-api/src/main/java/org/bukkit/block/CreatureSpawner.java +++ b/paper-api/src/main/java/org/bukkit/block/CreatureSpawner.java @@ -1,54 +1,54 @@ -package org.bukkit.block; - -import org.bukkit.entity.CreatureType; - - -/** - * Represents a creature spawner. - * - * @author sk89q - * @author Cogito - */ -public interface CreatureSpawner extends BlockState { - /** - * Get the spawner's creature type. - * - * @return - */ - public CreatureType getCreatureType(); - - /** - * Set the spawner creature type. - * - * @param mobType - */ - public void setCreatureType(CreatureType creatureType); - - /** - * Get the spawner's creature type. - * - * @return - */ - public String getCreatureTypeId(); - - /** - * Set the spawner mob type. - * - * @param creatureType - */ - public void setCreatureTypeId(String creatureType); - - /** - * Get the spawner's delay. - * - * @return - */ - public int getDelay(); - - /** - * Set the spawner's delay. - * - * @param delay - */ - public void setDelay(int delay); -} +package org.bukkit.block; + +import org.bukkit.entity.CreatureType; + + +/** + * Represents a creature spawner. + * + * @author sk89q + * @author Cogito + */ +public interface CreatureSpawner extends BlockState { + /** + * Get the spawner's creature type. + * + * @return + */ + public CreatureType getCreatureType(); + + /** + * Set the spawner creature type. + * + * @param mobType + */ + public void setCreatureType(CreatureType creatureType); + + /** + * Get the spawner's creature type. + * + * @return + */ + public String getCreatureTypeId(); + + /** + * Set the spawner mob type. + * + * @param creatureType + */ + public void setCreatureTypeId(String creatureType); + + /** + * Get the spawner's delay. + * + * @return + */ + public int getDelay(); + + /** + * Set the spawner's delay. + * + * @param delay + */ + public void setDelay(int delay); +} diff --git a/paper-api/src/main/java/org/bukkit/block/Dispenser.java b/paper-api/src/main/java/org/bukkit/block/Dispenser.java index 5465953934..3a04c0d8a5 100644 --- a/paper-api/src/main/java/org/bukkit/block/Dispenser.java +++ b/paper-api/src/main/java/org/bukkit/block/Dispenser.java @@ -1,17 +1,17 @@ -package org.bukkit.block; - -/** - * Represents a dispenser. - * - * @author sk89q - */ -public interface Dispenser extends BlockState, ContainerBlock { - /** - * Attempts to dispense the contents of this block
- *
- * If the block is no longer a dispenser, this will return false - * - * @return true if successful, otherwise false - */ - public boolean dispense(); -} +package org.bukkit.block; + +/** + * Represents a dispenser. + * + * @author sk89q + */ +public interface Dispenser extends BlockState, ContainerBlock { + /** + * Attempts to dispense the contents of this block
+ *
+ * If the block is no longer a dispenser, this will return false + * + * @return true if successful, otherwise false + */ + public boolean dispense(); +} diff --git a/paper-api/src/main/java/org/bukkit/block/Furnace.java b/paper-api/src/main/java/org/bukkit/block/Furnace.java index 6f3e2bea5a..d272246755 100644 --- a/paper-api/src/main/java/org/bukkit/block/Furnace.java +++ b/paper-api/src/main/java/org/bukkit/block/Furnace.java @@ -1,36 +1,36 @@ -package org.bukkit.block; - -/** - * Represents a furnace. - * - * @author sk89q - */ -public interface Furnace extends BlockState, ContainerBlock { - /** - * Get burn time. - * - * @return - */ - public short getBurnTime(); - - /** - * Set burn time. - * - * @param burnTime - */ - public void setBurnTime(short burnTime); - - /** - * Get cook time. - * - * @return - */ - public short getCookTime(); - - /** - * Set cook time. - * - * @param cookTime - */ - public void setCookTime(short cookTime); -} +package org.bukkit.block; + +/** + * Represents a furnace. + * + * @author sk89q + */ +public interface Furnace extends BlockState, ContainerBlock { + /** + * Get burn time. + * + * @return + */ + public short getBurnTime(); + + /** + * Set burn time. + * + * @param burnTime + */ + public void setBurnTime(short burnTime); + + /** + * Get cook time. + * + * @return + */ + public short getCookTime(); + + /** + * Set cook time. + * + * @param cookTime + */ + public void setCookTime(short cookTime); +} diff --git a/paper-api/src/main/java/org/bukkit/block/NoteBlock.java b/paper-api/src/main/java/org/bukkit/block/NoteBlock.java index 1315c118da..547bde0204 100644 --- a/paper-api/src/main/java/org/bukkit/block/NoteBlock.java +++ b/paper-api/src/main/java/org/bukkit/block/NoteBlock.java @@ -1,30 +1,30 @@ -package org.bukkit.block; - -/** - * Represents a note. - * - * @author sk89q - */ -public interface NoteBlock extends BlockState { - /** - * Gets the note. - * - * @return - */ - public byte getNote(); - - /** - * Set the note. - * - * @param note - */ - public void setNote(byte note); - /** - * Attempts to play the note at block
- *
- * If the block is no longer a note block, this will return false - * - * @return true if successful, otherwise false - */ - public boolean play(); -} +package org.bukkit.block; + +/** + * Represents a note. + * + * @author sk89q + */ +public interface NoteBlock extends BlockState { + /** + * Gets the note. + * + * @return + */ + public byte getNote(); + + /** + * Set the note. + * + * @param note + */ + public void setNote(byte note); + /** + * Attempts to play the note at block
+ *
+ * If the block is no longer a note block, this will return false + * + * @return true if successful, otherwise false + */ + public boolean play(); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Animals.java b/paper-api/src/main/java/org/bukkit/entity/Animals.java index e4ae589fe0..e41b3cc8c1 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Animals.java +++ b/paper-api/src/main/java/org/bukkit/entity/Animals.java @@ -1,11 +1,11 @@ -package org.bukkit.entity; - -/** - * Represents an Animal. - * - * @author Cogito - * - */ -public interface Animals extends Creature{ - -} +package org.bukkit.entity; + +/** + * Represents an Animal. + * + * @author Cogito + * + */ +public interface Animals extends Creature{ + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Arrow.java b/paper-api/src/main/java/org/bukkit/entity/Arrow.java index 90efb643c6..33c14a8648 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Arrow.java +++ b/paper-api/src/main/java/org/bukkit/entity/Arrow.java @@ -1,9 +1,9 @@ -package org.bukkit.entity; - -/** - * Represents an arrow. - * - * @author sk89q - */ -public interface Arrow extends Entity { -} +package org.bukkit.entity; + +/** + * Represents an arrow. + * + * @author sk89q + */ +public interface Arrow extends Entity { +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Boat.java b/paper-api/src/main/java/org/bukkit/entity/Boat.java index 1565cd81f6..cec262ea65 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Boat.java +++ b/paper-api/src/main/java/org/bukkit/entity/Boat.java @@ -1,22 +1,22 @@ -package org.bukkit.entity; - -/** - * Represents a boat entity. - * - * @author sk89q - */ -public interface Boat extends Vehicle { - /** - * Gets the maximum speed of a boat. The speed is unrelated to the velocity. - * - * @param speed - */ - public double getMaxSpeed(); - - /** - * Sets the maximum speed of a boat. Must be nonnegative. Default is 0.4D. - * - * @param speed - */ - public void setMaxSpeed(double speed); -} +package org.bukkit.entity; + +/** + * Represents a boat entity. + * + * @author sk89q + */ +public interface Boat extends Vehicle { + /** + * Gets the maximum speed of a boat. The speed is unrelated to the velocity. + * + * @param speed + */ + public double getMaxSpeed(); + + /** + * Sets the maximum speed of a boat. Must be nonnegative. Default is 0.4D. + * + * @param speed + */ + public void setMaxSpeed(double speed); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Chicken.java b/paper-api/src/main/java/org/bukkit/entity/Chicken.java index db7fb3ea0e..6254911de4 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Chicken.java +++ b/paper-api/src/main/java/org/bukkit/entity/Chicken.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Chicken. - * - * @author Cogito - * - */ -public interface Chicken extends Animals { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Chicken. + * + * @author Cogito + * + */ +public interface Chicken extends Animals { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Cow.java b/paper-api/src/main/java/org/bukkit/entity/Cow.java index 67e34a913e..4af61f095b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Cow.java +++ b/paper-api/src/main/java/org/bukkit/entity/Cow.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Cow. - * - * @author Cogito - * - */ -public interface Cow extends Animals { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Cow. + * + * @author Cogito + * + */ +public interface Cow extends Animals { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Creature.java b/paper-api/src/main/java/org/bukkit/entity/Creature.java index 2589f4c902..156057323c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Creature.java +++ b/paper-api/src/main/java/org/bukkit/entity/Creature.java @@ -1,23 +1,23 @@ -package org.bukkit.entity; - -/** - * Represents a Creature. Creatures are non-intelligent monsters or animals which - * have very simple abilities. - */ -public interface Creature extends LivingEntity { - /** - * Instructs this Creature to set the specified LivingEntity as its target. - * Hostile creatures may attack their target, and friendly creatures may - * follow their target. - * - * @param target New LivingEntity to target, or null to clear the target - */ - public void setTarget(LivingEntity target); - - /** - * Gets the current target of this Creature - * - * @return Current target of this creature, or null if none exists - */ - public LivingEntity getTarget(); -} +package org.bukkit.entity; + +/** + * Represents a Creature. Creatures are non-intelligent monsters or animals which + * have very simple abilities. + */ +public interface Creature extends LivingEntity { + /** + * Instructs this Creature to set the specified LivingEntity as its target. + * Hostile creatures may attack their target, and friendly creatures may + * follow their target. + * + * @param target New LivingEntity to target, or null to clear the target + */ + public void setTarget(LivingEntity target); + + /** + * Gets the current target of this Creature + * + * @return Current target of this creature, or null if none exists + */ + public LivingEntity getTarget(); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Egg.java b/paper-api/src/main/java/org/bukkit/entity/Egg.java index c7b3d0223f..6de27264a5 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Egg.java +++ b/paper-api/src/main/java/org/bukkit/entity/Egg.java @@ -1,9 +1,9 @@ -package org.bukkit.entity; - -/** - * Represents an egg. - * - * @author sk89q - */ -public interface Egg extends Entity { -} +package org.bukkit.entity; + +/** + * Represents an egg. + * + * @author sk89q + */ +public interface Egg extends Entity { +} diff --git a/paper-api/src/main/java/org/bukkit/entity/FallingSand.java b/paper-api/src/main/java/org/bukkit/entity/FallingSand.java index 0e498170f2..3d4853fb5e 100644 --- a/paper-api/src/main/java/org/bukkit/entity/FallingSand.java +++ b/paper-api/src/main/java/org/bukkit/entity/FallingSand.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents Falling Sand. - * - * @author Cogito - * - */ -public interface FallingSand extends Entity { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents Falling Sand. + * + * @author Cogito + * + */ +public interface FallingSand extends Entity { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Fireball.java b/paper-api/src/main/java/org/bukkit/entity/Fireball.java index 424de3013f..180a762d5c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Fireball.java +++ b/paper-api/src/main/java/org/bukkit/entity/Fireball.java @@ -1,9 +1,9 @@ -package org.bukkit.entity; - -/** - * Represents a Fireball. - * - * @author Cogito - */ -public interface Fireball extends Entity { -} +package org.bukkit.entity; + +/** + * Represents a Fireball. + * + * @author Cogito + */ +public interface Fireball extends Entity { +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Fish.java b/paper-api/src/main/java/org/bukkit/entity/Fish.java index 44fcede759..1808db49ed 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Fish.java +++ b/paper-api/src/main/java/org/bukkit/entity/Fish.java @@ -1,9 +1,9 @@ -package org.bukkit.entity; - -/** - * Represents a Fish. - * - * @author Cogito - */ -public interface Fish extends Entity { -} +package org.bukkit.entity; + +/** + * Represents a Fish. + * + * @author Cogito + */ +public interface Fish extends Entity { +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Flying.java b/paper-api/src/main/java/org/bukkit/entity/Flying.java index 14099fa37c..115715474a 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Flying.java +++ b/paper-api/src/main/java/org/bukkit/entity/Flying.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Flying Entity. - * - * @author Cogito - * - */ -public interface Flying extends LivingEntity { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Flying Entity. + * + * @author Cogito + * + */ +public interface Flying extends LivingEntity { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Ghast.java b/paper-api/src/main/java/org/bukkit/entity/Ghast.java index a84c4786e8..97d6cde23c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Ghast.java +++ b/paper-api/src/main/java/org/bukkit/entity/Ghast.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Ghast. - * - * @author Cogito - * - */ -public interface Ghast extends Flying { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Ghast. + * + * @author Cogito + * + */ +public interface Ghast extends Flying { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Giant.java b/paper-api/src/main/java/org/bukkit/entity/Giant.java index 5a42baedaf..05a595077b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Giant.java +++ b/paper-api/src/main/java/org/bukkit/entity/Giant.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Giant. - * - * @author Cogito - * - */ -public interface Giant extends Monster { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Giant. + * + * @author Cogito + * + */ +public interface Giant extends Monster { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Item.java b/paper-api/src/main/java/org/bukkit/entity/Item.java index aaf5b3d462..e66b14d46e 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Item.java +++ b/paper-api/src/main/java/org/bukkit/entity/Item.java @@ -1,26 +1,26 @@ -package org.bukkit.entity; - -import org.bukkit.inventory.ItemStack; - -/** - * Represents an Item. - * - * @author Cogito - * - */ -public interface Item extends Entity { - - /** - * Gets the item stack associated with this item drop. - * - * @return - */ - public ItemStack getItemStack(); - - /** - * Sets the item stack associated with this item drop. - * - * @param stack - */ - public void setItemStack(ItemStack stack); -} +package org.bukkit.entity; + +import org.bukkit.inventory.ItemStack; + +/** + * Represents an Item. + * + * @author Cogito + * + */ +public interface Item extends Entity { + + /** + * Gets the item stack associated with this item drop. + * + * @return + */ + public ItemStack getItemStack(); + + /** + * Sets the item stack associated with this item drop. + * + * @param stack + */ + public void setItemStack(ItemStack stack); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Minecart.java b/paper-api/src/main/java/org/bukkit/entity/Minecart.java index 71a84c0458..4d51cbba83 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Minecart.java +++ b/paper-api/src/main/java/org/bukkit/entity/Minecart.java @@ -1,83 +1,83 @@ -package org.bukkit.entity; - -import org.bukkit.util.Vector; - -/** - * Represents a minecart entity. - * - * @author sk89q - */ -public interface Minecart extends Vehicle { - /** - * Sets a minecart's damage. - * - * @param damage over 40 to "kill" a minecart - */ - public void setDamage(int damage); - - /** - * Gets a minecart's damage. - * - * @param damage - */ - public int getDamage(); - - /** - * Gets the maximum speed of a minecart. The speed is unrelated to the velocity. - * - * @param speed - */ - public double getMaxSpeed(); - - /** - * Sets the maximum speed of a minecart. Must be nonnegative. Default is 0.4D. - * - * @param speed - */ - public void setMaxSpeed(double speed); - - /** - * Returns whether this minecart will slow down faster without a passenger occupying it - * - */ - public boolean isSlowWhenEmpty(); - - /** - * Sets whether this minecart will slow down faster without a passenger occupying it - * - * @param slow - */ - public void setSlowWhenEmpty(boolean slow); - - /** - * Gets the flying velocity modifier. Used for minecarts that are in mid-air. - * A flying minecart's velocity is multiplied by this factor each tick. - * - * @param flying velocity modifier - */ - public Vector getFlyingVelocityMod(); - - /** - * Sets the flying velocity modifier. Used for minecarts that are in mid-air. - * A flying minecart's velocity is multiplied by this factor each tick. - * - * @param flying velocity modifier - */ - public void setFlyingVelocityMod(Vector flying); - - /** - * Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails. - * - * A derailed minecart's velocity is multiplied by this factor each tick. - * @param visible speed - */ - public Vector getDerailedVelocityMod(); - - /** - * Sets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails. - * A derailed minecart's velocity is multiplied by this factor each tick. - * - * @param visible speed - */ - public void setDerailedVelocityMod(Vector derailed); -} +package org.bukkit.entity; + +import org.bukkit.util.Vector; + +/** + * Represents a minecart entity. + * + * @author sk89q + */ +public interface Minecart extends Vehicle { + /** + * Sets a minecart's damage. + * + * @param damage over 40 to "kill" a minecart + */ + public void setDamage(int damage); + + /** + * Gets a minecart's damage. + * + * @param damage + */ + public int getDamage(); + + /** + * Gets the maximum speed of a minecart. The speed is unrelated to the velocity. + * + * @param speed + */ + public double getMaxSpeed(); + + /** + * Sets the maximum speed of a minecart. Must be nonnegative. Default is 0.4D. + * + * @param speed + */ + public void setMaxSpeed(double speed); + + /** + * Returns whether this minecart will slow down faster without a passenger occupying it + * + */ + public boolean isSlowWhenEmpty(); + + /** + * Sets whether this minecart will slow down faster without a passenger occupying it + * + * @param slow + */ + public void setSlowWhenEmpty(boolean slow); + + /** + * Gets the flying velocity modifier. Used for minecarts that are in mid-air. + * A flying minecart's velocity is multiplied by this factor each tick. + * + * @param flying velocity modifier + */ + public Vector getFlyingVelocityMod(); + + /** + * Sets the flying velocity modifier. Used for minecarts that are in mid-air. + * A flying minecart's velocity is multiplied by this factor each tick. + * + * @param flying velocity modifier + */ + public void setFlyingVelocityMod(Vector flying); + + /** + * Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails. + * + * A derailed minecart's velocity is multiplied by this factor each tick. + * @param visible speed + */ + public Vector getDerailedVelocityMod(); + + /** + * Sets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails. + * A derailed minecart's velocity is multiplied by this factor each tick. + * + * @param visible speed + */ + public void setDerailedVelocityMod(Vector derailed); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Monster.java b/paper-api/src/main/java/org/bukkit/entity/Monster.java index 2f20e4d4f5..86e4d29846 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Monster.java +++ b/paper-api/src/main/java/org/bukkit/entity/Monster.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Monster. - * - * @author Cogito - * - */ -public interface Monster extends Creature { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Monster. + * + * @author Cogito + * + */ +public interface Monster extends Creature { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Painting.java b/paper-api/src/main/java/org/bukkit/entity/Painting.java index 7dab8d12d5..1aa654e8ce 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Painting.java +++ b/paper-api/src/main/java/org/bukkit/entity/Painting.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Painting. - * - * @author Cogito - * - */ -public interface Painting extends Entity { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Painting. + * + * @author Cogito + * + */ +public interface Painting extends Entity { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Pig.java b/paper-api/src/main/java/org/bukkit/entity/Pig.java index cfe250b140..2d67cb0445 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Pig.java +++ b/paper-api/src/main/java/org/bukkit/entity/Pig.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Pig. - * - * @author Cogito - * - */ -public interface Pig extends Animals { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Pig. + * + * @author Cogito + * + */ +public interface Pig extends Animals { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/PigZombie.java b/paper-api/src/main/java/org/bukkit/entity/PigZombie.java index 25670d278e..721f7d2c8f 100644 --- a/paper-api/src/main/java/org/bukkit/entity/PigZombie.java +++ b/paper-api/src/main/java/org/bukkit/entity/PigZombie.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Pig Zombie. - * - * @author Cogito - * - */ -public interface PigZombie extends Zombie { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Pig Zombie. + * + * @author Cogito + * + */ +public interface PigZombie extends Zombie { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/PoweredMinecart.java b/paper-api/src/main/java/org/bukkit/entity/PoweredMinecart.java index 66f5ba7f2a..9a8f0285fb 100644 --- a/paper-api/src/main/java/org/bukkit/entity/PoweredMinecart.java +++ b/paper-api/src/main/java/org/bukkit/entity/PoweredMinecart.java @@ -1,10 +1,10 @@ -package org.bukkit.entity; - -/** - * Represents a powered minecart. - * - * @author sk89q - */ -public interface PoweredMinecart extends Minecart { - -} +package org.bukkit.entity; + +/** + * Represents a powered minecart. + * + * @author sk89q + */ +public interface PoweredMinecart extends Minecart { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Skeleton.java b/paper-api/src/main/java/org/bukkit/entity/Skeleton.java index 651cc90ae6..b9552cb4cd 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Skeleton.java +++ b/paper-api/src/main/java/org/bukkit/entity/Skeleton.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Skeleton. - * - * @author Cogito - * - */ -public interface Skeleton extends Monster { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Skeleton. + * + * @author Cogito + * + */ +public interface Skeleton extends Monster { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Snowball.java b/paper-api/src/main/java/org/bukkit/entity/Snowball.java index 69ac03abd0..4799c83aba 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Snowball.java +++ b/paper-api/src/main/java/org/bukkit/entity/Snowball.java @@ -1,9 +1,9 @@ -package org.bukkit.entity; - -/** - * Implements a snowball. - * - * @author sk89q - */ -public interface Snowball extends Entity { -} +package org.bukkit.entity; + +/** + * Implements a snowball. + * + * @author sk89q + */ +public interface Snowball extends Entity { +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Spider.java b/paper-api/src/main/java/org/bukkit/entity/Spider.java index 1e0edc04f3..e36140405c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Spider.java +++ b/paper-api/src/main/java/org/bukkit/entity/Spider.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Spider. - * - * @author Cogito - * - */ -public interface Spider extends Monster { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Spider. + * + * @author Cogito + * + */ +public interface Spider extends Monster { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Squid.java b/paper-api/src/main/java/org/bukkit/entity/Squid.java index 58a6f391c9..d5b25aea4a 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Squid.java +++ b/paper-api/src/main/java/org/bukkit/entity/Squid.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Squid. - * - * @author Cogito - * - */ -public interface Squid extends WaterMob { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Squid. + * + * @author Cogito + * + */ +public interface Squid extends WaterMob { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/StorageMinecart.java b/paper-api/src/main/java/org/bukkit/entity/StorageMinecart.java index 81b588ff9d..6d4cfefe8b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/StorageMinecart.java +++ b/paper-api/src/main/java/org/bukkit/entity/StorageMinecart.java @@ -1,17 +1,17 @@ -package org.bukkit.entity; - -import org.bukkit.inventory.Inventory; - -/** - * Represents a storage minecart. - * - * @author sk89q - */ -public interface StorageMinecart extends Minecart { - /** - * Return the inventory object for this StorageMinecart. - * - * @return The inventory for this Minecart - */ - public Inventory getInventory(); -} +package org.bukkit.entity; + +import org.bukkit.inventory.Inventory; + +/** + * Represents a storage minecart. + * + * @author sk89q + */ +public interface StorageMinecart extends Minecart { + /** + * Return the inventory object for this StorageMinecart. + * + * @return The inventory for this Minecart + */ + public Inventory getInventory(); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java b/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java index 3532fb1823..160bfaf0a2 100644 --- a/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java +++ b/paper-api/src/main/java/org/bukkit/entity/TNTPrimed.java @@ -1,14 +1,14 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Primed TNT. - * - * @author Cogito - * - */ -public interface TNTPrimed extends Entity { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Primed TNT. + * + * @author Cogito + * + */ +public interface TNTPrimed extends Entity { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/WaterMob.java b/paper-api/src/main/java/org/bukkit/entity/WaterMob.java index 8ab61165cc..f01a5a3f06 100644 --- a/paper-api/src/main/java/org/bukkit/entity/WaterMob.java +++ b/paper-api/src/main/java/org/bukkit/entity/WaterMob.java @@ -1,13 +1,13 @@ -/** - * - */ -package org.bukkit.entity; - -/** - * Represents a Water Mob - * @author Cogito - * - */ -public interface WaterMob extends Creature { - -} +/** + * + */ +package org.bukkit.entity; + +/** + * Represents a Water Mob + * @author Cogito + * + */ +public interface WaterMob extends Creature { + +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Zombie.java b/paper-api/src/main/java/org/bukkit/entity/Zombie.java index 18b9a283b0..b58886558b 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Zombie.java +++ b/paper-api/src/main/java/org/bukkit/entity/Zombie.java @@ -1,11 +1,11 @@ -package org.bukkit.entity; - -/** - * Represents a Zombie. - * - * @author Cogito - * - */ -public interface Zombie extends Monster{ - -} +package org.bukkit.entity; + +/** + * Represents a Zombie. + * + * @author Cogito + * + */ +public interface Zombie extends Monster{ + +} diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockEvent.java index 08a42c45c5..d787534884 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockEvent.java @@ -1,24 +1,24 @@ -package org.bukkit.event.block; - -import org.bukkit.block.Block; -import org.bukkit.event.Event; - -/** - * Represents a block related event - */ -public class BlockEvent extends Event { - protected Block block; - - public BlockEvent(final Event.Type type, final Block theBlock) { - super(type); - block = theBlock; - } - - /** - * Returns the block involved in this event - * @return Block which block is involved in this event - */ - public final Block getBlock() { - return block; - } -} +package org.bukkit.event.block; + +import org.bukkit.block.Block; +import org.bukkit.event.Event; + +/** + * Represents a block related event + */ +public class BlockEvent extends Event { + protected Block block; + + public BlockEvent(final Event.Type type, final Block theBlock) { + super(type); + block = theBlock; + } + + /** + * Returns the block involved in this event + * @return Block which block is involved in this event + */ + public final Block getBlock() { + return block; + } +} diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerEvent.java index 2e176535a2..d74bc5471d 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerEvent.java @@ -1,25 +1,25 @@ - -package org.bukkit.event.player; - -import org.bukkit.entity.Player; -import org.bukkit.event.Event; - -/** - * Represents a player related event - */ -public class PlayerEvent extends Event { - protected Player player; - - public PlayerEvent(final Event.Type type, final Player who) { - super(type); - player = who; - } - - /** - * Returns the player involved in this event - * @return Player who is involved in this event - */ - public final Player getPlayer() { - return player; - } -} + +package org.bukkit.event.player; + +import org.bukkit.entity.Player; +import org.bukkit.event.Event; + +/** + * Represents a player related event + */ +public class PlayerEvent extends Event { + protected Player player; + + public PlayerEvent(final Event.Type type, final Player who) { + super(type); + player = who; + } + + /** + * Returns the player involved in this event + * @return Player who is involved in this event + */ + public final Player getPlayer() { + return player; + } +} diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java index da7e2bd983..358ec3a0d3 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java @@ -1,14 +1,14 @@ -package org.bukkit.event.vehicle; - -import org.bukkit.entity.Vehicle; - -/** - * Raised when a vehicle collides. - * - * @author sk89q - */ -public class VehicleCollisionEvent extends VehicleEvent { - public VehicleCollisionEvent(Type type, Vehicle vehicle) { - super(type, vehicle); - } -} +package org.bukkit.event.vehicle; + +import org.bukkit.entity.Vehicle; + +/** + * Raised when a vehicle collides. + * + * @author sk89q + */ +public class VehicleCollisionEvent extends VehicleEvent { + public VehicleCollisionEvent(Type type, Vehicle vehicle) { + super(type, vehicle); + } +} diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java index 78fc757d13..292d6ee8ba 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java @@ -1,27 +1,27 @@ -package org.bukkit.event.vehicle; - -import org.bukkit.entity.Vehicle; -import org.bukkit.event.Event; - -/** - * Represents a vehicle-related event. - * - * @author sk89q - */ -public class VehicleEvent extends Event { - protected Vehicle vehicle; - - public VehicleEvent(final Event.Type type, final Vehicle vehicle) { - super(type); - this.vehicle = vehicle; - } - - /** - * Get the vehicle. - * - * @return the vehicle - */ - public final Vehicle getVehicle() { - return vehicle; - } -} +package org.bukkit.event.vehicle; + +import org.bukkit.entity.Vehicle; +import org.bukkit.event.Event; + +/** + * Represents a vehicle-related event. + * + * @author sk89q + */ +public class VehicleEvent extends Event { + protected Vehicle vehicle; + + public VehicleEvent(final Event.Type type, final Vehicle vehicle) { + super(type); + this.vehicle = vehicle; + } + + /** + * Get the vehicle. + * + * @return the vehicle + */ + public final Vehicle getVehicle() { + return vehicle; + } +} diff --git a/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java b/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java index 556a582111..ee80d205ac 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java @@ -1,204 +1,204 @@ - -package org.bukkit.inventory; - -import org.bukkit.Material; -import org.bukkit.material.MaterialData; - -/** - * Represents a stack of items - */ -public class ItemStack { - private int type; - private int amount = 0; - private MaterialData data = null; - private short durability = 0; - - public ItemStack(final int type) { - this(type, 0); - } - - public ItemStack(final Material type) { - this(type, 0); - } - - public ItemStack(final int type, final int amount) { - this(type, amount, (short) 0); - } - - public ItemStack(final Material type, final int amount) { - this(type.getId(), amount); - } - - public ItemStack(final int type, final int amount, final short damage) { - this(type, amount, damage, null); - } - - public ItemStack(final Material type, final int amount, final short damage) { - this(type.getId(), amount, damage); - } - - public ItemStack(final int type, final int amount, final short damage, final Byte data) { - this.type = type; - this.amount = amount; - this.durability = damage; - if (data != null) { - createData(data); - this.durability = data; - } - } - - public ItemStack(final Material type, final int amount, final short damage, final Byte data) { - this(type.getId(), amount, damage, data); - } - - /** - * Gets the type of this item - * - * @return Type of the items in this stack - */ - public Material getType() { - return Material.getMaterial(type); - } - - /** - * Sets the type of this item
- *
- * Note that in doing so you will reset the MaterialData for this stack - * - * @param type New type to set the items in this stack to - */ - public void setType(Material type) { - setTypeId(type.getId()); - } - - /** - * Gets the type id of this item - * - * @return Type Id of the items in this stack - */ - public int getTypeId() { - return type; - } - - /** - * Sets the type id of this item
- *
- * Note that in doing so you will reset the MaterialData for this stack - * - * @param type New type id to set the items in this stack to - */ - public void setTypeId(int type) { - this.type = type; - createData((byte)0); - } - - /** - * Gets the amount of items in this stack - * - * @return Amount of items in this stick - */ - public int getAmount() { - return amount; - } - - /** - * Sets the amount of items in this stack - * - * @param amount New amount of items in this stack - */ - public void setAmount(int amount) { - this.amount = amount; - } - - /** - * Gets the MaterialData for this stack of items - * - * @return MaterialData for this item - */ - public MaterialData getData() { - if (Material.getMaterial(getTypeId()).getData() != null) { - data = Material.getMaterial(getTypeId()).getNewData((byte)this.durability); - } - - return data; - } - - /** - * Sets the MaterialData for this stack of items - * - * @param amount New MaterialData for this item - */ - public void setData(MaterialData data) { - Material mat = getType(); - - if ((mat == null) || (mat.getData() == null)) { - this.data = data; - } else { - if ((data.getClass() == mat.getData()) || (data.getClass() == MaterialData.class)) { - this.data = data; - } else { - throw new IllegalArgumentException("Provided data is not of type " - + mat.getData().getName() + ", found " + data.getClass().getName()); - } - } - } - - /** - * Sets the durability of this item - * - * @param durability Durability of this item - */ - public void setDurability(final short durability) { - this.durability = durability; - } - - /** - * Gets the durability of this item - * - * @return Durability of this item - */ - public short getDurability() { - return durability; - } - - /** - * Get the maximum stacksize for the material hold in this ItemStack - * Returns -1 if it has no idea. - * - * @return The maximum you can stack this material to. - */ - public int getMaxStackSize() { - return -1; - } - - private void createData(final byte data) { - Material mat = Material.getMaterial(type); - if (mat == null) { - this.data = new MaterialData(type, data); - } else { - this.data = mat.getNewData(data); - } - } - - @Override - public String toString() { - return "ItemStack{"+getType().name()+" x "+getAmount()+"}"; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ItemStack)) - return false; - - ItemStack item = (ItemStack)obj; - return item.getAmount() == getAmount() && item.getTypeId() == getTypeId(); - } - - @Override - public int hashCode() { - int hash = 11; - hash = hash * 19 + 7 * getTypeId(); // Overriding hashCode since equals is overridden, it's just - hash = hash * 7 + 23 * getAmount(); // too bad these are mutable values... Q_Q - return hash; - } -} + +package org.bukkit.inventory; + +import org.bukkit.Material; +import org.bukkit.material.MaterialData; + +/** + * Represents a stack of items + */ +public class ItemStack { + private int type; + private int amount = 0; + private MaterialData data = null; + private short durability = 0; + + public ItemStack(final int type) { + this(type, 0); + } + + public ItemStack(final Material type) { + this(type, 0); + } + + public ItemStack(final int type, final int amount) { + this(type, amount, (short) 0); + } + + public ItemStack(final Material type, final int amount) { + this(type.getId(), amount); + } + + public ItemStack(final int type, final int amount, final short damage) { + this(type, amount, damage, null); + } + + public ItemStack(final Material type, final int amount, final short damage) { + this(type.getId(), amount, damage); + } + + public ItemStack(final int type, final int amount, final short damage, final Byte data) { + this.type = type; + this.amount = amount; + this.durability = damage; + if (data != null) { + createData(data); + this.durability = data; + } + } + + public ItemStack(final Material type, final int amount, final short damage, final Byte data) { + this(type.getId(), amount, damage, data); + } + + /** + * Gets the type of this item + * + * @return Type of the items in this stack + */ + public Material getType() { + return Material.getMaterial(type); + } + + /** + * Sets the type of this item
+ *
+ * Note that in doing so you will reset the MaterialData for this stack + * + * @param type New type to set the items in this stack to + */ + public void setType(Material type) { + setTypeId(type.getId()); + } + + /** + * Gets the type id of this item + * + * @return Type Id of the items in this stack + */ + public int getTypeId() { + return type; + } + + /** + * Sets the type id of this item
+ *
+ * Note that in doing so you will reset the MaterialData for this stack + * + * @param type New type id to set the items in this stack to + */ + public void setTypeId(int type) { + this.type = type; + createData((byte)0); + } + + /** + * Gets the amount of items in this stack + * + * @return Amount of items in this stick + */ + public int getAmount() { + return amount; + } + + /** + * Sets the amount of items in this stack + * + * @param amount New amount of items in this stack + */ + public void setAmount(int amount) { + this.amount = amount; + } + + /** + * Gets the MaterialData for this stack of items + * + * @return MaterialData for this item + */ + public MaterialData getData() { + if (Material.getMaterial(getTypeId()).getData() != null) { + data = Material.getMaterial(getTypeId()).getNewData((byte)this.durability); + } + + return data; + } + + /** + * Sets the MaterialData for this stack of items + * + * @param amount New MaterialData for this item + */ + public void setData(MaterialData data) { + Material mat = getType(); + + if ((mat == null) || (mat.getData() == null)) { + this.data = data; + } else { + if ((data.getClass() == mat.getData()) || (data.getClass() == MaterialData.class)) { + this.data = data; + } else { + throw new IllegalArgumentException("Provided data is not of type " + + mat.getData().getName() + ", found " + data.getClass().getName()); + } + } + } + + /** + * Sets the durability of this item + * + * @param durability Durability of this item + */ + public void setDurability(final short durability) { + this.durability = durability; + } + + /** + * Gets the durability of this item + * + * @return Durability of this item + */ + public short getDurability() { + return durability; + } + + /** + * Get the maximum stacksize for the material hold in this ItemStack + * Returns -1 if it has no idea. + * + * @return The maximum you can stack this material to. + */ + public int getMaxStackSize() { + return -1; + } + + private void createData(final byte data) { + Material mat = Material.getMaterial(type); + if (mat == null) { + this.data = new MaterialData(type, data); + } else { + this.data = mat.getNewData(data); + } + } + + @Override + public String toString() { + return "ItemStack{"+getType().name()+" x "+getAmount()+"}"; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ItemStack)) + return false; + + ItemStack item = (ItemStack)obj; + return item.getAmount() == getAmount() && item.getTypeId() == getTypeId(); + } + + @Override + public int hashCode() { + int hash = 11; + hash = hash * 19 + 7 * getTypeId(); // Overriding hashCode since equals is overridden, it's just + hash = hash * 7 + 23 * getAmount(); // too bad these are mutable values... Q_Q + return hash; + } +} diff --git a/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java b/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java index 0e82ca0e15..73f2046347 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/PlayerInventory.java @@ -1,94 +1,94 @@ -package org.bukkit.inventory; - -/** - * Includes interface to the 4 armor slots - */ -public interface PlayerInventory extends Inventory { - /** - * Get all ItemStacks from the armor slots - * - * @return All the ItemStacks from the armor slots - */ - public ItemStack[] getArmorContents(); - - /** - * Return the ItemStack from the helmet slot - * - * @return The ItemStack in the helmet slot - */ - public ItemStack getHelmet(); - - /** - * Return the ItemStack from the chestplate slot - * - * @return The ItemStack in the chestplate slot - */ - public ItemStack getChestplate(); - - /** - * Return the ItemStack from the leg slot - * - * @return The ItemStack in the leg slot - */ - public ItemStack getLeggings(); - - /** - * Return the ItemStack from the boots slot - * - * @return The ItemStack in the boots slot - */ - public ItemStack getBoots(); - - /** - * Put the given ItemStack into the helmet slot - * This does not check if the ItemStack is a helmet - * - * @param helmet The ItemStack to use as helmet - */ - public void setHelmet(ItemStack helmet); - - /** - * Put the given ItemStack into the chestplate slot - * This does not check if the ItemStack is a chestplate - * - * @param chestplate The ItemStack to use as chestplate - */ - public void setChestplate(ItemStack chestplate); - - /** - * Put the given ItemStack into the leg slot - * This does not check if the ItemStack is a pair of leggings - * - * @param leggings The ItemStack to use as leggings - */ - public void setLeggings(ItemStack leggings); - - /** - * Put the given ItemStack into the boots slot - * This does not check if the ItemStack is a boots - * - * @param boots The ItemStack to use as boots - */ - public void setBoots(ItemStack boots); - - /** - * Returns the ItemStack currently hold - * - * @return The currently held ItemStack - */ - public ItemStack getItemInHand(); - - /** - * Sets the item in hand - * - * @param stack Stack to set - */ - public void setItemInHand(ItemStack stack); - - /** - * Get the slot number of the currently held item - * - * @return Held item slot number - */ - public int getHeldItemSlot(); +package org.bukkit.inventory; + +/** + * Includes interface to the 4 armor slots + */ +public interface PlayerInventory extends Inventory { + /** + * Get all ItemStacks from the armor slots + * + * @return All the ItemStacks from the armor slots + */ + public ItemStack[] getArmorContents(); + + /** + * Return the ItemStack from the helmet slot + * + * @return The ItemStack in the helmet slot + */ + public ItemStack getHelmet(); + + /** + * Return the ItemStack from the chestplate slot + * + * @return The ItemStack in the chestplate slot + */ + public ItemStack getChestplate(); + + /** + * Return the ItemStack from the leg slot + * + * @return The ItemStack in the leg slot + */ + public ItemStack getLeggings(); + + /** + * Return the ItemStack from the boots slot + * + * @return The ItemStack in the boots slot + */ + public ItemStack getBoots(); + + /** + * Put the given ItemStack into the helmet slot + * This does not check if the ItemStack is a helmet + * + * @param helmet The ItemStack to use as helmet + */ + public void setHelmet(ItemStack helmet); + + /** + * Put the given ItemStack into the chestplate slot + * This does not check if the ItemStack is a chestplate + * + * @param chestplate The ItemStack to use as chestplate + */ + public void setChestplate(ItemStack chestplate); + + /** + * Put the given ItemStack into the leg slot + * This does not check if the ItemStack is a pair of leggings + * + * @param leggings The ItemStack to use as leggings + */ + public void setLeggings(ItemStack leggings); + + /** + * Put the given ItemStack into the boots slot + * This does not check if the ItemStack is a boots + * + * @param boots The ItemStack to use as boots + */ + public void setBoots(ItemStack boots); + + /** + * Returns the ItemStack currently hold + * + * @return The currently held ItemStack + */ + public ItemStack getItemInHand(); + + /** + * Sets the item in hand + * + * @param stack Stack to set + */ + public void setItemInHand(ItemStack stack); + + /** + * Get the slot number of the currently held item + * + * @return Held item slot number + */ + public int getHeldItemSlot(); } \ No newline at end of file diff --git a/paper-api/src/main/java/org/bukkit/material/Colorable.java b/paper-api/src/main/java/org/bukkit/material/Colorable.java index 05fca12e0c..ab9608c958 100644 --- a/paper-api/src/main/java/org/bukkit/material/Colorable.java +++ b/paper-api/src/main/java/org/bukkit/material/Colorable.java @@ -1,27 +1,27 @@ -package org.bukkit.material; - -import org.bukkit.DyeColor; - -/** - * An object that can be colored. - * - * @author Cogito - * - */ -public interface Colorable { - - /** - * Gets the color of this object. - * - * @return The DyeColor of this object. - */ - public DyeColor getColor(); - - /** - * Sets the color of this object to the specified DyeColor. - * - * @param color The color of the object, as a DyeColor. - */ - public void setColor(DyeColor color); - -} +package org.bukkit.material; + +import org.bukkit.DyeColor; + +/** + * An object that can be colored. + * + * @author Cogito + * + */ +public interface Colorable { + + /** + * Gets the color of this object. + * + * @return The DyeColor of this object. + */ + public DyeColor getColor(); + + /** + * Sets the color of this object to the specified DyeColor. + * + * @param color The color of the object, as a DyeColor. + */ + public void setColor(DyeColor color); + +} diff --git a/paper-api/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java b/paper-api/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java index a1a7551a35..ce1f7e3e12 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java +++ b/paper-api/src/main/java/org/bukkit/plugin/InvalidDescriptionException.java @@ -1,62 +1,62 @@ - -package org.bukkit.plugin; - -/** - * Thrown when attempting to load an invalid PluginDescriptionFile - */ -public class InvalidDescriptionException extends Exception { - private static final long serialVersionUID = 5721389122281775894L; - private final Throwable cause; - private final String message; - - /** - * Constructs a new InvalidDescriptionException based on the given Exception - * - * @param throwable Exception that triggered this Exception - */ - public InvalidDescriptionException(Throwable throwable) { - this(throwable, "Invalid plugin.yml"); - } - - /** - * Constructs a new InvalidDescriptionException with the given message - * - * @param message Brief message explaining the cause of the exception - */ - public InvalidDescriptionException(final String message) { - this(null, message); - } - - /** - * Constructs a new InvalidDescriptionException based on the given Exception - * - * @param message Brief message explaining the cause of the exception - * @param throwable Exception that triggered this Exception - */ - public InvalidDescriptionException(final Throwable throwable, final String message) { - this.cause = null; - this.message = message; - } - - /** - * Constructs a new InvalidDescriptionException - */ - public InvalidDescriptionException() { - this(null, "Invalid plugin.yml"); - } - - /** - * If applicable, returns the Exception that triggered this Exception - * - * @return Inner exception, or null if one does not exist - */ - @Override - public Throwable getCause() { - return cause; - } - - @Override - public String getMessage() { - return message; - } -} + +package org.bukkit.plugin; + +/** + * Thrown when attempting to load an invalid PluginDescriptionFile + */ +public class InvalidDescriptionException extends Exception { + private static final long serialVersionUID = 5721389122281775894L; + private final Throwable cause; + private final String message; + + /** + * Constructs a new InvalidDescriptionException based on the given Exception + * + * @param throwable Exception that triggered this Exception + */ + public InvalidDescriptionException(Throwable throwable) { + this(throwable, "Invalid plugin.yml"); + } + + /** + * Constructs a new InvalidDescriptionException with the given message + * + * @param message Brief message explaining the cause of the exception + */ + public InvalidDescriptionException(final String message) { + this(null, message); + } + + /** + * Constructs a new InvalidDescriptionException based on the given Exception + * + * @param message Brief message explaining the cause of the exception + * @param throwable Exception that triggered this Exception + */ + public InvalidDescriptionException(final Throwable throwable, final String message) { + this.cause = null; + this.message = message; + } + + /** + * Constructs a new InvalidDescriptionException + */ + public InvalidDescriptionException() { + this(null, "Invalid plugin.yml"); + } + + /** + * If applicable, returns the Exception that triggered this Exception + * + * @return Inner exception, or null if one does not exist + */ + @Override + public Throwable getCause() { + return cause; + } + + @Override + public String getMessage() { + return message; + } +} diff --git a/paper-api/src/main/java/org/bukkit/util/BlockVector.java b/paper-api/src/main/java/org/bukkit/util/BlockVector.java index 1d5ab4fc60..fc1a49ac14 100644 --- a/paper-api/src/main/java/org/bukkit/util/BlockVector.java +++ b/paper-api/src/main/java/org/bukkit/util/BlockVector.java @@ -1,111 +1,111 @@ -package org.bukkit.util; - -/** - * A vector with a hash function that floors the X, Y, Z components, a la - * BlockVector in WorldEdit. BlockVectors can be used in hash sets and - * hash maps. Be aware that BlockVectors are mutable, but it is important - * that BlockVectors are never changed once put into a hash set or hash map. - * - * @author sk89q - */ -public class BlockVector extends Vector { - /** - * Construct the vector with all components as 0. - */ - public BlockVector() { - this.x = 0; - this.y = 0; - this.z = 0; - } - - /** - * Construct the vector with another vector. - */ - public BlockVector(Vector vec) { - this.x = vec.getX(); - this.y = vec.getY(); - this.z = vec.getZ(); - } - - /** - * Construct the vector with provided integer components. - * - * @param x - * @param y - * @param z - */ - public BlockVector(int x, int y, int z) { - this.x = x; - this.y = y; - this.z = z; - } - - /** - * Construct the vector with provided double components. - * - * @param x - * @param y - * @param z - */ - public BlockVector(double x, double y, double z) { - this.x = x; - this.y = y; - this.z = z; - } - - /** - * Construct the vector with provided float components. - * - * @param x - * @param y - * @param z - */ - public BlockVector(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - - /** - * Checks if another object is equivalent. - * - * @param obj - * @return whether the other object is equivalent - */ - @Override - public boolean equals(Object obj) { - if (!(obj instanceof BlockVector)) { - return false; - } - BlockVector other = (BlockVector)obj; - return (int)other.getX() == (int)this.x && (int)other.getY() == (int)this.y - && (int)other.getZ() == (int)this.z; - - } - - /** - * Returns a hash code for this vector. - * - * @return hash code - */ - @Override - public int hashCode() { - return (Integer.valueOf((int)x).hashCode() >> 13) ^ - (Integer.valueOf((int)y).hashCode() >> 7) ^ - Integer.valueOf((int)z).hashCode(); - } - - /** - * Get a new block vector. - * - * @return vector - */ - @Override - public BlockVector clone() { - BlockVector v = (BlockVector)super.clone(); - v.x = x; - v.y = y; - v.z = z; - return v; - } -} +package org.bukkit.util; + +/** + * A vector with a hash function that floors the X, Y, Z components, a la + * BlockVector in WorldEdit. BlockVectors can be used in hash sets and + * hash maps. Be aware that BlockVectors are mutable, but it is important + * that BlockVectors are never changed once put into a hash set or hash map. + * + * @author sk89q + */ +public class BlockVector extends Vector { + /** + * Construct the vector with all components as 0. + */ + public BlockVector() { + this.x = 0; + this.y = 0; + this.z = 0; + } + + /** + * Construct the vector with another vector. + */ + public BlockVector(Vector vec) { + this.x = vec.getX(); + this.y = vec.getY(); + this.z = vec.getZ(); + } + + /** + * Construct the vector with provided integer components. + * + * @param x + * @param y + * @param z + */ + public BlockVector(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + /** + * Construct the vector with provided double components. + * + * @param x + * @param y + * @param z + */ + public BlockVector(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } + + /** + * Construct the vector with provided float components. + * + * @param x + * @param y + * @param z + */ + public BlockVector(float x, float y, float z) { + this.x = x; + this.y = y; + this.z = z; + } + + /** + * Checks if another object is equivalent. + * + * @param obj + * @return whether the other object is equivalent + */ + @Override + public boolean equals(Object obj) { + if (!(obj instanceof BlockVector)) { + return false; + } + BlockVector other = (BlockVector)obj; + return (int)other.getX() == (int)this.x && (int)other.getY() == (int)this.y + && (int)other.getZ() == (int)this.z; + + } + + /** + * Returns a hash code for this vector. + * + * @return hash code + */ + @Override + public int hashCode() { + return (Integer.valueOf((int)x).hashCode() >> 13) ^ + (Integer.valueOf((int)y).hashCode() >> 7) ^ + Integer.valueOf((int)z).hashCode(); + } + + /** + * Get a new block vector. + * + * @return vector + */ + @Override + public BlockVector clone() { + BlockVector v = (BlockVector)super.clone(); + v.x = x; + v.y = y; + v.z = z; + return v; + } +} diff --git a/paper-api/src/main/java/org/bukkit/util/config/ConfigurationException.java b/paper-api/src/main/java/org/bukkit/util/config/ConfigurationException.java index 3b8338fcda..6854566903 100644 --- a/paper-api/src/main/java/org/bukkit/util/config/ConfigurationException.java +++ b/paper-api/src/main/java/org/bukkit/util/config/ConfigurationException.java @@ -1,18 +1,18 @@ -package org.bukkit.util.config; - -/** - * Configuration exception. - * - * @author sk89q - */ -public class ConfigurationException extends Exception { - private static final long serialVersionUID = -2442886939908724203L; - - public ConfigurationException() { - super(); - } - - public ConfigurationException(String msg) { - super(msg); - } -} +package org.bukkit.util.config; + +/** + * Configuration exception. + * + * @author sk89q + */ +public class ConfigurationException extends Exception { + private static final long serialVersionUID = -2442886939908724203L; + + public ConfigurationException() { + super(); + } + + public ConfigurationException(String msg) { + super(msg); + } +}