Skip to content

Instantly share code, notes, and snippets.

View strangeglyph's full-sized avatar

strangeglyph strangeglyph

View GitHub Profile
public boolean zonesCollide(Zone zone, Zone zone1) {
if (zone.x2 <= zone1.x2 && zone.x2 >= zone1.x1 && zone.z2 <= zone1.z2 && zone.z2 >= zone1.z1) {
return true;
} else if (zone.x1 <= zone1.x2 && zone.x1 >= zone1.x1 && zone.z1 <= zone1.z2 && zone.z1 >= zone1.z1) {
return true;
}
//Edit sign message
evt.setLine(0, ChatColor.BLACK + "[Black" + ChatColor.WHITE + "White]");
evt.setLine(1, ChatColor.GREEN + lines[2]);
evt.setLine(2, ChatColor.GOLD + lines[1].substring(0, 1).toUpperCase() + lines[1].substring(1).toLowerCase() + " zone");
/* Input:
*
* [BW]
* white
* Test
14:51:00 [SCHWERWIEGEND] Could not pass event BLOCK_BREAK to BlackAndWhite
java.lang.ClassCastException: org.bukkit.craftbukkit.block.CraftBlock cannot be
cast to org.bukkit.block.Sign
//Receiving code snippet:
Zone zone = ZoneManager.getWhiteZoneByCoords(evt.getBlock().getX(), evt.getBlock().getZ());
MsgTools.log("Received zone: " + zone);
public static Zone getWhiteZoneByCoords(int x, int z) {
for (int i = 0; i < whiteZones.size(); i++) {
int xPos = whiteZones.get(i).x1 + 10;
int zPos = whiteZones.get(i).z1 + 10;
if (xPos == x && zPos == z) {
MsgTools.log("ZoneCenter: " + xPos + ", " + zPos);
MsgTools.log("Sending zone: " + whiteZones.get(i));
16:43:19 [INFORMATION] [BlackAndWhite] ZoneCorners: 1129, 1149, -358, -338
16:43:19 [INFORMATION] [BlackAndWhite] ZoneCenter: 1139, -348
16:43:19 [INFORMATION] [BlackAndWhite] Sending zone: de.boreeas.blackandwhite.ma
in.Zone@14a0173
16:43:19 [INFORMATION] [BlackAndWhite] Received zone: null
java.io.FileNotFoundException: Data\Boreeas.properties (Zugriff verweigert)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at org.bukkit.craftbukkit.util.PlayerProperties.<init>(PlayerProperties.
java:45)
at org.bukkit.craftbukkit.util.PlayerProperties.getPlayerPropertiesObjec
t(PlayerProperties.java:278)
== This is the code ==
Exception in thread "Minecraft main thread" java.lang.UnsatisfiedLinkError: /home/malte/.minecraft/bin/natives/liblwjgl.so: /home/malte/.minecraft/bin/natives/liblwjgl.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at org.lwjgl.Sys$1.run(Sys.java:69)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:65)
at org.lwjgl.Sys.loadLibrary(Sys.java:81)
/**
* Save the object in form of a .yml file
*
* @param o The object
* @param filename The filename (not including file ending and path)
*/
public void save(Object o, String filename) {
try {
File f = new File(cb.getDataFolder() + "/" + filename + ".yml");
public class FoodEntity extends Entity {
//The size of the entiy
public int size;
public FoodEntity() {
size = r.nextInt(100);
spawn(); //Warning: Overridable method call in constructor
}