Skip to content

Instantly share code, notes, and snippets.

View SocraticPhoenix's full-sized avatar

John-Ryan Dunn SocraticPhoenix

  • U.S.
View GitHub Profile
package com.gmail.socraticphoenix.testplugin;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.filter.cause.First;
import org.spongepowered.api.event.filter.type.Include;
import org.spongepowered.api.event.item.inventory.InteractItemEvent;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColor;
package io.github.socraticphoenix.inversey.generator;
import io.github.socraticphoenix.inversey.interfaces.ConsumerX;
import io.github.socraticphoenix.inversey.interfaces.DangerousConsumerX;
import io.github.socraticphoenix.inversey.interfaces.DangerousFunctionX;
import io.github.socraticphoenix.inversey.interfaces.FunctionX;
import io.github.socraticphoenix.jource.ast.annotation.JavaSourceAnnotation;
import io.github.socraticphoenix.jource.ast.block.JavaSourceIfBlock;
import io.github.socraticphoenix.jource.ast.definition.JavaSourceInterfaceDefinition;
import io.github.socraticphoenix.jource.ast.member.JavaSourceMethod;
@Listener
public void onLogin(ClientConnectionEvent.Join ev) {
Player player = ev.getTargetEntity();
if (!player.get(InventoryData.class).isPresent()) {
InventoryData data = player.getOrCreate(InventoryData.class).get();
player.offer(data);
Hotbar hotbar = player.getInventory().query(QueryOperationTypes.INVENTORY_TYPE.of(Hotbar.class));
hotbar.set(SlotIndex.of(0), ItemStack.builder().itemType(ItemTypes.WRITABLE_BOOK).itemData(ButtonData.of(printMessage)).add(Keys.DISPLAY_NAME, Text.of("Quest Book")).build());
package com.gmail.socraticphoenix.color;
import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.Game;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Role;
policy Ignore : all
model Tape : tape
model CharIo : io
token ">" {
tape.shiftPointer(1);
}
token "<" {
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 socraticphoenix@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 socraticphoenix@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
package your.namespace.here;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* The Stopwatch class represents a mapping of versatile timing entries, each of which can be independently stopped, started, or examined.
*
* @param <T> The type of key to use for the timing entries
*/
package com.gmail.socraticphoenix.planet9;
import com.gmail.socraticphoenix.planet9.grammar.line.lines.SourceExtendsStatement;
import com.gmail.socraticphoenix.planet9.grammar.line.lines.SourceIsStatement;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException {