Skip to content

Instantly share code, notes, and snippets.

View Twister915's full-sized avatar

Joey Twister915

  • Northern Virginia
View GitHub Profile
@Twister915
Twister915 / TimeUtils.java
Created July 3, 2014 04:45
Here, have some cool code. Converts timespecs in the format of (3s4m24d4w) into seconds. Useful for punishment plugins!
package net.cogzmc.core.util;
import java.util.HashMap;
import java.util.Map;
public final class TimeUtils {
private static final Map<Character, Double> TIMEMAP = new HashMap<>();
static {
TIMEMAP.put('s', 1D);
@Twister915
Twister915 / gist:daf86ec20ac8b7c3d5da
Last active August 29, 2015 14:03
Twister's Dev Chat | Bot Rules

Bot Rules

Hey guys, wanted to establish some guidelines so that this is no longer solely bots in the chat.

  • Bots may not send more messages than are directed to them. In the case of notifications, ie: twitter watching, github updates:
    • updates must not advertise a certain product, service, brand, or idea
    • updates must be less frequent than one per minute per topic
    • updates must not monitor more than 10 topics
  • Bots must have a unique prefix. Prefix "#" is reserved.
@Twister915
Twister915 / EnderBar.java
Created May 28, 2014 21:37
Ender Bar ProtocolLib example (irrelevant without code from this project, but it's still pretty cool)
package net.cogzmc.core.enderBar;
import com.comphenix.packetwrapper.WrapperPlayServerEntityDestroy;
import com.comphenix.packetwrapper.WrapperPlayServerEntityMetadata;
import com.comphenix.packetwrapper.WrapperPlayServerEntityTeleport;
import com.comphenix.packetwrapper.WrapperPlayServerSpawnEntityLiving;
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;