summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authort00thpick1 <t00thpick1dirko@gmail.com>2014-01-20 00:03:21 -0500
committerNate Mortensen <nate.richard.mortensen@gmail.com>2014-01-30 21:47:44 -0700
commit8a5ad89a680ca5442f486f56553077cdfee921fa (patch)
tree31cac0af3166e3bbda1d30f2e4a07a1cd9fb8868 /src/main/java/net
parentac53442e7e07f86117dfa0862ed1dc2f4c26126b (diff)
downloadcraftbukkit-8a5ad89a680ca5442f486f56553077cdfee921fa.tar
craftbukkit-8a5ad89a680ca5442f486f56553077cdfee921fa.tar.gz
craftbukkit-8a5ad89a680ca5442f486f56553077cdfee921fa.tar.lz
craftbukkit-8a5ad89a680ca5442f486f56553077cdfee921fa.tar.xz
craftbukkit-8a5ad89a680ca5442f486f56553077cdfee921fa.zip
[Bleeding] Implement ProjectileSource API. Addresses BUKKIT-1038, BUKKIT-1156
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/DispenseBehaviorFireball.java5
-rw-r--r--src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java1
-rw-r--r--src/main/java/net/minecraft/server/Entity.java1
-rw-r--r--src/main/java/net/minecraft/server/EntityArrow.java3
-rw-r--r--src/main/java/net/minecraft/server/EntityFireball.java1
-rw-r--r--src/main/java/net/minecraft/server/EntityProjectile.java1
6 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java b/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java
index 56ff6122..0fd9487b 100644
--- a/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java
+++ b/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java
@@ -49,7 +49,10 @@ final class DispenseBehaviorFireball extends DispenseBehaviorItem {
}
}
- world.addEntity(new EntitySmallFireball(world, d0, d1, d2, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ()));
+ EntitySmallFireball entitysmallfireball = new EntitySmallFireball(world, d0, d1, d2, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ());
+ entitysmallfireball.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource((TileEntityDispenser) isourceblock.getTileEntity());
+
+ world.addEntity(entitysmallfireball);
// itemstack.a(1); // Handled during event processing
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java
index 0a51bafd..49de3f41 100644
--- a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java
+++ b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java
@@ -42,6 +42,7 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem {
}
iprojectile.shoot(event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), this.b(), this.a());
+ ((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource((TileEntityDispenser) isourceblock.getTileEntity());
// CraftBukkit end
world.addEntity((Entity) iprojectile);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index dc0abc59..f74d937e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -109,6 +109,7 @@ public abstract class Entity {
public UUID uniqueID; // CraftBukkit - protected -> public
public EnumEntitySize at;
public boolean valid; // CraftBukkit
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
public int getId() {
return this.id;
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index efa05ba2..51c3173f 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -3,6 +3,7 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
+import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
// CraftBukkit end
@@ -41,6 +42,7 @@ public class EntityArrow extends Entity implements IProjectile {
super(world);
this.k = 10.0D;
this.shooter = entityliving;
+ this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
if (entityliving instanceof EntityHuman) {
this.fromPlayer = 1;
}
@@ -69,6 +71,7 @@ public class EntityArrow extends Entity implements IProjectile {
super(world);
this.k = 10.0D;
this.shooter = entityliving;
+ this.projectileSource = (LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
if (entityliving instanceof EntityHuman) {
this.fromPlayer = 1;
}
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java
index 82da554b..939de5dd 100644
--- a/src/main/java/net/minecraft/server/EntityFireball.java
+++ b/src/main/java/net/minecraft/server/EntityFireball.java
@@ -42,6 +42,7 @@ public abstract class EntityFireball extends Entity {
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
super(world);
this.shooter = entityliving;
+ this.projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
this.a(1.0F, 1.0F);
this.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.setPosition(this.locX, this.locY, this.locZ);
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
index 10c242c1..329aecd8 100644
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
@@ -25,6 +25,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
public EntityProjectile(World world, EntityLiving entityliving) {
super(world);
this.shooter = entityliving;
+ this.projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
this.a(0.25F, 0.25F);
this.setPositionRotation(entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight(), entityliving.locZ, entityliving.yaw, entityliving.pitch);
this.locX -= (double) (MathHelper.cos(this.yaw / 180.0F * 3.1415927F) * 0.16F);