First update to 1.9. Sadly makes it not work w/ 1.8
This commit is contained in:
parent
1618e17d63
commit
95b159c69d
@ -12,7 +12,7 @@ Developing/Building
|
|||||||
===
|
===
|
||||||
If you want to make some changes, build, and run the unit tests you will notice we require CraftBukkit 1.8 with maven and it isn't hosted anywhere publically for legal reasons. You will need to build CraftBukkit 1.8 yourself and then put it locally for maven with the following command:
|
If you want to make some changes, build, and run the unit tests you will notice we require CraftBukkit 1.8 with maven and it isn't hosted anywhere publically for legal reasons. You will need to build CraftBukkit 1.8 yourself and then put it locally for maven with the following command:
|
||||||
|
|
||||||
`mvn install:install-file -Dfile=craftbukkit-1.8.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.8-R0.1-SNAPSHOT -Dpackaging=jar`
|
`mvn install:install-file -Dfile=craftbukkit-1.9-R0.1.jar -DgroupId=org.bukkit -DartifactId=craftbukkit -Dversion=1.9-R0.1-SNAPSHOT -Dpackaging=jar`
|
||||||
|
|
||||||
Beta 5 Changes
|
Beta 5 Changes
|
||||||
===
|
===
|
||||||
|
12
pom.xml
12
pom.xml
@ -51,28 +51,28 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.8-R0.1-SNAPSHOT</version>
|
<version>1.9-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>craftbukkit</artifactId>
|
<artifactId>craftbukkit</artifactId>
|
||||||
<version>1.8-R0.1-SNAPSHOT</version>
|
<version>1.9-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sk89q</groupId>
|
<groupId>com.sk89q.worldedit</groupId>
|
||||||
<artifactId>worldedit</artifactId>
|
<artifactId>worldedit-bukkit</artifactId>
|
||||||
<version>5.5.7-SNAPSHOT</version>
|
<version>6.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>Vault</artifactId>
|
<artifactId>Vault</artifactId>
|
||||||
<version>1.4.1</version>
|
<version>1.5.6</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class PlayerListener implements Listener {
|
|||||||
Location loc = event.getClickedBlock() == null ? p.getLocation() : event.getClickedBlock().getLocation();
|
Location loc = event.getClickedBlock() == null ? p.getLocation() : event.getClickedBlock().getLocation();
|
||||||
JailManager jm = pl.getJailManager();
|
JailManager jm = pl.getJailManager();
|
||||||
|
|
||||||
if(p.getItemInHand().isSimilar(Util.getWand())) {
|
if(p.getInventory().getItemInMainHand().isSimilar(Util.getWand())) {
|
||||||
if(jm.isCreatingSomething(p.getName())) {
|
if(jm.isCreatingSomething(p.getName())) {
|
||||||
if(jm.isCreatingAJail(p.getName())) {
|
if(jm.isCreatingAJail(p.getName())) {
|
||||||
pl.debug("Stepping into creating a jail.");
|
pl.debug("Stepping into creating a jail.");
|
||||||
@ -225,8 +225,8 @@ public class PlayerListener implements Listener {
|
|||||||
Player player = (Player) event.getEntity();
|
Player player = (Player) event.getEntity();
|
||||||
|
|
||||||
if(pl.getJailStickManager().isUsingJailStick(attacker.getUniqueId())) {
|
if(pl.getJailStickManager().isUsingJailStick(attacker.getUniqueId())) {
|
||||||
if(pl.getJailStickManager().isValidStick(attacker.getItemInHand().getType())) {
|
if(pl.getJailStickManager().isValidStick(attacker.getInventory().getItemInMainHand().getType())) {
|
||||||
if(attacker.hasPermission("jail.usejailstick." + attacker.getItemInHand().getType().toString().toLowerCase())) {
|
if(attacker.hasPermission("jail.usejailstick." + attacker.getInventory().getItemInMainHand().getType().toString().toLowerCase())) {
|
||||||
//The person the attacker is trying to jail stick is already jailed, don't handle that
|
//The person the attacker is trying to jail stick is already jailed, don't handle that
|
||||||
if(pl.getJailManager().isPlayerJailed(player.getUniqueId())) {
|
if(pl.getJailManager().isPlayerJailed(player.getUniqueId())) {
|
||||||
attacker.sendMessage(Lang.ALREADYJAILED.get(player.getName()));
|
attacker.sendMessage(Lang.ALREADYJAILED.get(player.getName()));
|
||||||
@ -234,7 +234,7 @@ public class PlayerListener implements Listener {
|
|||||||
if(player.hasPermission("jail.cantbejailed")) {
|
if(player.hasPermission("jail.cantbejailed")) {
|
||||||
attacker.sendMessage(Lang.CANTBEJAILED.get());
|
attacker.sendMessage(Lang.CANTBEJAILED.get());
|
||||||
}else {
|
}else {
|
||||||
Stick s = pl.getJailStickManager().getStick(attacker.getItemInHand().getType());
|
Stick s = pl.getJailStickManager().getStick(attacker.getInventory().getItemInMainHand().getType());
|
||||||
|
|
||||||
if(player.getHealth() <= s.getHealth() || s.getHealth() == -1) {
|
if(player.getHealth() <= s.getHealth() || s.getHealth() == -1) {
|
||||||
Prisoner p = new Prisoner(player.getUniqueId().toString(), player.getName(),
|
Prisoner p = new Prisoner(player.getUniqueId().toString(), player.getName(),
|
||||||
|
@ -289,7 +289,7 @@ public class ProtectionListener implements Listener {
|
|||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}else if (event.getPlayer().getItemInHand() != null) {
|
}else if (event.getPlayer().getInventory().getItemInMainHand() != null) {
|
||||||
//Otherwise let's check if they have something in hand
|
//Otherwise let's check if they have something in hand
|
||||||
//Get the interaction blacklist, check if the current item is in there
|
//Get the interaction blacklist, check if the current item is in there
|
||||||
//if it is, then let's take action
|
//if it is, then let's take action
|
||||||
|
@ -37,8 +37,8 @@ public class CellCreationSteps {
|
|||||||
if(player.getInventory().contains(wand)) {
|
if(player.getInventory().contains(wand)) {
|
||||||
int i = player.getInventory().first(wand);
|
int i = player.getInventory().first(wand);
|
||||||
if(i != -1) {
|
if(i != -1) {
|
||||||
player.getInventory().setItem(i, player.getItemInHand());
|
player.getInventory().setItem(i, player.getInventory().getItemInMainHand());
|
||||||
player.setItemInHand(wand);
|
player.getInventory().setItemInMainHand(wand);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
player.getInventory().addItem(wand);
|
player.getInventory().addItem(wand);
|
||||||
|
@ -30,8 +30,8 @@ public class JailCreationSteps {
|
|||||||
if(player.getInventory().contains(wand)) {
|
if(player.getInventory().contains(wand)) {
|
||||||
int i = player.getInventory().first(wand);
|
int i = player.getInventory().first(wand);
|
||||||
if(i != -1) {
|
if(i != -1) {
|
||||||
player.getInventory().setItem(i, player.getItemInHand());
|
player.getInventory().setItem(i, player.getInventory().getItemInMainHand());
|
||||||
player.setItemInHand(wand);
|
player.getInventory().setItemInMainHand(wand);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
player.getInventory().addItem(wand);
|
player.getInventory().addItem(wand);
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.HumanEntity;
|
import org.bukkit.entity.HumanEntity;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
@ -13,7 +14,6 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
|
||||||
public class MockPlayerInventory implements PlayerInventory {
|
public class MockPlayerInventory implements PlayerInventory {
|
||||||
|
|
||||||
private int armorSize = 4, inventorySize = 36;
|
private int armorSize = 4, inventorySize = 36;
|
||||||
ItemStack[] armorContents = new ItemStack[armorSize];
|
ItemStack[] armorContents = new ItemStack[armorSize];
|
||||||
ItemStack[] inventoryContents = new ItemStack[inventorySize];
|
ItemStack[] inventoryContents = new ItemStack[inventorySize];
|
||||||
@ -294,8 +294,27 @@ public class MockPlayerInventory implements PlayerInventory {
|
|||||||
+ ",\"armorContents\":" + makeMap(getArmorContents()) + "}";
|
+ ",\"armorContents\":" + makeMap(getArmorContents()) + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setHeldItemSlot(int slot) {
|
public void setHeldItemSlot(int slot) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getLocation() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getItemInMainHand() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getItemInOffHand() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemInMainHand(ItemStack item) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemInOffHand(ItemStack item) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -30,7 +30,7 @@ import org.bukkit.WorldCreator;
|
|||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemFactory;
|
import org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemFactory;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
Loading…
Reference in New Issue
Block a user