@@ -12,15 +12,16 @@
|
||||
public class BlockRedstoneOre extends Block {
|
||||
|
||||
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
|
||||
@@ -16,23 +21,44 @@
|
||||
}
|
||||
@@ -18,25 +23,46 @@
|
||||
|
||||
@Override
|
||||
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
|
||||
- interact(iblockdata, world, blockposition);
|
||||
+ interact(iblockdata, world, blockposition, entityhuman); // CraftBukkit - add entityhuman
|
||||
super.attack(iblockdata, world, blockposition, entityhuman);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, Entity entity) {
|
||||
- interact(world.getType(blockposition), world, blockposition);
|
||||
- super.stepOn(world, blockposition, entity);
|
||||
@@ -44,10 +45,11 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) {
|
||||
@Override
|
||||
public boolean interact(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
- interact(iblockdata, world, blockposition);
|
||||
+ interact(iblockdata, world, blockposition, entityhuman); // CraftBukkit - add entityhuman
|
||||
return super.interact(iblockdata, world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2);
|
||||
return super.interact(iblockdata, world, blockposition, entityhuman, enumhand, movingobjectpositionblock);
|
||||
}
|
||||
|
||||
- private static void interact(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
@@ -62,9 +64,9 @@
|
||||
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3);
|
||||
}
|
||||
|
||||
@@ -40,6 +66,11 @@
|
||||
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
@@ -45,6 +71,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callBlockFadeEvent(world, blockposition, iblockdata.set(BlockRedstoneOre.a, false)).isCancelled()) {
|
||||
@@ -74,29 +76,31 @@
|
||||
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3);
|
||||
}
|
||||
|
||||
@@ -59,12 +90,25 @@
|
||||
|
||||
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, float f, int i) {
|
||||
super.dropNaturally(iblockdata, world, blockposition, f, i);
|
||||
@@ -53,14 +84,27 @@
|
||||
@Override
|
||||
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.dropNaturally(iblockdata, world, blockposition, itemstack);
|
||||
+ /* CraftBukkit start - Delegated to getExpDrop
|
||||
if (this.getDropType(iblockdata, world, blockposition, i) != this) {
|
||||
int j = 1 + world.random.nextInt(5);
|
||||
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
||||
int i = 1 + world.random.nextInt(5);
|
||||
|
||||
this.dropExperience(world, blockposition, j);
|
||||
this.dropExperience(world, blockposition, i);
|
||||
}
|
||||
+ // */
|
||||
+
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, int enchantmentLevel) {
|
||||
+ if (this.getDropType(iblockdata, world, blockposition, enchantmentLevel) != this) {
|
||||
+ int j = 1 + world.random.nextInt(5);
|
||||
+ public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
+ if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
||||
+ int i = 1 + world.random.nextInt(5);
|
||||
+
|
||||
+ return j;
|
||||
+ return i;
|
||||
+ }
|
||||
+ return 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
private static void playEffect(World world, BlockPosition blockposition) {
|
||||
double d0 = 0.5625D;
|
||||
Random random = world.random;
|
||||
|
||||
Reference in New Issue
Block a user