Skip to content

Instantly share code, notes, and snippets.

View aikar's full-sized avatar
:atom:
Powered by Steak

Daniel Ennis aikar

:atom:
Powered by Steak
View GitHub Profile
@aikar
aikar / Listener.java
Created March 28, 2019 05:11
Example of using PlayerDeathEvent#getItemsToKeep
@EventHandler(ignoreCancelled = true)
public void onPlayerDeath(PlayerDeathEvent event) {
for (Iterator<ItemStack> iterator = event.getDrops().iterator(); iterator.hasNext(); ) {
ItemStack drop = iterator.next();
List<String> lore = drop.getLore();
if (lore != null && !lore.isEmpty()) {
if (lore.get(0).contains("(SOULBOUND)")) {
iterator.remove();
event.getItemsToKeep().add(drop);
package net.minecraft.server;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Iterator;
package co.aikar.fairnaturalspawns;
import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
commit d2742ea527a35a1969de2613764dfcff7738f210
Author: Aikar <aikar@aikar.co>
Date: Mon Mar 18 01:37:42 2019 -0400
Update Lombok and add delombok to javadocs
diff --git a/Empire/pom.xml b/Empire/pom.xml
index 22e65e883..e0c2ad827 100644
--- a/Empire/pom.xml
+++ b/Empire/pom.xml
/*
* Copyright (c) 2016. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.systems.packages;
import co.aikar.idb.DbRow;
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.4.0</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
<!--
~ Copyright (c) 2016. Starlis LLC / dba Empire Minecraft
~
~ This source code is proprietary software and must not be redistributed without Starlis LLC's approval
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
// Paper start
java.util.List<ItemStack> providedItems = new java.util.ArrayList<>();
co.aikar.util.Counter<ItemStack> matchedProvided = new co.aikar.util.Counter<>();
co.aikar.util.Counter<RecipeItemStack> matchedIngredients = new co.aikar.util.Counter<>();
// Paper end
for (int j = 0; j < iinventory.n(); ++j) {
for (int k = 0; k < iinventory.U_(); ++k) {
ItemStack itemstack = iinventory.getItem(k + j * iinventory.U_());
if (!itemstack.isEmpty()) {
diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java
index a7f1f44d..7b0325d2 100644
--- a/src/main/java/co/aikar/timings/TimingIdentifier.java
+++ b/src/main/java/co/aikar/timings/TimingIdentifier.java
@@ -24,12 +24,13 @@
package co.aikar.timings;
import co.aikar.util.LoadingMap;
-import co.aikar.util.MRUMapCache;
package co.aikar.someplugin;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;