13
0
geforkt von Mirrors/Paper

SPIGOT-4188: Fish not dispensing from buckets

Dieser Commit ist enthalten in:
md_5 2018-07-30 09:43:46 +10:00
Ursprung b94fd7c7e4
Commit 0b274effbb

Datei anzeigen

@ -158,7 +158,7 @@
return itemstack; return itemstack;
} }
@@ -175,9 +271,51 @@ @@ -175,9 +271,52 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
@ -196,7 +196,7 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
if (itembucket.a((EntityHuman) null, world, blockposition, (MovingObjectPosition) null)) { if (itembucket.a((EntityHuman) null, world, blockposition, (MovingObjectPosition) null)) {
- itembucket.a(world, itemstack, blockposition); itembucket.a(world, itemstack, blockposition);
- return new ItemStack(Items.BUCKET); - return new ItemStack(Items.BUCKET);
+ // CraftBukkit start - Handle stacked buckets + // CraftBukkit start - Handle stacked buckets
+ Item item = Items.BUCKET; + Item item = Items.BUCKET;
@ -212,7 +212,7 @@
} else { } else {
return this.a.dispense(isourceblock, itemstack); return this.a.dispense(isourceblock, itemstack);
} }
@@ -207,6 +345,30 @@ @@ -207,6 +346,30 @@
} else { } else {
Item item = fluidtype.b(); Item item = fluidtype.b();
@ -243,7 +243,7 @@
itemstack.subtract(1); itemstack.subtract(1);
if (itemstack.isEmpty()) { if (itemstack.isEmpty()) {
return new ItemStack(item); return new ItemStack(item);
@@ -227,11 +389,39 @@ @@ -227,11 +390,39 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
@ -284,7 +284,7 @@
} else { } else {
Block block = world.getType(blockposition).getBlock(); Block block = world.getType(blockposition).getBlock();
@@ -255,12 +445,55 @@ @@ -255,12 +446,55 @@
this.a = true; this.a = true;
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -340,7 +340,7 @@
return itemstack; return itemstack;
} }
@@ -269,11 +502,40 @@ @@ -269,11 +503,40 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
World world = isourceblock.getWorld(); World world = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
@ -383,7 +383,7 @@
return itemstack; return itemstack;
} }
})); }));
@@ -295,6 +557,30 @@ @@ -295,6 +558,30 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
@ -414,7 +414,7 @@
this.a = true; this.a = true;
if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) { if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) {
world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(enumdirection.opposite().get2DRotationValue() * 4)), 3); world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(enumdirection.opposite().get2DRotationValue() * 4)), 3);
@@ -318,6 +604,30 @@ @@ -318,6 +605,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN; BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
@ -445,7 +445,7 @@
this.a = true; this.a = true;
if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) { if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) {
if (!world.isClientSide) { if (!world.isClientSide) {
@@ -379,6 +689,51 @@ @@ -379,6 +690,51 @@
} }
d(); d();
@ -497,7 +497,7 @@
} }
} }
} }
@@ -387,7 +742,7 @@ @@ -387,7 +743,7 @@
LocaleLanguage localelanguage = LocaleLanguage.a(); LocaleLanguage localelanguage = LocaleLanguage.a();
registrymaterials.iterator().forEachRemaining((object) -> { registrymaterials.iterator().forEachRemaining((object) -> {
@ -506,7 +506,7 @@
if (!localelanguage.b(s)) { if (!localelanguage.b(s)) {
DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s); DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s);
@@ -481,6 +836,30 @@ @@ -481,6 +837,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP; EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
@ -537,7 +537,7 @@
this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS; this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS;
if (this.a) { if (this.a) {
itemstack.subtract(1); itemstack.subtract(1);
@@ -534,12 +913,40 @@ @@ -534,12 +914,40 @@
d3 = 0.0D; d3 = 0.0D;
} }