Skip to content

Instantly share code, notes, and snippets.

package io.github.Dinner1111.ServerUtils.ProjectBuilder;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import nu.xom.*;
public class ScriptStorage {
Document XML;
Element root = new Element("scripts");
package Weee;
// The theme classes you need imported
import io.github.Dinner1111.ChatThemes.ThemeColors;
import io.github.Dinner1111.ChatThemes.ChatThemes.ThemeType;
import io.github.Dinner1111.ChatThemes.ChatThemes;
// Derp imports for the example
import org.bukkit.command.*;
import org.bukkit.entity.Player;
<?xml version="1.0"?>
<map proto="1.3.0">
<name>Opasis</name>
<version>1.0.0</version>
<objective>Kill the enemy team while staying alive yourself!</objective>
<authors>
<author>_DTC</author>
</authors>
<contributors>
<contributor contribution="XML">Dinner1111</contributor>
if (cmd.getName().equalsIgnoreCase("util-config")) {
if (sender.hasPermission("Utils.Util.Config")) {
if (args.length == 2) {
if (sender instanceof Player) {
Player p = (Player) sender;
try { cm.getConfig().getConfigurationSection("players." + p.getName()).getKeys(false).contains(args[0]); } catch (Exception e) {
sender.sendMessage(theme.color1 + args[0] + theme.color3 + " is not a valid configuration section.");
sender.sendMessage(theme.color3 + "Usage: " + theme.color1 + "/util-config [player] [configuration section] [value]");
return true;
}
@Dinner1111
Dinner1111 / hi.java
Last active December 28, 2015 01:39
@EventHandler
public void listen(EntityDamageEvent e) {
if (e.getEntityType().equals(EntityType.SNOWBALL)) {
Player p = (Player) e.getEntity();
PotionEffect poteff = new PotionEffect(PotionEffectType.SLOW, 1, 100);
p.addPotionEffect(poteff);
}
}
if (cmd.getName().equalsIgnoreCase("purge")) {
if (sender.hasPermission("Utils.Purge")) {
if (args.length == 0) {
for (Entity e : ((Player) sender).getWorld().getEntities()) {
if (!e.getType().equals(EntityType.VILLAGER) || !e.getType().equals(EntityType.PLAYER)) {
Bukkit.broadcastMessage(e.getType().toString());
e.getWorld().spawnEntity(e.getLocation(), EntityType.LIGHTNING);
//e.remove();
}
}
<?xml version="1.0"?>
<map proto="1.3.0">
<name>Nucleus</name>
<version>1.0.0</version>
<objective>Capture and hold the center hill!</objective>
<authors>
<author>Stealth5061</author>
<author>xXFracXx</author>
</authors>
<contributors>
package io.github.Dinner1111.ServerUtils;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
package io.github.Dinner1111.ServerUtils;
import io.github.Dinner1111.ServerUtils.ChatThemes.ThemeType;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Color;
public class ThemeColors {
if (cmd.getName().equalsIgnoreCase("math")) {
if (sender.hasPermission("Utils.Math")) {
if (args.length != 0) {
List<String> operators = Lists.newArrayList("+", "++", "-", "--", "*", "/", "%", "=", "+=", "-=", "%=", "=+", "=-", "=%");
double[] numbers = new double[args.length];
String[] op = new String[args.length];
int numLength = 0;
int opLength = 0;
for (int i = 0; i < args.length; i++) {
try {