mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Merge remote branch 'upstream/master' into HEAD
By: durron597 <martin.jared@gmail.com>
This commit is contained in:
commit
fef6ae3d7f
17
paper-api/.gitignore
vendored
17
paper-api/.gitignore
vendored
@ -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
17
paper-api/pom.xml
Executable 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>
|
@ -1,3 +1,4 @@
|
||||
|
||||
package org.bukkit;
|
||||
|
||||
/**
|
@ -0,0 +1,6 @@
|
||||
package org.bukkit.event;
|
||||
|
||||
public interface Cancellable {
|
||||
public boolean isCancelled();
|
||||
public void setCancelled(boolean cancel);
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
@ -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
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package org.bukkit.event;
|
||||
|
||||
public interface Cancellable {
|
||||
public boolean isCancelled();
|
||||
public void setCancelled(boolean cancel);
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user