Using global operations.
This commit is contained in:
@ -18,7 +18,7 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
public class OnBlockBreakEventHandler {
|
||||
@SubscribeEvent
|
||||
public void OnBlockBreakEvent(BlockEvent.BreakEvent event) {
|
||||
float xpToDrop = (Config.Server.blockBreakDefaultNoXp.get()) ? 0 : event.getExpToDrop();
|
||||
float xpToDrop = event.getExpToDrop();
|
||||
List<OperationItem> operations = new ArrayList<>();
|
||||
|
||||
// Collect operations on relevant block_id
|
||||
@ -45,6 +45,9 @@ public class OnBlockBreakEventHandler {
|
||||
// Sort operations based on priority
|
||||
operations.sort(Comparator.comparingInt(OperationItem::getPriority));
|
||||
|
||||
// Add global operations before all others
|
||||
operations.addAll(0, Config.Server.blockBreakGlobalOperationItems);
|
||||
|
||||
// Apply operations to xp drops
|
||||
for (OperationItem operation : operations) {
|
||||
// Calculate operation value
|
||||
|
Reference in New Issue
Block a user