mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Updated README for line-ending demands, also fixed line-endigs.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
485a47aac4
commit
2556140901
46 changed files with 1240 additions and 1239 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<br />
|
||||
* <br />
|
||||
* 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<br />
|
||||
* <br />
|
||||
* If the block is no longer a dispenser, this will return false
|
||||
*
|
||||
* @return true if successful, otherwise false
|
||||
*/
|
||||
public boolean dispense();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<br />
|
||||
* <br />
|
||||
* 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<br />
|
||||
* <br />
|
||||
* If the block is no longer a note block, this will return false
|
||||
*
|
||||
* @return true if successful, otherwise false
|
||||
*/
|
||||
public boolean play();
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<br />
|
||||
* <br />
|
||||
* 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<br />
|
||||
* <br />
|
||||
* 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<br />
|
||||
* <br />
|
||||
* 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<br />
|
||||
* <br />
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue