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 / 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%;
@dumptruckman
dumptruckman / TargetFinder.java
Last active August 29, 2015 13:56
A utility for finding the target entity of an entity.
/* 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.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;