Buggy code:
public class SampEventDispatcher implements SampCallbackHandler { private static SampEventDispatcher instance ; private SampObjectManagerImpl sampObjectStore ; private EventManagerRoot rootEventManager ; private boolean active = true ; private long lastProcessTimeMillis ; public SampEventDispatcher ( SampObjectManagerImpl store , EventManagerRoot manager ) { } public static SampEventDispatcher getInstance ( ) { } @ Override public void onProcessTick ( ) { } @ Override public int onGameModeExit ( ) { } @ Override public int onGameModeInit ( ) { } @ Override public boolean isActive ( ) { } public void setActive ( boolean active ) { } @ Override public void onAmxLoad ( int handle ) { } @ Override public void onAmxUnload ( int handle ) { } @ Override public int onPlayerConnect ( int playerId ) { } @ Override public int onPlayerDisconnect ( int playerId , int reason ) { } @ Override public int onPlayerSpawn ( int playerId ) { } @ Override public int onPlayerDeath ( int playerId , int killerId , int reason ) { } @ Override public int onVehicleSpawn ( int vehicleId ) { } @ Override public int onVehicleDeath ( int vehicleId , int killerId ) { } @ Override public int onPlayerText ( int playerId , String text ) { } @ Override public int onPlayerCommandText ( int playerId , String cmdtext ) { } @ Override public int onPlayerRequestClass ( int playerId , int classId ) { } @ Override public int onPlayerEnterVehicle ( int playerId , int vehicleId , int isPassenger ) { } @ Override public int onPlayerExitVehicle ( int playerId , int vehicleId ) { } @ Override public int onPlayerStateChange ( int playerId , int state , int oldState ) { } @ Override public int onPlayerEnterCheckpoint ( int playerId ) { } @ Override public int onPlayerLeaveCheckpoint ( int playerId ) { } @ Override public int onPlayerEnterRaceCheckpoint ( int playerId ) { } @ Override public int onPlayerLeaveRaceCheckpoint ( int playerId ) { } @ Override public int onRconCommand ( String cmd ) { } @ Override public int onPlayerRequestSpawn ( int playerId ) { } @ Override public int onObjectMoved ( int objectId ) { } @ Override public int onPlayerObjectMoved ( int playerId , int objectId ) { } @ Override public int onPlayerPickUpPickup ( int playerId , int pickupId ) { try { Player player = sampObjectStore . getPlayer ( playerId ) ; Pickup pickup = sampObjectStore . getPickup ( pickupId ) ; if ( pickup == null ) { List < PickupImpl > staticPickups = sampObjectStore . getStaticPickups ( ) ; if ( ( ( staticPickups . size ( ) ) - 1 ) >= pickupId ) { pickup = sampObjectStore . getStaticPickups ( ) . get ( pickupId ) ; if ( pickup == null ) return 0 ; } else return 0 ; } PlayerPickupEvent event = new PlayerPickupEvent ( player , pickup ) ; if ( pickup instanceof PickupImpl ) { PickupImpl pickupImpl = ( ( PickupImpl ) ( pickup ) ) ; <START_BUG> EventHandler < PlayerPickupEvent > handler = pickupImpl . getPickupCallback ( ) ; <END_BUG> if ( handler != null ) handler . handleEvent ( event ) ; } rootEventManager . dispatchEvent ( event , pickup , player ) ; return 1 ; } catch ( Throwable e ) { e . printStackTrace ( ) ; return 0 ; } } @ Override public int onVehicleMod ( int playerId , int vehicleId , int componentId ) { } @ Override public int onEnterExitModShop ( int playerId , int enterexit , int interiorId ) { } @ Override public int onVehiclePaintjob ( int playerId , int vehicleId , int paintjobId ) { } @ Override public int onVehicleRespray ( int playerId , int vehicleId , int color1 , int color2 ) { } @ Override public int onVehicleDamageStatusUpdate ( int vehicleId , int playerId ) { } @ Override public int onUnoccupiedVehicleUpdate ( int vehicleId , int playerId , int passengerSeat , float newX , float newY , float newZ , float vel_x , float vel_y , float vel_z ) { } @ Override public int onPlayerSelectedMenuRow ( int playerId , int row ) { } @ Override public int onPlayerExitedMenu ( int playerId ) { } @ Override public int onPlayerInteriorChange ( int playerId , int interiorId , int oldInteriorId ) { } @ Override public int onPlayerKeyStateChange ( int playerId , int keys , int oldKeys ) { } @ Override public int onRconLoginAttempt ( String ip , String password , int isSuccess ) { } @ Override public int onPlayerUpdate ( int playerId ) { } @ Override public int onPlayerStreamIn ( int playerId , int forPlayerId ) { } @ Override public int onPlayerStreamOut ( int playerId , int forPlayerId ) { } @ Override public int onVehicleStreamIn ( int vehicleId , int forPlayerId ) { } @ Override public int onVehicleStreamOut ( int vehicleId , int forPlayerId ) { } @ Override public int onDialogResponse ( int playerId , int dialogId , int response , int listitem , String inputtext ) { } @ Override public int onPlayerTakeDamage ( int playerId , int issuerId , float amount , int weaponId , int bodypart ) { } @ Override public int onPlayerGiveDamage ( int playerId , int damagedId , float amount , int weaponId , int bodypart ) { } @ Override public int onPlayerClickMap ( int playerId , float x , float y , float z ) { } @ Override public int onPlayerClickTextDraw ( int playerid , int clickedid ) { } @ Override public int onPlayerClickPlayerTextDraw ( int playerid , int playertextid ) { } @ Override public int onPlayerClickPlayer ( int playerId , int clickedPlayerId , int source ) { } @ Override public int onPlayerEditObject ( int playerid , int playerobject , int objectid , int response , float fX , float fY , float fZ , float fRotX , float fRotY , float fRotZ ) { }

Fix:
EventHandler < PlayerPickupEvent > handler = pickupImpl . getPickupHandler ( ) ;