Add Support for the new FurnitureLib(1.9)

This commit is contained in:
BuildTools 2016-03-05 20:16:46 +01:00
parent 0df6cb1fc7
commit 20c0aa71af
42 changed files with 300 additions and 257 deletions

View File

@ -2,8 +2,8 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="C:/Plugins/jars/spigot.jar"/>
<classpathentry kind="lib" path="C:/Plugins/jars/FurnitureLib.jar"/>
<classpathentry kind="lib" path="C:/Plugins/jars/PostalService-1.0.6.jar"/>
<classpathentry kind="lib" path="C:/Plugins/jars/spigot_server.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,19 +1,21 @@
package de.Ste3et_C0st.Furniture.Camera.Utils;
import java.awt.Color;
import java.util.HashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.map.MapPalette;
import de.Ste3et_C0st.Furniture.Main.main;
public class GetBlocks {
public HashMap<Integer, HashMap<Integer, Byte>> returnBlocks(Location location, int höhe, int links){
public HashMap<Integer, HashMap<Integer, Byte>> returnBlocks(Location location, int höhe, int links){
HashMap<Integer, HashMap<Integer, Byte>> blockList = new HashMap<Integer, HashMap<Integer, Byte>>();
BlockFace b = main.getLocationUtil().yawToFace(location.getYaw());
höhe = höhe/2;
höhe = höhe/2;
//links = links/2;
location = main.getLocationUtil().getRelativ(location, b, 0D,- (double) (links/2));
Integer tiefe = 24;
@ -22,7 +24,7 @@ public class GetBlocks {
HashMap<Integer, Byte> layerlist = new HashMap<Integer, Byte>();
Integer blockindex = 0;
for(int y = 0;y<=links;y++){
for(int z = 0;z<=höhe;z++){
for(int z = 0;z<=höhe;z++){
Block b1 = main.getLocationUtil().getRelativ(location, b,(double) x, (double) y).add(0,z,0).getBlock();
byte byte1 = getByteFromBlock(b1);
layerlist.put(blockindex, byte1);
@ -37,6 +39,11 @@ public class GetBlocks {
return blockList;
}
@SuppressWarnings("deprecation")
public Color getRedByte(Block b){
return MapPalette.getColor((byte) b.getTypeId());
}
@SuppressWarnings("deprecation")
public Byte getByteFromBlock(Block b){
Material m = b.getType();

View File

@ -67,7 +67,7 @@ public class RenderClass extends MapRenderer {
}
}
//mapCanvas.drawText(10, 10, font, "§18;TESTPHASE");
//mapCanvas.drawText(10, 10, font, "<EFBFBD>18;TESTPHASE");
hasRendered = false;
}catch(Exception e){e.printStackTrace();}

View File

@ -58,7 +58,7 @@ public class Crossbow extends Furniture implements Listener {
Location loc = getLutil().getRelativ(getCenter().add(0, -1.7, 0), getLutil().yawToFace(yaw), .34, .4);
loc.setYaw(yaw+45);
fArmorStand stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setMarker(false);
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90,270,135)));
asList.add(stand);
@ -73,7 +73,7 @@ public class Crossbow extends Furniture implements Listener {
Location loc = getRelative(getCenter().add(0, -.74, 0), getBlockFace(), -.6, .48);
loc.setYaw(getYaw()-90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80,0,90)));
stand.setMarker(false);
asList.add(stand);
@ -81,7 +81,7 @@ public class Crossbow extends Furniture implements Listener {
loc = getRelative(getCenter().add(0, -.62, 0),getBlockFace(), -.4,.07);
loc.setYaw(getYaw()-90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.BOW));
stand.setItemInMainHand(new ItemStack(Material.BOW));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(0,10,90)));
stand.setMarker(false);
asList.add(stand);
@ -134,11 +134,11 @@ public class Crossbow extends Furniture implements Listener {
if(!e.canBuild()){return;}
fArmorStand stand = getArmorStand();
if(stand==null){return;}
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
if(!hasArrow()||(is!=null&&is.getType()!=null&&is.getType().equals(Material.ARROW))){
if(e.getPlayer().getItemInHand()==null){return;}
if(e.getPlayer().getItemInHand().getType()==null){return;}
if(!e.getPlayer().getItemInHand().getType().equals(Material.ARROW)){return;}
if(e.getPlayer().getInventory().getItemInMainHand()==null){return;}
if(e.getPlayer().getInventory().getItemInMainHand().getType()==null){return;}
if(!e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.ARROW)){return;}
addArmor(is, stand);
}else{
spawnArrow();
@ -155,11 +155,11 @@ public class Crossbow extends Furniture implements Listener {
if(!e.canBuild()){return;}
fArmorStand stand = getArmorStand();
if(stand==null){return;}
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
if(!hasArrow()||(is!=null&&is.getType()!=null&&is.getType().equals(Material.ARROW))){
if(e.getPlayer().getItemInHand()==null){return;}
if(e.getPlayer().getItemInHand().getType()==null){return;}
if(!e.getPlayer().getItemInHand().getType().equals(Material.ARROW)){return;}
if(e.getPlayer().getInventory().getItemInMainHand()==null){return;}
if(e.getPlayer().getInventory().getItemInMainHand().getType()==null){return;}
if(!e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.ARROW)){return;}
addArmor(is, stand);
}else{
spawnArrow();
@ -178,7 +178,7 @@ public class Crossbow extends Furniture implements Listener {
case WEST: v= new Vector(1.2, 0.5, 0);break;
default:break;
}
getWorld().playSound(getLocation(), Sound.SHOOT_ARROW, 1, 1);
getWorld().playSound(getLocation(), Sound.ENTITY_ARROW_SHOOT, 1, 1);
Location start = getRelative(getCenter(), getBlockFace(), 0,0);
start.setYaw(getYaw());
start = start.add(0, 1.8, 0);
@ -200,20 +200,20 @@ public class Crossbow extends Furniture implements Listener {
}
private void removeArrow(fArmorStand stand){
ItemStack is = stand.getItemInHand();
ItemStack is = stand.getItemInMainHand();
if(is.getAmount()-1<=0){
stand.setItemInHand(new ItemStack(Material.AIR));
stand.setItemInMainHand(new ItemStack(Material.AIR));
update();
return;
}
is.setAmount(is.getAmount()-1);
stand.setItemInHand(is);
stand.setItemInMainHand(is);
update();
}
private void addArmor(ItemStack is, fArmorStand stand){
if(getArrow()!=null){is.setAmount(getArrow().getAmount());}
stand.setItemInHand(is);
stand.setItemInMainHand(is);
update();
}
@ -231,8 +231,8 @@ public class Crossbow extends Furniture implements Listener {
private ItemStack getArrow(){
for(fArmorStand stand : getfAsList()){
if(stand.getName().equalsIgnoreCase("#ARROW#")){
if(!(stand.getItemInHand()==null||stand.getItemInHand().getType()==null||stand.getItemInHand().getType().equals(Material.AIR))){
return stand.getItemInHand();
if(!(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR))){
return stand.getItemInMainHand();
}
}
}
@ -242,7 +242,7 @@ public class Crossbow extends Furniture implements Listener {
private boolean hasArrow(){
for(fArmorStand stand : getfAsList()){
if(stand.getName().equalsIgnoreCase("#ARROW#")){
if(stand.getItemInHand()==null||stand.getItemInHand().getType()==null||stand.getItemInHand().getType().equals(Material.AIR)){
if(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR)){
return false;
}else{
return true;

View File

@ -35,32 +35,32 @@ public class HumanSkeleton extends Furniture implements Listener {
public void spawn(Location paramLocation) {
List<fArmorStand> asList = new ArrayList<fArmorStand>();
fArmorStand stand = spawnArmorStand(getRelative(getLocation().add(0, -1.4, 0), -.25, 0));
stand.setItemInHand(new ItemStack(Material.BONE));
stand.setItemInMainHand(new ItemStack(Material.BONE));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-40,0,90)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getLocation().add(0, -1.4, 0), .2, 1.2));
stand.setItemInHand(new ItemStack(Material.BONE));
stand.setItemInMainHand(new ItemStack(Material.BONE));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(40,0,90)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getLocation().add(0, -1.4, 0), .3, .75));
stand.setItemInHand(new ItemStack(Material.BONE));
stand.setItemInMainHand(new ItemStack(Material.BONE));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(0,0,90)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getLocation().add(0, -1.4, 0), .9, .42));
stand.setItemInHand(new ItemStack(Material.BONE));
stand.setItemInMainHand(new ItemStack(Material.BONE));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-30,0,90)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getLocation().add(0, -1.4, 0), 1.1, -.6));
stand.setItemInHand(new ItemStack(Material.BONE));
stand.setItemInMainHand(new ItemStack(Material.BONE));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-80,0,90)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getLocation().add(0, -1.4, 0), 1.6, 1.3));
stand.setItemInHand(new ItemStack(Material.BONE));
stand.setItemInMainHand(new ItemStack(Material.BONE));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(30,0,90)));
asList.add(stand);

View File

@ -19,6 +19,7 @@ import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
@ -84,28 +85,28 @@ public class catapult extends Furniture implements Listener {
Location loc = getRelative(getCenter(), getBlockFace(), .15, -.2).add(0, -1.6, 0);
fArmorStand stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setMarker(false);
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80,0,90)));
asList.add(stand);
loc = getRelative(getCenter(), getBlockFace(), 2.8-.12, -.2).add(0, -1.6, 0);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setMarker(false);
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80,0,90)));
asList.add(stand);
loc = getRelative(getCenter(), getBlockFace(), 1.5-.12, -.2).add(0, -1.6, 0);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setMarker(false);
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80,0,90)));
asList.add(stand);
loc = getRelative(getCenter(), getBlockFace(), 1.5-.12, -.2).add(0, 0, 0);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setMarker(false);
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80,0,90)));
asList.add(stand);
@ -113,7 +114,7 @@ public class catapult extends Furniture implements Listener {
loc = getRelative(getCenter(), getBlockFace(), 1.5-.3, -1.4).add(0, -1.1, 0);
loc.setYaw(getYaw()+180);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setMarker(false);
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(335,0,0)));
asList.add(stand);
@ -121,7 +122,7 @@ public class catapult extends Furniture implements Listener {
loc = getRelative(getCenter(), getBlockFace(), .4, -1.4).add(0, -.9, 0);
loc.setYaw(getYaw()+180);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(335,0,0)));
stand.setMarker(false);
asList.add(stand);
@ -165,6 +166,25 @@ public class catapult extends Furniture implements Listener {
Block b = entity.getLocation().getBlock().getRelative(BlockFace.DOWN);
if(!FurnitureLib.getInstance().getPermManager().canBuild(p, b.getLocation())){
e.setCancelled(true);
e.getEntity().remove();
}
}
}
}
@EventHandler
public void onPrimedTnt(EntityExplodeEvent e){
if(e.getEntity()==null) return;
if(e.getEntity() instanceof TNTPrimed){
if(fallingSandList.containsKey(e.getEntity())){
Entity entity = e.getEntity();
Player p = fallingSandList.get(e.getEntity());
fallingSandList.remove(e.getEntity());
Block b = entity.getLocation().getBlock().getRelative(BlockFace.DOWN);
if(!FurnitureLib.getInstance().getPermManager().canBuild(p, b.getLocation())){
e.setCancelled(true);
e.blockList().clear();
e.getEntity().remove();
}
}
}
@ -196,6 +216,7 @@ public class catapult extends Furniture implements Listener {
}
tnt.playEffect(EntityEffect.WITCH_MAGIC);
tnt.setVelocity(v.multiply(1));
fallingSandList.put(tnt, e.getPlayer());
}else{
FallingBlock block = getWorld().spawnFallingBlock(loc, stack.getType().getId(), (byte) stack.getDurability());
Vector v=null;

View File

@ -55,7 +55,7 @@ public class flag extends Furniture implements Listener {
Location loc = getLutil().getRelativ(center.clone(), getBlockFace(), .47, .38).add(0, .88*i, 0);
loc.setYaw(getYaw());
fArmorStand packet = spawnArmorStand(loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}
@ -146,12 +146,12 @@ public class flag extends Furniture implements Listener {
if(e.isCancelled()){return;}
if(!e.getID().equals(getObjID())){return;}
if(!e.canBuild()){return;}
if(e.getPlayer().getItemInHand()!=null&&e.getPlayer().getItemInHand().getType()!=null){
if(e.getPlayer().getItemInHand().getType().equals(Material.BANNER)){
getStand().setHelmet(e.getPlayer().getItemInHand());update();
if(e.getPlayer().getInventory().getItemInMainHand()!=null&&e.getPlayer().getInventory().getItemInMainHand().getType()!=null){
if(e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.BANNER)){
getStand().setHelmet(e.getPlayer().getInventory().getItemInMainHand());update();
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
is.setAmount(is.getAmount()-1);
e.getPlayer().getInventory().setItem(i, is);
e.getPlayer().updateInventory();
@ -186,12 +186,12 @@ public class flag extends Furniture implements Listener {
if(e.isCancelled()){return;}
if(!e.getID().equals(getObjID())){return;}
if(!e.canBuild()){return;}
if(e.getPlayer().getItemInHand()!=null&&e.getPlayer().getItemInHand().getType()!=null){
if(e.getPlayer().getItemInHand().getType().equals(Material.BANNER)){
getStand().setHelmet(e.getPlayer().getItemInHand());update();
if(e.getPlayer().getInventory().getItemInMainHand()!=null&&e.getPlayer().getInventory().getItemInMainHand().getType()!=null){
if(e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.BANNER)){
getStand().setHelmet(e.getPlayer().getInventory().getItemInMainHand());update();
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
is.setAmount(is.getAmount()-1);
e.getPlayer().getInventory().setItem(i, is);
e.getPlayer().updateInventory();

View File

@ -72,7 +72,7 @@ public class guillotine extends Furniture implements Listener{
pane = new ItemStack(Material.STAINED_GLASS_PANE);
pane.setDurability((short) 15);
ItemMeta im = pane.getItemMeta();
im.setDisplayName("§c");
im.setDisplayName("<EFBFBD>c");
pane.setItemMeta(im);
@ -111,19 +111,27 @@ public class guillotine extends Furniture implements Listener{
}
}
if(packet3.getHelmet()!=null){
packet2.setHelmet(packet3.getHelmet());
packet3.setHelmet(new ItemStack(Material.AIR));
if(packet3!=null){
if(packet3.getHelmet()!=null){
packet2.setHelmet(packet3.getHelmet());
packet3.setHelmet(new ItemStack(Material.AIR));
}
}
soundPlaying = false;
packet1.setPose(getLutil().degresstoRad(new EulerAngle(190,0,329)), BodyPart.RIGHT_ARM);
packet1.setLeftArmPose(BodyPart.LEFT_ARM.getDefAngle());
Location loc13 = getStartLocation(packet2.getName());
packet2.teleport(loc13);
packet2.setPose(getLutil().degresstoRad(new EulerAngle(40,0,320)), BodyPart.RIGHT_ARM);
packet2.setPose(getLutil().degresstoRad(new EulerAngle(33,0,41)), BodyPart.LEFT_ARM);
packet2.setPose(getLutil().degresstoRad(new EulerAngle(40,25,0)), BodyPart.HEAD);
if(packet1!=null){
packet1.setPose(getLutil().degresstoRad(new EulerAngle(190,0,329)), BodyPart.RIGHT_ARM);
packet1.setLeftArmPose(BodyPart.LEFT_ARM.getDefAngle());
}
if(packet2!=null){
Location loc13 = getStartLocation(packet2.getName());
packet2.teleport(loc13);
packet2.setPose(getLutil().degresstoRad(new EulerAngle(40,0,320)), BodyPart.RIGHT_ARM);
packet2.setPose(getLutil().degresstoRad(new EulerAngle(33,0,41)), BodyPart.LEFT_ARM);
packet2.setPose(getLutil().degresstoRad(new EulerAngle(40,25,0)), BodyPart.HEAD);
}
timer = Bukkit.getScheduler().scheduleSyncRepeatingTask(getPlugin(), new Runnable() {
int x = 0;
@Override
@ -220,7 +228,7 @@ public class guillotine extends Furniture implements Listener{
packList.add(packet);
packet = getManager().createArmorStand(getObjID(), loc7);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
packList.add(packet);
@ -309,7 +317,7 @@ public class guillotine extends Furniture implements Listener{
if(canDrop(packet1.getChestPlate())){getWorld().dropItem(getLocation(), packet1.getChestPlate());}
if(canDrop(packet1.getLeggings())){getWorld().dropItem(getLocation(), packet1.getLeggings());}
if(canDrop(packet1.getBoots())){getWorld().dropItem(getLocation(), packet1.getBoots());}
if(canDrop(packet1.getItemInHand())){getWorld().dropItem(getLocation(), packet1.getItemInHand());}
if(canDrop(packet1.getItemInMainHand())){getWorld().dropItem(getLocation(), packet1.getItemInMainHand());}
if(canDrop(packet2.getHelmet())){getWorld().dropItem(getLocation(), packet2.getHelmet());}
if(canDrop(packet2.getChestPlate())){getWorld().dropItem(getLocation(), packet2.getChestPlate());}
if(canDrop(packet2.getLeggings())){getWorld().dropItem(getLocation(), packet2.getLeggings());}
@ -346,14 +354,14 @@ public class guillotine extends Furniture implements Listener{
ItemStack is = new ItemStack(Material.SKULL_ITEM);
is.setDurability((short) 1);
ItemMeta im = is.getItemMeta();
im.setDisplayName("§2Executioner");
im.setDisplayName("<EFBFBD>2Executioner");
is.setItemMeta(im);
invI.setItem(2, is);
is = new ItemStack(Material.SKULL_ITEM);
is.setDurability((short) 3);
im = is.getItemMeta();
im.setDisplayName("§cOblation");
im.setDisplayName("<EFBFBD>cOblation");
is.setItemMeta(im);
invI.setItem(6, is);
this.p = p;
@ -442,7 +450,7 @@ public class guillotine extends Furniture implements Listener{
boolean a = false,b = false,c = false;
a = !packet1.isVisible();
b = !packet2.isVisible();
if(packet1.getItemInHand()!=null&&!packet1.getItemInHand().equals(Material.AIR)){
if(packet1.getItemInMainHand()!=null&&!packet1.getItemInMainHand().equals(Material.AIR)){
c = true;
}
@ -566,12 +574,12 @@ public class guillotine extends Furniture implements Listener{
}
if(invII.getItem(16)!=null){
packet1.getInventory().setItemInHand(invII.getItem(16));
packet1.getInventory().setItemInMainHand(invII.getItem(16));
}
}else{
if(invII.getItem(43)!=null&&!invII.getItem(43).getType().equals(Material.AIR)){getWorld().dropItem(getLocation().clone().add(0, 1, 0), invII.getItem(43));}
if(invII.getItem(16)!=null&&!invII.getItem(16).getType().equals(Material.AIR)){getWorld().dropItem(getLocation().clone().add(0, 1, 0), invII.getItem(16));}
packet1.getInventory().setItemInHand(new ItemStack(Material.AIR));
packet1.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
packet1.setName("#Executioner#");
packet1.setNameVasibility(!invisible);
}
@ -602,9 +610,9 @@ public class guillotine extends Furniture implements Listener{
private void playSound(){
if(!soundPlaying){
getWorld().playSound(getLocation(), Sound.GHAST_DEATH, 2, 1);
getWorld().playSound(getLocation(), Sound.GHAST_SCREAM, 1, 1);
getWorld().playSound(getLocation(), Sound.GHAST_MOAN, 1, 1);
getWorld().playSound(getLocation(), Sound.ENTITY_GHAST_DEATH, 2, 1);
getWorld().playSound(getLocation(), Sound.ENTITY_GHAST_SCREAM, 1, 1);
getWorld().playSound(getLocation(), Sound.ENTITY_GHAST_WARN, 1, 1);
soundPlaying= true;
}
}
@ -638,7 +646,7 @@ public class guillotine extends Furniture implements Listener{
case 19:inv.setItem(j, packet.getChestPlate());break;
case 28:inv.setItem(j, packet.getLeggings());break;
case 37:inv.setItem(j, packet.getBoots());break;
case 16:if(i==1){inv.setItem(j, packet.getItemInHand());break;}
case 16:if(i==1){inv.setItem(j, packet.getItemInMainHand());break;}
case 43:if(i==1){inv.setItem(j, stack);break;}
default: inv.setItem(j, pane);break;
}

View File

@ -62,9 +62,9 @@ public class weaponStand extends Furniture {
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
for(fArmorStand packet : asList){
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
if(packet.getInventory().getItemInHand()!=null){
if(!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
getWorld().dropItem(getLocation(), packet.getInventory().getItemInHand());
if(packet.getInventory().getItemInMainHand()!=null){
if(!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
getWorld().dropItem(getLocation(), packet.getInventory().getItemInMainHand());
}
}
}
@ -84,7 +84,7 @@ public class weaponStand extends Furniture {
if(!e.canBuild()){return;}
this.p = e.getPlayer();
ItemStack itemstack = p.getItemInHand();
ItemStack itemstack = p.getInventory().getItemInMainHand();
if(itemstack!=null&&matList.contains(itemstack.getType())){
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getInventory().getHelmet()!=null){
@ -104,12 +104,12 @@ public class weaponStand extends Furniture {
ItemMeta im1 = is1.getItemMeta();
ItemMeta im3 = is3.getItemMeta();
im1.setDisplayName("§c");
im3.setDisplayName("§c");
im1.setDisplayName("<EFBFBD>c");
im3.setDisplayName("<EFBFBD>c");
is1.setItemMeta(im1);
is3.setItemMeta(im3);
inv = Bukkit.createInventory(null, 45, "§cWeaponBox");
inv = Bukkit.createInventory(null, 45, "<EFBFBD>cWeaponBox");
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
int j = 1;
@ -122,7 +122,7 @@ public class weaponStand extends Furniture {
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
ItemStack is = new ItemStack(Material.AIR);
if(packet.getInventory().getItemInHand()!=null){is = packet.getInventory().getItemInHand();}
if(packet.getInventory().getItemInMainHand()!=null){is = packet.getInventory().getItemInMainHand();}
inv.setItem(i, is);
}
}
@ -178,7 +178,7 @@ public class weaponStand extends Furniture {
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
ItemStack is = inv.getItem(i);
if(is==null){is = new ItemStack(Material.AIR);}
packet.getInventory().setItemInHand(is);
packet.getInventory().setItemInMainHand(is);
}
}
}

View File

@ -89,20 +89,20 @@ public class BlackBoard extends Furniture implements Listener {
Player p = e.getPlayer();
if(!e.canBuild()){return;}
e.setCancelled(true);
if(p.getItemInHand().getType().isBlock()&&!p.getItemInHand().getType().equals(Material.AIR)){return;}
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
ItemStack Itemstack = p.getItemInHand().clone();
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
Itemstack.setAmount(1);
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}
packet.getInventory().setItemInHand(Itemstack);
packet.getInventory().setItemInMainHand(Itemstack);
if(p.getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) break;
Integer i = p.getInventory().getHeldItemSlot();
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
is.setAmount(is.getAmount()-1);
p.getInventory().setItem(i, is);
p.updateInventory();

View File

@ -44,25 +44,25 @@ public class SchoolChair extends Furniture implements Listener {
loc4.setYaw(getYaw()+90);
fArmorStand stand = spawnArmorStand(loc1);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
stand = spawnArmorStand(loc2);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
stand = spawnArmorStand(loc3);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
stand = spawnArmorStand(loc4);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
@ -93,6 +93,7 @@ public class SchoolChair extends Furniture implements Listener {
if(getObjID()==null){return;}
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
if(e.isCancelled()){return;}
if(e.getID()==null) return;
if(!e.getID().equals(getObjID())){return;}
if(!e.canBuild()){return;}
delete();

View File

@ -43,8 +43,8 @@ public class SchoolTable extends Furniture implements Listener {
e.setCancelled(true);
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
getWorld().dropItem(getLocation(), is);
}
}
@ -62,20 +62,20 @@ public class SchoolTable extends Furniture implements Listener {
Player p = e.getPlayer();
if(!e.canBuild()){return;}
e.setCancelled(true);
if(p.getItemInHand().getType().isBlock()&&!p.getItemInHand().getType().equals(Material.AIR)){return;}
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
ItemStack Itemstack = p.getItemInHand().clone();
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
Itemstack.setAmount(1);
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}
packet.getInventory().setItemInHand(Itemstack);
packet.getInventory().setItemInMainHand(Itemstack);
if(p.getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) break;
Integer i = p.getInventory().getHeldItemSlot();
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
is.setAmount(is.getAmount()-1);
p.getInventory().setItem(i, is);
p.updateInventory();
@ -102,25 +102,25 @@ public class SchoolTable extends Furniture implements Listener {
loc5.setYaw(getYaw()+90);
fArmorStand stand = spawnArmorStand(loc1);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
stand = spawnArmorStand(loc2);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
stand = spawnArmorStand(loc3);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);
stand = spawnArmorStand(loc4);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-100, 0, 0)));
stand.setMarker(false);
asList.add(stand);

View File

@ -48,7 +48,7 @@ public class TrashCan extends Furniture implements Listener {
if(e.isCancelled()) return;
if(!e.getID().equals(getObjID())) return;
if(!e.canBuild()){return;}
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
fArmorStand stand = null;
for(fArmorStand s : getfAsList()){
if(s.getName().equalsIgnoreCase("#TRASH#")){
@ -57,14 +57,14 @@ public class TrashCan extends Furniture implements Listener {
}
if(stand==null){return;}
if(is==null||is.getType()==null||is.getType().equals(Material.AIR)){
if(stand.getItemInHand()!=null&&!stand.getItemInHand().getType().equals(Material.AIR)){
getWorld().dropItem(getCenter(), stand.getItemInHand());
stand.setItemInHand(new ItemStack(Material.AIR));
if(stand.getItemInMainHand()!=null&&!stand.getItemInMainHand().getType().equals(Material.AIR)){
getWorld().dropItem(getCenter(), stand.getItemInMainHand());
stand.setItemInMainHand(new ItemStack(Material.AIR));
update();
return;
}
}
stand.setItemInHand(is);
stand.setItemInMainHand(is);
e.getPlayer().getInventory().clear(e.getPlayer().getInventory().getHeldItemSlot());
e.getPlayer().updateInventory();
update();

View File

@ -14,6 +14,8 @@ import java.util.List;
import java.util.Random;
import java.util.UUID;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@ -101,7 +103,7 @@ public class AdventCalender extends Furniture implements Listener {
if(e.isCancelled()){return;}
if(e.getID() == null || getObjID() == null) return;
if(!e.getID().equals(getObjID())){return;}
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
if(is==null){open(e.getPlayer()); return;}
if(is.getType()==null){open(e.getPlayer()); return;}
if(is.getType().equals(Material.ARROW)){
@ -142,10 +144,12 @@ public class AdventCalender extends Furniture implements Listener {
if(name.startsWith("@PLAYER ")){
name = name.replace("%player%", p.getName());
name = name.replace("@PLAYER ", "");
name = ChatColor.translateAlternateColorCodes('&', name);
p.sendMessage(name);
}else if(name.startsWith("@BROADCAST ")){
name = name.replace("%player%", p.getName());
name = name.replace("@BROADCAST ", "");
name = ChatColor.translateAlternateColorCodes('&', name);
getLib().getServer().broadcastMessage(name);
}
}
@ -291,7 +295,7 @@ public class AdventCalender extends Furniture implements Listener {
}
private void openInventory(ItemStack[] is){
inv = Bukkit.createInventory(null, 54, "§8Christmas Reward [§c" + i + "§8]");
inv = Bukkit.createInventory(null, 54, "<EFBFBD>8Christmas Reward [<5B>c" + i + "<EFBFBD>8]");
if(is!=null) inv.setContents(is);
p.openInventory(inv);
}
@ -309,7 +313,7 @@ public class AdventCalender extends Furniture implements Listener {
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(210, 190, 305)));
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(60, 0, 0)));
stand.setHelmet(new ItemStack(Material.GOLD_BLOCK));
stand.setItemInHand(new ItemStack(Material.LEAVES));
stand.setItemInMainHand(new ItemStack(Material.LEAVES));
asList.add(stand);
l+=o;
}
@ -322,7 +326,7 @@ public class AdventCalender extends Furniture implements Listener {
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(210, 190, 305)));
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(60, 0, 0)));
stand.setHelmet(new ItemStack(Material.LEAVES));
stand.setItemInHand(new ItemStack(Material.LEAVES));
stand.setItemInMainHand(new ItemStack(Material.LEAVES));
stand.setSmall(true);
asList.add(stand);
l+=o;

View File

@ -55,6 +55,7 @@ public class AdventWreath extends Furniture implements Listener {
public void onFurnitureClick(FurnitureClickEvent e) {
if(getObjID()==null){return;}
if(e.isCancelled()){return;}
if(e.getID()==null) return;
if(!e.getID().equals(getObjID())){return;}
if(e.getID() == null || getObjID() == null) return;
if(!e.canBuild()){return;}
@ -102,7 +103,7 @@ public class AdventWreath extends Furniture implements Listener {
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(210, 190, 305)));
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(60, 0, 0)));
stand.setHelmet(new ItemStack(Material.GOLD_BLOCK));
stand.setItemInHand(new ItemStack(Material.LEAVES));
stand.setItemInMainHand(new ItemStack(Material.LEAVES));
asList.add(stand);
l+=o;
@ -116,7 +117,7 @@ public class AdventWreath extends Furniture implements Listener {
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(210, 190, 305)));
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(60, 0, 0)));
stand.setHelmet(new ItemStack(Material.LEAVES));
stand.setItemInHand(new ItemStack(Material.LEAVES));
stand.setItemInMainHand(new ItemStack(Material.LEAVES));
stand.setSmall(true);
asList.add(stand);
l+=o;

View File

@ -74,12 +74,12 @@ public class ChristmasTree extends Furniture implements Listener{
asList.add(stand);
stand = spawnArmorStand(getRelative(getCenter(), getBlockFace(), .5, .4).add(0, d+.2, 0));
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80, 0, 0)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getCenter(), getBlockFace(), .5, .4).add(0, d+3.3, 0));
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80, 0, 0)));
asList.add(stand);

View File

@ -44,8 +44,8 @@ public class FireworkLauncher extends Furniture implements Listener {
if(!canBuild(e.getPlayer())){return;}
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#FIREWORK#")){
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
getWorld().dropItem(getLocation(), is);
}
}
@ -71,11 +71,11 @@ public class FireworkLauncher extends Furniture implements Listener {
}
}
if(stand == null) return;
if(p.getItemInHand()!=null){
if(p.getItemInHand().getType()!=null){
if(p.getItemInHand().getType().equals(Material.FIREWORK)){
if(p.getInventory().getItemInMainHand()!=null){
if(p.getInventory().getItemInMainHand().getType()!=null){
if(p.getInventory().getItemInMainHand().getType().equals(Material.FIREWORK)){
drop(stand);
setItem(stand, p.getItemInHand());
setItem(stand, p.getInventory().getItemInMainHand());
Bukkit.getScheduler().runTaskLater(getPlugin(), new Runnable() {
@ -88,7 +88,7 @@ public class FireworkLauncher extends Furniture implements Listener {
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
is.setAmount(is.getAmount()-1);
p.getInventory().setItem(i, is);
p.updateInventory();
@ -99,7 +99,7 @@ public class FireworkLauncher extends Furniture implements Listener {
if(canLaunch(stand)){
Firework fw = (Firework) getWorld().spawnEntity(getCenter(), EntityType.FIREWORK);
FireworkMeta meta = (FireworkMeta) stand.getItemInHand().getItemMeta();
FireworkMeta meta = (FireworkMeta) stand.getItemInMainHand().getItemMeta();
fw.setFireworkMeta(meta);
setItem(stand, new ItemStack(Material.AIR));
}
@ -110,8 +110,8 @@ public class FireworkLauncher extends Furniture implements Listener {
}
public boolean canLaunch(fArmorStand stand){
if(stand.getItemInHand()!=null){
if(stand.getItemInHand().getType().equals(Material.FIREWORK)){
if(stand.getItemInMainHand()!=null){
if(stand.getItemInMainHand().getType().equals(Material.FIREWORK)){
return true;
}
}
@ -121,14 +121,14 @@ public class FireworkLauncher extends Furniture implements Listener {
public void setItem(fArmorStand stand, ItemStack is){
ItemStack stack = is.clone();
stack.setAmount(1);
stand.setItemInHand(stack);
stand.setItemInMainHand(stack);
update();
}
public void drop(fArmorStand stand){
if(stand.getItemInHand()!=null){
getWorld().dropItem(getCenter(), stand.getItemInHand());
stand.setItemInHand(new ItemStack(Material.AIR));
if(stand.getItemInMainHand()!=null){
getWorld().dropItem(getCenter(), stand.getItemInMainHand());
stand.setItemInMainHand(new ItemStack(Material.AIR));
update();
}
}
@ -139,12 +139,12 @@ public class FireworkLauncher extends Furniture implements Listener {
double d = -1.2;
fArmorStand stand = spawnArmorStand(getRelative(getCenter(), getBlockFace(), .5, .4).add(0, d+.2, 0));
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80, 0, 0)));
asList.add(stand);
stand = spawnArmorStand(getRelative(getCenter(), getBlockFace(), .5, .4).add(0, d+.9, 0));
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(80, 0, 0)));
asList.add(stand);

View File

@ -83,7 +83,7 @@ public class SnowGolem extends Furniture implements Listener{
Location loc = getRelative(getCenter().add(0, -.25, 0), -.18, -.54);
loc.setYaw(getYaw()+90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.CARROT_ITEM));
stand.setItemInMainHand(new ItemStack(Material.CARROT_ITEM));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90, 0, -40)));
stand.setMarker(false);
asList.add(stand);
@ -91,7 +91,7 @@ public class SnowGolem extends Furniture implements Listener{
loc = getRelative(getCenter().add(0, .2, 0), .05, -.15);
loc.setYaw(getYaw()+90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
stand.setItemInMainHand(new ItemStack(Material.COAL_BLOCK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
stand.setSmall(true);
asList.add(stand);
@ -99,7 +99,7 @@ public class SnowGolem extends Furniture implements Listener{
loc = getRelative(getCenter().add(0, .2, 0), .05, -.45);
loc.setYaw(getYaw()+90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
stand.setItemInMainHand(new ItemStack(Material.COAL_BLOCK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
stand.setSmall(true);
asList.add(stand);
@ -107,7 +107,7 @@ public class SnowGolem extends Furniture implements Listener{
loc = getRelative(getCenter().add(0, -.55, 0), -.15, -.28);
loc.setYaw(getYaw()+90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
stand.setItemInMainHand(new ItemStack(Material.COAL_BLOCK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
stand.setSmall(true);
asList.add(stand);
@ -115,7 +115,7 @@ public class SnowGolem extends Furniture implements Listener{
loc = getRelative(getCenter().add(0, -.95, 0), -.15, -.28);
loc.setYaw(getYaw()+90);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
stand.setItemInMainHand(new ItemStack(Material.COAL_BLOCK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
stand.setSmall(true);
asList.add(stand);
@ -123,14 +123,14 @@ public class SnowGolem extends Furniture implements Listener{
loc = getRelative(getCenter().add(0, -.45, 0), .0, 1.22);
loc.setYaw(getYaw());
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90f,90f,70f)));
asList.add(stand);
loc = getRelative(getCenter().add(0, -.45, 0), -.1, -1.22);
loc.setYaw(getYaw()+180);
stand = spawnArmorStand(loc);
stand.setItemInHand(new ItemStack(Material.STICK));
stand.setItemInMainHand(new ItemStack(Material.STICK));
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90f,90f,70f)));
asList.add(stand);

View File

@ -41,7 +41,7 @@ public class billboard extends Furniture implements Listener{
Location loc = getLutil().getRelativ(center.clone(), getBlockFace(), -.1, -.5).add(0, .88*i, 0);
loc.setYaw(loc.getYaw()+90);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}
@ -50,7 +50,7 @@ public class billboard extends Furniture implements Listener{
Location loc = getLutil().getRelativ(center2.clone(), getBlockFace(), -.1, -.5).add(0, .88*i, 0);
loc.setYaw(loc.getYaw()+90);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}
@ -59,7 +59,7 @@ public class billboard extends Furniture implements Listener{
Location loc = getLutil().getRelativ(center3.clone(), getBlockFace(), -.1, .88*i).add(0, .7D, 0);
loc.setYaw(loc.getYaw()+90);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(-.17, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}
@ -68,7 +68,7 @@ public class billboard extends Furniture implements Listener{
Location loc = getLutil().getRelativ(center3.clone(), getBlockFace(), -.1, .88*i).add(0, 2.9D, 0);
loc.setYaw(loc.getYaw()+90);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(-.17, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}

View File

@ -40,8 +40,8 @@ public class camera extends Furniture implements Listener{
List<fArmorStand> aspList = new ArrayList<fArmorStand>();
BlockFace b = getLutil().yawToFace(location.getYaw()).getOppositeFace();
Location center = getLutil().getCenter(location);
Location gehäuse = getLutil().getRelativ(center, b, 0D, 0D).add(0,-1.0,0);
Location gehäuse2 = getLutil().getRelativ(center, b, 0D, 0D).add(0,-0.4,0);
Location gehäuse = getLutil().getRelativ(center, b, 0D, 0D).add(0,-1.0,0);
Location gehäuse2 = getLutil().getRelativ(center, b, 0D, 0D).add(0,-0.4,0);
Location fokus = getLutil().getRelativ(center, b, .15D, 0D).add(0,-.24,0);
Location search = getLutil().getRelativ(center, b, .15D, 0D).add(0,-.7,0);
Location button = getLutil().getRelativ(center, b, -.15D, -.15D).add(0,.08,0);
@ -50,7 +50,7 @@ public class camera extends Furniture implements Listener{
Location feet2 = getLutil().getRelativ(center, b, -.2D, -.7D).add(0,-.9,0);
Location feet3 = getLutil().getRelativ(center, b, -.7D, .2D).add(0,-.9,0);
gehäuse.setYaw(getLutil().FaceToYaw(b));
gehäuse.setYaw(getLutil().FaceToYaw(b));
fokus.setYaw(getLutil().FaceToYaw(b));
search.setYaw(getLutil().FaceToYaw(b));
button.setYaw(getLutil().FaceToYaw(b));
@ -58,11 +58,11 @@ public class camera extends Furniture implements Listener{
feet2.setYaw(getLutil().FaceToYaw(b) + 180 - 45);
feet3.setYaw(getLutil().FaceToYaw(b) + 180 + 45);
fArmorStand as = getManager().createArmorStand(getObjID(), gehäuse);
fArmorStand as = getManager().createArmorStand(getObjID(), gehäuse);
as.getInventory().setHelmet(new ItemStack(Material.WOOL, 1, (short) 15));
aspList.add(as);
as = getManager().createArmorStand(getObjID(), gehäuse2);
as = getManager().createArmorStand(getObjID(), gehäuse2);
as.getInventory().setHelmet(new ItemStack(Material.WOOL, 1, (short) 15));
as.setSmall(true);
aspList.add(as);
@ -82,17 +82,17 @@ public class camera extends Furniture implements Listener{
aspList.add(as);
as = getManager().createArmorStand(getObjID(), feet1);
as.getInventory().setItemInHand(new ItemStack(Material.STICK));
as.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
as.setPose(new EulerAngle(1.2, 0, 0), BodyPart.RIGHT_ARM);
aspList.add(as);
as = getManager().createArmorStand(getObjID(), feet2);
as.getInventory().setItemInHand(new ItemStack(Material.STICK));
as.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
as.setPose(new EulerAngle(1.2, 0, 0), BodyPart.RIGHT_ARM);
aspList.add(as);
as = getManager().createArmorStand(getObjID(), feet3);
as.getInventory().setItemInHand(new ItemStack(Material.STICK));
as.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
as.setPose(new EulerAngle(1.2, 0, 0), BodyPart.RIGHT_ARM);
aspList.add(as);

View File

@ -64,21 +64,21 @@ public class streetlamp extends Furniture implements Listener{
for(int i = 0; i<=3;i++){
Location loc = getLutil().getRelativ(center.clone(), getBlockFace(), .47, .38).add(0, .88*i, 0);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}
fArmorStand packet = getManager().createArmorStand(getObjID(), getLutil().getRelativ(center, getBlockFace(), -.9, .38).add(0, 3.1, 0));
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(-.17, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
float yaw = getLutil().FaceToYaw(getBlockFace());
BlockFace face = getLutil().yawToFace(yaw +90);
packet = getManager().createArmorStand(getObjID(), getLutil().getRelativ(center, getBlockFace(), -.4, .38).add(0, 2.68, 0));
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);

View File

@ -53,7 +53,7 @@ public class TFlowerPot extends Furniture implements Listener {
fArmorStand asp = getManager().createArmorStand(getObjID(), location);
asp.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-115,45,0)));
asp.getInventory().setItemInHand(new ItemStack(Material.STICK));
asp.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packetList.add(asp);
yaw+=90;

View File

@ -49,11 +49,11 @@ public class Trunk extends Furniture implements Listener {
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
if(e.isCancelled()){return;}
if(!e.getID().equals(getObjID())){return;}
if(!e.getPlayer().getItemInHand().getType().isBlock()||
e.getPlayer().getItemInHand().getType().equals(Material.AIR)){setPassanger(e.getfArmorStand(), e.getPlayer());return;}
if(!e.getPlayer().getInventory().getItemInMainHand().getType().isBlock()||
e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.AIR)){setPassanger(e.getfArmorStand(), e.getPlayer());return;}
if(e.getPlayer().isSneaking()){setPassanger(e.getfArmorStand(), e.getPlayer());return;}
if(!e.canBuild()){return;}
ItemStack stack = e.getPlayer().getItemInHand();
ItemStack stack = e.getPlayer().getInventory().getItemInMainHand();
stack.setAmount(1);
for(fArmorStand stand : getfAsList()){
if(stand.getName().startsWith("#TO")){
@ -64,7 +64,7 @@ public class Trunk extends Furniture implements Listener {
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack item = e.getPlayer().getItemInHand();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
item.setAmount(item.getAmount()-1);
e.getPlayer().getInventory().setItem(i, item);
e.getPlayer().updateInventory();

View File

@ -61,10 +61,10 @@ public class WaterBottle extends Furniture implements Listener {
if(e.isCancelled()){return;}
if(!e.getID().equals(getObjID())){return;}
if(!canInteract(e.getPlayer())){return;}
Material data = e.getPlayer().getItemInHand().getType();
Material data = e.getPlayer().getInventory().getItemInMainHand().getType();
fArmorStand stand = removeItem();
if(matList.contains(data)){
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
is.setAmount(1);
stand.setHelmet(is);
update();
@ -76,8 +76,8 @@ public class WaterBottle extends Furniture implements Listener {
for(fArmorStand stand : getfAsList()){
if(stand.getName().equalsIgnoreCase("#ITEM#")){
fstand = stand;
if(stand.getItemInHand()!=null&&!stand.getItemInHand().equals(Material.AIR)){
ItemStack is = stand.getItemInHand();
if(stand.getItemInMainHand()!=null&&!stand.getItemInMainHand().equals(Material.AIR)){
ItemStack is = stand.getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}
@ -137,14 +137,14 @@ public class WaterBottle extends Furniture implements Listener {
as = spawnArmorStand(loc4);
as.setSmall(true);
as.setItemInHand(new ItemStack(Material.POTION));
as.setItemInMainHand(new ItemStack(Material.POTION));
as.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-110,0,0)));
as.setMarker(false);
stand.add(as);
as = spawnArmorStand(loc5);
as.setSmall(true);
as.setItemInHand(new ItemStack(Material.POTION));
as.setItemInMainHand(new ItemStack(Material.POTION));
as.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-110,0,0)));
as.setMarker(false);
stand.add(as);

View File

@ -65,13 +65,13 @@ public class campchair extends Furniture implements Listener {
Location l1 = getLutil().getRelativ(middle, getBlockFace(), .25, .4);
fArmorStand packet = getManager().createArmorStand(getObjID(), l1);
packet.getInventory().setItemInHand(new ItemStack(Material.LADDER));
packet.getInventory().setItemInMainHand(new ItemStack(Material.LADDER));
packet.setPose(getLutil().degresstoRad(new EulerAngle(50, 0, 0)), BodyPart.RIGHT_ARM);
aspList.add(packet);
l1 = getLutil().getRelativ(middle, getBlockFace().getOppositeFace(), .25, .4);
packet = getManager().createArmorStand(getObjID(), l1);
packet.getInventory().setItemInHand(new ItemStack(Material.LADDER));
packet.getInventory().setItemInMainHand(new ItemStack(Material.LADDER));
packet.setPose(getLutil().degresstoRad(new EulerAngle(50, 0, 0)), BodyPart.RIGHT_ARM);
aspList.add(packet);

View File

@ -106,11 +106,11 @@ public class graveStone extends Furniture implements Listener{
}
fArmorStand as = getManager().createArmorStand(getObjID(), kreutz1);
as.getInventory().setItemInHand(new ItemStack(Material.STICK));
as.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
as.setPose(new EulerAngle(1.38,.0,.0), BodyPart.RIGHT_ARM);
aspList.add(as);
as = getManager().createArmorStand(getObjID(), kreutz2);
as.getInventory().setItemInHand(new ItemStack(Material.STICK));
as.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
as.setPose(new EulerAngle(1.38,1.57,1.57), BodyPart.RIGHT_ARM);
aspList.add(as);
@ -157,7 +157,7 @@ public class graveStone extends Furniture implements Listener{
Player p = e.getPlayer();
if(!e.getID().equals(getObjID())) return;
if(!e.canBuild()){return;}
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
if (is == null) return;
if (!is.getType().equals(Material.WRITTEN_BOOK)) return;
readFromBook(is);

View File

@ -34,7 +34,7 @@ public class log extends Furniture {
Block b;
int mode = 0;
Inventory inv = Bukkit.createInventory(null, 9, "§2Settings");
Inventory inv = Bukkit.createInventory(null, 9, "<EFBFBD>2Settings");
ItemStack pane = new ItemStack(Material.STAINED_GLASS_PANE);
ItemStack permissions = new ItemStack(Material.ARROW);
List<ItemStack> isList = new ArrayList<ItemStack>();
@ -45,7 +45,7 @@ public class log extends Furniture {
b = getLocation().getBlock();
getObjID().addBlock(Arrays.asList(b));
ItemMeta meta = pane.getItemMeta();
meta.setDisplayName("§c");
meta.setDisplayName("<EFBFBD>c");
pane.setItemMeta(meta);
pane.setDurability((short) 15);
pane.setItemMeta(meta);
@ -61,24 +61,24 @@ public class log extends Furniture {
ItemStack stack = new ItemStack(Material.BANNER);
stack.setDurability((short) 1);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName("§6Mode: §cTop");
meta.setDisplayName("<EFBFBD>6Mode: <20>cTop");
stack.setItemMeta(meta);
isList.add(stack);
stack = new ItemStack(Material.BANNER);
stack.setDurability((short) 2);
meta = stack.getItemMeta();
meta.setDisplayName("§6Mode: §cFront I");
meta.setDisplayName("<EFBFBD>6Mode: <20>cFront I");
stack.setItemMeta(meta);
isList.add(stack);
stack = new ItemStack(Material.BANNER);
stack.setDurability((short) 11);
meta = stack.getItemMeta();
meta.setDisplayName("§6Mode: §cFront II");
meta.setDisplayName("<EFBFBD>6Mode: <20>cFront II");
stack.setItemMeta(meta);
isList.add(stack);
meta = permissions.getItemMeta();
meta.setDisplayName("§cChange Permissions (Owner Only)");
meta.setDisplayName("<EFBFBD>cChange Permissions (Owner Only)");
permissions.setItemMeta(meta);
}
@ -198,8 +198,8 @@ public class log extends Furniture {
}
if(standOld!=null&&standCurrent!=null){
standCurrent.setItemInHand(standOld.getItemInHand());
standOld.setItemInHand(new ItemStack(Material.AIR));
standCurrent.setItemInMainHand(standOld.getItemInMainHand());
standOld.setItemInMainHand(new ItemStack(Material.AIR));
update();
}
}
@ -224,18 +224,18 @@ public class log extends Furniture {
e.setCancelled(true);
Player p = e.getPlayer();
if(p.isSneaking()){
if(p.getItemInHand().getType().isBlock()&&!p.getItemInHand().getType().equals(Material.AIR)){
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
e.setCancelled(false);
return;
}
openInventory(p);
}else{
if(p.getItemInHand().getType().isBlock() && !p.getItemInHand().getType().equals(Material.AIR)){
this.b.setType(p.getItemInHand().getType());
this.b.setData((byte) p.getItemInHand().getDurability());
if(p.getInventory().getItemInMainHand().getType().isBlock() && !p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
this.b.setType(p.getInventory().getItemInMainHand().getType());
this.b.setData((byte) p.getInventory().getItemInMainHand().getDurability());
removeItem(p);
return;
}else if(!p.getItemInHand().getType().isBlock() && !p.getItemInHand().getType().equals(Material.AIR)){
}else if(!p.getInventory().getItemInMainHand().getType().isBlock() && !p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
fArmorStand stand = null;
for(fArmorStand s : getObjID().getPacketList()){
if(s.getName().equalsIgnoreCase(mode+"")){
@ -245,13 +245,13 @@ public class log extends Furniture {
}
if(stand==null){return;}
if(stand.getItemInHand()!=null&&!stand.getItemInHand().getType().equals(Material.AIR)){
ItemStack is = stand.getItemInHand();
if(stand.getInventory().getItemInMainHand()!=null&&!stand.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = stand.getInventory().getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}
ItemStack is = p.getItemInHand().clone();
ItemStack is = p.getInventory().getItemInMainHand().clone();
is.setAmount(1);
stand.setItemInHand(is);
update();
@ -268,8 +268,8 @@ public class log extends Furniture {
if(stand==null){return;}
if(stand.getItemInHand()!=null&&!stand.getItemInHand().getType().equals(Material.AIR)){
ItemStack is = stand.getItemInHand();
if(stand.getInventory().getItemInMainHand()!=null&&!stand.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = stand.getInventory().getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}
@ -285,7 +285,7 @@ public class log extends Furniture {
Boolean useGameMode = FurnitureLib.getInstance().useGamemode();
if(useGameMode&&p.getGameMode().equals(GameMode.CREATIVE)){return;}
Integer slot = p.getInventory().getHeldItemSlot();
ItemStack itemStack = p.getItemInHand().clone();
ItemStack itemStack = p.getInventory().getItemInMainHand().clone();
itemStack.setAmount(itemStack.getAmount()-1);
p.getInventory().setItem(slot, itemStack);
p.updateInventory();
@ -317,8 +317,8 @@ public class log extends Furniture {
if(stand==null){p.sendMessage("test1");return;}
if(stand.getItemInHand()!=null&&!stand.getItemInHand().getType().equals(Material.AIR)){
ItemStack is = stand.getItemInHand();
if(stand.getItemInMainHand()!=null&&!stand.getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = stand.getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}

View File

@ -59,7 +59,7 @@ public class mailBox extends Furniture implements Listener {
for(int i = 0; i<=1;i++){
Location loc = getLutil().getRelativ(middle.clone(), getBlockFace(), .47, .38).add(0, .88*i, 0);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
aspList.add(packet);
}
@ -81,7 +81,7 @@ public class mailBox extends Furniture implements Listener {
//x z y
//-.7 .73 -.3
packet.setPose(new EulerAngle(-.716D, .71D, -.32D), BodyPart.RIGHT_ARM);
packet.getInventory().setItemInHand(new ItemStack(Material.SMOOTH_STAIRS));
packet.getInventory().setItemInMainHand(new ItemStack(Material.SMOOTH_STAIRS));
aspList.add(packet);
loc = getLutil().getRelativ(middle.clone().add(0, 1.898, 0), getBlockFace().getOppositeFace(), -.44+.165*i, .462D);
@ -90,7 +90,7 @@ public class mailBox extends Furniture implements Listener {
//x z y
//-.7 .73 -.3
packet.setPose(new EulerAngle(-.716D, .71D, -.32D), BodyPart.RIGHT_ARM);
packet.getInventory().setItemInHand(new ItemStack(Material.SMOOTH_STAIRS));
packet.getInventory().setItemInMainHand(new ItemStack(Material.SMOOTH_STAIRS));
aspList.add(packet);
@ -100,7 +100,7 @@ public class mailBox extends Furniture implements Listener {
//x z y
//-.7 .73 -.3
packet.setPose(new EulerAngle(-.716D, .71D, -.32D), BodyPart.RIGHT_ARM);
packet.getInventory().setItemInHand(new ItemStack(Material.SMOOTH_BRICK, 1 ,(short) 0));
packet.getInventory().setItemInMainHand(new ItemStack(Material.SMOOTH_BRICK, 1 ,(short) 0));
aspList.add(packet);
}
@ -114,19 +114,19 @@ public class mailBox extends Furniture implements Listener {
aspList.add(as);
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.10, 0), face.getOppositeFace(), -.0, .31D));
as.getInventory().setItemInHand(new ItemStack(Material.PAPER, 1, (short) 0));
as.getInventory().setItemInMainHand(new ItemStack(Material.PAPER, 1, (short) 0));
as.setPose(getLutil().degresstoRad(new EulerAngle(0, -120, -90)), BodyPart.RIGHT_ARM);
as.setSmall(true);
aspList.add(as);
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.40, 0), face.getOppositeFace(), -.1, .34D));
as.getInventory().setItemInHand(new ItemStack(Material.WOOD_BUTTON, 1, (short) 0));
as.getInventory().setItemInMainHand(new ItemStack(Material.WOOD_BUTTON, 1, (short) 0));
as.setPose(getLutil().degresstoRad(new EulerAngle(-15,-67, -90)), BodyPart.RIGHT_ARM);
as.setSmall(true);
aspList.add(as);
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.2, 0), getBlockFace(), .2, .07D));
as.getInventory().setItemInHand(new ItemStack(Material.EMPTY_MAP, 1, (short) 0));
as.getInventory().setItemInMainHand(new ItemStack(Material.EMPTY_MAP, 1, (short) 0));
as.setPose(getLutil().degresstoRad(new EulerAngle(0, -120, -90)), BodyPart.RIGHT_ARM);
as.setSmall(true);
aspList.add(as);

View File

@ -72,7 +72,7 @@ public class sunshade extends Furniture implements Listener{
for(int i = 0; i<=2;i++){
Location loc = getLutil().getRelativ(center.clone(), getBlockFace(), .47, .38).add(0, .88*i, 0);
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(new EulerAngle(1.39, 0, 0), BodyPart.RIGHT_ARM);
asList.add(packet);
}
@ -119,7 +119,7 @@ public class sunshade extends Furniture implements Listener{
if(!e.canBuild()){return;}
e.setCancelled(true);
Player p = e.getPlayer();
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
if(!getLib().canBuild(e.getPlayer(), getObjID(), EventType.INTERACT)){return;}
if(is.getType().equals(Material.BANNER)){
e.setCancelled(true);
@ -161,8 +161,8 @@ public class sunshade extends Furniture implements Listener{
stopTimer();
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
getWorld().dropItem(getLocation(), is);
}
}
@ -180,7 +180,7 @@ public class sunshade extends Furniture implements Listener{
if(!e.canBuild()){return;}
e.setCancelled(true);
Player p = e.getPlayer();
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
if(is.getType().equals(Material.BANNER)){
e.setCancelled(true);
if(isRunning()){return;}
@ -209,7 +209,7 @@ public class sunshade extends Furniture implements Listener{
Boolean useGameMode = FurnitureLib.getInstance().useGamemode();
if(useGameMode&&p.getGameMode().equals(GameMode.CREATIVE)){return;}
Integer slot = p.getInventory().getHeldItemSlot();
ItemStack itemStack = p.getItemInHand().clone();
ItemStack itemStack = p.getInventory().getItemInMainHand().clone();
itemStack.setAmount(itemStack.getAmount()-1);
p.getInventory().setItem(slot, itemStack);
p.updateInventory();
@ -226,8 +226,8 @@ public class sunshade extends Furniture implements Listener{
stopTimer();
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
getWorld().dropItem(getLocation(), is);
}
}

View File

@ -122,7 +122,7 @@ public class lantern extends Furniture implements Listener{
if(!e.getID().equals(getObjID())) return;
if(!e.canBuild()){return;}
Player p = e.getPlayer();
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
if(is.getType().equals(Material.FLINT_AND_STEEL)){
setLight(true);
}else if(is.getType().equals(Material.WATER_BUCKET)){

View File

@ -116,22 +116,22 @@ public class largeTable extends Furniture implements Listener{
fArmorStand as = getManager().createArmorStand(getObjID(), feet1);
as.setPose(new EulerAngle(-1.75, 0, 0), BodyPart.RIGHT_ARM);
as.getInventory().setItemInHand(new ItemStack(Material.BONE));
as.getInventory().setItemInMainHand(new ItemStack(Material.BONE));
armorlist.add(as);
as = getManager().createArmorStand(getObjID(), feet2);
as.setPose(new EulerAngle(-1.75, 0, 0), BodyPart.RIGHT_ARM);
as.getInventory().setItemInHand(new ItemStack(Material.BONE));
as.getInventory().setItemInMainHand(new ItemStack(Material.BONE));
armorlist.add(as);
as = getManager().createArmorStand(getObjID(), feet3);
as.setPose(new EulerAngle(-1.75, 0, 0), BodyPart.RIGHT_ARM);
as.getInventory().setItemInHand(new ItemStack(Material.BONE));
as.getInventory().setItemInMainHand(new ItemStack(Material.BONE));
armorlist.add(as);
as = getManager().createArmorStand(getObjID(), feet4);
as.setPose(new EulerAngle(-1.75, 0, 0), BodyPart.RIGHT_ARM);
as.getInventory().setItemInHand(new ItemStack(Material.BONE));
as.getInventory().setItemInMainHand(new ItemStack(Material.BONE));
armorlist.add(as);
@ -168,7 +168,7 @@ public class largeTable extends Furniture implements Listener{
int i = 0;
for(Integer id : tellerIDs){
fArmorStand as = getManager().getfArmorStandByID(id);
as.getInventory().setItemInHand(itemList.get(i));
as.getInventory().setItemInMainHand(itemList.get(i));
i++;
}
}
@ -178,14 +178,15 @@ public class largeTable extends Furniture implements Listener{
if(getObjID()==null){return;}
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
if(e.isCancelled()){return;}
if(e.getID()==null){return;}
if(!e.getID().equals(getObjID())){return;}
if(!e.canBuild()){return;}
for(Integer id : tellerIDs){
fArmorStand asp = getManager().getfArmorStandByID(id);
if(asp!=null&&asp.getInventory().getItemInHand()!=null){
if(asp!=null&&asp.getInventory().getItemInMainHand()!=null){
if(asp.getName().startsWith("#TELLER")){
fArmorStand packet = asp;
e.getLocation().getWorld().dropItem(e.getLocation(), packet.getInventory().getItemInHand());
e.getLocation().getWorld().dropItem(e.getLocation(), packet.getInventory().getItemInMainHand());
}
}
}
@ -202,12 +203,12 @@ public class largeTable extends Furniture implements Listener{
if(!e.canBuild()){return;}
e.setCancelled(true);
Player p = e.getPlayer();
if(p.getItemInHand().getType().equals(Material.INK_SACK)){
if(p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
getLib().getColorManager().color(p, e.canBuild(), Material.STAINED_GLASS_PANE, getObjID(), ColorType.BLOCK, 3);
update();
return;
}else{
setTeller(p, p.getInventory().getItemInHand());
setTeller(p, p.getInventory().getItemInMainHand());
}
}
@ -228,17 +229,17 @@ public class largeTable extends Furniture implements Listener{
}
}
if(as!=null&&as.getInventory().getItemInHand()!= null && as.getInventory().getItemInHand().equals(is)){return;}
if(as.getInventory().getItemInHand()!=null&&!as.getInventory().getItemInHand().getType().equals(Material.AIR)){
if(as!=null&&as.getInventory().getItemInMainHand()!= null && as.getInventory().getItemInMainHand().equals(is)){return;}
if(as.getInventory().getItemInMainHand()!=null&&!as.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
fArmorStand asp = as;
ItemStack item = asp.getInventory().getItemInHand();
ItemStack item = asp.getInventory().getItemInMainHand();
item.setAmount(1);
asp.getLocation().getWorld().dropItem(asp.getLocation(), item);
}
ItemStack IS = is.clone();
IS.setAmount(1);
as.getInventory().setItemInHand(IS);
as.getInventory().setItemInMainHand(IS);
update();
@ -255,7 +256,7 @@ public class largeTable extends Furniture implements Listener{
for(Integer id : tellerIDs){
try{
fArmorStand as = getManager().getfArmorStandByID(id);
teller.put(teller.size(), as.getInventory().getItemInHand());
teller.put(teller.size(), as.getInventory().getItemInMainHand());
}catch(Exception e){
teller.put(teller.size(), new ItemStack(Material.AIR));
}

View File

@ -158,7 +158,7 @@ public class sofa extends Furniture implements Listener {
if(!e.getID().equals(getObjID())){return;}
e.setCancelled(true);
final Player p = e.getPlayer();
if(p.getItemInHand().getType().equals(Material.INK_SACK)){
if(p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
getLib().getColorManager().color(p, e.canBuild(), Material.CARPET, getObjID(), ColorType.BLOCK, 12);
}else{
fArmorStand packet = e.getfArmorStand();

View File

@ -52,7 +52,7 @@ public class table extends Furniture implements Listener {
packetL.add(asp);
locatio = locatio.clone().add(0,-0.65,0.68);
asp = getManager().createArmorStand(getObjID(), locatio);
asp.getInventory().setItemInHand(new ItemStack(Material.STICK));
asp.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
asp.setPose(new EulerAngle(1.38,.0,.0), BodyPart.RIGHT_ARM);
packetL.add(asp);
@ -74,8 +74,8 @@ public class table extends Furniture implements Listener {
e.setCancelled(true);
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
getWorld().dropItem(getLocation(), is);
}
}
@ -93,20 +93,20 @@ public class table extends Furniture implements Listener {
Player p = e.getPlayer();
if(!e.canBuild()){return;}
e.setCancelled(true);
if(p.getItemInHand().getType().isBlock()&&!p.getItemInHand().getType().equals(Material.AIR)){return;}
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
if(packet.getName().equalsIgnoreCase("#ITEM#")){
ItemStack Itemstack = p.getItemInHand().clone();
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
Itemstack.setAmount(1);
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInHand();
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getItemInMainHand();
is.setAmount(1);
getWorld().dropItem(getLocation(), is);
}
packet.getInventory().setItemInHand(Itemstack);
packet.getInventory().setItemInMainHand(Itemstack);
if(p.getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) break;
Integer i = p.getInventory().getHeldItemSlot();
ItemStack is = p.getItemInHand();
ItemStack is = p.getInventory().getItemInMainHand();
is.setAmount(is.getAmount()-1);
p.getInventory().setItem(i, is);
p.updateInventory();

View File

@ -55,7 +55,7 @@ public class barrels extends Furniture implements Listener {
if(!e.canBuild()){return;}
e.setCancelled(true);
Player p = e.getPlayer();
if(!p.getItemInHand().getType().isBlock()&&!p.getItemInHand().getType().equals(Material.AIR)){return;}
if(!p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
ItemStack is = packet.getInventory().getHelmet();
@ -63,13 +63,13 @@ public class barrels extends Furniture implements Listener {
getWorld().dropItem(getLocation(), is);
}
packet.getInventory().setHelmet(p.getItemInHand());
packet.getInventory().setHelmet(p.getInventory().getItemInMainHand());
getManager().updateFurniture(getObjID());
if(p.getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack item = e.getPlayer().getItemInHand();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
item.setAmount(item.getAmount()-1);
e.getPlayer().getInventory().setItem(i, item);
e.getPlayer().updateInventory();
@ -98,9 +98,9 @@ public class barrels extends Furniture implements Listener {
if(e.isCancelled()){return;}
if(!e.getID().equals(getObjID())){return;}
if(!e.canBuild()){return;}
if(!e.getPlayer().getItemInHand().getType().isBlock()&&!e.getPlayer().getItemInHand().getType().equals(Material.AIR)){return;}
if(!e.getPlayer().getInventory().getItemInMainHand().getType().isBlock()&&!e.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
e.setCancelled(true);
ItemStack Itemstack = e.getPlayer().getItemInHand().clone();
ItemStack Itemstack = e.getPlayer().getInventory().getItemInMainHand().clone();
Itemstack.setAmount(1);
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
@ -116,7 +116,7 @@ public class barrels extends Furniture implements Listener {
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack item = e.getPlayer().getItemInHand();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
item.setAmount(item.getAmount()-1);
e.getPlayer().getInventory().setItem(i, item);
e.getPlayer().updateInventory();

View File

@ -55,7 +55,7 @@ public class campfire_1 extends Furniture implements Listener{
if(!e.canBuild()){return;}
e.setCancelled(true);
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
ItemStack is = e.getPlayer().getItemInHand();
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
if(is.getType().equals(Material.WATER_BUCKET)){
for(fArmorStand packet : aspList){
packet.setFire(false);

View File

@ -115,7 +115,7 @@ public class campfire_2 extends Furniture implements Listener{
fArmorStand asp = getManager().createArmorStand(getObjID(), location);
asp.setPose( new EulerAngle(2, 0, 0), BodyPart.RIGHT_ARM);
asp.getInventory().setItemInHand(new ItemStack(Material.STICK));
asp.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packetList.add(asp);
yaw+=90;
@ -124,16 +124,16 @@ public class campfire_2 extends Furniture implements Listener{
fArmorStand asp = getManager().createArmorStand(getObjID(), stick1);
asp.setPose(new EulerAngle(1.38,.0,.0), BodyPart.RIGHT_ARM);
asp.getInventory().setItemInHand(new ItemStack(Material.STICK));
asp.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packetList.add(asp);
asp = getManager().createArmorStand(getObjID(), stick2);
asp.setPose(new EulerAngle(1.38,.0,.0), BodyPart.RIGHT_ARM);
asp.getInventory().setItemInHand(new ItemStack(Material.STICK));
asp.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packetList.add(asp);
asp = getManager().createArmorStand(getObjID(), bone);
asp.setPose(new EulerAngle(1.38,.0,1.57), BodyPart.RIGHT_ARM);
asp.getInventory().setItemInHand(new ItemStack(Material.BONE));
asp.getInventory().setItemInMainHand(new ItemStack(Material.BONE));
packetList.add(asp);
asp = getManager().createArmorStand(getObjID(), middle.add(0,-1.3,0));
@ -157,7 +157,7 @@ public class campfire_2 extends Furniture implements Listener{
if(!e.canBuild()){return;}
e.setCancelled(true);
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
final ItemStack itemStack = e.getPlayer().getItemInHand();
final ItemStack itemStack = e.getPlayer().getInventory().getItemInMainHand();
fArmorStand packet = null;
for(fArmorStand pack : aspList){
if(pack.isSmall() && pack.isVisible()){
@ -176,7 +176,7 @@ public class campfire_2 extends Furniture implements Listener{
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
Integer i = e.getPlayer().getInventory().getHeldItemSlot();
ItemStack item = e.getPlayer().getItemInHand();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
item.setAmount(item.getAmount()-1);
e.getPlayer().getInventory().setItem(i, item);
e.getPlayer().updateInventory();
@ -188,7 +188,7 @@ public class campfire_2 extends Furniture implements Listener{
for(fArmorStand pack : getManager().getfArmorStandByObjectID(getObjID())){
if(pack.isSmall() && pack.isVisible()){
if((pack.getInventory().getHelmet() == null || pack.getInventory().getHelmet().getType().equals(Material.AIR)) &&
(pack.getInventory().getItemInHand() == null || pack.getInventory().getItemInHand().getType().equals(Material.AIR))){
(pack.getInventory().getItemInMainHand() == null || pack.getInventory().getItemInMainHand().getType().equals(Material.AIR))){
pack.setFire(b);
Location loc = middle.clone();
loc.add(0, 1.3, 0);
@ -224,7 +224,7 @@ public class campfire_2 extends Furniture implements Listener{
if(isRunning()){
Bukkit.getScheduler().cancelTask(timer);
timer=null;
if(armorS!=null&&armorS.getInventory().getItemInHand()!=null&&getItem(armorS.getInventory().getItemInHand())!=null){
if(armorS!=null&&armorS.getInventory().getItemInMainHand()!=null&&getItem(armorS.getInventory().getItemInMainHand())!=null){
getWorld().dropItem(middle.clone().add(0, .5, 0), getCooked(is));
armorS.kill();
armorS.delete();
@ -232,7 +232,7 @@ public class campfire_2 extends Furniture implements Listener{
}
}
if(armorS!=null){
if(armorS.getInventory().getItemInHand()!=null){getWorld().dropItem(middle.clone().add(0, .5, 0), getCooked(is));}
if(armorS.getInventory().getItemInMainHand()!=null){getWorld().dropItem(middle.clone().add(0, .5, 0), getCooked(is));}
armorS.kill();
armorS.delete();
armorS=null;
@ -265,7 +265,7 @@ public class campfire_2 extends Furniture implements Listener{
public void setGrill(){
this.armorS = getManager().createArmorStand(getObjID(), grill);
this.armorS.setInvisible(true);
this.armorS.getInventory().setItemInHand(is);
this.armorS.getInventory().setItemInMainHand(is);
getManager().send(getObjID());
this.timer = main.getInstance().getServer().getScheduler().scheduleSyncRepeatingTask(main.getInstance(), new Runnable() {
Integer rounds = getLutil().randInt(15, 30);

View File

@ -105,7 +105,7 @@ public class hammock extends Furniture implements Listener{
if(!e.getID().equals(getObjID())){return;}
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
Player p = e.getPlayer();
ItemStack stack = p.getItemInHand();
ItemStack stack = p.getInventory().getItemInMainHand();
if(stack!=null){
if(isMaterial(stack.getType())){
@ -127,7 +127,7 @@ public class hammock extends Furniture implements Listener{
Boolean useGameMode = FurnitureLib.getInstance().useGamemode();
if(useGameMode&&p.getGameMode().equals(GameMode.CREATIVE)){return;}
Integer slot = p.getInventory().getHeldItemSlot();
ItemStack itemStack = p.getItemInHand().clone();
ItemStack itemStack = p.getInventory().getItemInMainHand().clone();
itemStack.setAmount(itemStack.getAmount()-1);
p.getInventory().setItem(slot, itemStack);
p.updateInventory();
@ -141,7 +141,7 @@ public class hammock extends Furniture implements Listener{
if(!e.getID().equals(getObjID())){return;}
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
Player p = e.getPlayer();
ItemStack stack = p.getItemInHand();
ItemStack stack = p.getInventory().getItemInMainHand();
if(stack!=null){
if(isMaterial(stack.getType())){
if(setColor(p,stack, e.canBuild(), aspList)){return;}
@ -264,7 +264,7 @@ public class hammock extends Furniture implements Listener{
stick = stick.add(0, 1.7, 0);
stick.setYaw(getLutil().FaceToYaw(getBlockFace()));
packet = getManager().createArmorStand(getObjID(), stick);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(getLutil().degresstoRad(new EulerAngle(-40f,110f,0f)), BodyPart.RIGHT_ARM);
aspList.add(packet);
@ -272,7 +272,7 @@ public class hammock extends Furniture implements Listener{
stick = stick.add(0, 1.7, 0);
stick.setYaw(getLutil().FaceToYaw(getBlockFace()));
packet = getManager().createArmorStand(getObjID(), stick);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(getLutil().degresstoRad(new EulerAngle(-40f,73f,0f)), BodyPart.RIGHT_ARM);
packet.setArms(true);
aspList.add(packet);
@ -281,7 +281,7 @@ public class hammock extends Furniture implements Listener{
stick = stick.add(0, 1.7, 0);
stick.setYaw(getLutil().FaceToYaw(getBlockFace().getOppositeFace()));
packet = getManager().createArmorStand(getObjID(), stick);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(getLutil().degresstoRad(new EulerAngle(-40f,73f,0f)), BodyPart.RIGHT_ARM);
packet.setArms(true);
aspList.add(packet);
@ -290,7 +290,7 @@ public class hammock extends Furniture implements Listener{
stick = stick.add(0, 1.7, 0);
stick.setYaw(getLutil().FaceToYaw(getBlockFace().getOppositeFace()));
packet = getManager().createArmorStand(getObjID(), stick);
packet.getInventory().setItemInHand(new ItemStack(Material.STICK));
packet.getInventory().setItemInMainHand(new ItemStack(Material.STICK));
packet.setPose(getLutil().degresstoRad(new EulerAngle(-40f,110f,0f)), BodyPart.RIGHT_ARM);
packet.setArms(true);
aspList.add(packet);

View File

@ -237,7 +237,7 @@ public class tent_1 extends Furniture implements Listener{
@EventHandler
public void onFurnitureBreak(FurnitureBreakEvent e){
if(getObjID()==null){return;}
if(getObjID()==null||e.getID()==null) return;
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
if(e.isCancelled()){return;}
if(!e.getID().equals(getObjID())){return;}
@ -257,7 +257,7 @@ public class tent_1 extends Furniture implements Listener{
if(!e.canBuild()){return;}
e.setCancelled(true);
final Player p = e.getPlayer();
if(!p.getItemInHand().getType().equals(Material.INK_SACK)){
if(!p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
p.openWorkbench(this.block.getLocation(), true);
}else{
getLib().getColorManager().color(p, e.canBuild(), Material.CARPET, getObjID(), ColorType.BLOCK, 1);

View File

@ -200,7 +200,7 @@ public class tent_2 extends Furniture implements Listener{
e.setCancelled(true);
Player p = e.getPlayer();
if(!e.canBuild()){return;}
if(!p.getItemInHand().getType().equals(Material.INK_SACK)){
if(!p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
for(Block b : block){
if(b.getType().equals(Material.CHEST)){

View File

@ -175,7 +175,7 @@ public class tent_3 extends Furniture implements Listener{
e.setCancelled(true);
if(!e.canBuild()){return;}
Player p = e.getPlayer();
if(p.getItemInHand().getType().equals(Material.INK_SACK)){
if(p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
getLib().getColorManager().color(p, e.canBuild(), Material.BANNER, getObjID(), ColorType.BANNER, 1);
}else{
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){

View File

@ -98,7 +98,7 @@ public class BearTrap extends Furniture implements Listener{
if(!e.canBuild()){return;}
if(b){
setStatus(false);
getWorld().playSound(getLocation(), Sound.ANVIL_LAND, 10, 1);
getWorld().playSound(getLocation(), Sound.BLOCK_ANVIL_LAND, 10, 1);
}
}
@ -106,7 +106,7 @@ public class BearTrap extends Furniture implements Listener{
if(b){
stand1.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
stand2.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
getWorld().playSound(getLocation(), Sound.ITEM_BREAK, 5, 1);
getWorld().playSound(getLocation(), Sound.ENTITY_ITEM_BREAK, 5, 1);
}else{
stand1.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
stand2.setHeadPose(getLutil().degresstoRad(new EulerAngle(-90, 0, 0)));

View File

@ -1,5 +1,5 @@
name: DiceFurniture
version: 2.6
version: 2.6.6
description: Add some new Objects to the Server
author: Ste3et_C0st
website: http://dicecraft.de