Skip to content

Instantly share code, notes, and snippets.

@riking
riking / DonatorBeacons.java
Created August 14, 2013 01:48
Permission-based beacon effect boosting example
@EventHandler
public void onPaid(PlayerPayBeaconEvent event) {
if (event.getPlayer().hasPermission("rank.donator")) {
List<PotionEffect> effects = event.getNewEffects();
ListIterator<PotionEffect> iter = effects.listIterator();
while (iter.hasNext()) {
PotionEffect old = iter.next();
iter.set(new PotionEffect(old.getType(), old.getDuration(), old.getAmplifier() + 1, true));
}
event.setNewEffects(effects);
package com.github.riking.dropcontrol;
import java.util.Map;
import org.apache.commons.lang.Validate;
import org.bukkit.CoalType;
import org.bukkit.DyeColor;
import org.bukkit.GrassSpecies;
import org.bukkit.Material;
import org.bukkit.SandstoneType;
@riking
riking / update-cb.sh
Created August 28, 2013 16:03
CraftBukkit update script
# Update-Craftbukkit
# Author: Riking
# Date: 28 Aug 2013
# Purpose: Pull all upstream Bukkit / CraftBukkit changes
# Last Version Changelog: Added fancy failure conditions
# Instructions:
# 1. The git repositories must be in the same directory and named "Bukkit" and "CraftBukkit"
# 2. Set the remote named "release" to Bukkit's repository. git remote add release [email protected]:Bukkit/Bukkit.git and [email protected]:Bukkit/CraftBukkit.git in each corresponding local repo
# 3. Place this file in the parent of the git repositories (e.g. ~/workspace or ~/projects)
# 4. Run the file from that directory
package com.github.riking.singlefileplugins;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java
@@ -164,13 +164,11 @@ public final class Woodcutting {
// Handle the blocks around 'block'
for (int y = 0; y <= 1; y++) {
- for (int x = -1; x <= 1; x++) {
- for (int z = -1; z <= 1; z++) {
+ for (int x = -2; x <= 2; x++) {
+ for (int z = -2; z <= 2; z++) {
BlockState nextBlock = blockState.getBlock().getRelative(x, y, z).getState();
@riking
riking / Server.log
Created October 14, 2013 19:54
Tree feller testing
12:42:48 [INFO] Riking[/127.0.0.1:42459] logged in with entity id 2544 at ([world] 139.5, 71.0, 264.5)
12:42:54 [INFO] Riking issued server command: /gamemode 1
12:42:54 [INFO] Riking: Set own game mode to CREATIVE mode
12:43:01 [INFO] Riking issued server command: /give riking diamond_Axe
12:43:01 [INFO] Riking: Gave Riking some 279 (DIAMOND_AXE)
12:43:11 [INFO] Riking issued server command: /gamemode 0
12:43:11 [INFO] Riking: Set own game mode to SURVIVAL mode
12:43:17 [INFO] Riking issued server command: /mcrefresh
12:43:20 [INFO] [mcMMO] [Debug] Tree feller processing took -4390956 nanos
12:43:30 [INFO] Riking issued server command: /
* sigraptr ([email protected]) has joined #mcmmo
<sigraptr> Why hello there
<Riking> HELLO
<sigraptr> I'm here to share a little info that I have about minecraft.
<sigraptr> Ok, so how, in Minecraft, note that all of the planets are square.
<Riking> this is the mcmmo support channel
* Agge ([email protected]) has joined #mcmmo
<sigraptr> However, in real life, planets cannot be square as the azimuth, the angle formed betwixt two lines, has to be spherical
<sigraptr> You can find the formula for this by the form, slope 1 times slope 2
<Riking> what planets
Hi, I'm conducting a "Thousand Paperuts" survey for the mcMMO plugin.
What are your complaints about the plugin that were "too insignificant" to report? I may end up fixing them in the next few days.
@riking
riking / gist:7094156
Last active December 26, 2015 04:29
Server.getName() inspection results
admin-mode - INVALID
The plugin is in Planning stage, not released.
adminlobby - INVALID (PEX) +old(R1.4.5)
Bundles an old version of PEX inside the plugin, which is where the getName comes from.
ampcore - NOT AFFECTED +old('CB1337')
Concatenated into a general info string in a serverStats() function.
sData = sData + "|" + plugin.getServer().getName();
legacy_format := "obfuscated" | "bold" | "strikethrough" | "underline" | "italic" | "reset"
color := "black" | "dark_blue" | "dark_green" | "dark_aqua" | "dark_red" | "dark_purple" | "gold" | "gray" | "dark_gray" | "blue" | "green" | "aqua" | "red" | "light_purple" | "yellow" | "white"
color_or_format := color | legacy_format
// Cannot be sent from the server - local source only
click_action_local_only := "open_file"
// Alternate protocols, such as steam:// and magnet:, DO work for open_url.
click_action := "open_url" | "run_command" | "suggest_command"
clickevent := JsonObject{