-
-
Save ScruffyRules/2f8bc64864cfb2259ce2 to your computer and use it in GitHub Desktop.
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 com.oresomecraft.BattleMaps.maps; | |
import net.minecraft.server.v1_6_R2.Enchantment; | |
import org.bukkit.*; | |
import org.bukkit.event.Listener; | |
import org.bukkit.inventory.*; | |
import org.bukkit.inventory.meta.ItemMeta; | |
import org.bukkit.potion.*; | |
import com.oresomecraft.BattleMaps.*; | |
import com.oresomecraft.OresomeBattles.api.*; | |
public class AMazIng extends BattleMap implements Listener { | |
public AMazIng() { | |
super.initiate(this, name, fullName, creators, modes); | |
setAllowBuild(false); | |
disableDrops(new Material[]{Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_PANTS, Material.LEATHER_BOOTS, Material.STONE_SWORD}); | |
} | |
String name = "amazing"; | |
String fullName = "A Maz Ing"; | |
String[] creators = {"Beadycottonwood", "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