mirror of
https://github.com/Ste3et/furniture.git
synced 2024-06-25 22:24:56 +02:00
New Stuff
This commit is contained in:
parent
f3e1bd1299
commit
3bc20da4bf
12
src/Crafting/AdventCalender.yml
Normal file
12
src/Crafting/AdventCalender.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
AdventCalender:
|
||||
name: '&cAdventCalender'
|
||||
material: 383
|
||||
glow: true
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: false
|
||||
recipe: XXX,XEX,AXA
|
||||
index:
|
||||
E: 126
|
||||
X: 0
|
||||
A: 65
|
|
@ -7,7 +7,6 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
|
@ -21,9 +20,9 @@ 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.AdventCalender;
|
||||
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;
|
||||
|
@ -40,8 +39,8 @@ import de.Ste3et_C0st.Furniture.Objects.garden.log;
|
|||
import de.Ste3et_C0st.Furniture.Objects.garden.mailBox;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.sunshade;
|
||||
import de.Ste3et_C0st.Furniture.Objects.indoor.chair;
|
||||
import de.Ste3et_C0st.Furniture.Objects.indoor.largeTable;
|
||||
import de.Ste3et_C0st.Furniture.Objects.indoor.lantern;
|
||||
import de.Ste3et_C0st.Furniture.Objects.indoor.largeTable;
|
||||
import de.Ste3et_C0st.Furniture.Objects.indoor.sofa;
|
||||
import de.Ste3et_C0st.Furniture.Objects.indoor.table;
|
||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.CactusPlant;
|
||||
|
@ -59,7 +58,7 @@ import de.Ste3et_C0st.FurnitureLib.main.FurnitureLib;
|
|||
import de.Ste3et_C0st.FurnitureLib.main.Type.CenterType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.PlaceableSide;
|
||||
|
||||
public class main extends JavaPlugin implements Listener{
|
||||
public class main extends JavaPlugin{
|
||||
|
||||
FurnitureLib lib;
|
||||
config c;
|
||||
|
@ -73,50 +72,50 @@ public class main extends JavaPlugin implements Listener{
|
|||
instance = this;
|
||||
lib = (FurnitureLib) Bukkit.getPluginManager().getPlugin("FurnitureLib");
|
||||
util = lib.getLocationUtil();
|
||||
Bukkit.getPluginManager().registerEvents(this, this);
|
||||
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).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
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).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
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).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("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).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
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).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("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).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("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).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
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).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("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).setSize(1, 1, 1, CenterType.RIGHT);;
|
||||
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).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).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("AdventWreath", this, getResource("Crafting/AdventWreath.yml"), PlaceableSide.TOP, AdventWreath.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||
new Project("AdventCalender", this, getResource("Crafting/AdventCalender.yml"), PlaceableSide.TOP, AdventCalender.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||
//new Project("ChristmasTree", this, getResource("Crafting/ChristmasTree.yml"), PlaceableSide.TOP, ChristmasTree.class);
|
||||
new Project("ChristmasStar", this, getResource("Crafting/ChristmasStar.yml"), PlaceableSide.TOP, ChristmasStar.class);
|
||||
//new Project("ChristmasStar", this, getResource("Crafting/ChristmasStar.yml"), PlaceableSide.TOP, ChristmasStar.class);
|
||||
addDefault("fence", "whiteList", "config.yml");
|
||||
addDefault("bearTrap", "damage", "damage.yml");
|
||||
setDefaults();
|
||||
|
|
|
@ -147,6 +147,7 @@ public class catapult extends Furniture implements Listener {
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()) return;
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())) return;
|
||||
if(!e.canBuild()){return;}
|
||||
e.remove();
|
||||
|
|
|
@ -0,0 +1,507 @@
|
|||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.SkullType;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Firework;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.FireworkMeta;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.io.BukkitObjectInputStream;
|
||||
import org.bukkit.util.io.BukkitObjectOutputStream;
|
||||
import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.config;
|
||||
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 AdventCalender extends Furniture implements Listener {
|
||||
double sub = .9;
|
||||
|
||||
HashMap<Integer, ItemStack[]> isList = new HashMap<Integer, ItemStack[]>();
|
||||
HashMap<UUID, Integer> uuidList = new HashMap<UUID, Integer>();
|
||||
Player p;
|
||||
int i;
|
||||
int currentDay = 0;
|
||||
Inventory inv;
|
||||
|
||||
String ac_1 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzFiYzJiY2ZiMmJkMzc1OWU2YjFlODZmYzdhNzk1ODVlMTEyN2RkMzU3ZmMyMDI4OTNmOWRlMjQxYmM5ZTUzMCJ9fX0=";
|
||||
String ac_2 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNkOWVlZWU4ODM0Njg4ODFkODM4NDhhNDZiZjMwMTI0ODVjMjNmNzU3NTNiOGZiZTg0ODczNDE0MTk4NDcifX19";
|
||||
String ac_3 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWQ0ZWFlMTM5MzM4NjBhNmRmNWU4ZTk1NTY5M2I5NWE4YzNiMTVjMzZiOGI1ODc1MzJhYzA5OTZiYzM3ZTUifX19";
|
||||
String ac_4 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDJlNzhmYjIyNDI0MjMyZGMyN2I4MWZiY2I0N2ZkMjRjMWFjZjc2MDk4NzUzZjJkOWMyODU5ODI4N2RiNSJ9fX0=";
|
||||
String ac_5 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmQ1N2UzYmM4OGE2NTczMGUzMWExNGUzZjQxZTAzOGE1ZWNmMDg5MWE2YzI0MzY0M2I4ZTU0NzZhZTIifX19";
|
||||
String ac_6 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzM0YjM2ZGU3ZDY3OWI4YmJjNzI1NDk5YWRhZWYyNGRjNTE4ZjVhZTIzZTcxNjk4MWUxZGNjNmIyNzIwYWIifX19";
|
||||
String ac_7 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmRiNmViMjVkMWZhYWJlMzBjZjQ0NGRjNjMzYjU4MzI0NzVlMzgwOTZiN2UyNDAyYTNlYzQ3NmRkN2I5In19fQ==";
|
||||
String ac_8 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTkxOTQ5NzNhM2YxN2JkYTk5NzhlZDYyNzMzODM5OTcyMjI3NzRiNDU0Mzg2YzgzMTljMDRmMWY0Zjc0YzJiNSJ9fX0=";
|
||||
String ac_9 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTY3Y2FmNzU5MWIzOGUxMjVhODAxN2Q1OGNmYzY0MzNiZmFmODRjZDQ5OWQ3OTRmNDFkMTBiZmYyZTViODQwIn19fQ==";
|
||||
String ac_0 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMGViZTdlNTIxNTE2OWE2OTlhY2M2Y2VmYTdiNzNmZGIxMDhkYjg3YmI2ZGFlMjg0OWZiZTI0NzE0YjI3In19fQ==";
|
||||
String ac_NULL = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTBlOWQyYmViODRiMzJlM2YxNWUzODBjYzJjNTUxMDY0MjkxMWE1MTIxMDVmYTJlYzY3OWJjNTQwZmQ4MTg0In19fQ==";
|
||||
|
||||
public AdventCalender(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
load();
|
||||
check();
|
||||
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() == null || getObjID() == null) 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(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
if(p!=null){return;}
|
||||
ItemStack is = e.getPlayer().getItemInHand();
|
||||
if(is==null) return;
|
||||
if(is.getType()==null) return;
|
||||
if(is.getType().equals(Material.ARROW)){
|
||||
i = is.getAmount();
|
||||
if(i>31 || i<1) return;
|
||||
this.p = e.getPlayer();
|
||||
if(isList.containsKey(i)){
|
||||
openInventory(isList.get(i));
|
||||
}else{
|
||||
openInventory(null);
|
||||
}
|
||||
}else{
|
||||
if(isList.containsKey(getDay())){
|
||||
if(uuidList.containsKey(e.getPlayer().getUniqueId())){
|
||||
if(uuidList.get(e.getPlayer().getUniqueId()) == getDay()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
ItemStack[] stack = isList.get(getDay());
|
||||
for(ItemStack iS : stack){
|
||||
if(iS!=null&&iS.getType()!=null){
|
||||
if(!iS.getType().equals(Material.FIREWORK)){
|
||||
if(iS.hasItemMeta()&&iS.getItemMeta().hasDisplayName()){
|
||||
if(is.getItemMeta().getDisplayName().startsWith("@CONSOLE ")){
|
||||
if(!isOP()) continue;
|
||||
String s = is.getItemMeta().getDisplayName();
|
||||
s = s.replace("@CONSOLE ", "");
|
||||
s = s.replace("%player%", e.getPlayer().getName());
|
||||
ConsoleCommandSender sender = Bukkit.getConsoleSender();
|
||||
Bukkit.dispatchCommand(sender, s);
|
||||
continue;
|
||||
}else if(is.getItemMeta().getDisplayName().startsWith("@PLAYER ")){
|
||||
if(!isOP()) continue;
|
||||
String s = is.getItemMeta().getDisplayName();
|
||||
s = s.replace("@PLAYER ", "");
|
||||
s = s.replace("%player%", e.getPlayer().getName());
|
||||
e.getPlayer().chat(s);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
e.getPlayer().getInventory().addItem(iS);
|
||||
}else{
|
||||
Firework fw = (Firework) getWorld().spawnEntity(getCenter(), EntityType.FIREWORK);
|
||||
FireworkMeta meta = (FireworkMeta) iS.getItemMeta();
|
||||
fw.setFireworkMeta(meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
save(getDay(), e.getPlayer().getUniqueId());
|
||||
uuidList.put(e.getPlayer().getUniqueId(), getDay());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOP(){
|
||||
if(getObjID().getUUID()!=null){
|
||||
UUID uuid = getObjID().getUUID();
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
|
||||
if(player == null) return false;
|
||||
return player.isOp();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String itemStackArrayToBase64(ItemStack[] items) throws IllegalStateException {
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
|
||||
dataOutput.writeInt(items.length);
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
dataOutput.writeObject(items[i]);
|
||||
}
|
||||
dataOutput.close();
|
||||
return Base64Coder.encodeLines(outputStream.toByteArray());
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Unable to save item stacks.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack[] itemStackArrayFromBase64(String data) throws IOException {
|
||||
try {
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
|
||||
BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
|
||||
ItemStack[] items = new ItemStack[dataInput.readInt()];
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
items[i] = (ItemStack) dataInput.readObject();
|
||||
}
|
||||
dataInput.close();
|
||||
return items;
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new IOException("Unable to decode class type.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void load(){
|
||||
config conf = new config();
|
||||
FileConfiguration file = conf.getConfig(getObjID().getID(), "plugin/AdventCalender/Data/");
|
||||
if(file == null) return;
|
||||
for(int i = 1; i<32;i++){
|
||||
if(file.isSet(i+"")){
|
||||
String s = file.getString(i+"");
|
||||
try {
|
||||
ItemStack[] is = itemStackArrayFromBase64(s);
|
||||
isList.put(i, is);
|
||||
} catch (IOException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
conf = new config();
|
||||
file = conf.getConfig(getObjID().getID() + ":Players", "plugin/AdventCalender/Data/");
|
||||
if(file == null) return;
|
||||
if(!file.isSet("Players")) return;
|
||||
for(String s : file.getConfigurationSection("Players").getKeys(false)){
|
||||
UUID uuid = UUID.fromString(s);
|
||||
int i = file.getInt("Players." + s);
|
||||
uuidList.put(uuid, i);
|
||||
}
|
||||
}
|
||||
|
||||
public void save(int i, UUID uuid){
|
||||
config conf = new config();
|
||||
FileConfiguration file = conf.getConfig(getObjID().getID(), "plugin/AdventCalender/Data/");
|
||||
file.set(i + "", getSerialze(i));
|
||||
conf.saveConfig(getObjID().getID(), file, "plugin/AdventCalender/Data/");
|
||||
|
||||
if(uuid != null){
|
||||
conf = new config();
|
||||
file = conf.getConfig(getObjID().getID() + ":Players", "plugin/AdventCalender/Data/");
|
||||
file.set("Players." + uuid.toString(), i);
|
||||
conf.saveConfig(getObjID().getID() + ":Players", file, "plugin/AdventCalender/Data/");
|
||||
}
|
||||
}
|
||||
|
||||
private String getSerialze(int i) {
|
||||
if(!isList.containsKey(i)){return "";}
|
||||
return itemStackArrayToBase64(isList.get(i));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent e){
|
||||
check();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onTeleport(PlayerTeleportEvent e){
|
||||
check();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onClose(InventoryCloseEvent e){
|
||||
if(p==null) return;
|
||||
if(e.getInventory()==null) return;
|
||||
if(!e.getInventory().equals(inv)) return;
|
||||
if(!e.getPlayer().equals(p)) return;
|
||||
isList.put(i, e.getInventory().getContents());
|
||||
save(i, null);
|
||||
p = null;
|
||||
inv = null;
|
||||
}
|
||||
|
||||
private void openInventory(ItemStack[] is){
|
||||
inv = Bukkit.createInventory(null, 54, "§8Christmas Reward [§c" + i + "§8]");
|
||||
if(is!=null) inv.setContents(is);
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Location arg0) {
|
||||
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;
|
||||
}
|
||||
|
||||
Location loc = getCenter();
|
||||
loc.setYaw(getYaw()+180);
|
||||
fArmorStand stand = spawnArmorStand(loc.add(0,-1.5,0));
|
||||
stand.setHelmet(new ItemStack(Material.CHEST));
|
||||
asList.add(stand);
|
||||
|
||||
ItemStack[] is = getStack();
|
||||
|
||||
loc = getRelative(getCenter(), getBlockFace(), 0, .25);
|
||||
loc.setYaw(getYaw()+180);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(is[0]);
|
||||
stand.setName("#Advent1#");
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
loc = getRelative(getCenter(), getBlockFace(), 0, -.25);
|
||||
loc.setYaw(getYaw()+180);
|
||||
stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(is[1]);
|
||||
stand.setName("#Advent2#");
|
||||
stand.setSmall(true);
|
||||
asList.add(stand);
|
||||
|
||||
for(fArmorStand pack : asList){
|
||||
pack.setInvisible(true);
|
||||
pack.setGravity(false);
|
||||
pack.setBasePlate(false);
|
||||
}
|
||||
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getDay(){
|
||||
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
||||
Date today = new Date();
|
||||
try {
|
||||
Date todayWithZeroTime =formatter.parse(formatter.format(today));
|
||||
int i = todayWithZeroTime.getDate();
|
||||
return i;
|
||||
} catch (ParseException e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void check(){
|
||||
if(currentDay==getDay()){return;}
|
||||
|
||||
ItemStack[] is = getStack();
|
||||
fArmorStand stand1= null;
|
||||
fArmorStand stand2 = null;
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#Advent1#")){
|
||||
stand1 = stand;
|
||||
}else if(stand.getName().equalsIgnoreCase("#Advent2#")){
|
||||
stand2 = stand;
|
||||
}
|
||||
}
|
||||
if(stand1!=null){stand1.setHelmet(is[0]);}
|
||||
if(stand2!=null){stand2.setHelmet(is[1]);}
|
||||
currentDay=getDay();
|
||||
update();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public ItemStack[] getStack(){
|
||||
ItemStack[] stack = new ItemStack[2];
|
||||
stack[0] = getSkull(ac_NULL);
|
||||
stack[1] = getSkull(ac_NULL);
|
||||
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
||||
Date today = new Date();
|
||||
try {
|
||||
Date todayWithZeroTime =formatter.parse(formatter.format(today));
|
||||
int i = todayWithZeroTime.getDate();
|
||||
int y = todayWithZeroTime.getMonth();
|
||||
if(y==11){
|
||||
switch (i) {
|
||||
case 1:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_1);break;
|
||||
case 2:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_2);break;
|
||||
case 3:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_3);break;
|
||||
case 4:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_4);break;
|
||||
case 5:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_5);break;
|
||||
case 6:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_6);break;
|
||||
case 7:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_7);break;
|
||||
case 8:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_8);break;
|
||||
case 9:
|
||||
stack[0] = getSkull(ac_0);
|
||||
stack[1] = getSkull(ac_9);break;
|
||||
case 10:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_0);break;
|
||||
case 11:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_1);break;
|
||||
case 12:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_2);break;
|
||||
case 13:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_3);break;
|
||||
case 14:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_4);break;
|
||||
case 15:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_5);break;
|
||||
case 16:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_6);break;
|
||||
case 17:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_7);break;
|
||||
case 18:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_8);break;
|
||||
case 19:
|
||||
stack[0] = getSkull(ac_1);
|
||||
stack[1] = getSkull(ac_9);break;
|
||||
case 20:
|
||||
stack[0] = getSkull(ac_2);
|
||||
stack[1] = getSkull(ac_0);break;
|
||||
case 21:
|
||||
stack[0] = getSkull(ac_2);
|
||||
stack[1] = getSkull(ac_1);break;
|
||||
case 22:
|
||||
stack[0] = getSkull(ac_2);
|
||||
stack[1] = getSkull(ac_2);break;
|
||||
case 23:
|
||||
stack[0] = getSkull(ac_2);
|
||||
stack[1] = getSkull(ac_3);break;
|
||||
case 24:
|
||||
stack[0] = getSkull(ac_2);
|
||||
stack[1] = getSkull(ac_4);break;
|
||||
default:
|
||||
stack[0] = getSkull(ac_NULL);
|
||||
stack[1] = getSkull(ac_NULL);break;
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
||||
|
||||
} catch (ParseException e) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
public String generateSessionKey(int length){
|
||||
String alphabet = new String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); //9
|
||||
int n = alphabet.length();
|
||||
String result = new String();
|
||||
Random r = new Random();
|
||||
for (int i=0; i<length; i++) result = result + alphabet.charAt(r.nextInt(n));
|
||||
return result;
|
||||
}
|
||||
|
||||
private int getDegress(int j){
|
||||
return 360/j;
|
||||
}
|
||||
|
||||
public ItemStack getSkull(String s) {
|
||||
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
|
||||
ItemMeta headMeta = skull.getItemMeta();
|
||||
GameProfile profile = new GameProfile(UUID.randomUUID(), generateSessionKey(10));
|
||||
Property textures = new Property(
|
||||
"textures", s
|
||||
);
|
||||
profile.getProperties().put(textures.getName(), textures);
|
||||
|
||||
try {
|
||||
Field profileField = headMeta.getClass().getDeclaredField("profile");
|
||||
profileField.setAccessible(true);
|
||||
profileField.set(headMeta, profile);
|
||||
} catch (NoSuchFieldException | SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
skull.setItemMeta(headMeta);
|
||||
return skull;
|
||||
}
|
||||
}
|
|
@ -44,6 +44,7 @@ public class AdventWreath extends Furniture implements Listener {
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove(true,false);
|
||||
|
@ -55,6 +56,7 @@ public class AdventWreath extends Furniture implements Listener {
|
|||
if(getObjID()==null){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
fArmorStand stand = e.getfArmorStand();
|
||||
|
@ -63,9 +65,9 @@ public class AdventWreath extends Furniture implements Listener {
|
|||
int i = Integer.parseInt(str.split(":")[1]);
|
||||
for(fArmorStand fstand : getfAsList()){
|
||||
if(fstand.getName().equalsIgnoreCase("Fire:" + i)){
|
||||
if(!fstand.getName().endsWith("#Burn")){
|
||||
if(!fstand.getName().endsWith("Burn")){
|
||||
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
||||
fstand.setName("Fire:" + i + "#Burn");
|
||||
fstand.setName("Fire:" + i + ":Burn");
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +78,7 @@ public class AdventWreath extends Furniture implements Listener {
|
|||
private void load(){
|
||||
for(fArmorStand fstand : getfAsList()){
|
||||
if(fstand.getName().startsWith("Fire:")){
|
||||
if(fstand.getName().endsWith("#Burn")){
|
||||
if(fstand.getName().endsWith("Burn")){
|
||||
if(!fstand.isParticlePlayed()){
|
||||
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,21 @@
|
|||
package de.Ste3et_C0st.Furniture.Objects.christmas;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.SkullType;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||
|
@ -29,20 +35,51 @@ public class CandyCane extends Furniture implements Listener {
|
|||
spawn(id.getStartLocation());
|
||||
}
|
||||
|
||||
private String generateSessionKey(int length){
|
||||
String alphabet = new String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); //9
|
||||
int n = alphabet.length();
|
||||
String result = new String();
|
||||
Random r = new Random();
|
||||
for (int i=0; i<length; i++) result = result + alphabet.charAt(r.nextInt(n));
|
||||
return result;
|
||||
}
|
||||
|
||||
private ItemStack getSkull() {
|
||||
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
|
||||
ItemMeta headMeta = skull.getItemMeta();
|
||||
GameProfile profile = new GameProfile(UUID.randomUUID(), generateSessionKey(10));
|
||||
Property textures = new Property(
|
||||
"textures",
|
||||
"eyJ0aW1lc3RhbXAiOjE0NDc5NDgyNDcwODQsInByb2ZpbGVJZCI6IjBlNGUzZmIwMTY4ZjRmMWI4NDM3ZjM5ZWYxNTdhZjk0IiwicHJvZmlsZU5hbWUiOiJDb29raWVNYWtlcjIwMDAiLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMDgxYWI4MDdjZDRhZTcxZWYyYjI2MzdiNWQ3MWM1ZDZjYTRjNzdjNWQ1YTQ1Mjc1MjRlNzYzZWM5ZWVlIn19fQ=="
|
||||
);
|
||||
profile.getProperties().put(textures.getName(), textures);
|
||||
|
||||
try {
|
||||
Field profileField = headMeta.getClass().getDeclaredField("profile");
|
||||
profileField.setAccessible(true);
|
||||
profileField.set(headMeta, profile);
|
||||
} catch (NoSuchFieldException | SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
skull.setItemMeta(headMeta);
|
||||
return skull;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) 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
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -50,11 +87,8 @@ public class CandyCane extends Furniture implements Listener {
|
|||
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);
|
||||
|
||||
ItemStack is = getSkull();
|
||||
|
||||
double d = .0;
|
||||
double c = .0;
|
||||
for(int i = 1; i<7;i++){
|
||||
|
|
|
@ -44,6 +44,7 @@ public class SnowGolem extends Furniture implements Listener{
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove();
|
||||
|
@ -55,6 +56,7 @@ public class SnowGolem extends Furniture implements Listener{
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove();
|
||||
|
|
|
@ -97,6 +97,7 @@ public class billboard extends Furniture implements Listener{
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
e.remove();
|
||||
|
|
|
@ -109,6 +109,7 @@ public class camera extends Furniture implements Listener{
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.remove();
|
||||
|
@ -119,7 +120,7 @@ public class camera extends Furniture implements Listener{
|
|||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -128,7 +128,7 @@ public class streetlamp extends Furniture implements Listener{
|
|||
@EventHandler
|
||||
private void onBlockBreak(FurnitureBlockBreakEvent e){
|
||||
if(e.isCancelled()){return;}
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
|
@ -140,7 +140,7 @@ public class streetlamp extends Furniture implements Listener{
|
|||
@EventHandler
|
||||
private void onBlockClick(FurnitureBlockClickEvent e){
|
||||
if(e.isCancelled()){return;}
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
|
@ -222,7 +222,7 @@ public class streetlamp extends Furniture implements Listener{
|
|||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(e.isCancelled()){return;}
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
|
@ -233,7 +233,7 @@ public class streetlamp extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class tv extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class SleepingBag extends Furniture implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -44,7 +44,7 @@ public class SleepingBag extends Furniture implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -31,7 +31,7 @@ public class campchair extends Furniture implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e) {
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -42,6 +42,7 @@ public class campchair extends Furniture implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e) {
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class fance extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
private void onBlockBreak(FurnitureBlockBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -82,7 +82,7 @@ public class fance extends Furniture implements Listener{
|
|||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
private void onBlockBreak(FurnitureBlockClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -125,7 +125,7 @@ public class graveStone extends Furniture implements Listener{
|
|||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().getPlugin().equalsIgnoreCase(main.getInstance().getName())){return;}
|
||||
|
@ -140,7 +140,7 @@ public class graveStone extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
private void onPhysiks(BlockPhysicsEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if (sign==null) return;
|
||||
if (e.getBlock() == null) return;
|
||||
|
@ -150,7 +150,7 @@ public class graveStone extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(!e.getID().getPlugin().equalsIgnoreCase(getPlugin().getName())){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
|
|
|
@ -216,7 +216,7 @@ public class log extends Furniture {
|
|||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onBlockClick(FurnitureBlockClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -299,7 +299,7 @@ public class log extends Furniture {
|
|||
|
||||
@EventHandler
|
||||
public void onBlockBreak(FurnitureBlockBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -187,7 +187,7 @@ public class mailBox extends Furniture implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()) return;
|
||||
if(!e.getID().equals(getObjID())) return;
|
||||
|
|
|
@ -112,7 +112,7 @@ public class sunshade extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureClick(FurnitureClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -152,7 +152,7 @@ public class sunshade extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onBlockBreak(FurnitureBlockBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -173,7 +173,7 @@ public class sunshade extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onBlockBreak(FurnitureBlockClickEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
@ -217,7 +217,7 @@ public class sunshade extends Furniture implements Listener{
|
|||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
|
|
|
@ -95,6 +95,7 @@ public class chair extends Furniture implements Listener{
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.remove();
|
||||
|
@ -106,6 +107,7 @@ public class chair extends Furniture implements Listener{
|
|||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
fArmorStand packet = null;
|
||||
for(fArmorStand as : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: DiceFurniture
|
||||
version: 2.4.6
|
||||
version: 2.5.6
|
||||
description: Add some new Objects to the Server
|
||||
author: Ste3et_C0st
|
||||
website: http://dicecraft.de
|
||||
|
|
Loading…
Reference in New Issue
Block a user