3
0
This commit is contained in:
Prototik
2015-06-05 20:41:54 +07:00
parent 9c2057bf68
commit 7f699c1473
21 changed files with 398 additions and 42 deletions

View File

@ -1,11 +1,22 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityArrow.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityArrow.java
@@ -23,6 +23,13 @@
@@ -2,7 +2,9 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+
import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -23,6 +25,14 @@
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
+// CraftBukkit start
+import net.minecraft.entity.item.EntityItem;
+
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
+import org.bukkit.event.player.PlayerPickupItemEvent;
@ -14,7 +25,7 @@
public class EntityArrow extends Entity implements IProjectile
{
private int field_145791_d = -1;
@@ -30,14 +37,14 @@
@@ -30,14 +40,14 @@
private int field_145789_f = -1;
private Block field_145790_g;
private int inData;
@ -31,7 +42,7 @@
private static final String __OBFID = "CL_00001715";
public EntityArrow(World p_i1753_1_)
@@ -61,6 +68,7 @@
@@ -61,6 +71,7 @@
super(p_i1755_1_);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = p_i1755_2_;
@ -39,7 +50,7 @@
if (p_i1755_2_ instanceof EntityPlayer)
{
@@ -91,6 +99,7 @@
@@ -91,6 +102,7 @@
super(p_i1756_1_);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = p_i1756_2_;
@ -47,7 +58,7 @@
if (p_i1756_2_ instanceof EntityPlayer)
{
@@ -199,7 +208,7 @@
@@ -199,7 +211,7 @@
{
++this.ticksInGround;
@ -56,7 +67,7 @@
{
this.setDead();
}
@@ -246,7 +255,7 @@
@@ -246,7 +258,7 @@
if (movingobjectposition1 != null)
{
@ -65,7 +76,7 @@
if (d1 < d0 || d0 == 0.0D)
{
@@ -277,6 +286,8 @@
@@ -277,6 +289,8 @@
if (movingobjectposition != null)
{
@ -74,7 +85,7 @@
if (movingobjectposition.entityHit != null)
{
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
@@ -298,13 +309,23 @@
@@ -298,13 +312,23 @@
damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity);
}
@ -103,7 +114,7 @@
if (movingobjectposition.entityHit instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
@@ -487,6 +508,23 @@
@@ -487,6 +511,23 @@
{
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
{
@ -127,7 +138,7 @@
boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode;
if (this.canBePickedUp == 1 && !p_70100_1_.inventory.addItemStackToInventory(new ItemStack(Items.arrow, 1)))
@@ -553,4 +591,11 @@
@@ -553,4 +594,18 @@
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
return (b0 & 1) != 0;
}
@ -138,4 +149,11 @@
+ return inGround;
+ }
+ // CraftBukkit end
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -1,22 +1,24 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityEgg.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityEgg.java
@@ -6,6 +6,15 @@
@@ -6,6 +6,17 @@
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+// CraftBukkit start
+import net.minecraft.entity.player.EntityPlayerMP;
+
+import org.bukkit.entity.Ageable;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerEggThrowEvent;
+
+import net.minecraft.entity.Entity;
+// CraftBukkit end
+
public class EntityEgg extends EntityThrowable
{
private static final String __OBFID = "CL_00001724";
@@ -32,24 +41,43 @@
@@ -32,24 +43,43 @@
p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
}
@ -71,3 +73,15 @@
for (int j = 0; j < 8; ++j)
{
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
@@ -60,4 +90,11 @@
this.setDead();
}
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -1,14 +1,16 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityFireball.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityFireball.java
@@ -3,6 +3,7 @@
@@ -2,7 +2,9 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+
import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -15,6 +16,8 @@
@@ -15,6 +17,8 @@
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@ -17,7 +19,7 @@
public abstract class EntityFireball extends Entity
{
private int field_145795_e = -1;
@@ -28,6 +31,8 @@
@@ -28,6 +32,8 @@
public double accelerationX;
public double accelerationY;
public double accelerationZ;
@ -26,7 +28,7 @@
private static final String __OBFID = "CL_00001717";
public EntityFireball(World p_i1759_1_)
@@ -62,11 +67,19 @@
@@ -62,11 +68,19 @@
{
super(p_i1761_1_);
this.shootingEntity = p_i1761_2_;
@ -46,7 +48,7 @@
p_i1761_3_ += this.rand.nextGaussian() * 0.4D;
p_i1761_5_ += this.rand.nextGaussian() * 0.4D;
p_i1761_7_ += this.rand.nextGaussian() * 0.4D;
@@ -140,7 +153,7 @@
@@ -140,7 +154,7 @@
if (movingobjectposition1 != null)
{
@ -55,7 +57,7 @@
if (d1 < d0 || d0 == 0.0D)
{
@@ -159,6 +172,14 @@
@@ -159,6 +173,14 @@
if (movingobjectposition != null)
{
this.onImpact(movingobjectposition);
@ -70,7 +72,7 @@
}
this.posX += this.motionX;
@@ -227,6 +248,8 @@
@@ -227,6 +249,8 @@
p_70014_1_.setShort("zTile", (short)this.field_145794_g);
p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145796_h));
p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0));
@ -79,7 +81,7 @@
p_70014_1_.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
}
@@ -238,8 +261,17 @@
@@ -238,8 +262,17 @@
this.field_145796_h = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
this.inGround = p_70037_1_.getByte("inGround") == 1;
@ -98,7 +100,7 @@
NBTTagList nbttaglist = p_70037_1_.getTagList("direction", 6);
this.motionX = nbttaglist.func_150309_d(0);
this.motionY = nbttaglist.func_150309_d(1);
@@ -273,6 +305,13 @@
@@ -273,6 +306,13 @@
if (p_70097_1_.getEntity() != null)
{
@ -112,7 +114,7 @@
Vec3 vec3 = p_70097_1_.getEntity().getLookVec();
if (vec3 != null)
@@ -288,6 +327,7 @@
@@ -288,6 +328,7 @@
if (p_70097_1_.getEntity() instanceof EntityLivingBase)
{
this.shootingEntity = (EntityLivingBase)p_70097_1_.getEntity();
@ -120,3 +122,15 @@
}
return true;
@@ -315,4 +356,11 @@
{
return 15728880;
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -114,3 +114,15 @@
}
}
}
@@ -594,4 +645,11 @@
this.field_146042_b.fishEntity = null;
}
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -1,12 +1,26 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityPotion.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityPotion.java
@@ -14,9 +14,16 @@
@@ -2,8 +2,10 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+
import java.util.Iterator;
import java.util.List;
+
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@@ -14,9 +16,19 @@
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+
+// CraftBukkit start
+import java.util.HashMap;
+
+import net.minecraft.entity.player.EntityPlayerMP;
+
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.entity.LivingEntity;
+// CraftBukkit end
@ -18,7 +32,7 @@
private static final String __OBFID = "CL_00001727";
public EntityPotion(World p_i1788_1_)
@@ -88,14 +95,16 @@
@@ -88,14 +100,16 @@
{
List list = Items.potionitem.getEffects(this.potionDamage);
@ -37,7 +51,7 @@
while (iterator.hasNext())
{
@@ -111,6 +120,25 @@
@@ -111,6 +125,25 @@
d1 = 1.0D;
}
@ -63,7 +77,7 @@
Iterator iterator1 = list.iterator();
while (iterator1.hasNext())
@@ -118,9 +146,22 @@
@@ -118,9 +151,22 @@
PotionEffect potioneffect = (PotionEffect)iterator1.next();
int i = potioneffect.getPotionID();
@ -87,3 +101,15 @@
}
else
{
@@ -170,4 +216,11 @@
p_70014_1_.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound()));
}
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -42,3 +42,15 @@
}
}
@@ -85,4 +102,11 @@
{
return false;
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -0,0 +1,14 @@
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntitySnowball.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntitySnowball.java
@@ -49,4 +49,11 @@
this.setDead();
}
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}

View File

@ -36,3 +36,15 @@
this.setDead();
}
}
@@ -125,4 +136,11 @@
{
this.dataWatcher.updateObject(10, Byte.valueOf((byte)(p_82343_1_ ? 1 : 0)));
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
+ return true;
+ }
+ // Cauldron end
}