Update CraftBukkit to Minecraft 1.7.2
This commit is contained in:
@@ -3,6 +3,7 @@ package net.minecraft.server;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityCow extends EntityAnimal {
|
||||
@@ -14,45 +15,45 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, Item.WHEAT.id, false));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, Items.WHEAT, false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
}
|
||||
|
||||
public boolean bf() {
|
||||
public boolean bk() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void az() {
|
||||
super.az();
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(10.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D);
|
||||
}
|
||||
|
||||
protected String r() {
|
||||
protected String t() {
|
||||
return "mob.cow.say";
|
||||
}
|
||||
|
||||
protected String aO() {
|
||||
protected String aT() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
protected String aP() {
|
||||
protected String aU() {
|
||||
return "mob.cow.hurt";
|
||||
}
|
||||
|
||||
protected void a(int i, int j, int k, int l) {
|
||||
protected void a(int i, int j, int k, Block block) {
|
||||
this.makeSound("mob.cow.step", 0.15F, 1.0F);
|
||||
}
|
||||
|
||||
protected float ba() {
|
||||
protected float bf() {
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
protected int getLootId() {
|
||||
return Item.LEATHER.id;
|
||||
protected Item getLoot() {
|
||||
return Items.LEATHER;
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
@@ -63,13 +64,13 @@ public class EntityCow extends EntityAnimal {
|
||||
int k;
|
||||
|
||||
if (j > 0) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(Item.LEATHER.id, j));
|
||||
loot.add(new org.bukkit.inventory.ItemStack(CraftMagicNumbers.getMaterial(Items.LEATHER), j));
|
||||
}
|
||||
|
||||
j = this.random.nextInt(3) + 1 + this.random.nextInt(1 + i);
|
||||
|
||||
if (j > 0) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(this.isBurning() ? Item.COOKED_BEEF.id : Item.RAW_BEEF.id, j));
|
||||
loot.add(new org.bukkit.inventory.ItemStack(this.isBurning() ? CraftMagicNumbers.getMaterial(Items.COOKED_BEEF) : CraftMagicNumbers.getMaterial(Items.RAW_BEEF), j));
|
||||
}
|
||||
|
||||
CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||
@@ -79,10 +80,10 @@ public class EntityCow extends EntityAnimal {
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.id == Item.BUCKET.id && !entityhuman.abilities.canInstantlyBuild) {
|
||||
if (itemstack != null && itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild) {
|
||||
// CraftBukkit start - Got milk?
|
||||
org.bukkit.Location loc = this.getBukkitEntity().getLocation();
|
||||
org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET);
|
||||
org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Items.MILK_BUCKET);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return false;
|
||||
@@ -90,8 +91,8 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
if (--itemstack.count <= 0) {
|
||||
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, CraftItemStack.asNMSCopy(event.getItemStack()));
|
||||
} else if (!entityhuman.inventory.pickup(new ItemStack(Item.MILK_BUCKET))) {
|
||||
entityhuman.drop(CraftItemStack.asNMSCopy(event.getItemStack()));
|
||||
} else if (!entityhuman.inventory.pickup(new ItemStack(Items.MILK_BUCKET))) {
|
||||
entityhuman.drop(CraftItemStack.asNMSCopy(event.getItemStack()), false);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user