Update CraftBukkit to 1.6.1
This commit is contained in:
committed by
Wesley Wolfe
parent
f887b76a25
commit
6c09066e22
@@ -8,7 +8,7 @@ import org.bukkit.event.entity.SheepDyeWoolEvent;
|
||||
public class ItemDye extends Item {
|
||||
|
||||
public static final String[] a = new String[] { "black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"};
|
||||
public static final String[] b = new String[] { "dyePowder_black", "dyePowder_red", "dyePowder_green", "dyePowder_brown", "dyePowder_blue", "dyePowder_purple", "dyePowder_cyan", "dyePowder_silver", "dyePowder_gray", "dyePowder_pink", "dyePowder_lime", "dyePowder_yellow", "dyePowder_lightBlue", "dyePowder_magenta", "dyePowder_orange", "dyePowder_white"};
|
||||
public static final String[] b = new String[] { "black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"};
|
||||
public static final int[] c = new int[] { 1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320};
|
||||
|
||||
public ItemDye(int i) {
|
||||
@@ -29,7 +29,7 @@ public class ItemDye extends Item {
|
||||
return false;
|
||||
} else {
|
||||
if (itemstack.getData() == 15) {
|
||||
if (a(itemstack, world, i, j, k, entityhuman)) {
|
||||
if (a(itemstack, world, i, j, k)) {
|
||||
if (!world.isStatic) {
|
||||
world.triggerEffect(2005, i, j, k, 0);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class ItemDye extends Item {
|
||||
int i1 = world.getTypeId(i, j, k);
|
||||
int j1 = world.getData(i, j, k);
|
||||
|
||||
if (i1 == Block.LOG.id && BlockLog.d(j1) == 3) {
|
||||
if (i1 == Block.LOG.id && BlockLog.f(j1) == 3) {
|
||||
if (l == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -67,6 +67,7 @@ public class ItemDye extends Item {
|
||||
|
||||
if (world.isEmpty(i, j, k)) {
|
||||
int k1 = Block.byId[Block.COCOA.id].getPlacedData(world, i, j, k, l, f, f1, f2, 0);
|
||||
|
||||
world.setTypeIdAndData(i, j, k, Block.COCOA.id, k1, 2);
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
--itemstack.count;
|
||||
@@ -149,20 +150,20 @@ public class ItemDye extends Item {
|
||||
int l1 = k;
|
||||
|
||||
for (int i2 = 0; i2 < i1 / 16; ++i2) {
|
||||
j1 += e.nextInt(3) - 1;
|
||||
k1 += (e.nextInt(3) - 1) * e.nextInt(3) / 2;
|
||||
l1 += e.nextInt(3) - 1;
|
||||
j1 += f.nextInt(3) - 1;
|
||||
k1 += (f.nextInt(3) - 1) * f.nextInt(3) / 2;
|
||||
l1 += f.nextInt(3) - 1;
|
||||
if (world.getTypeId(j1, k1 - 1, l1) != Block.GRASS.id || world.u(j1, k1, l1)) {
|
||||
continue label102;
|
||||
}
|
||||
}
|
||||
|
||||
if (world.getTypeId(j1, k1, l1) == 0) {
|
||||
if (e.nextInt(10) != 0) {
|
||||
if (f.nextInt(10) != 0) {
|
||||
if (Block.LONG_GRASS.f(world, j1, k1, l1)) {
|
||||
world.setTypeIdAndData(j1, k1, l1, Block.LONG_GRASS.id, 1, 3);
|
||||
}
|
||||
} else if (e.nextInt(3) != 0) {
|
||||
} else if (f.nextInt(3) != 0) {
|
||||
if (Block.YELLOW_FLOWER.f(world, j1, k1, l1)) {
|
||||
world.setTypeIdUpdate(j1, k1, l1, Block.YELLOW_FLOWER.id);
|
||||
}
|
||||
@@ -190,8 +191,8 @@ public class ItemDye extends Item {
|
||||
if (!world.isStatic) {
|
||||
if ((double) world.random.nextFloat() < 0.4D) {
|
||||
// CraftBukkit start - Validate
|
||||
Player player = (entityhuman instanceof EntityPlayer) ? (Player) entityhuman.getBukkitEntity() : null;
|
||||
((BlockMushroom) Block.byId[l]).grow(world, i, j, k, world.random, true, player, itemstack);
|
||||
Player player = (entityhuman instanceof EntityPlayer) ? (Player) entityhuman.getBukkitEntity() : null;
|
||||
((BlockMushroom) Block.byId[l]).grow(world, i, j, k, world.random, true, player, itemstack);
|
||||
}
|
||||
|
||||
//--itemstack.count; - called later if the bonemeal attempt was not cancelled by a plugin
|
||||
@@ -202,10 +203,10 @@ public class ItemDye extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(ItemStack itemstack, EntityLiving entityliving) {
|
||||
public boolean a(ItemStack itemstack, EntityHuman entityhuman, EntityLiving entityliving) {
|
||||
if (entityliving instanceof EntitySheep) {
|
||||
EntitySheep entitysheep = (EntitySheep) entityliving;
|
||||
int i = BlockCloth.g_(itemstack.getData());
|
||||
int i = BlockCloth.j_(itemstack.getData());
|
||||
|
||||
if (!entitysheep.isSheared() && entitysheep.getColor() != i) {
|
||||
// CraftBukkit start
|
||||
|
||||
Reference in New Issue
Block a user