Skip to content

Instantly share code, notes, and snippets.

View dumptruckman's full-sized avatar
💭
I may be slow to respond.

Jeremy Wood dumptruckman

💭
I may be slow to respond.
View GitHub Profile
@dumptruckman
dumptruckman / InventoryBuilder.kt
Last active November 10, 2017 22:01
A DSL for building Bukkit Inventory objects in Kotlin
/**
* Copyright 2017 Jeremy Wood
*
* 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 above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
@dumptruckman
dumptruckman / AFKPoolListener.java
Last active May 1, 2020 05:02
Punishes players who stand in liquid for too long.
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
@dumptruckman
dumptruckman / PlayTimePlugin.java
Last active August 16, 2017 23:33
Simple plugin for time played
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
@dumptruckman
dumptruckman / ExamplePlugin.java
Last active July 29, 2017 00:52
Type Safe Metadata
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.java.JavaPlugin;
/**
* An example of a pretty dumb plugin that uses Metadata.
*/
@dumptruckman
dumptruckman / CommandBase.java
Last active January 24, 2023 17:22
Simple Sub Commands
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import java.util.HashMap;
import java.util.Map;
/**
* A simple class for implementing sub commands.
@dumptruckman
dumptruckman / ConfigUtil.java
Created July 20, 2017 02:23
ConfigUtil (for Lists of any type)
import org.bukkit.configuration.ConfigurationSection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class ConfigUtil {
/**
/***************************************************************************
// Programmer: Jonathan Wheeler CSC110 Programming Assignment 5
// Date: May 8, 2017
// Description:
// Input:
// Output:
****************************************************************************/
import java.io.*;
import java.util.*;
@dumptruckman
dumptruckman / ActionBarUtil.java
Created January 19, 2016 15:08
A simple utility class for sending action bar messages.
/* Copyright (c) dumptruckman 2016
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package net.dawnofages.util;
import net.minecraft.server.v1_8_R3.IChatBaseComponent;
import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
@dumptruckman
dumptruckman / PlayerDataFactory.java
Last active May 1, 2020 05:05
Safe Player Data Map
/* Copyright (C) dumptruckman 2014
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;