mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-23 15:00:30 +01:00
#716: Fix barrel open API playing sound twice
This commit is contained in:
parent
74b6982b03
commit
8408de02d2
1 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.server.BlockBarrel;
|
||||
import net.minecraft.server.IBlockData;
|
||||
import net.minecraft.server.SoundEffects;
|
||||
import net.minecraft.server.TileEntityBarrel;
|
||||
|
@ -38,9 +39,13 @@ public class CraftBarrel extends CraftLootable<TileEntityBarrel> implements Barr
|
|||
requirePlaced();
|
||||
if (!getTileEntity().opened) {
|
||||
IBlockData blockData = getTileEntity().getBlock();
|
||||
boolean open = blockData.get(BlockBarrel.b);
|
||||
|
||||
if (!open) {
|
||||
getTileEntity().setOpenFlag(blockData, true);
|
||||
getTileEntity().playOpenSound(blockData, SoundEffects.BLOCK_BARREL_OPEN);
|
||||
}
|
||||
}
|
||||
getTileEntity().opened = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue