Skip to content

Instantly share code, notes, and snippets.

public static void main(String[] args) {
String line = "30-09-2012 20-24-23 [BLOCK_BREAK] By: blackwolf12333 GM: 1 What: GRASS:0 on Pos: -682, 64, -461 in: world";
if(!(BaseData.loadFromString(line) == null)) {
System.out.print("contains");
} else {
System.out.print("doesn't contain");
}
}
@blackwolf12333
blackwolf12333 / orbital crash
Created April 6, 2013 19:52
orbital weston plugin crashed with a segfault, this is the trace back
[21:43:12.533] caught signal: 11
[21:43:12.534] 0: /root/install/lib/weston/orbital-shell.so (_ZN9Workspace6insertEP12weston_layer+0x27) [0xb68ba705]
[21:43:12.534] 1: /root/install/lib/weston/orbital-shell.so (_ZN5Shell17activateWorkspaceEP9Workspace+0x50) [0xb68b3dde]
[21:43:12.535] 2: /root/install/lib/weston/orbital-shell.so (_ZN5Shell23selectPreviousWorkspaceEv+0x6a) [0xb68b3cae]
[21:43:12.535] 3: /root/install/lib/weston/orbital-shell.so (_ZZN5Shell4initEvENKUlP7wl_seatjjPvE3_clES1_jjS2_+0x1d) [0xb68b20db]
[21:43:12.536] 4: /root/install/lib/weston/orbital-shell.so (_ZZN5Shell4initEvENUlP7wl_seatjjPvE3_4_FUNES1_jjS2_+0x2e) [0xb68b2110]
[21:43:12.550] 5: /root/install/bin/weston (weston_compositor_run_key_binding+0x69) [0x8058302]
[21:43:12.550] 6: ? (?+0x69) [0x96d0591]
@blackwolf12333
blackwolf12333 / orbital crash
Created April 6, 2013 19:52
orbital weston plugin crashed with a segfault, this is the trace back
[21:43:12.533] caught signal: 11
[21:43:12.534] 0: /root/install/lib/weston/orbital-shell.so (_ZN9Workspace6insertEP12weston_layer+0x27) [0xb68ba705]
[21:43:12.534] 1: /root/install/lib/weston/orbital-shell.so (_ZN5Shell17activateWorkspaceEP9Workspace+0x50) [0xb68b3dde]
[21:43:12.535] 2: /root/install/lib/weston/orbital-shell.so (_ZN5Shell23selectPreviousWorkspaceEv+0x6a) [0xb68b3cae]
[21:43:12.535] 3: /root/install/lib/weston/orbital-shell.so (_ZZN5Shell4initEvENKUlP7wl_seatjjPvE3_clES1_jjS2_+0x1d) [0xb68b20db]
[21:43:12.536] 4: /root/install/lib/weston/orbital-shell.so (_ZZN5Shell4initEvENUlP7wl_seatjjPvE3_4_FUNES1_jjS2_+0x2e) [0xb68b2110]
[21:43:12.550] 5: /root/install/bin/weston (weston_compositor_run_key_binding+0x69) [0x8058302]
[21:43:12.550] 6: ? (?+0x69) [0x96d0591]
[21:43:12.533] caught signal: 11
[21:43:12.534] 0: /root/install/lib/weston/orbital-shell.so (_ZN9Workspace6insertEP12weston_layer+0x27) [0xb68ba705]
[21:43:12.534] 1: /root/install/lib/weston/orbital-shell.so (_ZN5Shell17activateWorkspaceEP9Workspace+0x50) [0xb68b3dde]
[21:43:12.535] 2: /root/install/lib/weston/orbital-shell.so (_ZN5Shell23selectPreviousWorkspaceEv+0x6a) [0xb68b3cae]
[21:43:12.535] 3: /root/install/lib/weston/orbital-shell.so (_ZZN5Shell4initEvENKUlP7wl_seatjjPvE3_clES1_jjS2_+0x1d) [0xb68b20db]
[21:43:12.536] 4: /root/install/lib/weston/orbital-shell.so (_ZZN5Shell4initEvENUlP7wl_seatjjPvE3_4_FUNES1_jjS2_+0x2e) [0xb68b2110]
[21:43:12.550] 5: /root/install/bin/weston (weston_compositor_run_key_binding+0x69) [0x8058302]
[21:43:12.550] 6: ? (?+0x69) [0x96d0591]
@blackwolf12333
blackwolf12333 / annotation command
Last active January 2, 2016 05:49
A prototype for how to use annotations to map the commands in a cleaner way.
@Command(command="save", aliases="s,sv")
public void save() {
player.save();
}
public void setup() {
list<Method> commands = getAllAnnotatedMethods();
for(Method m : commands) {
commandmap.put(m.getAnnotation().command(), m);
}
@blackwolf12333
blackwolf12333 / QueueProducer.java
Created January 12, 2014 12:25
QueueProducer to prevent passing allong the Queue all the time.
public class QueueProducer {
public static LinkedBlockingQueue queue = new LinkedBlockingQueue<String>();
public static void initiate() {
new Messenger(queue).start();
}
public static void offer(String msg) {
queue.offer(msg);
}
package tk.blackwolf12333.grieflog.utils.logging.worldedit;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
@blackwolf12333
blackwolf12333 / Main.java
Created June 15, 2014 18:27
code for BUKKIT-5654
package me.blackwolf12333;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.Bukkit;
import org.bukkit.block.BlockState;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockMultiPlaceEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
-(void)didMoveToView:(SKView*)view {
SKNode *player = [self childNodeWithName:@"player"];
SKSpriteNode *texture = [SKSpriteNode spriteNodeWithImageNamed:@"Spaceship"];
[player addChild:texture];
}
extends Node2D
# member variables here, example:
# var a=2
# var b="textvar"
func _ready():
set_process(true)
get_node("player").connect("body_enter", self, "_on_player_body_enter")
pass