mirror of
https://github.com/Ste3et/furniture.git
synced 2024-11-22 18:46:08 +01:00
Add new Stuff
This commit is contained in:
parent
1e681f23d1
commit
f3e1bd1299
12
src/Crafting/AdventWreath.yml
Normal file
12
src/Crafting/AdventWreath.yml
Normal file
@ -0,0 +1,12 @@
|
||||
AdventWreath:
|
||||
name: '&cAdventWreath'
|
||||
material: 383
|
||||
glow: true
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: false
|
||||
recipe: XXX,XEX,AXA
|
||||
index:
|
||||
E: 126
|
||||
X: 0
|
||||
A: 65
|
10
src/Crafting/CandyCane.yml
Normal file
10
src/Crafting/CandyCane.yml
Normal file
@ -0,0 +1,10 @@
|
||||
CandyCane:
|
||||
name: '&cCandyCane'
|
||||
material: 383
|
||||
glow: false
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: true
|
||||
recipe: XXX,XXX,XXX
|
||||
index:
|
||||
X: 0
|
12
src/Crafting/ChristmasStar.yml
Normal file
12
src/Crafting/ChristmasStar.yml
Normal file
@ -0,0 +1,12 @@
|
||||
ChristmasStar:
|
||||
name: '&cChristmasStar'
|
||||
material: 383
|
||||
glow: false
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: false
|
||||
recipe: XXX,XXX,A0A
|
||||
index:
|
||||
'0': 0
|
||||
X: 160
|
||||
A: 352
|
10
src/Crafting/ChristmasTree.yml
Normal file
10
src/Crafting/ChristmasTree.yml
Normal file
@ -0,0 +1,10 @@
|
||||
ChristmasTree:
|
||||
name: '&cChristmasTree'
|
||||
material: 383
|
||||
glow: false
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: true
|
||||
recipe: XXX,XXX,XXX
|
||||
index:
|
||||
X: 0
|
12
src/Crafting/SnowGolem.yml
Normal file
12
src/Crafting/SnowGolem.yml
Normal file
@ -0,0 +1,12 @@
|
||||
SnowGolem:
|
||||
name: '&cSnowGolem'
|
||||
material: 383
|
||||
glow: false
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: true
|
||||
recipe: XTX,ATA,TAT
|
||||
index:
|
||||
T: 0
|
||||
X: 280
|
||||
A: 336
|
@ -2,15 +2,11 @@ package de.Ste3et_C0st.Furniture.Main;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -25,6 +21,10 @@ import de.Ste3et_C0st.Furniture.Objects.School.BlackBoard;
|
||||
import de.Ste3et_C0st.Furniture.Objects.School.SchoolChair;
|
||||
import de.Ste3et_C0st.Furniture.Objects.School.SchoolTable;
|
||||
import de.Ste3et_C0st.Furniture.Objects.School.TrashCan;
|
||||
import de.Ste3et_C0st.Furniture.Objects.christmas.AdventWreath;
|
||||
import de.Ste3et_C0st.Furniture.Objects.christmas.CandyCane;
|
||||
import de.Ste3et_C0st.Furniture.Objects.christmas.ChristmasStar;
|
||||
import de.Ste3et_C0st.Furniture.Objects.christmas.SnowGolem;
|
||||
import de.Ste3et_C0st.Furniture.Objects.electric.billboard;
|
||||
import de.Ste3et_C0st.Furniture.Objects.electric.camera;
|
||||
import de.Ste3et_C0st.Furniture.Objects.electric.streetlamp;
|
||||
@ -54,147 +54,83 @@ import de.Ste3et_C0st.Furniture.Objects.outdoor.tent_2;
|
||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.tent_3;
|
||||
import de.Ste3et_C0st.Furniture.Objects.trap.BearTrap;
|
||||
import de.Ste3et_C0st.FurnitureLib.Crafting.Project;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureItemEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureManager;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.CenterType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.PlaceableSide;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
|
||||
public class main extends JavaPlugin implements Listener{
|
||||
|
||||
FurnitureLib lib;
|
||||
FurnitureManager manager;
|
||||
config c;
|
||||
FileConfiguration file;
|
||||
public static double damage = 0;
|
||||
static main instance;
|
||||
public static main instance;
|
||||
static LocationUtil util;
|
||||
public static List<Material> materialWhiteList = new ArrayList<Material>();
|
||||
@SuppressWarnings("unused")
|
||||
public void onEnable(){
|
||||
if(!Bukkit.getPluginManager().isPluginEnabled("FurnitureLib")){Bukkit.getPluginManager().disablePlugin(this);}
|
||||
instance = this;
|
||||
lib = (FurnitureLib) Bukkit.getPluginManager().getPlugin("FurnitureLib");
|
||||
manager = lib.getFurnitureManager();
|
||||
util = lib.getLocationUtil();
|
||||
Bukkit.getPluginManager().registerEvents(this, this);
|
||||
|
||||
new Project("Camera", this,getResource("Crafting/Camera.yml"),PlaceableSide.TOP, camera.class);
|
||||
new Project("Camera", this,getResource("Crafting/Camera.yml"),PlaceableSide.TOP, camera.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||
new Project("TV", this,getResource("Crafting/TV.yml"),PlaceableSide.TOP, tv.class).setSize(1, 2, 3, CenterType.CENTER);
|
||||
new Project("GraveStone", this,getResource("Crafting/GraveStone.yml"),PlaceableSide.TOP, graveStone.class).setSize(1, 2, 3, CenterType.CENTER);
|
||||
new Project("Chair", this,getResource("Crafting/Chair.yml"),PlaceableSide.TOP, chair.class);
|
||||
new Project("Chair", this,getResource("Crafting/Chair.yml"),PlaceableSide.TOP, chair.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("LargeTable", this,getResource("Crafting/LargeTable.yml"),PlaceableSide.TOP, largeTable.class).setSize(2, 1, 2, CenterType.RIGHT);
|
||||
new Project("Lantern", this,getResource("Crafting/Lantern.yml"),PlaceableSide.TOP, lantern.class);
|
||||
new Project("Lantern", this,getResource("Crafting/Lantern.yml"),PlaceableSide.TOP, lantern.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Sofa", this,getResource("Crafting/Sofa.yml"),PlaceableSide.TOP, sofa.class).setSize(1, 1, 3, CenterType.RIGHT);
|
||||
new Project("Table", this,getResource("Crafting/Table.yml"),PlaceableSide.TOP, table.class);
|
||||
new Project("Barrels", this,getResource("Crafting/Barrels.yml"),PlaceableSide.TOP, barrels.class);
|
||||
new Project("Campfire1", this,getResource("Crafting/Campfire1.yml"),PlaceableSide.TOP, campfire_1.class);
|
||||
new Project("Table", this,getResource("Crafting/Table.yml"),PlaceableSide.TOP, table.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Barrels", this,getResource("Crafting/Barrels.yml"),PlaceableSide.TOP, barrels.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Campfire1", this,getResource("Crafting/Campfire1.yml"),PlaceableSide.TOP, campfire_1.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Campfire2", this,getResource("Crafting/Campfire2.yml"),PlaceableSide.TOP, campfire_2.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||
new Project("Tent1", this,getResource("Crafting/Tent1.yml"),PlaceableSide.TOP, tent_1.class).setSize(4, 3, 5, CenterType.RIGHT);
|
||||
new Project("Tent2", this,getResource("Crafting/Tent2.yml"),PlaceableSide.TOP, tent_2.class).setSize(4, 3, 5, CenterType.RIGHT);
|
||||
new Project("Tent3", this,getResource("Crafting/Tent3.yml"),PlaceableSide.TOP, tent_3.class).setSize(3, 2, 3, CenterType.CENTER);
|
||||
new Project("Fence", this, getResource("Crafting/fence.yml"),PlaceableSide.TOP, fance.class);
|
||||
new Project("Fence", this, getResource("Crafting/fence.yml"),PlaceableSide.TOP, fance.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Sunshade", this, getResource("Crafting/Sunshade.yml"),PlaceableSide.TOP, sunshade.class).setSize(1, 3, 1, CenterType.RIGHT);
|
||||
new Project("Streetlamp", this, getResource("Crafting/Streetlamp.yml"),PlaceableSide.TOP, streetlamp.class).setSize(2, 4, 1, CenterType.FRONT);
|
||||
new Project("Billboard", this, getResource("Crafting/Billboard.yml"),PlaceableSide.TOP, billboard.class).setSize(1, 3, 3, CenterType.RIGHT);
|
||||
new Project("Mailbox", this, getResource("Crafting/Mailbox.yml"),PlaceableSide.TOP, mailBox.class).setSize(1, 2, 1, CenterType.RIGHT);
|
||||
new Project("WeaponStand", this, getResource("Crafting/WeaponStand.yml"),PlaceableSide.TOP, weaponStand.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||
new Project("Hammock", this, getResource("Crafting/Hammock.yml"),PlaceableSide.TOP, hammock.class).setSize(1, 2, 7, CenterType.RIGHT);
|
||||
new Project("CampChair", this, getResource("Crafting/CampChair.yml"),PlaceableSide.TOP, campchair.class);
|
||||
new Project("CactusPlant", this, getResource("Crafting/CactusPlant.yml"),PlaceableSide.TOP, CactusPlant.class);
|
||||
new Project("CampChair", this, getResource("Crafting/CampChair.yml"),PlaceableSide.TOP, campchair.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("CactusPlant", this, getResource("Crafting/CactusPlant.yml"),PlaceableSide.TOP, CactusPlant.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Guillotine", this, getResource("Crafting/guillotine.yml"),PlaceableSide.TOP, guillotine.class).setSize(1, 5, 2, CenterType.RIGHT);
|
||||
new Project("Log", this, getResource("Crafting/log.yml"), PlaceableSide.TOP, log.class);
|
||||
new Project("FlowerPot", this, getResource("Crafting/FlowerPot.yml"),PlaceableSide.BOTTOM, TFlowerPot.class);
|
||||
new Project("WaterBottle", this, getResource("Crafting/WaterBottle.yml"), PlaceableSide.WATER, WaterBottle.class);
|
||||
new Project("Log", this, getResource("Crafting/log.yml"), PlaceableSide.TOP, log.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("FlowerPot", this, getResource("Crafting/FlowerPot.yml"),PlaceableSide.BOTTOM, TFlowerPot.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("WaterBottle", this, getResource("Crafting/WaterBottle.yml"), PlaceableSide.WATER, WaterBottle.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("SleepingBag", this, getResource("Crafting/SleepingBag.yml"), PlaceableSide.TOP, SleepingBag.class).setSize(1, 1, 2, CenterType.RIGHT);
|
||||
new Project("BearTrap", this, getResource("Crafting/BearTrap.yml"), PlaceableSide.TOP, BearTrap.class);
|
||||
new Project("BearTrap", this, getResource("Crafting/BearTrap.yml"), PlaceableSide.TOP, BearTrap.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("Trunk", this, getResource("Crafting/Trunk.yml"), PlaceableSide.TOP, Trunk.class).setSize(1, 1, 4, CenterType.RIGHT);
|
||||
new Project("SchoolTable", this, getResource("Crafting/SchoolTable.yml"), PlaceableSide.TOP, SchoolTable.class);
|
||||
new Project("SchoolChair", this, getResource("Crafting/SchoolChair.yml"), PlaceableSide.TOP, SchoolChair.class);
|
||||
new Project("SchoolTable", this, getResource("Crafting/SchoolTable.yml"), PlaceableSide.TOP, SchoolTable.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("SchoolChair", this, getResource("Crafting/SchoolChair.yml"), PlaceableSide.TOP, SchoolChair.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("BlackBoard", this, getResource("Crafting/BlackBoard.yml"), PlaceableSide.SIDE, BlackBoard.class).setSize(1, 2, 3, CenterType.RIGHT);
|
||||
new Project("TrashCan", this, getResource("Crafting/TrashCan.yml"), PlaceableSide.TOP, TrashCan.class);
|
||||
new Project("TrashCan", this, getResource("Crafting/TrashCan.yml"), PlaceableSide.TOP, TrashCan.class).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
new Project("HumanSkeleton", this, getResource("Crafting/HumanSkeleton.yml"), PlaceableSide.TOP, HumanSkeleton.class).setSize(3, 1, 2, CenterType.RIGHT);
|
||||
new Project("Crossbow", this, getResource("Crafting/Crossbow.yml"), PlaceableSide.TOP, Crossbow.class);
|
||||
new Project("Crossbow", this, getResource("Crafting/Crossbow.yml"), PlaceableSide.TOP, Crossbow.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||
new Project("Catapult", this, getResource("Crafting/Catapult.yml"), PlaceableSide.TOP, catapult.class).setSize(3, 2, 3, CenterType.RIGHT);
|
||||
new Project("Flag", this, getResource("Crafting/flag.yml"), PlaceableSide.TOP, flag.class);
|
||||
List<ObjectID> objList = new ArrayList<ObjectID>();
|
||||
for(ObjectID obj : manager.getObjectList()){
|
||||
if(obj==null) continue;
|
||||
if(objList.contains(obj)) continue;
|
||||
if(!objList.contains(obj)) objList.add(obj);
|
||||
if(obj.getPlugin()==null) continue;
|
||||
if(obj.getSQLAction().equals(SQLAction.REMOVE)) continue;
|
||||
if(obj.getPlugin().equalsIgnoreCase(this.getName())){
|
||||
switch (obj.getProject()) {
|
||||
case "Camera":new camera(this, obj);break;
|
||||
case "TV":new tv(this, obj);break;
|
||||
case "GraveStone":new graveStone(this, obj);break;
|
||||
case "Chair":new chair(this, obj);break;
|
||||
case "LargeTable":new largeTable(this, obj);break;
|
||||
case "Lantern":new lantern(this, obj);break;
|
||||
case "Sofa":new sofa(this, obj);break;
|
||||
case "Table":new table(this, obj);break;
|
||||
case "Barrels":new barrels(this, obj);break;
|
||||
case "Campfire1":new campfire_1(this, obj);break;
|
||||
case "Campfire2":new campfire_2(this, obj);break;
|
||||
case "Tent1":new tent_1(this, obj);break;
|
||||
case "Tent2":new tent_2(this, obj);break;
|
||||
case "Tent3":new tent_3(this, obj);break;
|
||||
case "Fence":new fance(this, obj);break;
|
||||
case "Sunshade":new sunshade(this, obj);break;
|
||||
case "Streetlamp":new streetlamp(this, obj);break;
|
||||
case "Billboard": new billboard(this, obj); break;
|
||||
case "WeaponStand": new weaponStand(this, obj);break;
|
||||
case "Hammock": new hammock(this, obj); break;
|
||||
case "CampChair": new campchair(this, obj); break;
|
||||
case "CactusPlant": new CactusPlant(this, obj); break;
|
||||
case "Guillotine": new guillotine(this, obj); break;
|
||||
case "FlowerPot": new TFlowerPot(this, obj);break;
|
||||
case "WaterBottle": new WaterBottle(this, obj); break;
|
||||
case "SleepingBag": new SleepingBag(this, obj); break;
|
||||
case "BearTrap": new BearTrap(this, obj); break;
|
||||
case "Trunk": new Trunk(this, obj); break;
|
||||
case "SchoolTable": new SchoolTable(this, obj); break;
|
||||
case "SchoolChair": new SchoolChair(this, obj); break;
|
||||
case "BlackBoard": new BlackBoard(this, obj); break;
|
||||
case "TrashCan": new TrashCan(this, obj); break;
|
||||
case "HumanSkeleton": new HumanSkeleton(this, obj);break;
|
||||
case "Crossbow": new Crossbow(this, obj);break;
|
||||
case "Catapult": new catapult(this, obj); break;
|
||||
case "Flag": new flag(this, obj); break;
|
||||
case "Log": new log(this, obj);
|
||||
case "Mailbox" :
|
||||
mailBox mail = new mailBox(lib, obj);
|
||||
/*try {
|
||||
mail.addMailbox(loadPlayerMailBox(obj));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
addDefault();
|
||||
new Project("Flag", this, getResource("Crafting/flag.yml"), PlaceableSide.TOP, flag.class).setSize(1, 3, 1, CenterType.RIGHT);
|
||||
new Project("SnowGolem", this, getResource("Crafting/SnowGolem.yml"), PlaceableSide.TOP, SnowGolem.class).setSize(1, 2, 1, CenterType.RIGHT);
|
||||
new Project("CandyCane", this, getResource("Crafting/CandyCane.yml"), PlaceableSide.TOP, CandyCane.class).setSize(3, 4, 1, CenterType.RIGHT);
|
||||
new Project("AdventWreath", this, getResource("Crafting/AdventWreath.yml"), PlaceableSide.TOP, AdventWreath.class);
|
||||
//new Project("ChristmasTree", this, getResource("Crafting/ChristmasTree.yml"), PlaceableSide.TOP, ChristmasTree.class);
|
||||
new Project("ChristmasStar", this, getResource("Crafting/ChristmasStar.yml"), PlaceableSide.TOP, ChristmasStar.class);
|
||||
addDefault("fence", "whiteList", "config.yml");
|
||||
addDefault("bearTrap", "damage", "damage.yml");
|
||||
setDefaults();
|
||||
setDefaults_2();
|
||||
lib.registerPluginFurnitures(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void addDefault(){
|
||||
private void addDefault(String a, String b, String d){
|
||||
c = new config();
|
||||
this.file = c.getConfig("whiteList", "plugin/fence/");
|
||||
this.file.addDefaults(YamlConfiguration.loadConfiguration(getResource("config.yml")));
|
||||
this.file = c.getConfig(b, "plugin/"+a+"/");
|
||||
this.file.addDefaults(YamlConfiguration.loadConfiguration(getResource(d)));
|
||||
this.file.options().copyDefaults(true);
|
||||
this.c.saveConfig("whiteList", this.file, "plugin/fence/");
|
||||
setDefaults();
|
||||
|
||||
c = new config();
|
||||
this.file = c.getConfig("damage", "plugin/bearTrap/");
|
||||
this.file.addDefaults(YamlConfiguration.loadConfiguration(getResource("damage.yml")));
|
||||
this.file.options().copyDefaults(true);
|
||||
this.c.saveConfig("damage", this.file, "plugin/bearTrap/");
|
||||
setDefaults_2();
|
||||
this.c.saveConfig(b, this.file, "plugin/"+a+"/");
|
||||
}
|
||||
|
||||
private void setDefaults_2(){
|
||||
@ -215,75 +151,6 @@ public class main extends JavaPlugin implements Listener{
|
||||
}
|
||||
}
|
||||
|
||||
public void onDisable(){
|
||||
|
||||
}
|
||||
|
||||
public Player loadPlayerMailBox(ObjectID objID){
|
||||
c = new config();
|
||||
file = c.getConfig("player", "plugin/mailbox/");
|
||||
ConfigurationSection section = file.getConfigurationSection("players");
|
||||
for(String s : section.getKeys(false)){
|
||||
for(String str : file.getStringList("players." + s)){
|
||||
if(str.equalsIgnoreCase(objID.getSerial())){
|
||||
return Bukkit.getPlayer(UUID.fromString(s));
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onClick(FurnitureItemEvent e){
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getProject().hasPermissions(e.getPlayer())){return;}
|
||||
if(!e.getProject().getPlugin().getName().equalsIgnoreCase(this.getName())){return;}
|
||||
ObjectID obj = e.getObjID();
|
||||
if(!e.canBuild()){return;}
|
||||
switch(e.getProject().getName()){
|
||||
case "Camera" : new camera(this, obj);break;
|
||||
case "TV" : new tv(this, obj);break;
|
||||
case "GraveStone" : new graveStone(this, obj);break;
|
||||
case "Chair" : new chair(this, obj); break;
|
||||
case "LargeTable" : new largeTable(this, obj);break;
|
||||
case "Lantern" : new lantern(this, obj);break;
|
||||
case "Sofa" : new sofa(this, obj);break;
|
||||
case "Table" : new table(this, obj);break;
|
||||
case "Barrels" : new barrels(this, obj);break;
|
||||
case "Campfire1" : new campfire_1(this, obj);break;
|
||||
case "Campfire2" : new campfire_2(this, obj);break;
|
||||
case "Tent1" : new tent_1(this, obj);break;
|
||||
case "Tent2" : new tent_2(this, obj);break;
|
||||
case "Tent3" : new tent_3(this, obj);break;
|
||||
case "Fence" : new fance(this, obj);break;
|
||||
case "Sunshade": new sunshade(this, obj);break;
|
||||
case "Streetlamp": new streetlamp(this, obj);break;
|
||||
case "Billboard": new billboard(this, obj);break;
|
||||
case "Mailbox" : new mailBox(this, obj); break;
|
||||
case "WeaponStand": new weaponStand(this, obj); break;
|
||||
case "Hammock": new hammock(this, obj); break;
|
||||
case "CampChair": new campchair(this, obj); break;
|
||||
case "CactusPlant": new CactusPlant(this, obj); break;
|
||||
case "Guillotine": new guillotine(this, obj); break;
|
||||
case "FlowerPot":new TFlowerPot(this, obj);break;
|
||||
case "Log": new log(this, obj); break;
|
||||
case "WaterBottle": new WaterBottle(this,obj);break;
|
||||
case "SleepingBag": new SleepingBag(this, obj); break;
|
||||
case "BearTrap": new BearTrap(this, obj); break;
|
||||
case "Trunk": new Trunk(this, obj); break;
|
||||
case "SchoolTable": new SchoolTable(this, obj); break;
|
||||
case "SchoolChair": new SchoolChair(this, obj); break;
|
||||
case "BlackBoard": new BlackBoard(this, obj); break;
|
||||
case "TrashCan": new TrashCan(this, obj); break;
|
||||
case "HumanSkeleton": new HumanSkeleton(this, obj);break;
|
||||
case "Crossbow": new Crossbow(this, obj);break;
|
||||
case "Catapult": new catapult(this, obj); break;
|
||||
case "Flag": new flag(this, obj); break;
|
||||
}
|
||||
e.finish();
|
||||
e.removeItem();
|
||||
}
|
||||
|
||||
public static LocationUtil getLocationUtil(){return util;}
|
||||
|
||||
public static Plugin getInstance() {
|
||||
|
@ -16,10 +16,10 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -31,11 +31,11 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class Crossbow extends Furniture implements Listener {
|
||||
|
||||
public Crossbow(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public Crossbow(ObjectID id){
|
||||
super(id);
|
||||
setBlock();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -9,9 +9,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -21,10 +21,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class HumanSkeleton extends Furniture implements Listener {
|
||||
|
||||
public HumanSkeleton(Plugin plugin, ObjectID id) {
|
||||
super(plugin, id);
|
||||
public HumanSkeleton(ObjectID id) {
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -1,6 +1,7 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.RPG;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -8,34 +9,43 @@ import org.bukkit.EntityEffect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class catapult extends Furniture implements Listener {
|
||||
|
||||
public catapult(Plugin plugin, ObjectID id) {
|
||||
super(plugin, id);
|
||||
public catapult(ObjectID id) {
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
|
||||
HashMap<Entity, Player> fallingSandList = new HashMap<Entity, Player>();
|
||||
|
||||
|
||||
@Override
|
||||
public void spawn(Location paramLocation) {
|
||||
List<fArmorStand> asList = new ArrayList<fArmorStand>();
|
||||
@ -143,6 +153,22 @@ public class catapult extends Furniture implements Listener {
|
||||
delete();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFallingSand(EntityChangeBlockEvent e){
|
||||
if(e.getEntity()==null) return;
|
||||
if(e.getEntity() instanceof FallingBlock){
|
||||
if(fallingSandList.containsKey(e.getEntity())){
|
||||
Entity entity = e.getEntity();
|
||||
Player p = fallingSandList.get(e.getEntity());
|
||||
fallingSandList.remove(e.getEntity());
|
||||
Block b = entity.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||
if(!FurnitureLib.getInstance().getPermManager().canBuild(p, b.getLocation())){
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
@ -181,8 +207,8 @@ public class catapult extends Furniture implements Listener {
|
||||
}
|
||||
block.playEffect(EntityEffect.WITCH_MAGIC);
|
||||
block.setDropItem(false);
|
||||
//block.setHurtEntities(true);
|
||||
block.setVelocity(v.multiply(1));
|
||||
fallingSandList.put(block, e.getPlayer());
|
||||
}
|
||||
|
||||
if(e.getPlayer().getGameMode().equals(GameMode.CREATIVE) && getLib().useGamemode()) return;
|
||||
|
@ -12,9 +12,9 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -27,12 +27,12 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class flag extends Furniture implements Listener {
|
||||
|
||||
public flag(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public flag(ObjectID id){
|
||||
super(id);
|
||||
setBlock();
|
||||
if(isFinish()){
|
||||
setState(3, getStand());
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -19,9 +19,9 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -56,10 +56,10 @@ public class guillotine extends Furniture implements Listener{
|
||||
Material.DIAMOND_BOOTS, Material.CHAINMAIL_BOOTS);
|
||||
List<fArmorStand> armorStandList = new ArrayList<fArmorStand>();
|
||||
ItemStack pane = new ItemStack(Material.STAINED_GLASS_PANE);
|
||||
public guillotine(Plugin plugin, ObjectID id) {
|
||||
super(plugin, id);
|
||||
public guillotine(ObjectID id) {
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
setDefault();
|
||||
initializeInventory();
|
||||
return;
|
||||
@ -82,27 +82,39 @@ public class guillotine extends Furniture implements Listener{
|
||||
invIII = Bukkit.createInventory(null, 54, s + "III");
|
||||
}
|
||||
|
||||
private void setDefault(){
|
||||
armorStandList.clear();
|
||||
private fArmorStand getByName(String s){
|
||||
for(fArmorStand packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(!packets.getName().equalsIgnoreCase("")){
|
||||
if(packets.getName().startsWith("#Oblation#")){
|
||||
packet2 = packets;
|
||||
}else if(packets.getName().equalsIgnoreCase("#Head#")){
|
||||
packet3 = packets;
|
||||
if(packet3.getHelmet()!=null&&packet3.getHelmet().getType().equals(Material.SKULL_ITEM)){
|
||||
packet2.getInventory().setHelmet(packet3.getHelmet());
|
||||
packet3.getInventory().setHelmet(new ItemStack(Material.AIR));
|
||||
}
|
||||
}else if(packets.getName().startsWith("iron")){
|
||||
armorStandList.add(packets);
|
||||
Location loc = getStartLocation(packets.getName());
|
||||
packets.teleport(loc);
|
||||
}else{
|
||||
packet1 = packets;
|
||||
return packets;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void setDefault(){
|
||||
armorStandList.clear();
|
||||
if(packet2==null){packet2 = getByName("#Oblation#");}
|
||||
if(packet3==null){packet3 = getByName("#Head#");}
|
||||
for(fArmorStand packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(!packets.getName().equalsIgnoreCase("")){
|
||||
if(!(packets.getName().startsWith("#Oblation#") && packets.getName().startsWith("#Head#"))){
|
||||
if(packets.getName().startsWith("iron")){
|
||||
armorStandList.add(packets);
|
||||
Location loc = getStartLocation(packets.getName());
|
||||
packets.teleport(loc);
|
||||
}else{
|
||||
packet1 = packets;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(packet3.getHelmet()!=null){
|
||||
packet2.setHelmet(packet3.getHelmet());
|
||||
packet3.setHelmet(new ItemStack(Material.AIR));
|
||||
}
|
||||
|
||||
soundPlaying = false;
|
||||
packet1.setPose(getLutil().degresstoRad(new EulerAngle(190,0,329)), BodyPart.RIGHT_ARM);
|
||||
|
@ -15,9 +15,9 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -38,10 +38,10 @@ public class weaponStand extends Furniture {
|
||||
Material.DARK_OAK_FENCE_GATE,
|
||||
Material.ACACIA_FENCE_GATE);
|
||||
|
||||
public weaponStand(Plugin plugin, ObjectID id) {
|
||||
super(plugin, id);
|
||||
public weaponStand(ObjectID id) {
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -22,10 +22,10 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class BlackBoard extends Furniture implements Listener {
|
||||
public BlackBoard(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public BlackBoard(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -9,9 +9,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -21,10 +21,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class SchoolChair extends Furniture implements Listener {
|
||||
|
||||
public SchoolChair(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public SchoolChair(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -24,10 +24,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class SchoolTable extends Furniture implements Listener {
|
||||
|
||||
public SchoolTable(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public SchoolTable(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -9,9 +9,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -21,10 +21,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class TrashCan extends Furniture implements Listener {
|
||||
|
||||
public TrashCan(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public TrashCan(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
218
src/de/Ste3et_C0st/Furniture/Objects/christmas/AdventWreath.java
Normal file
218
src/de/Ste3et_C0st/Furniture/Objects/christmas/AdventWreath.java
Normal file
@ -0,0 +1,218 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class AdventWreath extends Furniture implements Listener {
|
||||
double sub = .9;
|
||||
|
||||
List<Location> locationList = Arrays.asList(
|
||||
getRelative(getCenter(), getLutil().yawToFace(0), 0, .7),
|
||||
getRelative(getCenter(), getLutil().yawToFace(90), .7, 0),
|
||||
getRelative(getCenter(), getLutil().yawToFace(180), 0, -.7),
|
||||
getRelative(getCenter(), getLutil().yawToFace(270),-.7, 0)
|
||||
);
|
||||
|
||||
public AdventWreath(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
load();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove(true,false);
|
||||
delete();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
fArmorStand stand = e.getfArmorStand();
|
||||
String str = stand.getName();
|
||||
if(str.startsWith("Fire") || str.startsWith("Torch")){
|
||||
int i = Integer.parseInt(str.split(":")[1]);
|
||||
for(fArmorStand fstand : getfAsList()){
|
||||
if(fstand.getName().equalsIgnoreCase("Fire:" + i)){
|
||||
if(!fstand.getName().endsWith("#Burn")){
|
||||
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
||||
fstand.setName("Fire:" + i + "#Burn");
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void load(){
|
||||
for(fArmorStand fstand : getfAsList()){
|
||||
if(fstand.getName().startsWith("Fire:")){
|
||||
if(fstand.getName().endsWith("#Burn")){
|
||||
if(!fstand.isParticlePlayed()){
|
||||
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Location location) {
|
||||
List<fArmorStand> asList = new ArrayList<fArmorStand>();
|
||||
|
||||
int j = 15;
|
||||
double l = 0;
|
||||
double o = getDegress(j);
|
||||
for(int i = 0; i<=j;i++){
|
||||
Location loc = getCenter();
|
||||
loc.setYaw((float) l);
|
||||
fArmorStand stand = spawnArmorStand(loc.subtract(0, 1.2+sub, 0));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(210, 190, 305)));
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(60, 0, 0)));
|
||||
stand.setHelmet(new ItemStack(Material.GOLD_BLOCK));
|
||||
stand.setItemInHand(new ItemStack(Material.LEAVES));
|
||||
asList.add(stand);
|
||||
l+=o;
|
||||
|
||||
}
|
||||
|
||||
l = 0;
|
||||
for(int i = 0; i<=j;i++){
|
||||
Location loc = getCenter();
|
||||
loc.setYaw((float) l);
|
||||
fArmorStand stand = spawnArmorStand(loc.subtract(0, .3+sub, 0));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(210, 190, 305)));
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(60, 0, 0)));
|
||||
stand.setHelmet(new ItemStack(Material.LEAVES));
|
||||
stand.setItemInHand(new ItemStack(Material.LEAVES));
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
l+=o;
|
||||
}
|
||||
|
||||
double d = .7;
|
||||
float y = 0;
|
||||
List<Location> locL = Arrays.asList(
|
||||
getRelative(getCenter(), getLutil().yawToFace(0), 0, d),
|
||||
getRelative(getCenter(), getLutil().yawToFace(90), d, 0),
|
||||
getRelative(getCenter(), getLutil().yawToFace(180), 0, -d),
|
||||
getRelative(getCenter(), getLutil().yawToFace(270),-d, 0)
|
||||
);
|
||||
|
||||
for(int i = 0; i<=3;i++){
|
||||
Location loc = locL.get(i);
|
||||
loc.subtract(0, .1+sub, 0);
|
||||
loc.setYaw(y);
|
||||
fArmorStand stand = spawnArmorStand(loc);
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-41,-37.5f,18)));
|
||||
stand.setSmall(true);
|
||||
stand.setName("Torch:" + i);
|
||||
stand.setHelmet(new ItemStack(Material.STAINED_CLAY, 1, (short) 14));
|
||||
asList.add(stand);
|
||||
|
||||
stand = spawnArmorStand(loc.clone().subtract(0, .4, 0));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-41,-37.5f,18)));
|
||||
stand.setSmall(true);
|
||||
stand.setName("Torch:" + i);
|
||||
stand.setHelmet(new ItemStack(Material.STAINED_CLAY, 1, (short) 13));
|
||||
asList.add(stand);
|
||||
|
||||
stand = spawnArmorStand(loc.clone().add(0, .4, 0));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(-41,-37.5f,18)));
|
||||
stand.setSmall(true);
|
||||
stand.setName("Torch:" + i);
|
||||
stand.setHelmet(new ItemStack(Material.LEVER, 1, (short) 13));
|
||||
asList.add(stand);
|
||||
y=y+90;
|
||||
}
|
||||
|
||||
ItemStack is = new ItemStack(Material.RED_ROSE, 1, (short) 8);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), .5, .5), is);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), -.5, -.5), is);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), -.5, .5), is);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), .5, -.5), is);
|
||||
|
||||
is = new ItemStack(Material.RED_ROSE, 1, (short) 4);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), .25, .25), is);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), -.25, -.25), is);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), -.25, .25), is);
|
||||
spawnFlower(getRelative(getCenter().subtract(0, .7, 0), getLutil().yawToFace(0), .25, -.25), is);
|
||||
|
||||
y=0;
|
||||
for(int i = 0; i<=3;i++){
|
||||
Location loc = locationList.get(i);
|
||||
loc.add(0, .3-sub, 0);
|
||||
loc.setYaw(y);
|
||||
fArmorStand stand = spawnArmorStand(loc.add(0, -1.5, 0));
|
||||
stand.setSmall(true);
|
||||
stand.setName("Fire:" + i);
|
||||
stand.setFire(false);
|
||||
asList.add(stand);
|
||||
|
||||
stand = spawnArmorStand(loc.add(0, 1.6, 0));
|
||||
stand.setName("Torch:" + i);
|
||||
stand.setNameVasibility(false);
|
||||
asList.add(stand);
|
||||
y=y+90;
|
||||
}
|
||||
|
||||
for(fArmorStand pack : asList){
|
||||
pack.setInvisible(true);
|
||||
pack.setGravity(false);
|
||||
pack.setBasePlate(false);
|
||||
}
|
||||
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
|
||||
private void spawnFlower(Location loc, ItemStack stack){
|
||||
int j = 8;
|
||||
double l = 0;
|
||||
double o = getDegress(j);
|
||||
loc = loc.add(0, -sub, 0);
|
||||
for(int i = 0; i<j;i++){
|
||||
loc.setYaw((float) l);
|
||||
fArmorStand stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(stack);
|
||||
stand.setInvisible(true);
|
||||
stand.setGravity(false);
|
||||
stand.setBasePlate(false);
|
||||
l+=o;
|
||||
}
|
||||
}
|
||||
|
||||
private int getDegress(int j){
|
||||
return 360/j;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class CandyCane extends Furniture implements Listener {
|
||||
|
||||
public CandyCane(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove();
|
||||
delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFurnitureClick(FurnitureClickEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Location arg0) {
|
||||
List<fArmorStand> asList = new ArrayList<fArmorStand>();
|
||||
|
||||
ItemStack is = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
|
||||
SkullMeta im = (SkullMeta) is.getItemMeta();
|
||||
im.setOwner("CookieMaker2000");
|
||||
is.setItemMeta(im);
|
||||
|
||||
double d = .0;
|
||||
double c = .0;
|
||||
for(int i = 1; i<7;i++){
|
||||
d = -2.6+ .59*i;
|
||||
Location loc = getCenter().clone().add(0,d, 0);
|
||||
fArmorStand stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(is);
|
||||
asList.add(stand);
|
||||
}
|
||||
d = d + 3.5;
|
||||
for(int i = 1; i<4;i++){
|
||||
c = -.32+.59*i;
|
||||
Location loc = getRelative(getCenter(), c, 0).add(0,-2.9+d, 0);
|
||||
fArmorStand stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(is);
|
||||
asList.add(stand);
|
||||
}
|
||||
|
||||
Location loc = getRelative(getCenter(), c+.3, 0).add(0,-3.5+d, 0);
|
||||
fArmorStand stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(is);
|
||||
asList.add(stand);
|
||||
|
||||
for(fArmorStand pack : asList){
|
||||
pack.setInvisible(true);
|
||||
pack.setGravity(false);
|
||||
pack.setBasePlate(false);
|
||||
}
|
||||
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class ChristmasStar extends Furniture implements Listener {
|
||||
|
||||
public ChristmasStar(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFurnitureBreak(FurnitureBreakEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFurnitureClick(FurnitureClickEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Location loc) {
|
||||
List<fArmorStand> asList = new ArrayList<fArmorStand>();
|
||||
|
||||
Location location = getRelative(getCenter().add(0, -1.0, 0), getBlockFace(), .25,0);
|
||||
fArmorStand stand = spawnArmorStand(location);
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90f,180f,90f)));
|
||||
stand.setHelmet(new ItemStack(Material.GOLD_BLOCK));
|
||||
asList.add(stand);
|
||||
|
||||
stand = spawnArmorStand(location);
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90f,180f,45f)));
|
||||
stand.setHelmet(new ItemStack(Material.GOLD_BLOCK));
|
||||
asList.add(stand);
|
||||
|
||||
for(fArmorStand pack : asList){
|
||||
pack.setInvisible(true);
|
||||
pack.setGravity(false);
|
||||
pack.setBasePlate(false);
|
||||
}
|
||||
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class ChristmasTree extends Furniture implements Listener{
|
||||
|
||||
public ChristmasTree(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFurnitureBreak(FurnitureBreakEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFurnitureClick(FurnitureClickEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Location arg0) {
|
||||
List<fArmorStand> asList = new ArrayList<fArmorStand>();
|
||||
|
||||
fArmorStand stand = spawnArmorStand(getCenter());
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90f,180f,90f)));
|
||||
stand.setHelmet(new ItemStack(Material.GOLD_BLOCK));
|
||||
asList.add(stand);
|
||||
|
||||
for(fArmorStand pack : asList){
|
||||
pack.setInvisible(true);
|
||||
pack.setGravity(false);
|
||||
pack.setBasePlate(false);
|
||||
}
|
||||
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
}
|
145
src/de/Ste3et_C0st/Furniture/Objects/christmas/SnowGolem.java
Normal file
145
src/de/Ste3et_C0st/Furniture/Objects/christmas/SnowGolem.java
Normal file
@ -0,0 +1,145 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class SnowGolem extends Furniture implements Listener{
|
||||
|
||||
public SnowGolem(ObjectID id){
|
||||
super(id);
|
||||
setBlock();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
private void setBlock(){
|
||||
Block b = getCenter().getBlock();
|
||||
b.setType(Material.SNOW_BLOCK);
|
||||
getObjID().addBlock(Arrays.asList(b));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove();
|
||||
delete();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBlockBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove();
|
||||
delete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFurnitureClick(FurnitureClickEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Location arg0) {
|
||||
List<fArmorStand> asList = new ArrayList<fArmorStand>();
|
||||
fArmorStand stand = spawnArmorStand(getCenter().add(0, -.87, 0));
|
||||
stand.setHelmet(new ItemStack(Material.SNOW_BLOCK));
|
||||
asList.add(stand);
|
||||
|
||||
stand = spawnArmorStand(getCenter().add(0, .38, 0));
|
||||
stand.setHelmet(new ItemStack(Material.COAL_BLOCK));
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
Location loc = getRelative(getCenter().add(0, -.25, 0), -.18, -.54);
|
||||
loc.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.CARROT_ITEM));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90, 0, -40)));
|
||||
stand.setMarker(false);
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter().add(0, .2, 0), .05, -.15);
|
||||
loc.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter().add(0, .2, 0), .05, -.45);
|
||||
loc.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter().add(0, -.55, 0), -.15, -.28);
|
||||
loc.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter().add(0, -.95, 0), -.15, -.28);
|
||||
loc.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.COAL_BLOCK));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(70f, 0f, 45f)));
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter().add(0, -.45, 0), .0, 1.22);
|
||||
loc.setYaw(getYaw());
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.STICK));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90f,90f,70f)));
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter().add(0, -.45, 0), -.1, -1.22);
|
||||
loc.setYaw(getYaw()+180);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setItemInHand(new ItemStack(Material.STICK));
|
||||
stand.setRightArmPose(getLutil().degresstoRad(new EulerAngle(90f,90f,70f)));
|
||||
asList.add(stand);
|
||||
|
||||
for(fArmorStand pack : asList){
|
||||
pack.setInvisible(true);
|
||||
pack.setGravity(false);
|
||||
pack.setBasePlate(false);
|
||||
}
|
||||
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
|
||||
}
|
@ -10,9 +10,9 @@ import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -22,10 +22,10 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class billboard extends Furniture implements Listener{
|
||||
public billboard(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public billboard(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -14,10 +14,10 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.map.MapRenderer;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Camera.Utils.RenderClass;
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -27,10 +27,10 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class camera extends Furniture implements Listener{
|
||||
public camera(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public camera(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -12,10 +12,10 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockRedstoneEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -33,14 +33,14 @@ public class streetlamp extends Furniture implements Listener{
|
||||
Vector loc2, loc3;
|
||||
boolean redstone = false;
|
||||
|
||||
public streetlamp(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public streetlamp(ObjectID id){
|
||||
super(id);
|
||||
setBlock();
|
||||
this.loc2 = id.getStartLocation().toVector();
|
||||
this.loc3 = id.getStartLocation().getBlock().getRelative(BlockFace.DOWN).getLocation().toVector();
|
||||
this.light = getLutil().getRelativ(getLocation(), getBlockFace(), -1D, 0D);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -10,9 +10,9 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -22,10 +22,10 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class tv extends Furniture implements Listener{
|
||||
public tv(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public tv(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -9,9 +9,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -21,10 +21,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class SleepingBag extends Furniture implements Listener {
|
||||
|
||||
public SleepingBag(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public SleepingBag(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -9,17 +9,13 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.FlowerPot;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -30,12 +26,11 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
public class TFlowerPot extends Furniture implements Listener {
|
||||
|
||||
Block pot;
|
||||
FlowerPot potMeta;
|
||||
public TFlowerPot(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public TFlowerPot(ObjectID id){
|
||||
super(id);
|
||||
setPotState();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
@ -44,7 +39,6 @@ public class TFlowerPot extends Furniture implements Listener {
|
||||
private void setPotState(){
|
||||
pot=getLocation().getBlock();
|
||||
if(pot.getType()==null||!pot.getType().equals(Material.FLOWER_POT)){pot.setType(Material.FLOWER_POT);}
|
||||
potMeta = (FlowerPot) pot.getState().getData();
|
||||
getObjID().addBlock(Arrays.asList(pot));
|
||||
}
|
||||
|
||||
@ -91,13 +85,9 @@ public class TFlowerPot extends Furniture implements Listener {
|
||||
if(!e.getBlock().equals(pot)){return;}
|
||||
e.setCancelled(true);
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
if(potMeta!=null&&potMeta.getContents()!=null){
|
||||
getWorld().dropItem(getLocation(), potMeta.getContents().toItemStack());
|
||||
}
|
||||
destroy(e.getPlayer());
|
||||
pot.setType(Material.AIR);
|
||||
pot=null;
|
||||
potMeta=null;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -110,33 +100,4 @@ public class TFlowerPot extends Furniture implements Listener {
|
||||
if (!e.getBlock().equals(pot)) return;
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
||||
private void resendFlowerPot(){
|
||||
pot.getState().setData(new MaterialData(Material.AIR));
|
||||
pot.getState().update();
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
pot.getState().setData(potMeta);
|
||||
pot.getState().update();
|
||||
}
|
||||
}, 5);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.HIGHEST)
|
||||
private void onRightClick(FurnitureBlockClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.getBlock()==null||pot==null){return;}
|
||||
if(!e.getBlock().equals(pot)){return;}
|
||||
if(!canInteract(e.getPlayer())){
|
||||
e.setCancelled(true);
|
||||
resendFlowerPot();
|
||||
return;
|
||||
}else{
|
||||
potMeta = (FlowerPot) pot.getState().getData();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -23,10 +23,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class Trunk extends Furniture implements Listener {
|
||||
|
||||
public Trunk(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public Trunk(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -11,9 +11,9 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -33,10 +33,10 @@ public class WaterBottle extends Furniture implements Listener {
|
||||
Material.RED_MUSHROOM,
|
||||
Material.DEAD_BUSH);
|
||||
|
||||
public WaterBottle(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public WaterBottle(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(getLocation());
|
||||
|
@ -9,7 +9,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -21,10 +20,10 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class campchair extends Furniture implements Listener {
|
||||
public campchair(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public campchair(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -12,8 +12,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
@ -38,11 +36,11 @@ public class fance extends Furniture implements Listener{
|
||||
Block block;
|
||||
Material m;
|
||||
|
||||
public fance(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public fance(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
setBlock();
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -13,13 +13,14 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -29,11 +30,11 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class graveStone extends Furniture implements Listener{
|
||||
public graveStone(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public graveStone(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
setBlock();
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
@ -122,11 +123,12 @@ public class graveStone extends Furniture implements Listener{
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()) return;
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().getPlugin().equalsIgnoreCase(main.getInstance().getName())){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.remove();
|
||||
@ -150,8 +152,9 @@ public class graveStone extends Furniture implements Listener{
|
||||
public void onFurnitureClick(FurnitureClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(!e.getID().getPlugin().equalsIgnoreCase(getPlugin().getName())){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
Player p = e.getPlayer();
|
||||
if(e.isCancelled()) return;
|
||||
if(!e.getID().equals(getObjID())) return;
|
||||
if(!e.canBuild()){return;}
|
||||
ItemStack is = p.getItemInHand();
|
||||
|
@ -16,9 +16,9 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -40,8 +40,8 @@ public class log extends Furniture {
|
||||
List<ItemStack> isList = new ArrayList<ItemStack>();
|
||||
Player p;
|
||||
|
||||
public log(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public log(ObjectID id){
|
||||
super(id);
|
||||
b = getLocation().getBlock();
|
||||
getObjID().addBlock(Arrays.asList(b));
|
||||
ItemMeta meta = pane.getItemMeta();
|
||||
@ -51,7 +51,7 @@ public class log extends Furniture {
|
||||
pane.setItemMeta(meta);
|
||||
setList();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -14,9 +14,9 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -30,10 +30,11 @@ public class mailBox extends Furniture implements Listener {
|
||||
List<Block> blockList = new ArrayList<Block>();
|
||||
UUID uuid;
|
||||
|
||||
public mailBox(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public mailBox(ObjectID id){
|
||||
super(id);
|
||||
setBlock();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -17,9 +17,9 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -45,11 +45,11 @@ public class sunshade extends Furniture implements Listener{
|
||||
Integer timer;
|
||||
Block block;
|
||||
|
||||
public sunshade(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public sunshade(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
setblock();
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
setblock();
|
||||
|
@ -10,9 +10,9 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -23,10 +23,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class chair extends Furniture implements Listener{
|
||||
|
||||
public chair(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public chair(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -13,8 +13,8 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -24,11 +24,11 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class lantern extends Furniture implements Listener{
|
||||
|
||||
public lantern(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public lantern(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
setBlock();
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -13,9 +13,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -27,8 +27,8 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class largeTable extends Furniture implements Listener{
|
||||
|
||||
public largeTable(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public largeTable(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().startsWith("#TELLER")){
|
||||
@ -36,7 +36,7 @@ public class largeTable extends Furniture implements Listener{
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
@ -204,6 +204,7 @@ public class largeTable extends Furniture implements Listener{
|
||||
Player p = e.getPlayer();
|
||||
if(p.getItemInHand().getType().equals(Material.INK_SACK)){
|
||||
getLib().getColorManager().color(p, e.canBuild(), Material.STAINED_GLASS_PANE, getObjID(), ColorType.BLOCK, 3);
|
||||
update();
|
||||
return;
|
||||
}else{
|
||||
setTeller(p, p.getInventory().getItemInHand());
|
||||
|
@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -26,10 +26,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class sofa extends Furniture implements Listener {
|
||||
|
||||
public sofa(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public sofa(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
place = .3;
|
||||
|
@ -11,9 +11,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -24,10 +24,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class table extends Furniture implements Listener {
|
||||
|
||||
public table(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public table(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -9,9 +9,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -22,10 +22,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class CactusPlant extends Furniture implements Listener {
|
||||
|
||||
public CactusPlant(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public CactusPlant(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -11,8 +11,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -25,13 +25,13 @@ public class barrels extends Furniture implements Listener {
|
||||
Integer id;
|
||||
Block block;
|
||||
|
||||
public barrels(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public barrels(ObjectID id){
|
||||
super(id);
|
||||
if(id.isFinish()){
|
||||
this.block = getLocation().getBlock();
|
||||
this.block.setType(Material.CAULDRON);
|
||||
getObjID().addBlock(Arrays.asList(block));
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -8,8 +8,8 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -19,10 +19,10 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class campfire_1 extends Furniture implements Listener{
|
||||
|
||||
public campfire_1(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public campfire_1(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -11,7 +11,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
@ -61,8 +60,8 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
fArmorStand armorS;
|
||||
ItemStack is;
|
||||
|
||||
public campfire_2(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public campfire_2(ObjectID id){
|
||||
super(id);
|
||||
middle = getLutil().getCenter(getLocation());
|
||||
middle = getLutil().getRelativ(middle, getBlockFace(), .5D, -.5D);
|
||||
middle.add(0,-1.2,0);
|
||||
@ -70,7 +69,7 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
grill = getLutil().getRelativ(middle,getBlockFace(), .0D, .5D);
|
||||
grill.setYaw(getLutil().FaceToYaw(getBlockFace())+90);
|
||||
if(id.isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -14,9 +14,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBlockClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -31,11 +31,11 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class hammock extends Furniture implements Listener{
|
||||
|
||||
public hammock(Plugin plugin, ObjectID id) {
|
||||
super(plugin, id);
|
||||
public hammock(ObjectID id) {
|
||||
super(id);
|
||||
setBlock();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -14,9 +14,9 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -30,15 +30,15 @@ import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
public class tent_1 extends Furniture implements Listener{
|
||||
|
||||
Block block;
|
||||
public tent_1(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public tent_1(ObjectID id){
|
||||
super(id);
|
||||
Location loc = id.getStartLocation();
|
||||
if(getBlockFace().equals(BlockFace.WEST)){loc=getLutil().getRelativ(loc, getBlockFace(), 1D, 0D);}
|
||||
if(getBlockFace().equals(BlockFace.NORTH)){loc=getLutil().getRelativ(loc, getBlockFace(), 1D, 1D);}
|
||||
if(getBlockFace().equals(BlockFace.EAST)){loc=getLutil().getRelativ(loc, getBlockFace(), 0D, 1D);}
|
||||
if(id.isFinish()){
|
||||
setblock();
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(loc);
|
||||
|
@ -15,9 +15,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -32,8 +32,8 @@ public class tent_2 extends Furniture implements Listener{
|
||||
List<Block> block = new ArrayList<Block>();
|
||||
Location bedLoc;
|
||||
|
||||
public tent_2(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public tent_2(ObjectID id){
|
||||
super(id);
|
||||
Location loc = getLocation();
|
||||
if(getBlockFace().equals(BlockFace.WEST)){loc=getLutil().getRelativ(loc, getBlockFace(), 1D, 0D);}
|
||||
if(getBlockFace().equals(BlockFace.NORTH)){loc=getLutil().getRelativ(loc, getBlockFace(), 1D, 1D);}
|
||||
@ -51,7 +51,7 @@ public class tent_2 extends Furniture implements Listener{
|
||||
setBlock(loca);
|
||||
|
||||
if(id.isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(loc);
|
||||
|
@ -17,9 +17,9 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
@ -30,11 +30,11 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
|
||||
public class tent_3 extends Furniture implements Listener{
|
||||
public tent_3(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public tent_3(ObjectID id){
|
||||
super(id);
|
||||
setBlock();
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
Location loc = getLocation();
|
||||
|
@ -12,7 +12,6 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
@ -28,8 +27,8 @@ public class BearTrap extends Furniture implements Listener{
|
||||
fArmorStand stand1, stand2;
|
||||
boolean b;
|
||||
|
||||
public BearTrap(Plugin plugin, ObjectID id){
|
||||
super(plugin, id);
|
||||
public BearTrap(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#IRON1#")){
|
||||
@ -39,7 +38,7 @@ public class BearTrap extends Furniture implements Listener{
|
||||
}
|
||||
}
|
||||
setStatus(false);
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: DiceFurniture
|
||||
version: 2.4.1
|
||||
version: 2.4.6
|
||||
description: Add some new Objects to the Server
|
||||
author: Ste3et_C0st
|
||||
website: http://dicecraft.de
|
||||
|
Loading…
Reference in New Issue
Block a user