Adventure Backpack

Adventure Backpack

5M Downloads

Event issues

master801 opened this issue ยท 3 comments

commented

You might want to consider changing the way you handle your ItemStacks in the events.

The ItemStack fields should be final, since they should never be set to a value outside of the constructor.

https://github.com/Darkona/AdventureBackpack2/blob/master/src/main/java/com/darkona/adventurebackpack/events/EquipBackpackEvent.java#L14

https://github.com/Darkona/AdventureBackpack2/blob/master/src/main/java/com/darkona/adventurebackpack/events/UnequipBackpackEvent.java#L16

commented

Fixed, thank you.

commented

I didn't mean for you to make then private, but that works too I guess...

commented

I'll just add a getter, I personally like good encapsulation.
Besides, I'm not really sure if that event is going to be necessary anyway, I might remove it eventually.