Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:
Powered by Steak

Daniel Ennis aikar

:atom:
Powered by Steak
View GitHub Profile
View EmpireScoreboard.java
public class EmpireScoreboard {
static Scoreboard scoreboard;
public static void initialize() {
scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
}
public static Team getTeam(Player player) {
return Util.getMetadata(player, TempMetaKey.PLAYER_SCOREBOARD_TEAM);
}
View ItemUtil.java
package com.empireminecraft.util;
import com.empireminecraft.config.language.MiscLang;
import com.empireminecraft.features.items.FinalItems;
import com.empireminecraft.features.items.SoulboundItems;
import com.empireminecraft.features.items.UnbreakableItems;
import com.empireminecraft.features.shops.Items.Items;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
View LaborBench.java
public static final UsableCustomItem LABOR_BENCH =
new UsableCustomItem("LaborBench", Material.WORKBENCH) {
{
ItemUtil.buildLore(this).setName("&aLabor Bench")
.add("&32013 Labor Day Promo Item")
.empty()
.add("&3&l (Open Workbench without placing)")
.save();
}
View .gitconfig
[alias]
co = checkout
ci = commit
st = status
cl = clone
re = rebase
l = log
oldest-ancestor = !bash -c 'diff -u <(git rev-list --first-parent \"${1:-master}\") <(git r$
View AsyncDbQueue.java
package com.empireminecraft.systems.db;
import com.empireminecraft.util.Util;
import java.sql.SQLException;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
View CaselessHashMap.java
package com.empireminecraft.util.java;
import java.util.HashMap;
import java.util.Map;
public class CaselessHashMap<T> extends HashMap<String, T> {
public CaselessHashMap(int initialCapacity, float loadFactor) {
super(initialCapacity, loadFactor);
}
View ResidenceEntityListener.java
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onEntityDamage(EntityDamageEvent event) {
Util.log("EDE: " + event.getEntity() + " - " + event.getDamage() + ":f " + event.getFinalDamage());
for (EntityDamageEvent.DamageModifier damageModifier : EntityDamageEvent.DamageModifier.values()) {
Util.log("type: " + damageModifier.name());
Util.log("orig: " + event.getOriginalDamage(damageModifier));
Util.log("dmg: " + event.getDamage(damageModifier));
}
Util.log("====");
View gist:c74b2933b58dbf34a6ce
[22:20:33 INFO]: [Empire] EDE: CraftSkeleton - 12.0:f 0.0
[22:20:33 INFO]: [Empire] type: BASE
[22:20:33 INFO]: [Empire] orig: 12.0
[22:20:33 INFO]: [Empire] dmg: 12.0
[22:20:33 INFO]: [Empire] type: HARD_HAT
[22:20:33 INFO]: [Empire] orig: 0.0
[22:20:33 INFO]: [Empire] dmg: 0.0
[22:20:33 INFO]: [Empire] type: BLOCKING
[22:20:33 INFO]: [Empire] orig: 0.0
[22:20:33 INFO]: [Empire] dmg: 0.0
View gist:9001bc4d8982cc2ae1da
Applying: Allow Disabling of Command Logging
fatal: sha1 information is lacking or useless (src/main/java/net/minecraft/server/PlayerConnection.java).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0032 Allow Disabling of Command Logging
The copy of the patch that failed is found in:
/store/home/aikar/projects/emc/spigot/Spigot-Server/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
View -
diff --git a/Empire/src/main/java/com/empireminecraft/systems/residence/Residence.java b/Empire/src/main/java/com/empireminecraft/systems/residence/Residence.java
index 4ac4165..a36e70d 100644
--- a/Empire/src/main/java/com/empireminecraft/systems/residence/Residence.java
+++ b/Empire/src/main/java/com/empireminecraft/systems/residence/Residence.java
@@ -1824,6 +1824,13 @@ public class Residence {
ClaimedResidence area = rmanager.getByName(args[1]);
if (area != null) {
area.getPermissions().setOwner(args[2], true);
+ if (area.getAddress() > 0) {
+ Long userId = !area.isServerOwned() ? EmpireUser.getUserId(args[1]) : null;