Merge remote branch 'upstream/master' into HEAD

By: durron597 <martin.jared@gmail.com>
This commit is contained in:
Bukkit/Spigot 2011-01-01 06:55:14 -05:00
commit fef6ae3d7f
47 changed files with 302 additions and 271 deletions

17
paper-api/.gitignore vendored
View File

@ -1,9 +1,18 @@
# Eclipse stuff
/.classpath
/.project
/.settings
/build
# netbeans
/nbproject
/build.xml
/manifest.mf
/dist
# maven
/target
# vim
.*.sw[a-p]
# test stuff (do remove me!)
/sample/test
/sample/build.xml
/sample/build

17
paper-api/pom.xml Executable file
View File

@ -0,0 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Bukkit</name>
<url>http://www.bukkit.org</url>
<dependencies>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.7</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,6 @@
package org.bukkit.event;
public interface Cancellable {
public boolean isCancelled();
public void setCancelled(boolean cancel);
}

View File

@ -0,0 +1,47 @@
/**
*
*/
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.Material;
import org.bukkit.event.Cancellable;
/**
* @author durron597
*/
public class BlockCanBuildEvent extends BlockEvent {
protected boolean buildable;
protected int material;
public BlockCanBuildEvent(Type type, Block block, int id, boolean canBuild) {
super(type, block);
buildable = canBuild;
material = id;
}
/**
* Returns whether or not the block can be built here. By default, returns
* Minecraft's answer on whether the block can be built
*
* @return boolean whether or not the block can be built
*/
public boolean isBuildable() {
return buildable;
}
/**
* Set whether the block can be built here.
*/
public void setBuildable(boolean cancel) {
this.buildable = cancel;
}
public Material getMaterial() {
return Material.getMaterial(material);
}
public int getMaterialID() {
return material;
}
}

View File

@ -38,10 +38,12 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
return from;
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}

View File

@ -0,0 +1,19 @@
package org.bukkit.event.block;
import org.bukkit.event.Event;
/**
* @author durron597
*
*/
public class BlockIgniteEvent extends Event {
/**
* @param type
*/
public BlockIgniteEvent(Type type) {
super(type);
// TODO Auto-generated constructor stub
}
}

View File

@ -1,6 +1,7 @@
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.ItemStack;
import org.bukkit.Material;
import org.bukkit.event.Event;

View File

@ -0,0 +1,32 @@
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.event.Cancellable;
/**
* Not implemented yet
*/
public class BlockPlacedEvent extends BlockEvent implements Cancellable {
private boolean cancel;
/**
* @param type
* @param theBlock
*/
public BlockPlacedEvent(Type type, Block theBlock) {
super(type, theBlock);
cancel = false;
}
@Override
public boolean isCancelled() {
// TODO Auto-generated method stub
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}

View File

@ -0,0 +1,53 @@
/**
*
*/
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.BlockFace;
import org.bukkit.ItemStack;
import org.bukkit.Player;
/**
* @author durron597
*/
public class BlockRightClickedEvent extends BlockEvent {
protected Player clicker;
protected BlockFace direction;
protected ItemStack clickedWith;
/**
* @param type The type of event this is
* @param theBlock The clicked block
* @param direction The face we clicked from
* @param clicker The player who clicked a block
* @param clickedWith Item in player's hand
*/
public BlockRightClickedEvent(Type type, Block theBlock, BlockFace direction, Player clicker, ItemStack clickedWith) {
super(type, theBlock);
this.direction = direction;
this.clicker = clicker;
this.clickedWith = clickedWith;
}
/**
* @return the clicker
*/
public Player getClicker() {
return clicker;
}
/**
* @return the direction
*/
public BlockFace getDirection() {
return direction;
}
/**
* @return the clickedWith
*/
public ItemStack getClickedWith() {
return clickedWith;
}
}

View File

@ -1,6 +0,0 @@
package org.bukkit.event;
public interface Cancellable {
public boolean isCancelled();
public void setCancelled(boolean cancel);
}

View File

@ -1,46 +0,0 @@
/**
*
*/
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.Material;
/**
* @author durron597
*/
public class BlockCanBuildEvent extends BlockEvent {
protected boolean buildable;
protected int material;
public BlockCanBuildEvent(Type type, Block block, int id, boolean canBuild) {
super(type, block);
buildable = canBuild;
material = id;
}
/**
* Returns whether or not the block can be built here. By default, returns
* Minecraft's answer on whether the block can be built
*
* @return boolean whether or not the block can be built
*/
public boolean isBuildable() {
return buildable;
}
/**
* Set whether the block can be built here.
*/
public void setBuildable(boolean cancel) {
this.buildable = cancel;
}
public Material getMaterial() {
return Material.getMaterial(material);
}
public int getMaterialID() {
return material;
}
}

View File

@ -1,19 +0,0 @@
package org.bukkit.event.block;
import org.bukkit.event.Event;
/**
* @author durron597
*
*/
public class BlockIgniteEvent extends Event {
/**
* @param type
*/
public BlockIgniteEvent(Type type) {
super(type);
// TODO Auto-generated constructor stub
}
}

View File

@ -1,32 +0,0 @@
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.event.Cancellable;
/**
* Not implemented yet
*/
public class BlockPlacedEvent extends BlockEvent implements Cancellable {
private boolean cancel;
/**
* @param type
* @param theBlock
*/
public BlockPlacedEvent(Type type, Block theBlock) {
super(type, theBlock);
cancel = false;
}
@Override
public boolean isCancelled() {
// TODO Auto-generated method stub
return cancel;
}
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}

View File

@ -1,53 +0,0 @@
/**
*
*/
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.BlockFace;
import org.bukkit.ItemStack;
import org.bukkit.Player;
/**
* @author durron597
*/
public class BlockRightClickedEvent extends BlockEvent {
protected Player clicker;
protected BlockFace direction;
protected ItemStack clickedWith;
/**
* @param type The type of event this is
* @param theBlock The clicked block
* @param direction The face we clicked from
* @param clicker The player who clicked a block
* @param clickedWith Item in player's hand
*/
public BlockRightClickedEvent(Type type, Block theBlock, BlockFace direction, Player clicker, ItemStack clickedWith) {
super(type, theBlock);
this.direction = direction;
this.clicker = clicker;
this.clickedWith = clickedWith;
}
/**
* @return the clicker
*/
public Player getClicker() {
return clicker;
}
/**
* @return the direction
*/
public BlockFace getDirection() {
return direction;
}
/**
* @return the clickedWith
*/
public ItemStack getClickedWith() {
return clickedWith;
}
}