3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

#716: Fix barrel open API playing sound twice

Dieser Commit ist enthalten in:
jameslfc19 2020-08-27 11:16:27 +10:00 committet von md_5
Ursprung 74b6982b03
Commit 8408de02d2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: E8E901AC7C617C11

Datei anzeigen

@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.server.BlockBarrel;
import net.minecraft.server.IBlockData; import net.minecraft.server.IBlockData;
import net.minecraft.server.SoundEffects; import net.minecraft.server.SoundEffects;
import net.minecraft.server.TileEntityBarrel; import net.minecraft.server.TileEntityBarrel;
@ -38,8 +39,12 @@ public class CraftBarrel extends CraftLootable<TileEntityBarrel> implements Barr
requirePlaced(); requirePlaced();
if (!getTileEntity().opened) { if (!getTileEntity().opened) {
IBlockData blockData = getTileEntity().getBlock(); IBlockData blockData = getTileEntity().getBlock();
getTileEntity().setOpenFlag(blockData, true); boolean open = blockData.get(BlockBarrel.b);
getTileEntity().playOpenSound(blockData, SoundEffects.BLOCK_BARREL_OPEN);
if (!open) {
getTileEntity().setOpenFlag(blockData, true);
getTileEntity().playOpenSound(blockData, SoundEffects.BLOCK_BARREL_OPEN);
}
} }
getTileEntity().opened = true; getTileEntity().opened = true;
} }