Skip to content

Instantly share code, notes, and snippets.

Chris Holland Zren

Block or report user

Report or block Zren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Zren
Zren / Test.java
Created Feb 22, 2011
Hello World with extensive documentation.
View Test.java
// Open up a new project called Test
// Make a new class called Test
//Now try this code
public class Test {
public static void main(String[] args) {
System.out.println("Hello World");
}
View gist:838261
// For loops are a simple way to count numbers in a pattern. In this case the pattern is that all numbers
// increase by one each cycle through the loop. The first cycle will start with the variable i (which
// is an integer (a number, but not a fraction)) as the number 0. Then the next cycle, it's 1, then 2 ...
// All the way until the last cycle where it's 9, then when you add by 1 and make i = 10
for (Assign local seed value; exit conditional; increment or modify the variable) {
System.out.println(i);
}
// The whole time, whenever the cycle forced us to increment the number (+1), then it was also checking the
View gist:1102780
Once upon a time in a land far far away...
A land covered with the snowiest landscapes, the largest deserts and the biggest forests.
A land flooded by oceans so big, one man couldn't see the other side.
A land carved with mountains that reach for the sun.
In this land called Revessa, there were two kingdoms that lived in peace.
In the North there was Biru, and in the south lived the people of Rosso.
These communities lived in great harmony with each other. Via the trade routes they exchanged
raw materials such as obsidian, netherrack, gold and even diamonds, but also spices and food such as seeds,
wheat... all you can think of. Both nations share the same god, Tuhan.
View gist:1218204
Plugin test = Bukkit.getServer().getPluginManager().getPlugin("Towny");
if (test == null) {
throw a shitstorm
} else {
Towny towny = (Towny)test;
TownyUniverse universe = towny.getTownyUnverse();
setTowny(universe);
}
@Zren
Zren / Character.java
Created Dec 7, 2011
RPG Mechanics (Exp/Stat/Equipment)
View Character.java
public class Character {
private Map<Stat, Integer> stats = new HashMap<Stat, Integer>();
private Map<Stat, Integer> statOffsets = new HashMap<Stat, Integer>();
private Job job;
private LevelCurve levelCurve;
private int level = 1;
private int experience = 0;
private final EquipmentInventory equipmentInventory = new EquipmentInventory();
public Character(Job job) {
@Zren
Zren / DarkMonokai.qss
Last active Sep 19, 2019
Dark Monokai - Quassel Theme (qss)
View DarkMonokai.qss
/**
** ____ _ ___ ___ _ _
** | _ \ | | | \/ | | | (_)
** | | \ |__ _ _ __| | __ | . . | ___ _ __ ___ | | __ __ _ _
** | | | | _` | '__| |/ / | |\/| |/ _ \| '_ \ / _ \| |/ // _` | |
** | |_/ /(_| | | | < | | | | (_) | | | | (_) | <| (_| | |
** |____/\__,_|_| |_|\_\ \_| |_/\___/|_| |_|\___/|_|\_\\__,_|_|
**
** Quassel Theme
**
@Zren
Zren / InjectIntoBukkitTask.java
Created May 29, 2012
Task Injector for Bukkit's Scheduler
View InjectIntoBukkitTask.java
package ca.xshade.bukkit.util;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import java.util.TimerTask;
/**
* A task that can be scheduled for one-time or repeated execution by a Timer that will insert the defined task into Bukkit's schedular to
* run on it's next tick.
@Zren
Zren / gist:2955111
Created Jun 19, 2012
Recursive CountDownTask (Rounds up into the future second when scheduling)
View gist:2955111
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
public class Test {
// Output:
View Output
onPlayerMove()
from = Vector(-44.973586, 63.000000, 184.599402)
to = Vector(-44.976534, 63.000000, 184.491422)
Delta = Vector(-0.002948, 0.000000, -0.107980)
Delta (Normalized) = Vector(-0.027288, 0.000000, -0.999628)
inFront = Vector(-45.003822, 63.000000, 183.491795)
inFront (Block) = Vector(-46.000000, 63.000000, 183.000000)
onPlayerMove()
from = Vector(-44.976534, 63.000000, 184.491422)
to = Vector(-44.926589, 63.000000, 184.349126)
View Config.java
package ca.xshade.bukkit.util.config;
import ca.xshade.bukkit.util.BukkitUtil;
import com.pridemc.games.arena.CuboidRegion;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
You can’t perform that action at this time.