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:
Introduction
This document is intended to aid users of the JLSC configuration format.
Preliminary
Background
JLSC stands for JSON-Like Structured Configuration. JSON stands for JavaScript Object Notation, and information about it can be found at json.org. JLSC is partially based off of JSON, as well as HOCON and YAML, two other
configuration formats. The goal of the JLSC project is to simultaneously provide the best experience for the user, and the easiest development for the coder. JLSC has the same data structure of JSON, but it has more advanced
parsing and programitic interaction.
Java Basics
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
*/