summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemFishingRod.h
diff options
context:
space:
mode:
authorFeyo Korenhof <35343640+feyokorenhof@users.noreply.github.com>2021-11-29 13:53:58 +0100
committerGitHub <noreply@github.com>2021-11-29 13:53:58 +0100
commit1be14ebf7f38ab446907b4c111370b3a62bdc268 (patch)
tree18c8b88096469ae04fff1228230ee3b7f0152ecb /src/Items/ItemFishingRod.h
parentProtocol: modernise plugin message handling (#5325) (diff)
downloadcuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.tar
cuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.tar.gz
cuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.tar.bz2
cuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.tar.lz
cuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.tar.xz
cuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.tar.zst
cuberite-1be14ebf7f38ab446907b4c111370b3a62bdc268.zip
Diffstat (limited to 'src/Items/ItemFishingRod.h')
-rw-r--r--src/Items/ItemFishingRod.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h
index 183c9756c..909f892c3 100644
--- a/src/Items/ItemFishingRod.h
+++ b/src/Items/ItemFishingRod.h
@@ -287,8 +287,10 @@ public:
a_Player.GetStatistics().Custom[CustomStatistic::FishCaught]++;
}
+ auto Experience = Random.RandInt(1, 6);
+
// Check with plugins if this loot is acceptable:
- if (cRoot::Get()->GetPluginManager()->CallHookPlayerFishing(a_Player, Drops))
+ if (cRoot::Get()->GetPluginManager()->CallHookPlayerFishing(a_Player, Drops, Experience))
{
return;
}
@@ -298,10 +300,10 @@ public:
const float FISH_SPEED_MULT = 2.25f;
Vector3d FlyDirection = (a_Player.GetEyePosition() - FloaterPos).addedY(1.0f) * FISH_SPEED_MULT;
a_World.SpawnItemPickups(Drops, FloaterPos, FlyDirection);
- a_World.SpawnExperienceOrb(a_Player.GetPosition(), Random.RandInt(1, 6));
+ a_World.SpawnExperienceOrb(a_Player.GetPosition(), Experience);
a_Player.UseEquippedItem(1);
// Notify plugins
- cRoot::Get()->GetPluginManager()->CallHookPlayerFished(a_Player, Drops);
+ cRoot::Get()->GetPluginManager()->CallHookPlayerFished(a_Player, Drops, Experience);
}
} ;