Pixelmon Sidemod API - Feature tracker

[8.2.0] PokeLootClaimedEvent implemented in vcs

Ticket description:
An update to this event.

Code: Select all                        if (Pixelmon.EVENT_BUS.post(new
PokeLootClaimedEvent((EntityPlayerMP)player, tile))) {
                            return true;
                        }

                        if (tile.shouldBreakBlock()) {
                            if (MinecraftForge.EVENT_BUS.post(new
BreakEvent(world, pos, state, player))) {
                                return true;
                            }

                            world.setBlockToAir(pos);
                        }

                        if (tile.isCustomDrop()) {
                            this.drops = tile.getCustomDrops();
                        } else {
                            this.drops = this.getRandomDrops(visibility);
                        }


As shown above, the code works, but the event doesn't include the drops
from the poke chest, which would be something essential for the event.

Possible fix:

Code: Select allif (tile.isCustomDrop()) {
                            this.drops = tile.getCustomDrops();
                        } else {
                            this.drops = this.getRandomDrops(visibility);
                        }

if (Pixelmon.EVENT_BUS.post(new
PokeLootClaimedEvent((EntityPlayerMP)player, tile, this.drops))) {
                            return true;
                        }         

Comments

#22248 Posted by Waterdude » 27 Apr 2021 10:01

PokeLootClaimedEvent is now PokeLootEvent, with subclasses Claim, GetDrops, and Drop.

Ticket details

  • Ticket ID: 15600
  • Project: Pixelmon Sidemod API
  • Status: Implemented in VCS
  • Component: Forge
  • Project version: 8.x.x
  • Priority: Normal
  • Assigned to: Waterdude
  • Reported by: TheKnightKarim (Send PM)
  • Reporter's tickets: (List all tickets)
  • Reported on: 18 Mar 2021 14:22
  • Ticket last visited by: Waterdude on 28 Apr 2021 22:49
JOIN THE TEAM