Skip to content

Instantly share code, notes, and snippets.

View gravityfox's full-sized avatar
🦊
Sleepy Foxchee

Mike Liu gravityfox

🦊
Sleepy Foxchee
View GitHub Profile
@gravityfox
gravityfox / SimpleHandler.java
Created December 1, 2015 10:26
Just... what...
@Override
public Text getDetails(String arguments) {
TextBuilder builder = super.getDetails(arguments).builder();
builder.append(Texts.of("\n"));
builder.append(Texts.of(TextColors.GREEN,
TextActions.suggestCommand("/foxguard modify handler " + this.name + " group members add "),
TextActions.showText(Texts.of("Click to Add a Player(s) to Members")),
"Members: "));
try {
this.lock.readLock().lock();
@gravityfox
gravityfox / FoxGuardMain.java
Created December 1, 2015 10:34
For Gabizou
public static ReadWriteLock getNewLock() {
if (FGConfigManager.getInstance().threadSafe()) {
return new ReentrantReadWriteLock();
} else {
return new ReadWriteLock() {
private final Lock lock = new Lock() {
@Override
public void lock() {
@gravityfox
gravityfox / AdvCmdParse.java
Created January 1, 2016 09:53
One command parser to rule them all.
public ParseResult parse2() throws CommandException {
ParseResult parseResult = new ParseResult();
boolean inQuote = false;
// Regex Pattern for identifying arguments and flags. It respects quotation marks and escape characters.
Pattern pattern = Pattern.compile(regex);
// Check for unclosed quotes
{
String toStrip = arguments;
while (true) {
@gravityfox
gravityfox / toContainer
Created January 6, 2016 07:29
The first entry is broken. The second one is working.
[23:28:05] [Server thread/INFO] [foxcore]: MemoryDataContainer{map={ContentVersion=1, ItemType=minecraft:golden_axe, Count=1, UnsafeDamage=0, UnsafeData=MemoryDataView{path=UnsafeData, map={ench=[], SpongeData=MemoryDataView{path=UnsafeData.SpongeData, map={CustomManipulators=[MemoryDataContainer{map={DataClass=net.foxdenstudio.sponge.foxcore.plugin.wand.data.WandData, ManipulatorData=MemoryDataView{path=ManipulatorData, map={wandtype=POSITION}}}}]}}, display=MemoryDataView{path=UnsafeData.display, map={Lore=[Position Wand]}}}}, Data=[MemoryDataContainer{map={DataClass=org.spongepowered.common.data.manipulator.mutable.item.SpongeEnchantmentData, ManipulatorData=MemoryDataView{path=ManipulatorData, map={ContentVersion=1, ItemEnchantments=[]}}}}]}}
[23:28:19] [Server thread/INFO] [foxcore]: MemoryDataContainer{map={ContentVersion=1, ItemType=minecraft:golden_axe, Count=1, UnsafeDamage=0, UnsafeData=MemoryDataView{path=UnsafeData, map={ench=[], SpongeData=MemoryDataView{path=UnsafeData.SpongeData, map={CustomMan
@gravityfox
gravityfox / Itemlog
Created January 10, 2016 21:23
First one works. Second is broken
[13:22:23] [Server thread/INFO] [STDOUT]: [net.foxdenstudio.sponge.foxcore.plugin.listener.WandListener:handle:54]: MemoryDataContainer{map={ContentVersion=1, ItemType=minecraft:golden_axe, Count=1, UnsafeDamage=0, UnsafeData=MemoryDataView{path=UnsafeData, map={ench=[], display=MemoryDataView{path=UnsafeData.display, map={Lore=[Position Wand]}}}}, Data=[MemoryDataContainer{map={DataClass=org.spongepowered.common.data.manipulator.mutable.item.SpongeEnchantmentData, ManipulatorData=MemoryDataView{path=ManipulatorData, map={ContentVersion=1, ItemEnchantments=[]}}}}, MemoryDataContainer{map={DataClass=net.foxdenstudio.sponge.foxcore.plugin.wand.data.WandData, ManipulatorData=MemoryDataView{path=ManipulatorData, map={ContentVersion=1, wandtype=POSITION}}}}]}}
[13:22:27] [Server thread/INFO] [STDOUT]: [net.foxdenstudio.sponge.foxcore.plugin.listener.WandListener:handle:54]: MemoryDataContainer{map={ContentVersion=1, ItemType=minecraft:golden_axe, Count=1, UnsafeDamage=0, UnsafeData=MemoryDataView{path=UnsafeData,
[23:28:05] [Server thread/INFO] [foxcore]:
MemoryDataContainer{
map={
ContentVersion=1,
ItemType=minecraft:golden_axe,
Count=1,
UnsafeDamage=0,
UnsafeData=MemoryDataView{
path=UnsafeData,
map={
<?xml version="1.0" encoding="UTF-8"?>
<!-- Sponge Log4j2 server config for dev-time. Based on the Forge log4j2.xml -->
<Configuration status="WARN" packages="com.mojang.util,net.minecraftforge.server.console">
<Appenders>
<TerminalConsole name="FmlConsole">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
</TerminalConsole>
<TerminalConsole name="Console">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
</TerminalConsole>
---- Minecraft Crash Report ----
WARNING: coremods are present:
LoadingPlugin (QUARK-BETA-28.jar)
EnderCorePlugin (ENDERCORE-1.9.4-0.4.0.26-ALPHA.jar)
SpongeCoremod (SPONGEFORGE-1.9.4-1968-5.0.0-BETA-1494.jar)
LoadingPlugin (RANDOMTHINGS-MC1.9.4-3.7.3.jar)
AppleCore (APPLECORE-MC1.9.4-1.3.4.jar)
FldLoadingPlugin (FASTLEAFDECAY-MC1.9.4-1.7.jar)
ShetiPhian-ASM (SHETIPHIANCORE-1.9.4-3.2.6.jar)
[11:47:21] [Server thread/TRACE] [Sponge/]: /***********************************************************************************************************************/
[11:47:21] [Server thread/TRACE] [Sponge/]: /* Exception trying to process over a phase! */
[11:47:21] [Server thread/TRACE] [Sponge/]: /***********************************************************************************************************************/
[11:47:21] [Server thread/TRACE] [Sponge/]: /* PhaseContext : */
[11:47:21] [Server thread/TRACE] [Sponge/]: /* - Name: Source */
[11:47:21] [Server thread/TRACE] [Sponge/]: /* Object: EntityPlayerMP['Inscrutable'/35996, l='block19', x=487.22, y=64.00, z=297.26] */
[11:47:21] [Server thread/TR

Keybase proof

I hereby claim:

  • I am gravityfox on github.
  • I am gravityfox (https://keybase.io/gravityfox) on keybase.
  • I have a public key whose fingerprint is 8FDE A976 3F22 DE67 D8CC 32C0 7FFB B26E 44D0 5366

To claim this, I am signing this object: