Skip to content

Instantly share code, notes, and snippets.

@ViolentShadow
Last active August 29, 2015 14:01
Show Gist options
  • Save ViolentShadow/961a717aa831c6ed15e4 to your computer and use it in GitHub Desktop.
Save ViolentShadow/961a717aa831c6ed15e4 to your computer and use it in GitHub Desktop.
package com.oresomecraft.BattleMaps.maps;
import org.bukkit.*;
import org.bukkit.event.*;
import org.bukkit.inventory.*;
import com.oresomecraft.maps.*;
import com.oresomecraft.maps.battles.*;
import com.oresomecraft.OresomeBattles.api.*;
@MapConfig
public class AMazIng extends BattleMap implements IBattleMap, Listener {
public amazing() {
super.initiate(this, name, fullName, creators, modes);
setTDMTime(Dawn);
setAllowBuild(false);
disableDrops(new Material[]{Material.LEATHER_HELMET, Material.STONE_SWORD});
}
String name = "amazing";
String fullName = "A Maz Ing";
String creators = "Beadycottonwood and Huxtech ";
Gamemode[] modes = {Gamemode.INFECTION, Gamemode.LTS, Gamemode.LMS};
public void readyTDMSpawns() {
redSpawns.add(new Location(w, 47, 71, 0));
blueSpawns.add(new Location(w, -46, 71, 0));
}
public void readyFFASpawns() {
FFASpawns.add(new Location(w, -23, 71, 42));
FFASpawns.add(new Location(w, -29, 71, 37));
FFASpawns.add(new Location(w, -31, 71, 19));
FFASpawns.add(new Location(w, -29, 71, -24));
FFASpawns.add(new Location(w, 0, 71, -42));
FFASpawns.add(new Location(w, -42, 71, -19));
FFASpawns.add(new Location(w, -12, 71, 45));
public void applyInventory(final BattlePlayer p) {
Inventory i = p.getInventory();
ItemStack LEATHER_HELMET = new ItemStack(Material.LEATHER_HELMET, 1);
ItemStack LEATHER_CHESTPLATE = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
ItemStack LEATHER_PANTS = new ItemStack(Material.LEATHER_LEGGINGS, 1);
ItemStack LEATHER_BOOTS = new ItemStack(Material.LEATHER_BOOTS, 1);
ItemStack SWORD = new ItemStack(Material.IRON_SWORD, 1);
ItemStack BOW = new ItemStack(Material.BOW, 1);
ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 3);
ItemStack HEALTH = new ItemStack(Material.GOLDEN_APPLE, 3);
ItemStack ARROWS = new ItemStack(Material.ARROW, 64);
InvUtils.colourArmourAccordingToTeam(p, new ItemStack[]{LEATHER_CHESTPLATE, LEATHER_PANTS, LEATHER_HELMET, LEATHER_BOOTS});
BOW.addEnchantment(Enchantment.ARROW_INFINITE, 1);
p.getInventory().setBoots(LEATHER_BOOTS);
p.getInventory().setLeggings(LEATHER_PANTS);
p.getInventory().setChestplate(LEATHER_CHESTPLATE);
p.getInventory().setHelmet(LEATHER_HELMET);
i.setItem(0, SWORD);
i.setItem(1, BOW);
i.setItem(3, STEAK);
i.setItem(2, HEALTH);
i.setItem(10, ARROWS);
}
// Region. (Top corner block and bottom corner block.
// Top left corner.
public int x1 = -55;
public int y1 = 115;
public int z1 = 55;
//Bottom right corner.
public int x2 = 55;
public int y2 = 60;
public int z2 = -55;
@EventHandler
public void arrowAway(org.bukkit.event.entity.ProjectileHitEvent event) {
org.bukkit.entity.Entity projectile = event.getEntity();
Location loc = projectile.getLocation();
if (loc.getWorld().getName().equals(name)) {
if (projectile instanceof org.bukkit.entity.Arrow) {
org.bukkit.entity.Arrow a = (org.bukkit.entity.Arrow) projectile;
a.remove();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment