summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ItemFireball.java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-04-25 16:18:01 -0500
committerTravis Watkins <amaranth@ubuntu.com>2012-05-09 01:40:19 -0500
commitbbc3d31be70781c07933e582d7c3e8c70330671c (patch)
tree5060ebe5a4c97bba039ac6d63522caf8009de9dd /src/main/java/net/minecraft/server/ItemFireball.java
parentfdc5c17a4c472d4a5df882881e745c3cf8a9249d (diff)
downloadcraftbukkit-bbc3d31be70781c07933e582d7c3e8c70330671c.tar
craftbukkit-bbc3d31be70781c07933e582d7c3e8c70330671c.tar.gz
craftbukkit-bbc3d31be70781c07933e582d7c3e8c70330671c.tar.lz
craftbukkit-bbc3d31be70781c07933e582d7c3e8c70330671c.tar.xz
craftbukkit-bbc3d31be70781c07933e582d7c3e8c70330671c.zip
Add ItemFireball from mc-dev for diff visibility
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemFireball.java')
-rw-r--r--src/main/java/net/minecraft/server/ItemFireball.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemFireball.java b/src/main/java/net/minecraft/server/ItemFireball.java
new file mode 100644
index 00000000..14b0b20e
--- /dev/null
+++ b/src/main/java/net/minecraft/server/ItemFireball.java
@@ -0,0 +1,55 @@
+package net.minecraft.server;
+
+public class ItemFireball extends Item {
+
+ public ItemFireball(int i) {
+ super(i);
+ }
+
+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
+ if (world.isStatic) {
+ return true;
+ } else {
+ if (l == 0) {
+ --j;
+ }
+
+ if (l == 1) {
+ ++j;
+ }
+
+ if (l == 2) {
+ --k;
+ }
+
+ if (l == 3) {
+ ++k;
+ }
+
+ if (l == 4) {
+ --i;
+ }
+
+ if (l == 5) {
+ ++i;
+ }
+
+ if (!entityhuman.d(i, j, k)) {
+ return false;
+ } else {
+ int i1 = world.getTypeId(i, j, k);
+
+ if (i1 == 0) {
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "fire.ignite", 1.0F, c.nextFloat() * 0.4F + 0.8F);
+ world.setTypeId(i, j, k, Block.FIRE.id);
+ }
+
+ if (!entityhuman.abilities.canInstantlyBuild) {
+ --itemstack.count;
+ }
+
+ return true;
+ }
+ }
+ }
+}