Updated source code for CB 1.1-R6.

This commit is contained in:
garbagemule 2012-03-02 22:30:52 +01:00
parent 353109c89a
commit dc9059cecd
10 changed files with 57 additions and 61 deletions

Binary file not shown.

View File

@ -12,7 +12,6 @@ public class ShootArrow implements Ability
{
@Override
public void execute(Arena arena, MABoss boss) {
//boss.getEntity().launchProjectile(Arrow.class);
boss.getEntity().shootArrow();
boss.getEntity().launchProjectile(Arrow.class);
}
}

View File

@ -12,7 +12,6 @@ public class ShootFireball implements Ability
{
@Override
public void execute(Arena arena, MABoss boss) {
//boss.getEntity().launchProjectile(Fireball.class);
boss.getEntity().throwEgg();
boss.getEntity().launchProjectile(Fireball.class);
}
}

View File

@ -13,11 +13,11 @@
<property name="ability-dest" location="${res}/res/abilities" />
<!-- Dependency variables -->
<property name="cbver" value="1.1-R4" />
<property name="cbver" value="1.1-R6" />
<property name="cbjar" value="craftbukkit-${cbver}.jar" />
<property name="cburl" value="http://repo.bukkit.org/content/repositories/releases/org/bukkit/craftbukkit/${cbver}/${cbjar}" />
<property name="vltver" value="1.2.10" />
<property name="vltver" value="1.2.12" />
<property name="vltjar" value="Vault-${vltver}-SNAPSHOT.jar" />
<property name="vlturl" value="http://ci.milkbowl.net/job/Vault/Recommended%20Build/artifact/target/${vltjar}" />
@ -28,7 +28,7 @@
<property name="spturl" value="http://ci.spout.org/job/SpoutPluginAPI/Recommended/artifact/target/${sptjar}" />
<property name="msjar" value="MagicSpells.jar" />
<property name="msurl" value="http://dev.bukkit.org/media/files/575/866/${msjar}" />
<property name="msurl" value="http://dev.bukkit.org/media/files/577/281/${msjar}" />
<path id="classpath">

View File

@ -1,7 +1,7 @@
name: MobArena
author: garbagemule
main: com.garbagemule.MobArena.MobArena
version: 0.94.4.51
version: 0.94.4.52
softdepend: [Spout,MultiVerse,XcraftGate,Towny,Heroes,MagicSpells,Vault]
commands:
ma:

View File

@ -12,16 +12,15 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.ContainerBlock;
import org.bukkit.entity.Entity;
//import org.bukkit.entity.EntityType; TODO USE THIS
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.entity.Vehicle;
import org.bukkit.entity.Wolf;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.permissions.PermissionAttachment;
@ -670,8 +669,8 @@ public class ArenaImpl implements Arena
p.getInventory().removeItem(new ItemStack(Material.BONE, petAmount));
for (int i = 0; i < petAmount; i++) {
//Wolf wolf = (Wolf) world.spawnCreature(p.getLocation(), EntityType.WOLF); TODO USE THIS
Wolf wolf = (Wolf) world.spawnCreature(p.getLocation(), CreatureType.WOLF);
Wolf wolf = (Wolf) world.spawnCreature(p.getLocation(), EntityType.WOLF);
//Wolf wolf = (Wolf) world.spawnCreature(p.getLocation(), CreatureType.WOLF);
wolf.setTamed(true);
wolf.setOwner(p);
wolf.setHealth(wolf.getMaxHealth());
@ -775,7 +774,7 @@ public class ArenaImpl implements Arena
public void run() {
for (Location loc : region.getContainers()) {
BlockState state = world.getBlockAt(loc).getState();
if (state instanceof ContainerBlock) {
if (state instanceof InventoryHolder) {
containables.add(new RepairableContainer(state, false));
}
}

View File

@ -12,7 +12,6 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.ContainerBlock;
import org.bukkit.block.Sign;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@ -53,6 +52,7 @@ import org.bukkit.event.player.PlayerPreLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Attachable;
import org.bukkit.material.Bed;
@ -148,7 +148,7 @@ public class ArenaListener
BlockState state = b.getState();
Repairable r = null;
if (state instanceof ContainerBlock)
if (state instanceof InventoryHolder)
r = new RepairableContainer(state);
else if (state instanceof Sign)
r = new RepairableSign(state);
@ -289,7 +289,7 @@ public class ArenaListener
// Create a Repairable from the block.
Repairable r = null;
if (state instanceof ContainerBlock)
if (state instanceof InventoryHolder)
r = new RepairableContainer(state);
else if (state instanceof Sign)
r = new RepairableSign(state);

View File

@ -1,8 +1,8 @@
package com.garbagemule.MobArena.commands.setup;
import org.bukkit.block.ContainerBlock;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryHolder;
import com.garbagemule.MobArena.*;
import com.garbagemule.MobArena.commands.*;
@ -35,7 +35,7 @@ public class AddContainerCommand implements Command
return false;
}
if (!(p.getTargetBlock(null, 50).getState() instanceof ContainerBlock)) {
if (!(p.getTargetBlock(null, 50).getState() instanceof InventoryHolder)) {
Messenger.tellPlayer(sender, "You must look at container.");
return false;
}

View File

@ -1,8 +1,8 @@
package com.garbagemule.MobArena.repairable;
import org.bukkit.block.BlockState;
import org.bukkit.block.ContainerBlock;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import com.garbagemule.MobArena.util.inventory.SerializableInventory;
@ -14,7 +14,7 @@ public class RepairableContainer extends RepairableBlock
super(state);
// Grab the inventory of the block
Inventory inv = ((ContainerBlock) state).getInventory();
Inventory inv = ((InventoryHolder) state).getInventory();
// Make a SerializableInventory
this.inv = new SerializableInventory(inv);
@ -34,7 +34,7 @@ public class RepairableContainer extends RepairableBlock
super.repair();
// Grab the inventory
ContainerBlock cb = (ContainerBlock) getWorld().getBlockAt(getX(),getY(),getZ()).getState();
InventoryHolder cb = (InventoryHolder) getWorld().getBlockAt(getX(),getY(),getZ()).getState();
Inventory chestInv = cb.getInventory();
SerializableInventory.loadContents(chestInv, this.inv);

View File

@ -3,7 +3,7 @@ package com.garbagemule.MobArena.waves;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Creature;
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Slime;
@ -15,61 +15,60 @@ import com.garbagemule.MobArena.framework.Arena;
public enum MACreature
{
// Default creatures
ZOMBIE(CreatureType.ZOMBIE), ZOMBIES(CreatureType.ZOMBIE),
SKELETON(CreatureType.SKELETON), SKELETONS(CreatureType.SKELETON),
SPIDER(CreatureType.SPIDER), SPIDERS(CreatureType.SPIDER),
CREEPER(CreatureType.CREEPER), CREEPERS(CreatureType.CREEPER),
WOLF(CreatureType.WOLF), WOLVES(CreatureType.WOLF),
ZOMBIE(EntityType.ZOMBIE), ZOMBIES(EntityType.ZOMBIE),
SKELETON(EntityType.SKELETON), SKELETONS(EntityType.SKELETON),
SPIDER(EntityType.SPIDER), SPIDERS(EntityType.SPIDER),
CREEPER(EntityType.CREEPER), CREEPERS(EntityType.CREEPER),
WOLF(EntityType.WOLF), WOLVES(EntityType.WOLF),
// Special creatures
ZOMBIEPIGMAN(CreatureType.PIG_ZOMBIE), ZOMBIEPIGMEN(CreatureType.PIG_ZOMBIE),
POWEREDCREEPER(CreatureType.CREEPER), POWEREDCREEPERS(CreatureType.CREEPER),
ANGRYWOLF(CreatureType.WOLF), ANGRYWOLVES(CreatureType.WOLF),
//HUMAN(CreatureType.VILLAGER), HUMANS(CreatureType.VILLAGER),
GIANT(CreatureType.GIANT), GIANTS(CreatureType.GIANT),
GHAST(CreatureType.GHAST), GHASTS(CreatureType.GHAST),
ENDERMAN(CreatureType.ENDERMAN), ENDERMEN(CreatureType.ENDERMAN),
CAVESPIDER(CreatureType.CAVE_SPIDER), CAVESPIDERS(CreatureType.CAVE_SPIDER),
SILVERFISH(CreatureType.SILVERFISH),
ZOMBIEPIGMAN(EntityType.PIG_ZOMBIE), ZOMBIEPIGMEN(EntityType.PIG_ZOMBIE),
POWEREDCREEPER(EntityType.CREEPER), POWEREDCREEPERS(EntityType.CREEPER),
ANGRYWOLF(EntityType.WOLF), ANGRYWOLVES(EntityType.WOLF),
GIANT(EntityType.GIANT), GIANTS(EntityType.GIANT),
GHAST(EntityType.GHAST), GHASTS(EntityType.GHAST),
ENDERMAN(EntityType.ENDERMAN), ENDERMEN(EntityType.ENDERMAN),
CAVESPIDER(EntityType.CAVE_SPIDER), CAVESPIDERS(EntityType.CAVE_SPIDER),
SILVERFISH(EntityType.SILVERFISH),
// 1.0 creatures
BLAZE(CreatureType.BLAZE), BLAZES(CreatureType.BLAZE),
ENDERDRAGON(CreatureType.ENDER_DRAGON), ENDERDRAGONS(CreatureType.ENDER_DRAGON),
SNOWMAN(CreatureType.SNOWMAN), SNOWMEN(CreatureType.SNOWMAN),
MUSHROOMCOW(CreatureType.MUSHROOM_COW), MUSHROOMCOWS(CreatureType.MUSHROOM_COW),
VILLAGER(CreatureType.VILLAGER), VILLAGERS(CreatureType.VILLAGER),
BLAZE(EntityType.BLAZE), BLAZES(EntityType.BLAZE),
ENDERDRAGON(EntityType.ENDER_DRAGON), ENDERDRAGONS(EntityType.ENDER_DRAGON),
SNOWMAN(EntityType.SNOWMAN), SNOWMEN(EntityType.SNOWMAN),
MUSHROOMCOW(EntityType.MUSHROOM_COW), MUSHROOMCOWS(EntityType.MUSHROOM_COW),
VILLAGER(EntityType.VILLAGER), VILLAGERS(EntityType.VILLAGER),
// Passive creatures
CHICKEN(CreatureType.CHICKEN), CHICKENS(CreatureType.CHICKEN),
COW(CreatureType.COW), COWS(CreatureType.COW),
PIG(CreatureType.PIG), PIGS(CreatureType.PIG),
SHEEP(CreatureType.SHEEP),
SQUID(CreatureType.SQUID), SQUIDS(CreatureType.SQUID),
CHICKEN(EntityType.CHICKEN), CHICKENS(EntityType.CHICKEN),
COW(EntityType.COW), COWS(EntityType.COW),
PIG(EntityType.PIG), PIGS(EntityType.PIG),
SHEEP(EntityType.SHEEP),
SQUID(EntityType.SQUID), SQUIDS(EntityType.SQUID),
// Extended creatures
EXPLODINGSHEEP(CreatureType.SHEEP),
EXPLODINGSHEEP(EntityType.SHEEP),
// Slimes
SLIME(CreatureType.SLIME), SLIMES(CreatureType.SLIME),
SLIMETINY(CreatureType.SLIME), SLIMESTINY(CreatureType.SLIME),
SLIMESMALL(CreatureType.SLIME), SLIMESSMALL(CreatureType.SLIME),
SLIMEBIG(CreatureType.SLIME), SLIMESBIG(CreatureType.SLIME),
SLIMEHUGE(CreatureType.SLIME), SLIMESHUGE(CreatureType.SLIME),
SLIME(EntityType.SLIME), SLIMES(EntityType.SLIME),
SLIMETINY(EntityType.SLIME), SLIMESTINY(EntityType.SLIME),
SLIMESMALL(EntityType.SLIME), SLIMESSMALL(EntityType.SLIME),
SLIMEBIG(EntityType.SLIME), SLIMESBIG(EntityType.SLIME),
SLIMEHUGE(EntityType.SLIME), SLIMESHUGE(EntityType.SLIME),
// Magma cubes
MAGMACUBE(CreatureType.MAGMA_CUBE), MAGMACUBES(CreatureType.MAGMA_CUBE),
MAGMACUBETINY(CreatureType.MAGMA_CUBE), MAGMACUBESTINY(CreatureType.MAGMA_CUBE),
MAGMACUBESMALL(CreatureType.MAGMA_CUBE),MAGMACUBESSMALL(CreatureType.MAGMA_CUBE),
MAGMACUBEBIG(CreatureType.MAGMA_CUBE), MAGMACUBESBIG(CreatureType.MAGMA_CUBE),
MAGMACUBEHUGE(CreatureType.MAGMA_CUBE), MAGMACUBESHUGE(CreatureType.MAGMA_CUBE);
MAGMACUBE(EntityType.MAGMA_CUBE), MAGMACUBES(EntityType.MAGMA_CUBE),
MAGMACUBETINY(EntityType.MAGMA_CUBE), MAGMACUBESTINY(EntityType.MAGMA_CUBE),
MAGMACUBESMALL(EntityType.MAGMA_CUBE),MAGMACUBESSMALL(EntityType.MAGMA_CUBE),
MAGMACUBEBIG(EntityType.MAGMA_CUBE), MAGMACUBESBIG(EntityType.MAGMA_CUBE),
MAGMACUBEHUGE(EntityType.MAGMA_CUBE), MAGMACUBESHUGE(EntityType.MAGMA_CUBE);
private CreatureType type;
private EntityType type;
private MACreature(CreatureType type) {
private MACreature(EntityType type) {
this.type = type;
}
public CreatureType getType() {
public EntityType getType() {
return type;
}