This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public enum TimeUnit | |
| { | |
| S("second", 1000, 's'), | |
| MIN("minute", 60000, 'm'), | |
| HOUR("hour", 3600000, 'h'), | |
| DAY("day", 86400000, 'd'), | |
| WEEK("week", 604800000, 'w') | |
| ; | |
| private final String name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static String test = "0,&f&fAura Spell,4,28[&2Random Spellpart{2:-10},&fRandom Spellpart{4:7,3:5}]|1,&2&2Ball Spell,3,36[&fRandom Spellpart{1:9,3:-7}]|0,&f&fAura Spell,4,61[&5Random Spellpart{0:2,1:2},&fRandom Spellpart{1:-6}]"; | |
| static Pattern nullSplitter = Pattern.compile("\0"); | |
| static Pattern spellsPattern = Pattern.compile("((?:[0-9]+),(?:.*?),(?:[0-9]+),(?:[0-9]+)(?:\\[(?:.*?)\\]))\\|?"); | |
| static Pattern spellPattern = Pattern.compile("([0-9]+),(.*?),([0-9]+),([0-9]+)(?:\\[(.*?)\\])"); | |
| static Pattern spellPartsPattern = Pattern.compile("((?:.*?)\\{(?:.*?)\\}),?"); | |
| static Pattern spellPartPattern = Pattern.compile("(.*?)\\{(.*?)\\}"); | |
| static Pattern modifiersPattern = Pattern.compile("([0-9]+:-?[0-9]+),?"); | |
| static Pattern modifierPattern = Pattern.compile("([0-9]+):(-?[0-9]+)"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.darkseraphim.settings; | |
| import com.google.common.collect.Sets; | |
| import org.bukkit.Color; | |
| import org.bukkit.entity.Player; | |
| import org.bukkit.inventory.ItemStack; | |
| import org.bukkit.metadata.FixedMetadataValue; | |
| import org.bukkit.util.NumberConversions; | |
| import org.bukkit.util.Vector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| public boolean damageEntity(DamageSource damagesource, float f) { | |
| boolean flag = super.damageEntity(damagesource, f); | |
| if(damagesource.isExplosion() && damagesource.getEntity() == CraftEventFactory.entityDamage) { | |
| return true; | |
| } | |
| return flag; | |
| } | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.darkseraphim.chat.filter; | |
| import org.apache.commons.lang.StringUtils; | |
| import java.util.regex.Pattern; | |
| /** | |
| * @author DarkSeraphim | |
| */ | |
| public class Regex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CachedConnection implements Connection | |
| { | |
| // Yay for delegation :3 | |
| // Just for the non Lombok people, it will automatically | |
| // create methods that delegate functionality to this object | |
| @Delegate(types = Connection.class) | |
| private final Connection connection; | |
| private final Map<String, PreparedStatement> cachedStatements; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.darkseraphim.worldlyplugins; | |
| import lombok.Delegate; | |
| import lombok.RequiredArgsConstructor; | |
| import org.bukkit.Bukkit; | |
| import org.bukkit.event.Event; | |
| import org.bukkit.event.HandlerList; | |
| import org.bukkit.plugin.*; | |
| import java.util.logging.Level; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.darkseraphim.dev | |
| import lombok.EqualsAndHashCode; | |
| import lombok.RequiredArgsConstructor; | |
| import org.apache.commons.lang.Validate; | |
| import java.util.AbstractSet; | |
| import java.util.Iterator; | |
| import java.util.Map; | |
| import java.util.Set; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * Do note: only Arrow and ThrownExpBottle work with this method. | |
| * The rest was just testing material. | |
| * | |
| **/ | |
| Team team; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class Callback<T> | |
| { | |
| public abstract void execute(T result); | |
| public final void call(Plugin plugin, T result) | |
| { | |
| if(Bukkit.isPrimaryThread()) | |
| { | |
| this.execute(result); | |
| return; |