Skip to content

Instantly share code, notes, and snippets.

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

うっちぃ ucchyocean

💭
I may be slow to respond.
View GitHub Profile
@ucchyocean
ucchyocean / gist:42c6200a667d7732b50f
Last active August 29, 2015 14:05
リテラルを使用しないで、「Hello, world!」を出力する
public class HelloWorld {
private enum A { Hello, world, Juuichimoji, Z }
public static void main (String[] args) {
System.out.println(A.Hello.name() +
(char)(A.Juuichimoji.name().length() + A.Juuichimoji.name().length() + A.Juuichimoji.name().length() + A.Juuichimoji.name().length()) +
(char)(A.Juuichimoji.name().length() + A.Juuichimoji.name().length() + A.Juuichimoji.name().length() - A.Z.name().length())
+ A.world.name() +
(char)(A.Juuichimoji.name().length() + A.Juuichimoji.name().length() + A.Juuichimoji.name().length())
@ucchyocean
ucchyocean / gist:bc0de00f7eaf139be588
Created June 9, 2014 09:25
ControlsFX gradle build script
import org.apache.tools.ant.filters.*
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'osgi'
apply plugin: 'maven'
apply from: 'mavenPublish.gradle'
@ucchyocean
ucchyocean / gist:7a8d38e7e0c034df5bb4
Created June 8, 2014 05:58
MCBans log file - part3
[14:54:03] [Server thread/INFO]: Starting minecraft server version 1.7.9
[14:54:03] [Server thread/INFO]: Loading properties
[14:54:03] [Server thread/INFO]: Default game type: SURVIVAL
[14:54:04] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-1487 (MC: 1.7.9) (Implementing API version 1.7.9-R0.3-SNAPSHOT)
[14:54:04] [Server thread/INFO]: Server Ping Player Sample Count: 12
[14:54:04] [Server thread/INFO]: Using 4 threads for Netty based IO
[14:54:04] [Server thread/INFO]: Generating keypair
[14:54:05] [Server thread/INFO]: Starting Minecraft server on *:25565
[14:54:05] [Server thread/INFO]: [MCBans] Loading MCBans v4.3.2
[14:54:05] [Server thread/INFO]: [MCBansAPITestPlugin] Loading MCBansAPITestPlugin v0.0.1
[01:34:20] [Server thread/INFO]: Starting minecraft server version 1.7.9
[01:34:20] [Server thread/INFO]: Loading properties
[01:34:20] [Server thread/INFO]: Default game type: SURVIVAL
[01:34:21] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-1487 (MC: 1.7.9) (Implementing API version 1.7.9-R0.3-SNAPSHOT)
[01:34:21] [Server thread/INFO]: Server Ping Player Sample Count: 12
[01:34:21] [Server thread/INFO]: Using 4 threads for Netty based IO
[01:34:22] [Server thread/INFO]: Generating keypair
[01:34:23] [Server thread/INFO]: Starting Minecraft server on *:25565
[01:34:23] [Server thread/INFO]: [iConomy] Loading iConomy v7.0
[01:34:23] [Server thread/INFO]: [BukkitChatBot] Loading BukkitChatBot v0.0.2
@ucchyocean
ucchyocean / TestPlugin2.java
Created March 13, 2014 12:34
/reload したときに、getResourceAsStream がnullになるかどうかの確認
/*
* @author ucchy
* @license All Rights Reserved
* @copyright Copyright ucchy 2014
*/
package test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@ucchyocean
ucchyocean / gist:9213643
Created February 25, 2014 17:27
SimpleDateFormatを使ったパースのサンプル
public static void main(String[] args) {
String[] testees = {"23:59:59", "03:02", "1:01:01"};
SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
Calendar cal = Calendar.getInstance();
for ( String t : testees ) {
if ( t.split(":").length < 3 ) {
@ucchyocean
ucchyocean / ScoreboardTestPlugin.java
Created September 27, 2013 01:14
スコアボードのテスト
package jp.ucchy;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
@ucchyocean
ucchyocean / gist:6033639
Created July 18, 2013 22:21
ゲームオーバー画面のスキップ
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
*/
package jp.ucchy.rs;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ucchyocean
ucchyocean / gist:5775561
Created June 13, 2013 17:24
PVPGunPlusで、リスポーン後のNoDamageTicks期間はダメージ無効にする。
/*
* @author ucchy
* @license GPLv3
* @copyright Copyright ucchy 2013
*/
package com.github.ucchyocean.pr;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ucchyocean
ucchyocean / gist:5735505
Last active December 18, 2015 05:49
LivingEntity の setCustomName メソッドは、Minecraft 1.5 以上で使用できる
/*
* @author ucchy
* @license GPLv3
* @copyright Copyright ucchy 2013
*/
package jp.ucchy.cp;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Zombie;