summaryrefslogtreecommitdiffstats
path: root/nms-patches/DispenserRegistry.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/DispenserRegistry.patch')
-rw-r--r--nms-patches/DispenserRegistry.patch38
1 files changed, 19 insertions, 19 deletions
diff --git a/nms-patches/DispenserRegistry.patch b/nms-patches/DispenserRegistry.patch
index d3f267cc..310e6d55 100644
--- a/nms-patches/DispenserRegistry.patch
+++ b/nms-patches/DispenserRegistry.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/DispenserRegistry.java
+++ b/net/minecraft/server/DispenserRegistry.java
-@@ -7,6 +7,15 @@
+@@ -8,6 +8,15 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -16,7 +16,7 @@
public class DispenserRegistry {
public static final PrintStream a = System.out;
-@@ -69,7 +78,7 @@
+@@ -70,7 +79,7 @@
BlockDispenser.REGISTRY.a(Items.SPLASH_POTION, new IDispenseBehavior() {
public ItemStack a(ISourceBlock isourceblock, final ItemStack itemstack) {
return (new DispenseBehaviorProjectile() {
@@ -25,7 +25,7 @@
return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack());
}
-@@ -86,7 +95,7 @@
+@@ -87,7 +96,7 @@
BlockDispenser.REGISTRY.a(Items.LINGERING_POTION, new IDispenseBehavior() {
public ItemStack a(ISourceBlock isourceblock, final ItemStack itemstack) {
return (new DispenseBehaviorProjectile() {
@@ -34,7 +34,7 @@
return new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ(), itemstack1.cloneItemStack());
}
-@@ -106,14 +115,46 @@
+@@ -107,14 +116,46 @@
double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX();
double d1 = (double) ((float) (isourceblock.getBlockPosition().getY() + enumdirection.getAdjacentY()) + 0.2F);
double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ();
@@ -83,7 +83,7 @@
return itemstack;
}
});
-@@ -123,10 +164,39 @@
+@@ -124,10 +165,39 @@
double d0 = isourceblock.getX() + (double) enumdirection.getAdjacentX();
double d1 = (double) ((float) isourceblock.getBlockPosition().getY() + 0.2F);
double d2 = isourceblock.getZ() + (double) enumdirection.getAdjacentZ();
@@ -125,7 +125,7 @@
return itemstack;
}
-@@ -147,8 +217,38 @@
+@@ -148,8 +218,38 @@
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentY();
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentZ();
@@ -166,7 +166,7 @@
return itemstack;
}
-@@ -169,7 +269,53 @@
+@@ -170,7 +270,53 @@
ItemBucket itembucket = (ItemBucket) itemstack.getItem();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@@ -221,7 +221,7 @@
}
};
-@@ -196,6 +342,30 @@
+@@ -197,6 +343,30 @@
item = Items.LAVA_BUCKET;
}
@@ -252,7 +252,7 @@
world.setAir(blockposition);
itemstack.subtract(1);
if (itemstack.isEmpty()) {
-@@ -213,14 +383,42 @@
+@@ -214,14 +384,42 @@
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld();
@@ -285,12 +285,12 @@
if (world.isEmpty(blockposition)) {
- world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
-- if (itemstack.isDamaged(1, world.random)) {
+- if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) {
- itemstack.setCount(0);
+ // CraftBukkit start - Ignition by dispensing flint and steel
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()).isCancelled()) {
+ world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
-+ if (itemstack.isDamaged(1, world.random)) {
++ if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) {
+ itemstack.setCount(0);
+ }
}
@@ -298,7 +298,7 @@
} else if (world.getType(blockposition).getBlock() == Blocks.TNT) {
Blocks.TNT.postBreak(world, blockposition, Blocks.TNT.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf(true)));
world.setAir(blockposition);
-@@ -238,6 +436,32 @@
+@@ -239,6 +437,32 @@
World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@@ -331,7 +331,7 @@
if (ItemDye.a(itemstack, world, blockposition)) {
if (!world.isClientSide) {
world.triggerEffect(2005, blockposition, 0);
-@@ -245,6 +469,26 @@
+@@ -246,6 +470,26 @@
} else {
this.b = false;
}
@@ -358,7 +358,7 @@
return itemstack;
} else {
-@@ -256,11 +500,40 @@
+@@ -257,11 +501,40 @@
protected ItemStack b(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@@ -395,13 +395,13 @@
+ // CraftBukkit end
world.addEntity(entitytntprimed);
- world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gV, SoundCategory.BLOCKS, 1.0F, 1.0F);
+ world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.hW, SoundCategory.BLOCKS, 1.0F, 1.0F);
- itemstack.subtract(1);
+ // itemstack.subtract(1); // CraftBukkit - handled above
return itemstack;
}
});
-@@ -271,6 +544,30 @@
+@@ -272,6 +545,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
BlockSkull blockskull = Blocks.SKULL;
@@ -432,7 +432,7 @@
this.b = true;
if (world.isEmpty(blockposition) && blockskull.b(world, blockposition, itemstack)) {
if (!world.isClientSide) {
-@@ -319,6 +616,30 @@
+@@ -320,6 +617,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
BlockPumpkin blockpumpkin = (BlockPumpkin) Blocks.PUMPKIN;
@@ -463,7 +463,7 @@
this.b = true;
if (world.isEmpty(blockposition) && blockpumpkin.b(world, blockposition)) {
if (!world.isClientSide) {
-@@ -388,6 +709,30 @@
+@@ -403,6 +724,30 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
@@ -494,7 +494,7 @@
this.b = world.a(block, blockposition, false, EnumDirection.DOWN, (Entity) null);
if (this.b) {
EnumDirection enumdirection1 = world.isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
-@@ -456,12 +801,40 @@
+@@ -471,12 +816,40 @@
d3 = 0.0D;
}