Skip to content

Instantly share code, notes, and snippets.

View macalinao's full-sized avatar

Ian Macalinao macalinao

View GitHub Profile
public class FlameShield extends Skill {
public FlameShield(Attribute attribute) {
super(attribute);
id(0x02);
name("Flame Shield");
description("For 10...45 seconds (linear), anything that harms you is set ablaze for 2...5 seconds (linear).");
}
@SpellInfo(id = "thunderstorm",
name = "ThunderStorm")
public class SpellThunderStorm implements Spell {
public Map<String, Integer> taskID = new HashMap<String, Integer>();
private MagicRPG mr;
public SpellThunderStorm(MagicRPG mr) {
this.mr = mr;
}
@macalinao
macalinao / a
Created December 22, 2011 06:04
package org.getspout.api.entity;
import org.getspout.api.entity.ai.AI;
import org.getspout.api.plugin.Plugin;
/**
* Represents an entity that can have AI.
*/
public interface AIable<T extends Entity> {
/**
/**
* Stores the ItemStack at the given index. Notifies all attached
* InventoryViewers of the change.
*
* @param index The index where to put the ItemStack
* @param item The ItemStack to set
*/
@Override
public void setItem(int index, SpoutItemStack item) {
super.setItem(index, item);
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.opencraft.render;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.vector.Vector3f;
import org.opencraft.Opencraft;
import org.royawesome.renderer.BatchVertexRenderer;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.crimsonrpg.core.citizens;
import com.crimsonrpg.api.citizen.MessageLevel;
import org.bukkit.ChatColor;
import org.bukkit.Location;
public static boolean checkCollision(BoundingBox a, Plane b) {
boolean pos = (a.min.dot(b.normal) > 0);
return pos != (a.max.dot(b.normal) > 0) //Planes that are axis-aligned. most cases
//X N N
|| pos != (new Vector3(a.max.getX(), a.min.getY(), a.min.getZ()).dot(b.normal) > 0)
//N X N
|| pos != (new Vector3(a.min.getX(), a.max.getY(), a.min.getZ()).dot(b.normal) > 0)
//N N X
|| pos != (new Vector3(a.min.getX(), a.min.getY(), a.max.getZ()).dot(b.normal) > 0)
a = Vector3.Up;
b = Vector3.Right;
boolean result = a.equals(b);
assertFalse(result);
return (((c.getY() - a.getY()) * (b.getX() - a.getX()))
< ((b.getY() - a.getY()) * (c.getX() - a.getX())))
&& ((c.getY() - a.getY()) * (b.getZ() - a.getZ())
< ((b.getY() - a.getY()) * (c.getZ() - a.getZ())));
var mod = mm.defineMod("My Mod", {
description: "An awesome mod.",
author: "AlbireoX",
revision: 1,
url: "http://simplyian.com"
});
var ore = mod.addOre("main-ore", {
texture: "http://example.com/sampletexture.png",
itemtexture: "http://example.com/sampletexture-item.png"