summaryrefslogtreecommitdiffstats
path: root/src/Items
diff options
context:
space:
mode:
authormathiascode <mathiascode@users.noreply.github.com>2017-02-15 06:05:24 +0100
committerMattes D <github@xoft.cz>2017-02-15 06:05:24 +0100
commitdae2adde6563bec4b614230992cae6b1ca965b4f (patch)
tree34149ac0340cc394019eb430247d03950b485555 /src/Items
parentAdded some blocks and items (#3503) (diff)
downloadcuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.tar
cuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.tar.gz
cuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.tar.bz2
cuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.tar.lz
cuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.tar.xz
cuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.tar.zst
cuberite-dae2adde6563bec4b614230992cae6b1ca965b4f.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemBow.h2
-rw-r--r--src/Items/ItemChest.h14
-rw-r--r--src/Items/ItemDye.h1
-rw-r--r--src/Items/ItemHandler.cpp23
-rw-r--r--src/Items/ItemHoe.h2
-rw-r--r--src/Items/ItemLighter.h4
-rw-r--r--src/Items/ItemSlab.h7
-rw-r--r--src/Items/ItemThrowable.h2
8 files changed, 5 insertions, 50 deletions
diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h
index fc0ee8434..a2f646efc 100644
--- a/src/Items/ItemBow.h
+++ b/src/Items/ItemBow.h
@@ -81,7 +81,7 @@ public:
return;
}
a_Player->GetWorld()->BroadcastSoundEffect(
- "random.bow",
+ "entity.arrow.shoot",
a_Player->GetPosX(),
a_Player->GetPosY(),
a_Player->GetPosZ(),
diff --git a/src/Items/ItemChest.h b/src/Items/ItemChest.h
index 786ed1067..a714e5c96 100644
--- a/src/Items/ItemChest.h
+++ b/src/Items/ItemChest.h
@@ -159,20 +159,6 @@ public:
a_World.FastSetBlock(a_BlockX + CrossCoords[NeighborIdx].x, a_BlockY, a_BlockZ + CrossCoords[NeighborIdx].z, ChestBlockType, Meta);
}
- // Play the placement sound:
- AString PlaceSound = cBlockInfo::GetPlaceSound(ChestBlockType);
- float Volume = 1.0f, Pitch = 0.8f;
- if (PlaceSound == "dig.metal")
- {
- Pitch = 1.2f;
- PlaceSound = "dig.stone";
- }
- else if (PlaceSound == "random.anvil_land")
- {
- Volume = 0.65f;
- }
- a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
-
// Remove the "placed" item:
if (a_Player.IsGameModeSurvival())
{
diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h
index c2635bcb6..c776d5244 100644
--- a/src/Items/ItemDye.h
+++ b/src/Items/ItemDye.h
@@ -63,7 +63,6 @@ public:
// Place the cocoa pod:
if (a_Player->PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_COCOA_POD, BlockMeta))
{
- a_World->BroadcastSoundEffect("dig.stone", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f);
if (a_Player->IsGameModeSurvival())
{
a_Player->GetInventory().RemoveOneEquippedItem();
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index b3ad73b25..d05364e95 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -416,29 +416,6 @@ bool cItemHandler::OnPlayerPlace(
return false;
}
- // Play the placement sound for the main block:
- for (const auto & blk: blocks)
- {
- // Find the main block by comparing the coords:
- if ((blk.GetX() != a_BlockX) || (blk.GetY() != a_BlockY) || (blk.GetZ() != a_BlockZ))
- {
- continue;
- }
- AString PlaceSound = cBlockInfo::GetPlaceSound(blk.m_BlockType);
- float Volume = 1.0f, Pitch = 0.8f;
- if (PlaceSound == "dig.metal")
- {
- Pitch = 1.2f;
- PlaceSound = "dig.stone";
- }
- else if (PlaceSound == "random.anvil_land")
- {
- Volume = 0.65f;
- }
- a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
- break;
- } // for blk - blocks[]
-
// Remove the "placed" item:
if (a_Player.IsGameModeSurvival())
{
diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h
index 62581e943..9a9a2cc64 100644
--- a/src/Items/ItemHoe.h
+++ b/src/Items/ItemHoe.h
@@ -58,7 +58,7 @@ public:
}
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, NewBlock, 0);
- a_World->BroadcastSoundEffect("dig.gravel", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f);
+ a_World->BroadcastSoundEffect("item.hoe.till", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f);
a_Player->UseEquippedItem();
return true;
}
diff --git a/src/Items/ItemLighter.h b/src/Items/ItemLighter.h
index eda7ed64c..72e358297 100644
--- a/src/Items/ItemLighter.h
+++ b/src/Items/ItemLighter.h
@@ -57,7 +57,7 @@ public:
case E_BLOCK_TNT:
{
// Activate the TNT:
- a_World->BroadcastSoundEffect("game.tnt.primed", static_cast<double>(a_BlockX), static_cast<double>(a_BlockY), static_cast<double>(a_BlockZ), 1.0f, 1.0f);
+ a_World->BroadcastSoundEffect("entity.tnt.primed", static_cast<double>(a_BlockX), static_cast<double>(a_BlockY), static_cast<double>(a_BlockZ), 1.0f, 1.0f);
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
a_World->SpawnPrimedTNT(a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5); // 80 ticks to boom
break;
@@ -73,7 +73,7 @@ public:
if (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_AIR)
{
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FIRE, 0);
- a_World->BroadcastSoundEffect("fire.ignite", static_cast<double>(a_BlockX), static_cast<double>(a_BlockY), static_cast<double>(a_BlockZ), 1.0F, 1.04F);
+ a_World->BroadcastSoundEffect("item.flintandsteel.use", static_cast<double>(a_BlockX), static_cast<double>(a_BlockY), static_cast<double>(a_BlockZ), 1.0F, 1.04F);
break;
}
}
diff --git a/src/Items/ItemSlab.h b/src/Items/ItemSlab.h
index e51c6675b..7741f5f30 100644
--- a/src/Items/ItemSlab.h
+++ b/src/Items/ItemSlab.h
@@ -39,10 +39,6 @@ public:
int a_CursorX, int a_CursorY, int a_CursorZ
) override
{
- // Prepare sound effect
- AString PlaceSound = cBlockInfo::GetPlaceSound(static_cast<BLOCKTYPE>(m_ItemType));
- float Volume = 1.0f, Pitch = 0.8f;
-
// Special slab handling - placing a slab onto another slab produces a dblslab instead:
BLOCKTYPE ClickedBlockType;
NIBBLETYPE ClickedBlockMeta;
@@ -59,7 +55,6 @@ public:
((ClickedBlockMeta & 0x08) == 0)
)
{
- a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, m_DoubleSlabBlockType, ClickedBlockMeta & 0x07))
{
return false;
@@ -77,7 +72,6 @@ public:
((ClickedBlockMeta & 0x08) != 0)
)
{
- a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, m_DoubleSlabBlockType, ClickedBlockMeta & 0x07))
{
return false;
@@ -101,7 +95,6 @@ public:
((PlaceBlockMeta & 0x07) == a_EquippedItem.m_ItemDamage) // Placing the same slab sub-kind (and existing slab is single)
)
{
- a_World.BroadcastSoundEffect(PlaceSound, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, Volume, Pitch);
if (!a_Player.PlaceBlock(a_BlockX, a_BlockY, a_BlockZ, m_DoubleSlabBlockType, PlaceBlockMeta & 0x07))
{
return false;
diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h
index d5a109887..eaeb118f0 100644
--- a/src/Items/ItemThrowable.h
+++ b/src/Items/ItemThrowable.h
@@ -37,7 +37,7 @@ public:
// Play sound
cFastRandom Random;
- a_World->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY() - a_Player->GetHeight(), a_Player->GetPosZ(), 0.5f, 0.4f / (Random.NextFloat(1.0f) * 0.4f + 0.8f));
+ a_World->BroadcastSoundEffect("entity.arrow.shoot", a_Player->GetPosX(), a_Player->GetPosY() - a_Player->GetHeight(), a_Player->GetPosZ(), 0.5f, 0.4f / (Random.NextFloat(1.0f) * 0.4f + 0.8f));
if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, &a_Player->GetEquippedItem(), &Speed) == cEntity::INVALID_ID)
{