This file contains hidden or 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
// 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"); | |
} |
This file contains hidden or 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
// 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 |
This file contains hidden or 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
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. |
This file contains hidden or 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
Plugin test = Bukkit.getServer().getPluginManager().getPlugin("Towny"); | |
if (test == null) { | |
throw a shitstorm | |
} else { | |
Towny towny = (Towny)test; | |
TownyUniverse universe = towny.getTownyUnverse(); | |
setTowny(universe); | |
} |
This file contains hidden or 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 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) { |
This file contains hidden or 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
/** | |
** ____ _ ___ ___ _ _ | |
** | _ \ | | | \/ | | | (_) | |
** | | \ |__ _ _ __| | __ | . . | ___ _ __ ___ | | __ __ _ _ | |
** | | | | _` | '__| |/ / | |\/| |/ _ \| '_ \ / _ \| |/ // _` | | | |
** | |_/ /(_| | | | < | | | | (_) | | | | (_) | <| (_| | | | |
** |____/\__,_|_| |_|\_\ \_| |_/\___/|_| |_|\___/|_|\_\\__,_|_| | |
** | |
** Quassel Theme | |
** |
This file contains hidden or 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 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. |
This file contains hidden or 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 java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Timer; | |
import java.util.TimerTask; | |
import java.util.concurrent.TimeUnit; | |
public class Test { | |
// Output: |
This file contains hidden or 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
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) |
This file contains hidden or 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 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; |
OlderNewer