Fixed material

This commit is contained in:
Dinnerbone
2011-01-01 07:01:53 +00:00
parent 3e8a740741
commit 0e4539cb4b
5 changed files with 284 additions and 78 deletions

View File

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

View File

@@ -1,39 +1,39 @@
/**
*
*/
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.event.Cancellable;
/**
* @author durron597
*/
public class BlockCanBuildEvent extends BlockEvent implements Cancellable {
protected boolean cancel;
public BlockCanBuildEvent(Type type, Block block, boolean canBuild) {
super(type, block);
cancel = canBuild;
}
/**
* 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
*/
@Override
public boolean isCancelled() {
return cancel;
}
/**
* Set whether the block can be built here.
*/
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}
/**
*
*/
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.event.Cancellable;
/**
* @author durron597
*/
public class BlockCanBuildEvent extends BlockEvent implements Cancellable {
protected boolean cancel;
public BlockCanBuildEvent(Type type, Block block, boolean canBuild) {
super(type, block);
cancel = canBuild;
}
/**
* 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
*/
@Override
public boolean isCancelled() {
return cancel;
}
/**
* Set whether the block can be built here.
*/
@Override
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}

View File

@@ -2,6 +2,7 @@ package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.ItemStack;
import org.bukkit.Material;
import org.bukkit.event.Event;
/**
@@ -33,7 +34,7 @@ public class BlockPhysicsEvent extends BlockEvent {
* @return Changed block's type
*/
public Material getChangedType() {
return Material.getType(changed); // TODO: Move type to its own file
return Material.getMaterial(changed);
}
/**

View File

@@ -1,32 +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;
}
}
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;
}
}