mirror of
https://github.com/Ste3et/furniture.git
synced 2024-09-29 16:17:29 +02:00
DiceFurniture
This commit is contained in:
parent
3af153b756
commit
0598bdb636
@ -4,5 +4,6 @@
|
|||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
<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/spigot.jar"/>
|
||||||
<classpathentry kind="lib" path="C:/Plugins/jars/FurnitureLib.jar"/>
|
<classpathentry kind="lib" path="C:/Plugins/jars/FurnitureLib.jar"/>
|
||||||
|
<classpathentry kind="lib" path="C:/Plugins/jars/PostalService-1.0.6.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
@ -87,26 +87,26 @@ public class main extends JavaPlugin implements Listener{
|
|||||||
if(!objList.contains(obj)) objList.add(obj);
|
if(!objList.contains(obj)) objList.add(obj);
|
||||||
if(obj.getPlugin().equalsIgnoreCase(this.getName())){
|
if(obj.getPlugin().equalsIgnoreCase(this.getName())){
|
||||||
switch (obj.getProject()) {
|
switch (obj.getProject()) {
|
||||||
case "Camera":new camera(obj.getStartLocation(), lib, "Camera", this, obj, null);break;
|
case "Camera":new camera(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "TV":new tv(obj.getStartLocation(), lib, "TV", this, obj, null);break;
|
case "TV":new tv(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "GraveStone":new graveStone(obj.getStartLocation(), lib, "GraveStone", this, obj, null);break;
|
case "GraveStone":new graveStone(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Chair":new chair(obj.getStartLocation(), lib, "Chair", this, obj, null);break;
|
case "Chair":new chair(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "LargeTable":new largeTable(obj.getStartLocation(), lib, "LargeTable", this, obj, null);break;
|
case "LargeTable":new largeTable(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Lantern":new lantern(obj.getStartLocation(), lib, "Lantern", this, obj, null);break;
|
case "Lantern":new lantern(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Sofa":new sofa(obj.getStartLocation(), lib, "Sofa", this, obj, null);break;
|
case "Sofa":new sofa(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Table":new table(obj.getStartLocation(), lib, "Table", this, obj, null);break;
|
case "Table":new table(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Barrels":new barrels(obj.getStartLocation(), lib, "Barrels", this, obj, null);break;
|
case "Barrels":new barrels(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Campfire1":new campfire_1(obj.getStartLocation(), lib, "Campfire1", this, obj, null);break;
|
case "Campfire1":new campfire_1(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Campfire2":new campfire_2(obj.getStartLocation(), lib, "Campfire2", this, obj, null);break;
|
case "Campfire2":new campfire_2(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Tent1":new tent_1(obj.getStartLocation(), lib, "Tent1", this, obj, null);break;
|
case "Tent1":new tent_1(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Tent2":new tent_2(obj.getStartLocation(), lib, "Tent2", this, obj, null);break;
|
case "Tent2":new tent_2(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Tent3":new tent_3(obj.getStartLocation(), lib, "Tent3", this, obj, null);break;
|
case "Tent3":new tent_3(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Fence":new fance(obj.getStartLocation(), lib, "Fence", this, obj, null);break;
|
case "Fence":new fance(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Sunshade":new sunshade(obj.getStartLocation(), lib, "Sunshade", this, obj, null);break;
|
case "Sunshade":new sunshade(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Streetlamp":new streetlamp(obj.getStartLocation(), lib, "Streetlamp", this, obj, null);break;
|
case "Streetlamp":new streetlamp(obj.getStartLocation(), lib, this, obj);break;
|
||||||
case "Billboard": new billboard(obj.getStartLocation(), lib, "Billboard", this, obj, null); break;
|
case "Billboard": new billboard(obj.getStartLocation(), lib, this, obj); break;
|
||||||
case "Mailbox" :
|
case "Mailbox" :
|
||||||
mailBox mail = new mailBox(obj.getStartLocation(), lib, "Mailbox", this, obj, null);
|
mailBox mail = new mailBox(obj.getStartLocation(), lib, this, obj);
|
||||||
/*try {
|
/*try {
|
||||||
mail.addMailbox(loadPlayerMailBox(obj));
|
mail.addMailbox(loadPlayerMailBox(obj));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -172,28 +172,32 @@ public class main extends JavaPlugin implements Listener{
|
|||||||
loc.add(0, 1, 0);
|
loc.add(0, 1, 0);
|
||||||
Project pro = e.getProject();
|
Project pro = e.getProject();
|
||||||
lib.getLimitationManager().add(e.getLocation(), pro);
|
lib.getLimitationManager().add(e.getLocation(), pro);
|
||||||
|
ObjectID obj = new ObjectID(pro.getName(), pro.getPlugin().getName(), e.getLocation());
|
||||||
|
|
||||||
switch(e.getProject().getName()){
|
switch(e.getProject().getName()){
|
||||||
case "Camera" : new camera(loc, lib, "Camera", instance, null, e.getPlayer());break;
|
case "Camera" : new camera(loc, lib, instance, obj);break;
|
||||||
case "TV" : new tv(loc, lib, "TV", instance, null, e.getPlayer());break;
|
case "TV" : new tv(loc, lib, instance, obj);break;
|
||||||
case "GraveStone" : new graveStone(loc, lib, "GraveStone", instance, null, e.getPlayer());break;
|
case "GraveStone" : new graveStone(loc, lib, instance, obj);break;
|
||||||
case "Chair" : new chair(loc, lib, "Chair", instance, null, e.getPlayer()); break;
|
case "Chair" : new chair(loc, lib, instance, obj); break;
|
||||||
case "LargeTable" : new largeTable(loc, lib, "LargeTable", instance, null, e.getPlayer());break;
|
case "LargeTable" : new largeTable(loc, lib, instance, obj);break;
|
||||||
case "Lantern" : new lantern(loc, lib, "Lantern", instance, null, e.getPlayer());break;
|
case "Lantern" : new lantern(loc, lib, instance, obj);break;
|
||||||
case "Sofa" : new sofa(loc, lib, "Sofa", instance, null, e.getPlayer());break;
|
case "Sofa" : new sofa(loc, lib, instance, obj);break;
|
||||||
case "Table" : new table(loc, lib, "Table", instance, null, e.getPlayer());break;
|
case "Table" : new table(loc, lib, instance, obj);break;
|
||||||
case "Barrels" : new barrels(loc, lib, "Barrels", instance, null, e.getPlayer());break;
|
case "Barrels" : new barrels(loc, lib, instance, obj);break;
|
||||||
case "Campfire1" : new campfire_1(loc, lib, "Campfire1", instance, null, e.getPlayer());break;
|
case "Campfire1" : new campfire_1(loc, lib, instance, obj);break;
|
||||||
case "Campfire2" : new campfire_2(loc, lib, "Campfire2", instance, null, e.getPlayer());break;
|
case "Campfire2" : new campfire_2(loc, lib, instance, obj);break;
|
||||||
case "Tent1" : new tent_1(loc, lib, "Tent1", instance, null, e.getPlayer());break;
|
case "Tent1" : new tent_1(loc, lib, instance, obj);break;
|
||||||
case "Tent2" : new tent_2(loc, lib, "Tent2", instance, null, e.getPlayer());break;
|
case "Tent2" : new tent_2(loc, lib, instance, obj);break;
|
||||||
case "Tent3" : new tent_3(loc, lib, "Tent3", instance, null, e.getPlayer());break;
|
case "Tent3" : new tent_3(loc, lib, instance, obj);break;
|
||||||
case "Fence" : new fance(loc, lib, "Fence", instance, null, e.getPlayer());break;
|
case "Fence" : new fance(loc, lib, instance, obj);break;
|
||||||
case "Sunshade": new sunshade(loc, lib, "Sunshade", instance, null, e.getPlayer());break;
|
case "Sunshade": new sunshade(loc, lib, instance, obj);break;
|
||||||
case "Streetlamp": new streetlamp(loc, lib, "Streetlamp", this, null, e.getPlayer());break;
|
case "Streetlamp": new streetlamp(loc, lib, this, obj);break;
|
||||||
case "Billboard": new billboard(loc, lib, "Billboard", instance, null, e.getPlayer());break;
|
case "Billboard": new billboard(loc, lib, instance, obj);break;
|
||||||
case "Mailbox" : new mailBox(loc, lib, "Mailbox", this, null, e.getPlayer()); break;
|
case "Mailbox" : new mailBox(loc, lib, instance, obj); break;
|
||||||
default: e.getPlayer().sendMessage("A error occorupted");break;
|
default: e.getPlayer().sendMessage("A error occorupted");return;
|
||||||
}
|
}
|
||||||
|
obj.setFinish();
|
||||||
|
|
||||||
e.removeItem();
|
e.removeItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.ItemFrame;
|
import org.bukkit.entity.ItemFrame;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -18,15 +17,16 @@ import org.bukkit.util.EulerAngle;
|
|||||||
|
|
||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class billboard implements Listener{
|
public class billboard extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -37,12 +37,11 @@ public class billboard implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
public billboard(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public billboard(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -51,16 +50,10 @@ public class billboard implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
if(id.isFinish()){
|
||||||
this.obj = id;
|
this.obj = id;
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -122,18 +115,20 @@ public class billboard implements Listener{
|
|||||||
pack.setGravity(false);
|
pack.setGravity(false);
|
||||||
pack.setBasePlate(false);
|
pack.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
e.remove();
|
e.remove();
|
||||||
obj=null;
|
obj=null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onFurnitureClick(FurnitureClickEvent e) {}
|
||||||
}
|
}
|
||||||
|
@ -22,15 +22,15 @@ import de.Ste3et_C0st.Furniture.Camera.Utils.RenderClass;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class camera implements Listener{
|
public class camera extends Furniture implements Listener{
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
World w;
|
World w;
|
||||||
@ -40,12 +40,11 @@ public class camera implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
public camera(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public camera(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -54,16 +53,10 @@ public class camera implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -132,15 +125,23 @@ public class camera implements Listener{
|
|||||||
asp.setInvisible(true);
|
asp.setInvisible(true);
|
||||||
asp.setGravity(false);
|
asp.setGravity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
//lib.saveObjToDB(obj);
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||||
|
if(e.isCancelled()){return;}
|
||||||
|
if(!e.canBuild()){return;}
|
||||||
|
if(!e.getID().equals(obj)){return;}
|
||||||
|
if(obj==null){return;}
|
||||||
|
e.remove();
|
||||||
|
obj=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
@ -149,6 +150,7 @@ public class camera implements Listener{
|
|||||||
Location locCopy = getLocation().clone();
|
Location locCopy = getLocation().clone();
|
||||||
if(pLocation.equals(locCopy) && lutil.yawToFace(p.getLocation().getYaw()).getOppositeFace().equals(b)){
|
if(pLocation.equals(locCopy) && lutil.yawToFace(p.getLocation().getYaw()).getOppositeFace().equals(b)){
|
||||||
if(!p.getInventory().getItemInHand().getType().equals(Material.MAP)){return;}
|
if(!p.getInventory().getItemInHand().getType().equals(Material.MAP)){return;}
|
||||||
|
|
||||||
MapView view = Bukkit.getMap(p.getItemInHand().getDurability());
|
MapView view = Bukkit.getMap(p.getItemInHand().getDurability());
|
||||||
Location l = getLocation();
|
Location l = getLocation();
|
||||||
l.setYaw(lutil.FaceToYaw(b.getOppositeFace()));
|
l.setYaw(lutil.FaceToYaw(b.getOppositeFace()));
|
||||||
@ -163,14 +165,4 @@ public class camera implements Listener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
|
||||||
if(e.isCancelled()){return;}
|
|
||||||
if(!e.canBuild()){return;}
|
|
||||||
if(!e.getID().equals(obj)){return;}
|
|
||||||
if(obj==null){return;}
|
|
||||||
e.remove();
|
|
||||||
obj=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
@ -23,15 +22,15 @@ import org.bukkit.util.Vector;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class streetlamp implements Listener{
|
public class streetlamp extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc, light;
|
Location loc, light;
|
||||||
Vector loc2;
|
Vector loc2;
|
||||||
@ -45,12 +44,11 @@ public class streetlamp implements Listener{
|
|||||||
boolean redstone = false;
|
boolean redstone = false;
|
||||||
List<Location> blockLocation = new ArrayList<Location>();
|
List<Location> blockLocation = new ArrayList<Location>();
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
public streetlamp(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public streetlamp(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -61,17 +59,11 @@ public class streetlamp implements Listener{
|
|||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.light = lutil.getRelativ(loc, b, -1D, 0D);
|
this.light = lutil.getRelativ(loc, b, -1D, 0D);
|
||||||
|
this.obj = id;
|
||||||
setBlock();
|
setBlock();
|
||||||
if(id!=null){
|
if(id.isFinish()){
|
||||||
this.obj = id;
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -132,7 +124,6 @@ public class streetlamp implements Listener{
|
|||||||
pack.setGravity(false);
|
pack.setGravity(false);
|
||||||
pack.setBasePlate(false);
|
pack.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
@ -164,6 +155,7 @@ public class streetlamp implements Listener{
|
|||||||
if(e.getClickedBlock()==null) return;
|
if(e.getClickedBlock()==null) return;
|
||||||
if(blockLocation.contains(e.getClickedBlock().getLocation())){
|
if(blockLocation.contains(e.getClickedBlock().getLocation())){
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
if(!lib.canBuild(e.getPlayer(), e.getClickedBlock().getLocation())){return;}
|
||||||
FurnitureLib.getInstance().getLightManager().removeLight(light);
|
FurnitureLib.getInstance().getLightManager().removeLight(light);
|
||||||
obj.remove(e.getPlayer());
|
obj.remove(e.getPlayer());
|
||||||
for(Location loc : blockLocation){
|
for(Location loc : blockLocation){
|
||||||
@ -174,6 +166,7 @@ public class streetlamp implements Listener{
|
|||||||
}else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
|
}else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
|
||||||
if(e.getClickedBlock()==null) return;
|
if(e.getClickedBlock()==null) return;
|
||||||
if(blockLocation.contains(e.getClickedBlock().getLocation())){
|
if(blockLocation.contains(e.getClickedBlock().getLocation())){
|
||||||
|
if(!lib.canBuild(e.getPlayer(), e.getClickedBlock().getLocation())){return;}
|
||||||
if(isOn()){
|
if(isOn()){
|
||||||
setLight(false);
|
setLight(false);
|
||||||
}else{
|
}else{
|
||||||
@ -183,23 +176,6 @@ public class streetlamp implements Listener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
private void onClick(FurnitureClickEvent e){
|
|
||||||
if(obj==null){return;}
|
|
||||||
if(e.isCancelled()){return;}
|
|
||||||
if(!e.getID().equals(obj)){return;}
|
|
||||||
e.setCancelled(true);
|
|
||||||
Boolean isOn = isOn();
|
|
||||||
ArmorStandPacket packet = getPacket();
|
|
||||||
if(packet==null) return;
|
|
||||||
if(redstone) return;
|
|
||||||
if(isOn){
|
|
||||||
setLight(false);
|
|
||||||
}else{
|
|
||||||
setLight(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBlockPowered(BlockRedstoneEvent e){
|
private void onBlockPowered(BlockRedstoneEvent e){
|
||||||
if(e.getBlock()==null) return;
|
if(e.getBlock()==null) return;
|
||||||
@ -255,7 +231,7 @@ public class streetlamp implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -267,5 +243,23 @@ public class streetlamp implements Listener{
|
|||||||
loc.getBlock().setType(Material.AIR);
|
loc.getBlock().setType(Material.AIR);
|
||||||
}
|
}
|
||||||
blockLocation.clear();
|
blockLocation.clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||||
|
if(obj==null){return;}
|
||||||
|
if(e.isCancelled()){return;}
|
||||||
|
if(!e.getID().equals(obj)){return;}
|
||||||
|
e.setCancelled(true);
|
||||||
|
Boolean isOn = isOn();
|
||||||
|
ArmorStandPacket packet = getPacket();
|
||||||
|
if(packet==null) return;
|
||||||
|
if(redstone) return;
|
||||||
|
if(isOn){
|
||||||
|
setLight(false);
|
||||||
|
}else{
|
||||||
|
setLight(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -17,15 +16,16 @@ import org.bukkit.util.EulerAngle;
|
|||||||
|
|
||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class tv implements Listener{
|
public class tv extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -36,12 +36,11 @@ public class tv implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
public tv(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public tv(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -50,16 +49,10 @@ public class tv implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -78,8 +71,6 @@ public class tv implements Listener{
|
|||||||
as.getInventory().setHelmet(new ItemStack(Material.IRON_PLATE));
|
as.getInventory().setHelmet(new ItemStack(Material.IRON_PLATE));
|
||||||
as.setSmall(true);
|
as.setSmall(true);
|
||||||
aspList.add(as);
|
aspList.add(as);
|
||||||
|
|
||||||
// Loc ,angle, ITEMSTACK , Arm , Mini, invis, ID , List
|
|
||||||
center.add(0, -.45, 0);
|
center.add(0, -.45, 0);
|
||||||
center.setYaw(lutil.FaceToYaw(b));
|
center.setYaw(lutil.FaceToYaw(b));
|
||||||
|
|
||||||
@ -101,7 +92,6 @@ public class tv implements Listener{
|
|||||||
asp.setBasePlate(false);
|
asp.setBasePlate(false);
|
||||||
asp.setInvisible(true);
|
asp.setInvisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
@ -122,7 +112,7 @@ public class tv implements Listener{
|
|||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -130,4 +120,7 @@ public class tv implements Listener{
|
|||||||
e.remove();
|
e.remove();
|
||||||
obj=null;
|
obj=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onFurnitureClick(FurnitureClickEvent e){}
|
||||||
}
|
}
|
||||||
|
@ -22,14 +22,14 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
|
|
||||||
public class fance implements Listener{
|
public class fance extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -40,11 +40,10 @@ public class fance implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public ObjectID getObjectID(){return this.obj;}
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
List<Material> matList = Arrays.asList(
|
List<Material> matList = Arrays.asList(
|
||||||
Material.SPRUCE_FENCE,
|
Material.SPRUCE_FENCE,
|
||||||
Material.BIRCH_FENCE,
|
Material.BIRCH_FENCE,
|
||||||
@ -56,7 +55,8 @@ public class fance implements Listener{
|
|||||||
Block block;
|
Block block;
|
||||||
Material m;
|
Material m;
|
||||||
|
|
||||||
public fance(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public fance(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -65,17 +65,11 @@ public class fance implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
setBlock();
|
setBlock();
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
setBlock();
|
setBlock();
|
||||||
@ -97,7 +91,6 @@ public class fance implements Listener{
|
|||||||
packet.setSmall(true);
|
packet.setSmall(true);
|
||||||
locat.add(0, .44, 0);
|
locat.add(0, .44, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
@ -117,7 +110,7 @@ public class fance implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -169,7 +162,7 @@ public class fance implements Listener{
|
|||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(this.block==null) return;
|
if(this.block==null) return;
|
||||||
|
@ -25,15 +25,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class graveStone implements Listener{
|
public class graveStone extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -44,13 +44,12 @@ public class graveStone implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public ObjectID getObjectID(){return this.obj;}
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
public graveStone(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public graveStone(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -59,17 +58,11 @@ public class graveStone implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
setBlock();
|
setBlock();
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
setBlock();
|
setBlock();
|
||||||
@ -153,13 +146,12 @@ public class graveStone implements Listener{
|
|||||||
asp.setInvisible(true);
|
asp.setInvisible(true);
|
||||||
asp.setBasePlate(false);
|
asp.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(e.isCancelled()) return;
|
if(e.isCancelled()) return;
|
||||||
if(!e.canBuild()) return;
|
if(!e.canBuild()) return;
|
||||||
if(!e.getID().equals(obj)) return;
|
if(!e.getID().equals(obj)) return;
|
||||||
@ -205,7 +197,7 @@ public class graveStone implements Listener{
|
|||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
if(e.isCancelled()) return;
|
if(e.isCancelled()) return;
|
||||||
if(!e.canBuild()) return;
|
if(!e.canBuild()) return;
|
||||||
|
@ -2,13 +2,14 @@ package de.Ste3et_C0st.Furniture.Objects.garden;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
@ -19,15 +20,16 @@ import org.bukkit.util.EulerAngle;
|
|||||||
|
|
||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class mailBox implements Listener {
|
public class mailBox extends Furniture implements Listener {
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -39,14 +41,14 @@ public class mailBox implements Listener {
|
|||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
List<Block> blockList = new ArrayList<Block>();
|
List<Block> blockList = new ArrayList<Block>();
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public ObjectID getObjectID(){return this.obj;}
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
UUID uuid;
|
||||||
|
|
||||||
public mailBox(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public mailBox(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -55,16 +57,10 @@ public class mailBox implements Listener {
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -138,6 +134,7 @@ public class mailBox implements Listener {
|
|||||||
as = manager.createArmorStand(obj, lutil.getRelativ(middle.clone().add(0, 1.5, 0), face, -.21, -.32D));
|
as = manager.createArmorStand(obj, lutil.getRelativ(middle.clone().add(0, 1.5, 0), face, -.21, -.32D));
|
||||||
as.getInventory().setHelmet(new ItemStack(Material.REDSTONE_TORCH_ON, 1, (short) 0));
|
as.getInventory().setHelmet(new ItemStack(Material.REDSTONE_TORCH_ON, 1, (short) 0));
|
||||||
as.setPose(lutil.degresstoRad(new EulerAngle(0, 0, 90)), BodyPart.HEAD);
|
as.setPose(lutil.degresstoRad(new EulerAngle(0, 0, 90)), BodyPart.HEAD);
|
||||||
|
as.setName("#ELEMENT#");
|
||||||
as.setSmall(true);
|
as.setSmall(true);
|
||||||
aspList.add(as);
|
aspList.add(as);
|
||||||
|
|
||||||
@ -171,19 +168,47 @@ public class mailBox implements Listener {
|
|||||||
b.setType(Material.BARRIER);
|
b.setType(Material.BARRIER);
|
||||||
blockList.add(b);
|
blockList.add(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public void addMailbox(Player p) throws MailboxException{
|
/*public void addMailbox(Player p){
|
||||||
if(Bukkit.getPluginManager().isPluginEnabled("PostalService")){
|
if(Bukkit.getPluginManager().isPluginEnabled("PostalService")){
|
||||||
PostalService.getMailboxManager().addMailboxAtLoc(blockList.get(1).getLocation(), p);
|
try {
|
||||||
|
PostalService.getMailboxManager().addMailboxAtLoc(blockList.get(1).getLocation(), p);
|
||||||
|
this.uuid = p.getUniqueId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendet(Boolean b){
|
||||||
|
for(ArmorStandPacket packet : manager.getArmorStandPacketByObjectID(obj)){
|
||||||
|
if(packet!=null&&packet.getName().equalsIgnoreCase("#ELEMENT#")){
|
||||||
|
if(b){
|
||||||
|
packet.setPose(lutil.degresstoRad(new EulerAngle(0, 0, 0)), BodyPart.HEAD);
|
||||||
|
manager.updateFurniture(obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
packet.setPose(lutil.degresstoRad(new EulerAngle(0, 0, 90)), BodyPart.HEAD);
|
||||||
|
manager.updateFurniture(obj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onMove(PlayerSendMailEvent e){
|
||||||
|
if(!Bukkit.getPluginManager().isPluginEnabled("PostalService")){return;}
|
||||||
|
UUID p1 = this.uuid;
|
||||||
|
UUID p2 = e.getRecipient().getUUID();
|
||||||
|
if(!p1.equals(p2)){return;}
|
||||||
|
setSendet(true);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(e.isCancelled()) return;
|
if(e.isCancelled()) return;
|
||||||
if(!e.canBuild()) return;
|
if(!e.canBuild()) return;
|
||||||
if(!e.getID().equals(obj)) return;
|
if(!e.getID().equals(obj)) return;
|
||||||
@ -196,6 +221,8 @@ public class mailBox implements Listener {
|
|||||||
obj=null;
|
obj=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onFurnitureClick(FurnitureClickEvent e){}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onInteract(PlayerInteractEvent e){
|
private void onInteract(PlayerInteractEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
|
@ -27,15 +27,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class sunshade implements Listener{
|
public class sunshade extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -46,11 +46,10 @@ public class sunshade implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
private String id;
|
|
||||||
public String getID(){return this.id;}
|
|
||||||
public ObjectID getObjectID(){return this.obj;}
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
public Location getLocation(){return this.loc;}
|
public Location getLocation(){return this.loc;}
|
||||||
public BlockFace getBlockFace(){return this.b;}
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
List<Material> matList = Arrays.asList(
|
List<Material> matList = Arrays.asList(
|
||||||
Material.SPRUCE_FENCE,
|
Material.SPRUCE_FENCE,
|
||||||
Material.BIRCH_FENCE,
|
Material.BIRCH_FENCE,
|
||||||
@ -63,7 +62,8 @@ public class sunshade implements Listener{
|
|||||||
Integer timer;
|
Integer timer;
|
||||||
Block block;
|
Block block;
|
||||||
|
|
||||||
public sunshade(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public sunshade(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -72,17 +72,11 @@ public class sunshade implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
setblock();
|
setblock();
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
setblock();
|
setblock();
|
||||||
spawn(location);
|
spawn(location);
|
||||||
@ -137,14 +131,12 @@ public class sunshade implements Listener{
|
|||||||
packet.setGravity(false);
|
packet.setGravity(false);
|
||||||
packet.setBasePlate(false);
|
packet.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -199,6 +191,7 @@ public class sunshade implements Listener{
|
|||||||
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK)){
|
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK)){
|
||||||
if(e.getClickedBlock().getLocation().equals(block.getLocation())){
|
if(e.getClickedBlock().getLocation().equals(block.getLocation())){
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
if(!lib.canBuild(e.getPlayer(), e.getClickedBlock().getLocation())){return;}
|
||||||
stopTimer();
|
stopTimer();
|
||||||
for(ArmorStandPacket packet : manager.getArmorStandPacketByObjectID(obj)){
|
for(ArmorStandPacket packet : manager.getArmorStandPacketByObjectID(obj)){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
@ -215,6 +208,7 @@ public class sunshade implements Listener{
|
|||||||
}
|
}
|
||||||
}else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
|
}else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
|
||||||
if(e.getClickedBlock().getLocation().equals(block.getLocation())){
|
if(e.getClickedBlock().getLocation().equals(block.getLocation())){
|
||||||
|
if(!lib.canBuild(e.getPlayer(), e.getClickedBlock().getLocation())){return;}
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
ItemStack is = p.getItemInHand();
|
ItemStack is = p.getItemInHand();
|
||||||
if(is==null||!is.getType().equals(Material.BANNER)){
|
if(is==null||!is.getType().equals(Material.BANNER)){
|
||||||
@ -252,7 +246,7 @@ public class sunshade implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -18,15 +17,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class chair implements Listener{
|
public class chair extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -37,7 +36,12 @@ public class chair implements Listener{
|
|||||||
LocationUtil lutil;
|
LocationUtil lutil;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public chair(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public chair(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -46,16 +50,10 @@ public class chair implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -114,13 +112,12 @@ public class chair implements Listener{
|
|||||||
asp.setInvisible(true);
|
asp.setInvisible(true);
|
||||||
asp.setBasePlate(false);
|
asp.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -130,7 +127,7 @@ public class chair implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
|
@ -19,14 +19,14 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
|
|
||||||
public class lantern implements Listener{
|
public class lantern extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -38,7 +38,12 @@ public class lantern implements Listener{
|
|||||||
Integer id;
|
Integer id;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public lantern(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public lantern(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -47,17 +52,12 @@ public class lantern implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
|
|
||||||
setBlock();
|
setBlock();
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -112,7 +112,6 @@ public class lantern implements Listener{
|
|||||||
packet.setGravity(false);
|
packet.setGravity(false);
|
||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
@ -129,7 +128,7 @@ public class lantern implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()) return;
|
if(e.isCancelled()) return;
|
||||||
if(block==null) return;
|
if(block==null) return;
|
||||||
@ -140,7 +139,7 @@ public class lantern implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onInteract(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()) return;
|
if(e.isCancelled()) return;
|
||||||
if(block==null) return;
|
if(block==null) return;
|
||||||
|
@ -20,15 +20,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class largeTable implements Listener{
|
public class largeTable extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -40,7 +40,12 @@ public class largeTable implements Listener{
|
|||||||
Integer id;
|
Integer id;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public largeTable(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public largeTable(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -49,9 +54,8 @@ public class largeTable implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
|
|
||||||
for(ArmorStandPacket packet : manager.getArmorStandPacketByObjectID(obj)){
|
for(ArmorStandPacket packet : manager.getArmorStandPacketByObjectID(obj)){
|
||||||
if(packet.getName().startsWith("#TELLER")){
|
if(packet.getName().startsWith("#TELLER")){
|
||||||
tellerIDs.add(packet.getEntityId());
|
tellerIDs.add(packet.getEntityId());
|
||||||
@ -60,12 +64,6 @@ public class largeTable implements Listener{
|
|||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -186,7 +184,6 @@ public class largeTable implements Listener{
|
|||||||
asp.setInvisible(true);
|
asp.setInvisible(true);
|
||||||
asp.setBasePlate(false);
|
asp.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
@ -201,7 +198,7 @@ public class largeTable implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -220,7 +217,7 @@ public class largeTable implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -284,7 +281,9 @@ public class largeTable implements Listener{
|
|||||||
if(as!=null&&as.getInventory().getItemInHand()!= null && as.getInventory().getItemInHand().equals(is)){return;}
|
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.getInventory().getItemInHand()!=null&&!as.getInventory().getItemInHand().getType().equals(Material.AIR)){
|
||||||
ArmorStandPacket asp = as;
|
ArmorStandPacket asp = as;
|
||||||
asp.getLocation().getWorld().dropItem(asp.getLocation(), asp.getInventory().getItemInHand());
|
ItemStack item = asp.getInventory().getItemInHand();
|
||||||
|
item.setAmount(1);
|
||||||
|
asp.getLocation().getWorld().dropItem(asp.getLocation(), item);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack IS = is.clone();
|
ItemStack IS = is.clone();
|
||||||
|
@ -19,15 +19,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class sofa implements Listener {
|
public class sofa extends Furniture implements Listener {
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -39,7 +39,12 @@ public class sofa implements Listener {
|
|||||||
Integer id;
|
Integer id;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public sofa(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public sofa(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -48,16 +53,10 @@ public class sofa implements Listener {
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
place = .3;
|
place = .3;
|
||||||
spawn(location);
|
spawn(location);
|
||||||
@ -167,13 +166,12 @@ public class sofa implements Listener {
|
|||||||
asps.setGravity(false);
|
asps.setGravity(false);
|
||||||
asps.setBasePlate(false);
|
asps.setBasePlate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -237,7 +235,7 @@ public class sofa implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
|
@ -19,15 +19,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class table implements Listener {
|
public class table extends Furniture implements Listener {
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -39,7 +39,12 @@ public class table implements Listener {
|
|||||||
Integer id;
|
Integer id;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public table(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public table(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -48,16 +53,10 @@ public class table implements Listener {
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -89,13 +88,12 @@ public class table implements Listener {
|
|||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
packet.setGravity(false);
|
packet.setGravity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -114,7 +112,7 @@ public class table implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -128,6 +126,7 @@ public class table implements Listener {
|
|||||||
Itemstack.setAmount(1);
|
Itemstack.setAmount(1);
|
||||||
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
|
if(packet.getInventory().getItemInHand()!=null&&!packet.getInventory().getItemInHand().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getItemInHand();
|
ItemStack is = packet.getInventory().getItemInHand();
|
||||||
|
is.setAmount(1);
|
||||||
w.dropItem(loc, is);
|
w.dropItem(loc, is);
|
||||||
}
|
}
|
||||||
packet.getInventory().setItemInHand(Itemstack);
|
packet.getInventory().setItemInHand(Itemstack);
|
||||||
|
@ -19,14 +19,14 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
|
|
||||||
public class barrels implements Listener {
|
public class barrels extends Furniture implements Listener {
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -39,7 +39,12 @@ public class barrels implements Listener {
|
|||||||
Block block;
|
Block block;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public barrels(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public barrels(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -48,18 +53,12 @@ public class barrels implements Listener {
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
this.block = loc.getBlock();
|
this.block = loc.getBlock();
|
||||||
this.block.setType(Material.CAULDRON);
|
this.block.setType(Material.CAULDRON);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -70,13 +69,12 @@ public class barrels implements Listener {
|
|||||||
|
|
||||||
ArmorStandPacket packet = manager.createArmorStand(obj, lutil.getCenter(loc).add(0,-1.5,0));
|
ArmorStandPacket packet = manager.createArmorStand(obj, lutil.getCenter(loc).add(0,-1.5,0));
|
||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -87,6 +85,7 @@ public class barrels implements Listener {
|
|||||||
ArmorStandPacket packet = manager.getArmorStandPacketByObjectID(obj).get(0);
|
ArmorStandPacket packet = manager.getArmorStandPacketByObjectID(obj).get(0);
|
||||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getHelmet();
|
ItemStack is = packet.getInventory().getHelmet();
|
||||||
|
is.setAmount(1);
|
||||||
w.dropItem(loc, is);
|
w.dropItem(loc, is);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,8 +115,10 @@ public class barrels implements Listener {
|
|||||||
ItemStack Itemstack = p.getItemInHand().clone();
|
ItemStack Itemstack = p.getItemInHand().clone();
|
||||||
Itemstack.setAmount(1);
|
Itemstack.setAmount(1);
|
||||||
ArmorStandPacket packet = manager.getArmorStandPacketByObjectID(obj).get(0);
|
ArmorStandPacket packet = manager.getArmorStandPacketByObjectID(obj).get(0);
|
||||||
|
|
||||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getHelmet();
|
ItemStack is = packet.getInventory().getHelmet();
|
||||||
|
is.setAmount(1);
|
||||||
w.dropItem(loc, is);
|
w.dropItem(loc, is);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +153,7 @@ public class barrels implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
|
@ -7,7 +7,6 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -16,14 +15,14 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
|
|
||||||
public class campfire_1 implements Listener{
|
public class campfire_1 extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -35,7 +34,12 @@ public class campfire_1 implements Listener{
|
|||||||
Integer id;
|
Integer id;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public campfire_1(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public campfire_1(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -44,22 +48,16 @@ public class campfire_1 implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -76,7 +74,7 @@ public class campfire_1 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
|
@ -10,7 +10,6 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -20,15 +19,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class campfire_2 implements Listener{
|
public class campfire_2 extends Furniture implements Listener{
|
||||||
List<Material> items = new ArrayList<Material>(
|
List<Material> items = new ArrayList<Material>(
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
Material.RAW_BEEF,
|
Material.RAW_BEEF,
|
||||||
@ -75,7 +74,13 @@ public class campfire_2 implements Listener{
|
|||||||
Integer timer;
|
Integer timer;
|
||||||
ArmorStandPacket armorS;
|
ArmorStandPacket armorS;
|
||||||
ItemStack is;
|
ItemStack is;
|
||||||
public campfire_2(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
|
||||||
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public campfire_2(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -90,17 +95,10 @@ public class campfire_2 implements Listener{
|
|||||||
|
|
||||||
grill = lutil.getRelativ(middle,b, .0D, .5D);
|
grill = lutil.getRelativ(middle,b, .0D, .5D);
|
||||||
grill.setYaw(lutil.FaceToYaw(b)+90);
|
grill.setYaw(lutil.FaceToYaw(b)+90);
|
||||||
|
this.obj = id;
|
||||||
if(id!=null){
|
if(id.isFinish()){
|
||||||
this.obj = id;
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -174,13 +172,12 @@ public class campfire_2 implements Listener{
|
|||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
packet.setGravity(false);
|
packet.setGravity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -234,7 +231,7 @@ public class campfire_2 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
|
@ -21,15 +21,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class tent_1 implements Listener{
|
public class tent_1 extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -42,7 +42,12 @@ public class tent_1 implements Listener{
|
|||||||
Block block;
|
Block block;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public tent_1(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public tent_1(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -54,18 +59,11 @@ public class tent_1 implements Listener{
|
|||||||
if(b.equals(BlockFace.WEST)){loc=lutil.getRelativ(loc, b, 1D, 0D);}
|
if(b.equals(BlockFace.WEST)){loc=lutil.getRelativ(loc, b, 1D, 0D);}
|
||||||
if(b.equals(BlockFace.NORTH)){loc=lutil.getRelativ(loc, b, 1D, 1D);}
|
if(b.equals(BlockFace.NORTH)){loc=lutil.getRelativ(loc, b, 1D, 1D);}
|
||||||
if(b.equals(BlockFace.EAST)){loc=lutil.getRelativ(loc, b, 0D, 1D);}
|
if(b.equals(BlockFace.EAST)){loc=lutil.getRelativ(loc, b, 0D, 1D);}
|
||||||
|
this.obj = id;
|
||||||
if(id!=null){
|
if(id.isFinish()){
|
||||||
this.obj = id;
|
|
||||||
setblock();
|
setblock();
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(loc);
|
spawn(loc);
|
||||||
}
|
}
|
||||||
@ -256,13 +254,12 @@ public class tent_1 implements Listener{
|
|||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
packet.setGravity(false);
|
packet.setGravity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -274,7 +271,7 @@ public class tent_1 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
|
@ -22,15 +22,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class tent_2 implements Listener{
|
public class tent_2 extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -45,7 +45,13 @@ public class tent_2 implements Listener{
|
|||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
Location bedLoc;
|
Location bedLoc;
|
||||||
public tent_2(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
|
||||||
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public tent_2(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -57,10 +63,8 @@ public class tent_2 implements Listener{
|
|||||||
if(b.equals(BlockFace.WEST)){location=lutil.getRelativ(location, b, 1D, 0D);}
|
if(b.equals(BlockFace.WEST)){location=lutil.getRelativ(location, b, 1D, 0D);}
|
||||||
if(b.equals(BlockFace.NORTH)){location=lutil.getRelativ(location, b, 1D, 1D);}
|
if(b.equals(BlockFace.NORTH)){location=lutil.getRelativ(location, b, 1D, 1D);}
|
||||||
if(b.equals(BlockFace.EAST)){location=lutil.getRelativ(location, b, 0D, 1D);}
|
if(b.equals(BlockFace.EAST)){location=lutil.getRelativ(location, b, 0D, 1D);}
|
||||||
|
this.obj = id;
|
||||||
if(id!=null){
|
if(id.isFinish()){
|
||||||
this.obj = id;
|
|
||||||
|
|
||||||
Bukkit.broadcastMessage(b.name());
|
Bukkit.broadcastMessage(b.name());
|
||||||
|
|
||||||
Location loca = loc.clone();
|
Location loca = loc.clone();
|
||||||
@ -75,12 +79,6 @@ public class tent_2 implements Listener{
|
|||||||
setBlock(loca);
|
setBlock(loca);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
spawn(location);
|
spawn(location);
|
||||||
}
|
}
|
||||||
@ -201,7 +199,7 @@ public class tent_2 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
@ -215,7 +213,7 @@ public class tent_2 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(final FurnitureClickEvent e){
|
public void onFurnitureClick(final FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
|
@ -24,15 +24,15 @@ import org.bukkit.util.EulerAngle;
|
|||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureLateSpawnEvent;
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
import de.Ste3et_C0st.FurnitureLib.main.ArmorStandPacket;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
|
|
||||||
public class tent_3 implements Listener{
|
public class tent_3 extends Furniture implements Listener{
|
||||||
|
|
||||||
Location loc;
|
Location loc;
|
||||||
BlockFace b;
|
BlockFace b;
|
||||||
@ -44,7 +44,12 @@ public class tent_3 implements Listener{
|
|||||||
Integer id;
|
Integer id;
|
||||||
Plugin plugin;
|
Plugin plugin;
|
||||||
|
|
||||||
public tent_3(Location location, FurnitureLib lib, String name, Plugin plugin, ObjectID id, Player player){
|
public ObjectID getObjectID(){return this.obj;}
|
||||||
|
public Location getLocation(){return this.loc;}
|
||||||
|
public BlockFace getBlockFace(){return this.b;}
|
||||||
|
|
||||||
|
public tent_3(Location location, FurnitureLib lib, Plugin plugin, ObjectID id){
|
||||||
|
super(location, lib, plugin, id);
|
||||||
this.lutil = main.getLocationUtil();
|
this.lutil = main.getLocationUtil();
|
||||||
this.b = lutil.yawToFace(location.getYaw());
|
this.b = lutil.yawToFace(location.getYaw());
|
||||||
this.loc = location.getBlock().getLocation();
|
this.loc = location.getBlock().getLocation();
|
||||||
@ -53,17 +58,11 @@ public class tent_3 implements Listener{
|
|||||||
this.manager = lib.getFurnitureManager();
|
this.manager = lib.getFurnitureManager();
|
||||||
this.lib = lib;
|
this.lib = lib;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
if(id!=null){
|
this.obj = id;
|
||||||
this.obj = id;
|
if(id.isFinish()){
|
||||||
setBlock();
|
setBlock();
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
return;
|
return;
|
||||||
}else{
|
|
||||||
this.obj = new ObjectID(name, plugin.getName(), location);
|
|
||||||
if(player!=null){
|
|
||||||
FurnitureLateSpawnEvent lateSpawn = new FurnitureLateSpawnEvent(player, obj, obj.getProjectOBJ(), location);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(lateSpawn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(b.equals(BlockFace.WEST)){location=lutil.getRelativ(location, b, 1D, 0D);}
|
if(b.equals(BlockFace.WEST)){location=lutil.getRelativ(location, b, 1D, 0D);}
|
||||||
if(b.equals(BlockFace.NORTH)){location=lutil.getRelativ(location, b, 1D, 1D);}
|
if(b.equals(BlockFace.NORTH)){location=lutil.getRelativ(location, b, 1D, 1D);}
|
||||||
@ -165,7 +164,6 @@ public class tent_3 implements Listener{
|
|||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
packet.setGravity(false);
|
packet.setGravity(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.send(obj);
|
manager.send(obj);
|
||||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||||
}
|
}
|
||||||
@ -177,7 +175,7 @@ public class tent_3 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
@ -189,7 +187,7 @@ public class tent_3 implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onClick(FurnitureClickEvent e){
|
public void onFurnitureClick(FurnitureClickEvent e){
|
||||||
if(obj==null){return;}
|
if(obj==null){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(obj)){return;}
|
if(!e.getID().equals(obj)){return;}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: DiceFurniture
|
name: DiceFurniture
|
||||||
version: 2.0.8.1
|
version: 2.0.8.2
|
||||||
description: Furniture
|
description: Furniture
|
||||||
author: Ste3et_C0st
|
author: Ste3et_C0st
|
||||||
website: http://dicecraft.de
|
website: http://dicecraft.de
|
||||||
|
Loading…
Reference in New Issue
Block a user