This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bukkit.Bukkit; | |
import org.bukkit.Location; | |
import org.bukkit.World; | |
import org.bukkit.block.Block; | |
import org.bukkit.configuration.serialization.ConfigurationSerializable; | |
import org.bukkit.configuration.serialization.SerializableAs; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
import java.util.LinkedHashMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2019 dumptruckman | |
* | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any | |
def snake_to_camel(name): | |
components = name.split('_') | |
return components[0] + ''.join(x.title() for x in components[1:]) | |
def snake_case_attrs(klass): | |
"""A class decorator that enables getting and setting of attributes with lowerCamelCase names using snake_case.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpawnLocationSharable { | |
public static final Sharable<Location> SPAWN_LOCATION = new Sharable.Builder<Location>("spawn_location", Location.class, | |
new SharableHandler<Location>() { | |
@Override | |
public void updateProfile(PlayerProfile profile, Player player) { | |
profile.set(SPAWN_LOCATION, getPlayerSpawnLocation(player)); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.string :as s]) | |
(use 'clojure.zip) | |
(defn vectorize-program [code] | |
(let [t #(read-string (.substring % 1))] | |
(mapv #(mapv (juxt first t) (into [] (re-seq #"\w-?\d+" %))) | |
(s/split-lines code)))) | |
(defn prep-code [code] | |
(down (vector-zip (vectorize-program code)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dumptruckman.a0a0 | |
import java.util.LinkedList | |
import java.util.Scanner | |
fun main(args: Array<String>) { | |
// Example usage with cat program | |
Interpreter.interpret("A0 A0\n" + | |
"A0 C3 G1 G1 A0\n" + | |
"A0 I0 V0 P0 A0\n" + |
NewerOlder