fix bush loot pool
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-03 17:15:51 -04:00
parent 8c530823e7
commit fed342aa62
3 changed files with 4 additions and 3 deletions

View File

@ -19,7 +19,7 @@
"tickets" : [
{
"itemId" : "Stick",
"rarity" : 0.8,
"rarity" : 1.0,
"minQuantity" : 1,
"maxQuantity" : 1
}

View File

@ -1429,6 +1429,7 @@ Break out interaction ray casting into dedicated collision engine object
Bush hitbox
Harvesting interaction happens on server
Fix PoseActor position/rotation caching bug
Bush drops sticks

View File

@ -128,8 +128,8 @@ public class ServerLifeTree implements BehaviorTree {
Vector3d position = new Vector3d(EntityUtils.getPosition(parent));
Realm realm = Globals.realmManager.getEntityRealm(parent);
for(LootTicket ticket : this.healthSystem.getLootPool().getTickets()){
if(random.nextDouble() < ticket.getRarity()){
int numToGen = random.nextInt(ticket.getMinQuantity(), ticket.getMaxQuantity());
if(random.nextDouble() <= ticket.getRarity()){
int numToGen = random.nextInt(ticket.getMinQuantity(), ticket.getMaxQuantity()+1);
for(int i = 0; i < numToGen; i++){
ItemUtils.serverSpawnBasicItem(realm, position, ticket.getItemId());
}