Skip to content

Instantly share code, notes, and snippets.

View windy1's full-sized avatar
πŸ’­
Why do booleans make good finger food? Because they're only a byte πŸ˜‚

Walker Crouse windy1

πŸ’­
Why do booleans make good finger food? Because they're only a byte πŸ˜‚
View GitHub Profile
@windy1
windy1 / StarterPack.java
Last active December 11, 2015 20:59
StarterPack
public class StarterPack extends CommonPlugin implements Listener {
private final YamlConfiguration config = new YamlConfiguration(new File(getDataFolder(), "config.yml"));
private final YamlConfiguration users = new YamlConfiguration(new File(getDataFolder(), "users.yml"));
@Override
public void onEnable() {
config.load();
users.load();
Spout.getEventManager().registerEvents(this, this);
}
@windy1
windy1 / BackpackCommand.java
Created May 15, 2013 00:15
AnnotatedCommandExecutor example
public class BackpackCommand extends AnnotatedCommandExecutor {
@Command(aliases = {"backpack", "b"}, desc = "Opens the backpack", min = 0, max = 1)
@Binding(Keyboard.KEY_B)
public void backpack(CommandSource source, CommandArguments args) throws CommandException {
// '/backpack' executed here
}
}
Quest gatherQuest = Quest.builder()
// gather 5 stone for a reward of 19.99 and a message 'Congratulations!'
.gather(5)
.of(Material.STONE)
.withRewardOf(19.99)
.withMessage("Congratulations!")
.then()
// gather 20 dirt for a reward of 5 and a message 'Nice Dirt!'
.gather(20)
@windy1
windy1 / Quests.java
Last active December 17, 2015 12:29
Quest gatherQuest = Quest.builder()
// gather 5 stone for a reward of 19.99 and a message 'Congratulations!'
.gather(5)
.of(Material.STONE)
.withRewardOf(19.99)
.withMessage("Congratulations!")
.then()
// gather 20 dirt for a reward of 5 and a message 'Nice Dirt!'
.gather(20)
/*
* This file is part of Spout.
*
* Copyright (c) 2011-2012, Spout LLC <http://www.spout.org/>
* Spout is licensed under the Spout License Version 1.
*
* Spout is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
/*
* This file is part of Spout.
*
* Copyright (c) 2011-2012, Spout LLC <http://www.spout.org/>
* Spout is licensed under the Spout License Version 1.
*
* Spout is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.dalvir.find"
minSdkVersion 15
targetSdkVersion 20
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* 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
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* 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
package se.walkercrou.dev;
import static org.spongepowered.api.text.TextTemplate.arg;
import static org.spongepowered.api.text.TextTemplate.of;
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.message.MessageChannelEvent;
import org.spongepowered.api.plugin.Plugin;