mirror of
https://github.com/Ste3et/furniture.git
synced 2024-11-25 20:16:08 +01:00
Add WaxCandle and fix some bugs
This commit is contained in:
parent
e8d6f6dee3
commit
85574268f6
@ -4,6 +4,6 @@
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="lib" path="C:/Plugins/jars/FurnitureLib.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Plugins/jars/PostalService-1.0.6.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Plugins/jars/spigot_server.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
<classpathentry kind="lib" path="C:/Plugins/jars/spigot.jar"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
12
.externalToolBuilders/DiceFurniture.launch
Normal file
12
.externalToolBuilders/DiceFurniture.launch
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/DiceFurniture/builder.xml}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
</launchConfiguration>
|
10
.project
10
.project
@ -10,6 +10,16 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
|
||||
<triggers>auto,full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>LaunchConfigHandle</key>
|
||||
<value><project>/.externalToolBuilders/DiceFurniture.launch</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
|
7
builder.xml
Normal file
7
builder.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- Configuration of the Ant build system to generate a Jar file -->
|
||||
<project name="DiceFurniture" default="CreateJar">
|
||||
<target name="CreateJar" description="Create Jar file">
|
||||
<jar jarfile="C:/Plugins/BuildServer/plugins/DiceFurniture.jar" basedir="./target/classes/" includes="**/*" />
|
||||
</target>
|
||||
</project>
|
@ -1,4 +1,5 @@
|
||||
AdventCalender:
|
||||
system-ID: 'AdventCalender'
|
||||
name: '&cAdventCalender'
|
||||
material: 383
|
||||
glow: true
|
||||
|
@ -1,4 +1,5 @@
|
||||
AdventWreath:
|
||||
system-ID: 'AdventWreath'
|
||||
name: '&cAdventWreath'
|
||||
material: 383
|
||||
glow: true
|
||||
|
@ -1,4 +1,5 @@
|
||||
Barrels:
|
||||
systemID: 'Barrels'
|
||||
name: '&cBarrels'
|
||||
material: 383
|
||||
glow: true
|
||||
|
@ -1,4 +1,5 @@
|
||||
BearTrap:
|
||||
system-ID: 'BearTrap'
|
||||
name: '&cBearTrap'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Billboard:
|
||||
system-ID: 'Billboard'
|
||||
name: '&cBillboard'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
BlackBoard:
|
||||
system-Name: 'BlackBoard'
|
||||
name: '&cBlackBoard'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
CactusPlant:
|
||||
system-ID: 'CactusPlant'
|
||||
name: '&cCactusPlant'
|
||||
material: 383
|
||||
glow: true
|
||||
|
@ -1,4 +1,5 @@
|
||||
Camera:
|
||||
system-ID: 'Camera'
|
||||
name: '&cCamera'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
CampChair:
|
||||
system-ID: 'CampChair'
|
||||
name: '&cCampChair'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Campfire1:
|
||||
system-ID: 'Campfire1'
|
||||
name: '&cCampfire #1'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Campfire2:
|
||||
system-ID: 'Campfire2'
|
||||
name: '&cCampfire #2'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
CandyCane:
|
||||
system-ID: 'CandyCane'
|
||||
name: '&cCandyCane'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Catapult:
|
||||
system-ID: 'Catapult'
|
||||
name: '&cCatapult'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Chair:
|
||||
system-ID: 'Chair'
|
||||
name: '&cChair'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
ChristmasTree:
|
||||
system-ID: 'ChristmasTree'
|
||||
name: '&cChristmasTree'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Crossbow:
|
||||
system-ID: 'Crossbow'
|
||||
name: '&cCrossbow'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
FireworkLauncher:
|
||||
system-ID: 'FireworkLauncher'
|
||||
name: '&cFireworkLauncher'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
FlowerPot:
|
||||
system-ID: 'FlowerPot'
|
||||
name: '&cFlowerPot'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
GraveStone:
|
||||
system-ID: 'GraveStone'
|
||||
name: '&cGrave Stone'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Hammock:
|
||||
system-ID: 'Hammock'
|
||||
name: '&cHammock'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
HumanSkeleton:
|
||||
system-ID: 'HumanSkeleton'
|
||||
name: '&cHumanSkeleton'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Lantern:
|
||||
system-ID: 'Lantern'
|
||||
name: '&cLantern'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
LargeTable:
|
||||
system-ID: 'LargeTable'
|
||||
name: '&cLarge Table'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Mailbox:
|
||||
MailBox:
|
||||
system-ID: 'MailBox'
|
||||
name: '&cMailBox'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
SchoolChair:
|
||||
system-ID: 'SchoolChair'
|
||||
name: '&cSchoolChair'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
SchoolTable:
|
||||
system-ID: 'SchoolTable'
|
||||
name: '&cSchoolTable'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
SleepingBag:
|
||||
system-ID: 'SleepingBag'
|
||||
name: '&cSleepingBag'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
SnowGolem:
|
||||
system-ID: 'SnowGolem'
|
||||
name: '&cSnowGolem'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Sofa:
|
||||
system-ID: 'Sofa'
|
||||
name: '&cSofa'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Streetlamp:
|
||||
system-ID: 'Streetlamp'
|
||||
name: '&cStreetlamp'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Sunshade:
|
||||
system-ID: 'Sunshade'
|
||||
name: '&cSunshade'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
TV:
|
||||
system-ID: 'TV'
|
||||
name: '&cTV'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Table:
|
||||
system-ID: 'Table'
|
||||
name: '&cTable'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Tent1:
|
||||
system-ID: 'Tent1'
|
||||
name: '&cTent #1'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Tent2:
|
||||
system-ID: 'Tent2'
|
||||
name: '&cTent #2'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Tent3:
|
||||
system-ID: 'Tent3'
|
||||
name: '&cTent #3'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
TrashCan:
|
||||
system-ID: 'TrashCan'
|
||||
name: '&cTrashCan'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Trunk:
|
||||
system-ID: 'Trunk'
|
||||
name: '&cTrunk'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
WaterBottle:
|
||||
system-ID: 'WaterBottle'
|
||||
name: '&cWaterBottle'
|
||||
material: 383
|
||||
glow: false
|
||||
|
13
src/Crafting/WaxCandle.yml
Normal file
13
src/Crafting/WaxCandle.yml
Normal file
@ -0,0 +1,13 @@
|
||||
WaxCandle:
|
||||
system-ID: 'WaxCandle'
|
||||
name: '&cWaxCandle'
|
||||
material: 383
|
||||
glow: false
|
||||
lore: ''
|
||||
crafting:
|
||||
disable: false
|
||||
recipe: XXX,AAA,XOX
|
||||
index:
|
||||
X: 0
|
||||
A: 101
|
||||
O: 167
|
@ -1,4 +1,5 @@
|
||||
WeaponStand:
|
||||
system-ID: 'WeaponStand'
|
||||
name: '&cWeaponStand'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Fence:
|
||||
system-ID: 'Fence'
|
||||
name: '&cFence'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Flag:
|
||||
system-ID: 'Flag'
|
||||
name: '&cFlag'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Guillotine:
|
||||
system-ID: 'Guillotine'
|
||||
name: '&cGuillotine'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -1,4 +1,5 @@
|
||||
Log:
|
||||
system-ID: 'Log'
|
||||
name: '&cLog'
|
||||
material: 383
|
||||
glow: false
|
||||
|
@ -21,7 +21,6 @@ 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.ChristmasTree;
|
||||
import de.Ste3et_C0st.Furniture.Objects.christmas.FireworkLauncher;
|
||||
@ -33,7 +32,6 @@ import de.Ste3et_C0st.Furniture.Objects.electric.tv;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.SleepingBag;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.TFlowerPot;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.Trunk;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.WaterBottle;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.campchair;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.fance;
|
||||
import de.Ste3et_C0st.Furniture.Objects.garden.graveStone;
|
||||
@ -45,6 +43,7 @@ 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.light.WaxCandle;
|
||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.CactusPlant;
|
||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.barrels;
|
||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.campfire_1;
|
||||
@ -74,55 +73,59 @@ public class main extends JavaPlugin{
|
||||
instance = this;
|
||||
lib = (FurnitureLib) Bukkit.getPluginManager().getPlugin("FurnitureLib");
|
||||
util = lib.getLocationUtil();
|
||||
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("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("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("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("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("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("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("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("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("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).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).setSize(1, 1, 1, CenterType.CENTER);
|
||||
new Project("FireworkLauncher", this, getResource("Crafting/FireworkLauncher.yml"), PlaceableSide.TOP, FireworkLauncher.class).setSize(1, 1, 1, CenterType.CENTER);
|
||||
addDefault("fence", "whiteList", "config.yml");
|
||||
addDefault("bearTrap", "damage", "damage.yml");
|
||||
setDefaults();
|
||||
setDefaults_2();
|
||||
lib.registerPluginFurnitures(this);
|
||||
if(lib.getDescription().getVersion().startsWith("1.7") || lib.getDescription().getVersion().startsWith("1.6")){
|
||||
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("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("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("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("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("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("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("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("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("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("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).setSize(1, 1, 1, CenterType.CENTER);
|
||||
new Project("FireworkLauncher", this, getResource("Crafting/FireworkLauncher.yml"), PlaceableSide.TOP, FireworkLauncher.class).setSize(1, 1, 1, CenterType.CENTER);
|
||||
new Project("WaxCandle", this, getResource("Crafting/WaxCandle.yml"), PlaceableSide.TOP, WaxCandle.class);
|
||||
addDefault("fence", "whiteList", "config.yml");
|
||||
addDefault("bearTrap", "damage", "damage.yml");
|
||||
setDefaults();
|
||||
setDefaults_2();
|
||||
lib.registerPluginFurnitures(this);
|
||||
}else{
|
||||
lib.send("FurnitureLib Version 1.6.x or 1.7.x not found");
|
||||
lib.send("DiceFurniture deos not load");
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -28,6 +28,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class Crossbow extends Furniture implements Listener {
|
||||
|
||||
@ -131,7 +132,7 @@ public class Crossbow extends Furniture implements Listener {
|
||||
if(e.isCancelled()) return;
|
||||
if(!e.getID().equals(getObjID())) return;
|
||||
if(!e.canBuild()){return;}
|
||||
fArmorStand stand = getArmorStand();
|
||||
fEntity stand = getArmorStand();
|
||||
if(stand==null){return;}
|
||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||
if(!hasArrow()||(is!=null&&is.getType()!=null&&is.getType().equals(Material.ARROW))){
|
||||
@ -152,7 +153,7 @@ public class Crossbow extends Furniture implements Listener {
|
||||
if(e.isCancelled()) return;
|
||||
if(!e.getID().equals(getObjID())) return;
|
||||
if(!e.canBuild()){return;}
|
||||
fArmorStand stand = getArmorStand();
|
||||
fEntity stand = getArmorStand();
|
||||
if(stand==null){return;}
|
||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||
if(!hasArrow()||(is!=null&&is.getType()!=null&&is.getType().equals(Material.ARROW))){
|
||||
@ -198,7 +199,7 @@ public class Crossbow extends Furniture implements Listener {
|
||||
return entities;
|
||||
}
|
||||
|
||||
private void removeArrow(fArmorStand stand){
|
||||
private void removeArrow(fEntity stand){
|
||||
ItemStack is = stand.getItemInMainHand();
|
||||
if(is.getAmount()-1<=0){
|
||||
stand.setItemInMainHand(new ItemStack(Material.AIR));
|
||||
@ -210,7 +211,7 @@ public class Crossbow extends Furniture implements Listener {
|
||||
update();
|
||||
}
|
||||
|
||||
private void addArmor(ItemStack is, fArmorStand stand){
|
||||
private void addArmor(ItemStack is, fEntity stand){
|
||||
if(getArrow()!=null){is.setAmount(getArrow().getAmount());}
|
||||
stand.setItemInMainHand(is);
|
||||
update();
|
||||
@ -218,8 +219,8 @@ public class Crossbow extends Furniture implements Listener {
|
||||
|
||||
|
||||
|
||||
private fArmorStand getArmorStand(){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
private fEntity getArmorStand(){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
||||
return stand;
|
||||
}
|
||||
@ -228,7 +229,7 @@ public class Crossbow extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
private ItemStack getArrow(){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
||||
if(!(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR))){
|
||||
return stand.getItemInMainHand();
|
||||
@ -239,7 +240,7 @@ public class Crossbow extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
private boolean hasArrow(){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
||||
if(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR)){
|
||||
return false;
|
||||
|
@ -24,6 +24,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class flag extends Furniture implements Listener {
|
||||
|
||||
@ -83,7 +84,7 @@ public class flag extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
public int getState(){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().startsWith("#FLAG")){
|
||||
return Integer.parseInt(stand.getName().split(":")[1]);
|
||||
}
|
||||
@ -91,8 +92,8 @@ public class flag extends Furniture implements Listener {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public fArmorStand getStand(){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
public fEntity getStand(){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().startsWith("#FLAG")){
|
||||
return stand;
|
||||
}
|
||||
@ -100,7 +101,7 @@ public class flag extends Furniture implements Listener {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setState(int i, fArmorStand stand){
|
||||
public void setState(int i, fEntity stand){
|
||||
if(i<1||i>3){return;}
|
||||
if(stand==null){return;}
|
||||
switch (i) {
|
||||
|
@ -30,6 +30,7 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.EventType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class guillotine extends Furniture implements Listener{
|
||||
|
||||
@ -83,10 +84,10 @@ public class guillotine extends Furniture implements Listener{
|
||||
}
|
||||
|
||||
private fArmorStand getByName(String s){
|
||||
for(fArmorStand packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(!packets.getName().equalsIgnoreCase("")){
|
||||
if(packets.getName().startsWith("#Oblation#")){
|
||||
return packets;
|
||||
return (fArmorStand) packets;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -97,15 +98,18 @@ public class guillotine extends Furniture implements Listener{
|
||||
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;
|
||||
for(fEntity packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packets instanceof fArmorStand){
|
||||
fArmorStand stand = (fArmorStand) packets;
|
||||
if(!packets.getName().equalsIgnoreCase("")){
|
||||
if(!(packets.getName().startsWith("#Oblation#") && packets.getName().startsWith("#Head#"))){
|
||||
if(packets.getName().startsWith("iron")){
|
||||
armorStandList.add(stand);
|
||||
Location loc = getStartLocation(packets.getName());
|
||||
packets.teleport(loc);
|
||||
}else{
|
||||
packet1 = stand;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -447,8 +451,8 @@ public class guillotine extends Furniture implements Listener{
|
||||
private boolean canStart(){
|
||||
if(isRunning()) return false;
|
||||
boolean a = false,b = false,c = false;
|
||||
a = !packet1.isVisible();
|
||||
b = !packet2.isVisible();
|
||||
a = !packet1.isInvisible();
|
||||
b = !packet2.isInvisible();
|
||||
if(packet1.getItemInMainHand()!=null&&!packet1.getItemInMainHand().equals(Material.AIR)){
|
||||
c = true;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class weaponStand extends Furniture {
|
||||
|
||||
@ -59,8 +60,8 @@ public class weaponStand extends Furniture {
|
||||
if(p!=null){
|
||||
p.closeInventory();
|
||||
}
|
||||
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
for(fArmorStand packet : asList){
|
||||
List<fEntity> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
for(fEntity packet : asList){
|
||||
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
||||
if(packet.getInventory().getItemInMainHand()!=null){
|
||||
if(!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
@ -86,7 +87,7 @@ public class weaponStand extends Furniture {
|
||||
|
||||
ItemStack itemstack = p.getInventory().getItemInMainHand();
|
||||
if(itemstack!=null&&matList.contains(itemstack.getType())){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getInventory().getHelmet()!=null){
|
||||
if(packet.getInventory().getHelmet().getType().name().toLowerCase().endsWith("gate")){
|
||||
ItemStack itemStack = new ItemStack(itemstack.getType(), 1, (short) 0);
|
||||
@ -110,7 +111,7 @@ public class weaponStand extends Furniture {
|
||||
is3.setItemMeta(im3);
|
||||
|
||||
inv = Bukkit.createInventory(null, 45, "<EFBFBD>cWeaponBox");
|
||||
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
List<fEntity> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
|
||||
int j = 1;
|
||||
for(int i = 0; i<inv.getSize();i++){
|
||||
@ -118,7 +119,7 @@ public class weaponStand extends Furniture {
|
||||
if(slotList1.contains(i)){
|
||||
inv.setItem(i, is3);
|
||||
}else if(slotList2.contains(i)){
|
||||
for(fArmorStand packet : asList){
|
||||
for(fEntity packet : asList){
|
||||
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
||||
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
|
||||
ItemStack is = new ItemStack(Material.AIR);
|
||||
@ -169,11 +170,11 @@ public class weaponStand extends Furniture {
|
||||
if(inv==null){return;}
|
||||
if(!e.getInventory().getTitle().equalsIgnoreCase(inv.getTitle())){return;}
|
||||
|
||||
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
List<fEntity> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
int j = 1;
|
||||
for(int i = 0; i<inv.getSize();i++){
|
||||
if(slotList2.contains(i)){
|
||||
for(fArmorStand packet : asList){
|
||||
for(fEntity packet : asList){
|
||||
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
||||
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
|
||||
ItemStack is = inv.getItem(i);
|
||||
|
@ -20,6 +20,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class BlackBoard extends Furniture implements Listener {
|
||||
public BlackBoard(ObjectID id){
|
||||
@ -94,7 +95,7 @@ public class BlackBoard extends Furniture implements Listener {
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
||||
Itemstack.setAmount(1);
|
||||
|
@ -18,6 +18,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class SchoolChair extends Furniture implements Listener {
|
||||
|
||||
@ -105,7 +106,7 @@ public class SchoolChair extends Furniture implements Listener {
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||
if(packet.getPassanger()==null){
|
||||
packet.setPassanger(e.getPlayer());
|
||||
|
@ -21,6 +21,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class SchoolTable extends Furniture implements Listener {
|
||||
|
||||
@ -41,7 +42,7 @@ public class SchoolTable extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||
@ -63,7 +64,7 @@ public class SchoolTable extends Furniture implements Listener {
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
||||
Itemstack.setAmount(1);
|
||||
|
@ -18,6 +18,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class TrashCan extends Furniture implements Listener {
|
||||
|
||||
@ -49,8 +50,8 @@ public class TrashCan extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())) return;
|
||||
if(!e.canBuild()){return;}
|
||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||
fArmorStand stand = null;
|
||||
for(fArmorStand s : getfAsList()){
|
||||
fEntity stand = null;
|
||||
for(fEntity s : getfAsList()){
|
||||
if(s.getName().equalsIgnoreCase("#TRASH#")){
|
||||
stand = s;break;
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class AdventCalender extends Furniture implements Listener {
|
||||
double sub = .9;
|
||||
@ -228,7 +229,7 @@ public class AdventCalender extends Furniture implements Listener {
|
||||
|
||||
public void load(){
|
||||
config conf = new config();
|
||||
FileConfiguration file = conf.getConfig(getObjID().getID(), "plugin/AdventCalender/Data/");
|
||||
FileConfiguration file = conf.getConfig(getObjID().getSerial(), "plugin/AdventCalender/Data/");
|
||||
if(file == null) return;
|
||||
for(int i = 1; i<32;i++){
|
||||
if(file.isSet(i+"")){
|
||||
@ -241,7 +242,7 @@ public class AdventCalender extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
conf = new config();
|
||||
file = conf.getConfig(getObjID().getID() + ":Players", "plugin/AdventCalender/Data/");
|
||||
file = conf.getConfig(getObjID().getSerial() + "_Players", "plugin/AdventCalender/Data/");
|
||||
if(file == null) return;
|
||||
if(!file.isSet("Players")) return;
|
||||
for(String s : file.getConfigurationSection("Players").getKeys(false)){
|
||||
@ -253,17 +254,17 @@ public class AdventCalender extends Furniture implements Listener {
|
||||
|
||||
public void save(int i){
|
||||
config conf = new config();
|
||||
FileConfiguration file = conf.getConfig(getObjID().getID(), "plugin/AdventCalender/Data/");
|
||||
FileConfiguration file = conf.getConfig(getObjID().getSerial(), "plugin/AdventCalender/Data/");
|
||||
file.set(i + "", getSerialze(i));
|
||||
conf.saveConfig(getObjID().getID(), file, "plugin/AdventCalender/Data/");
|
||||
conf.saveConfig(getObjID().getSerial(), file, "plugin/AdventCalender/Data/");
|
||||
}
|
||||
|
||||
public void savePlayer(UUID uuid){
|
||||
if(uuid != null){
|
||||
config conf = new config();
|
||||
FileConfiguration file = conf.getConfig(getObjID().getID() + ":Players", "plugin/AdventCalender/Data/");
|
||||
FileConfiguration file = conf.getConfig(getObjID().getSerial() + "_Players", "plugin/AdventCalender/Data/");
|
||||
file.set("Players." + uuid.toString(), i);
|
||||
conf.saveConfig(getObjID().getID() + ":Players", file, "plugin/AdventCalender/Data/");
|
||||
conf.saveConfig(getObjID().getSerial() + "_Players", file, "plugin/AdventCalender/Data/");
|
||||
}
|
||||
}
|
||||
|
||||
@ -295,7 +296,7 @@ public class AdventCalender extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
private void openInventory(ItemStack[] is){
|
||||
inv = Bukkit.createInventory(null, 54, "<EFBFBD>8Christmas Reward [<5B>c" + i + "<EFBFBD>8]");
|
||||
inv = Bukkit.createInventory(null, 54, "§8Christmas Reward [§c" + i + "§8]");
|
||||
if(is!=null) inv.setContents(is);
|
||||
p.openInventory(inv);
|
||||
}
|
||||
@ -397,9 +398,9 @@ public class AdventCalender extends Furniture implements Listener {
|
||||
if(currentDay==getDay()){return;}
|
||||
if(getfAsList()==null) return;
|
||||
ItemStack[] is = getStack();
|
||||
fArmorStand stand1= null;
|
||||
fArmorStand stand2 = null;
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
fEntity stand1= null;
|
||||
fEntity stand2 = null;
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#Advent1#")){
|
||||
stand1 = stand;
|
||||
}else if(stand.getName().equalsIgnoreCase("#Advent2#")){
|
||||
|
@ -18,6 +18,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class AdventWreath extends Furniture implements Listener {
|
||||
double sub = .9;
|
||||
@ -64,7 +65,7 @@ public class AdventWreath extends Furniture implements Listener {
|
||||
String str = stand.getName();
|
||||
if(str.startsWith("Fire") || str.startsWith("Torch")){
|
||||
int i = Integer.parseInt(str.split(":")[1]);
|
||||
for(fArmorStand fstand : getfAsList()){
|
||||
for(fEntity fstand : getfAsList()){
|
||||
if(fstand.getName().equalsIgnoreCase("Fire:" + i)){
|
||||
if(!fstand.getName().endsWith("Burn")){
|
||||
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
||||
@ -77,7 +78,7 @@ public class AdventWreath extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
private void load(){
|
||||
for(fArmorStand fstand : getfAsList()){
|
||||
for(fEntity fstand : getfAsList()){
|
||||
if(fstand.getName().startsWith("Fire:")){
|
||||
if(fstand.getName().endsWith("Burn")){
|
||||
if(!fstand.isParticlePlayed()){
|
||||
@ -207,7 +208,7 @@ public class AdventWreath extends Furniture implements Listener {
|
||||
loc.subtract(0, .5, 0);
|
||||
|
||||
for(int i = 0; i<j;i++){
|
||||
loc.setYaw((float) l);
|
||||
loc.setYaw((float) l + 180);
|
||||
fArmorStand stand = spawnArmorStand(loc);
|
||||
stand.setHelmet(stack);
|
||||
stand.setInvisible(true);
|
||||
|
@ -50,7 +50,7 @@ public class CandyCane extends Furniture implements Listener {
|
||||
GameProfile profile = new GameProfile(UUID.randomUUID(), generateSessionKey(10));
|
||||
Property textures = new Property(
|
||||
"textures",
|
||||
"eyJ0aW1lc3RhbXAiOjE0NDc5NDgyNDcwODQsInByb2ZpbGVJZCI6IjBlNGUzZmIwMTY4ZjRmMWI4NDM3ZjM5ZWYxNTdhZjk0IiwicHJvZmlsZU5hbWUiOiJDb29raWVNYWtlcjIwMDAiLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMDgxYWI4MDdjZDRhZTcxZWYyYjI2MzdiNWQ3MWM1ZDZjYTRjNzdjNWQ1YTQ1Mjc1MjRlNzYzZWM5ZWVlIn19fQ=="
|
||||
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNjM2Y3ODFjOTIzYTI4ODdmMTRjMWVlYTExMDUwMTY2OTY2ZjI2MDI1Nzg0MDFmMTQ1MWU2MDk3Yjk3OWRmIn19fQ"
|
||||
);
|
||||
profile.getProperties().put(textures.getName(), textures);
|
||||
|
||||
|
@ -16,12 +16,14 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.FireworkMeta;
|
||||
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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class FireworkLauncher extends Furniture implements Listener {
|
||||
|
||||
@ -42,7 +44,7 @@ public class FireworkLauncher extends Furniture implements Listener {
|
||||
if(e.getID() == null || getObjID() == null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#FIREWORK#")){
|
||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||
@ -63,8 +65,8 @@ public class FireworkLauncher extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canBuild(e.getPlayer())){return;}
|
||||
Player p = e.getPlayer();
|
||||
fArmorStand stand = null;
|
||||
for(fArmorStand st : getfAsList()){
|
||||
fEntity stand = null;
|
||||
for(fEntity st : getfAsList()){
|
||||
if(st.getName().equalsIgnoreCase("#FIREWORK#")){
|
||||
stand = st;
|
||||
break;
|
||||
@ -109,7 +111,7 @@ public class FireworkLauncher extends Furniture implements Listener {
|
||||
return ThreadLocalRandom.current().nextDouble(min, max);
|
||||
}
|
||||
|
||||
public boolean canLaunch(fArmorStand stand){
|
||||
public boolean canLaunch(fEntity stand){
|
||||
if(stand.getItemInMainHand()!=null){
|
||||
if(stand.getItemInMainHand().getType().equals(Material.FIREWORK)){
|
||||
return true;
|
||||
@ -118,14 +120,14 @@ public class FireworkLauncher extends Furniture implements Listener {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setItem(fArmorStand stand, ItemStack is){
|
||||
public void setItem(fEntity stand, ItemStack is){
|
||||
ItemStack stack = is.clone();
|
||||
stack.setAmount(1);
|
||||
stand.setItemInMainHand(stack);
|
||||
update();
|
||||
}
|
||||
|
||||
public void drop(fArmorStand stand){
|
||||
public void drop(fEntity stand){
|
||||
if(stand.getItemInMainHand()!=null){
|
||||
getWorld().dropItem(getCenter(), stand.getItemInMainHand());
|
||||
stand.setItemInMainHand(new ItemStack(Material.AIR));
|
||||
|
@ -26,6 +26,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class streetlamp extends Furniture implements Listener{
|
||||
|
||||
@ -180,14 +181,14 @@ public class streetlamp extends Furniture implements Listener{
|
||||
|
||||
private void setLight(Boolean b){
|
||||
if(!b){
|
||||
fArmorStand packet = getPacket();
|
||||
fEntity packet = getPacket();
|
||||
if(packet==null) return;
|
||||
packet.getInventory().setHelmet(new ItemStack(Material.REDSTONE_LAMP_OFF));
|
||||
getManager().updateFurniture(getObjID());
|
||||
FurnitureLib.getInstance().getLightManager().removeLight(light);
|
||||
return;
|
||||
}else{
|
||||
fArmorStand packet = getPacket();
|
||||
fEntity packet = getPacket();
|
||||
if(packet==null) return;
|
||||
packet.getInventory().setHelmet(new ItemStack(Material.GLOWSTONE));
|
||||
getManager().updateFurniture(getObjID());
|
||||
@ -196,8 +197,8 @@ public class streetlamp extends Furniture implements Listener{
|
||||
}
|
||||
}
|
||||
|
||||
private fArmorStand getPacket(){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
private fEntity getPacket(){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#LAMP#")){
|
||||
return packet;
|
||||
}
|
||||
@ -206,7 +207,7 @@ public class streetlamp extends Furniture implements Listener{
|
||||
}
|
||||
|
||||
private boolean isOn(){
|
||||
for(fArmorStand as : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity as : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(as.getName().equalsIgnoreCase("#LAMP#")){
|
||||
switch (as.getInventory().getHelmet().getType()) {
|
||||
case REDSTONE_LAMP_OFF: return false;
|
||||
@ -239,7 +240,7 @@ public class streetlamp extends Furniture implements Listener{
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
Boolean isOn = isOn();
|
||||
fArmorStand packet = getPacket();
|
||||
fEntity packet = getPacket();
|
||||
if(packet==null) return;
|
||||
if(redstone) return;
|
||||
if(isOn){
|
||||
|
@ -18,6 +18,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class SleepingBag extends Furniture implements Listener {
|
||||
|
||||
@ -48,7 +49,7 @@ public class SleepingBag extends Furniture implements Listener {
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||
if(packet.getPassanger()==null){
|
||||
packet.setPassanger(e.getPlayer());
|
||||
|
@ -20,6 +20,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class Trunk extends Furniture implements Listener {
|
||||
|
||||
@ -55,7 +56,7 @@ public class Trunk extends Furniture implements Listener {
|
||||
if(!e.canBuild()){return;}
|
||||
ItemStack stack = e.getPlayer().getInventory().getItemInMainHand();
|
||||
stack.setAmount(1);
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().startsWith("#TO")){
|
||||
stand.setHelmet(stack);
|
||||
}
|
||||
@ -72,7 +73,7 @@ public class Trunk extends Furniture implements Listener {
|
||||
|
||||
private void setPassanger(fArmorStand stand, Player p){
|
||||
int i = Integer.parseInt(stand.getName().split(":")[1]);
|
||||
for(fArmorStand as : getfAsList()){
|
||||
for(fEntity as : getfAsList()){
|
||||
if(as.getName().equalsIgnoreCase("#Sitz:" + i)){
|
||||
if(as.getPassanger()==null){
|
||||
as.setPassanger(p);
|
||||
|
@ -20,6 +20,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class WaterBottle extends Furniture implements Listener {
|
||||
|
||||
@ -62,7 +63,7 @@ public class WaterBottle extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!canInteract(e.getPlayer())){return;}
|
||||
Material data = e.getPlayer().getInventory().getItemInMainHand().getType();
|
||||
fArmorStand stand = removeItem();
|
||||
fEntity stand = removeItem();
|
||||
if(matList.contains(data)){
|
||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||
is.setAmount(1);
|
||||
@ -71,9 +72,9 @@ public class WaterBottle extends Furniture implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private fArmorStand removeItem(){
|
||||
fArmorStand fstand = null;
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
private fEntity removeItem(){
|
||||
fEntity fstand = null;
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#ITEM#")){
|
||||
fstand = stand;
|
||||
if(stand.getItemInMainHand()!=null&&!stand.getItemInMainHand().equals(Material.AIR)){
|
||||
|
@ -18,6 +18,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class campchair extends Furniture implements Listener {
|
||||
public campchair(ObjectID id){
|
||||
@ -47,7 +48,7 @@ public class campchair extends Furniture implements Listener {
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||
if(packet.getPassanger()==null){
|
||||
packet.setPassanger(e.getPlayer());
|
||||
|
@ -22,10 +22,11 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class fance extends Furniture implements Listener{
|
||||
|
||||
private void setTypes(ItemStack is){for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){packet.getInventory().setHelmet(is);}}
|
||||
private void setTypes(ItemStack is){for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){packet.getInventory().setHelmet(is);}}
|
||||
List<Material> matList = Arrays.asList(
|
||||
Material.SPRUCE_FENCE,
|
||||
Material.BIRCH_FENCE,
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -23,6 +24,7 @@ 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.Utilitis.LocationUtil;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
@ -33,11 +35,12 @@ public class graveStone extends Furniture implements Listener{
|
||||
public graveStone(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
setBlock();
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
setBlock();
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
setBlock();
|
||||
}
|
||||
|
||||
@ -45,6 +48,7 @@ public class graveStone extends Furniture implements Listener{
|
||||
Block sign;
|
||||
String[] lines = new String[4];
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void setBlock(){
|
||||
Location location = getLocation().clone();
|
||||
if(getBlockFace().equals(BlockFace.WEST)){location = getLutil().getRelativ(location, getBlockFace(), .0, -1.02);}
|
||||
@ -57,7 +61,12 @@ public class graveStone extends Furniture implements Listener{
|
||||
this.signLoc = sign;
|
||||
|
||||
if(!sign.getBlock().getType().equals(Material.WALL_SIGN)){
|
||||
this.sign = getLutil().setSign(getBlockFace(), sign);
|
||||
sign.getBlock().setType(Material.WALL_SIGN);
|
||||
this.sign = sign.getBlock();
|
||||
BlockState state = this.sign.getState();
|
||||
LocationUtil util = getLutil();
|
||||
state.setRawData(util.getFacebyte(util.yawToFace(getYaw() + 90)));
|
||||
state.update();
|
||||
}else{
|
||||
this.sign = sign.getBlock();
|
||||
}
|
||||
@ -115,7 +124,6 @@ public class graveStone extends Furniture implements Listener{
|
||||
asp.setBasePlate(false);
|
||||
}
|
||||
send();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW)
|
||||
|
@ -29,12 +29,13 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class log extends Furniture {
|
||||
|
||||
Block b;
|
||||
int mode = 0;
|
||||
Inventory inv = Bukkit.createInventory(null, 9, "<EFBFBD>2Settings");
|
||||
Inventory inv = Bukkit.createInventory(null, 9, "$2Settings");
|
||||
ItemStack pane = new ItemStack(Material.STAINED_GLASS_PANE);
|
||||
ItemStack permissions = new ItemStack(Material.ARROW);
|
||||
List<ItemStack> isList = new ArrayList<ItemStack>();
|
||||
@ -45,7 +46,7 @@ public class log extends Furniture {
|
||||
b = getLocation().getBlock();
|
||||
getObjID().addBlock(Arrays.asList(b));
|
||||
ItemMeta meta = pane.getItemMeta();
|
||||
meta.setDisplayName("<EFBFBD>c");
|
||||
meta.setDisplayName("$c");
|
||||
pane.setItemMeta(meta);
|
||||
pane.setDurability((short) 15);
|
||||
pane.setItemMeta(meta);
|
||||
@ -61,24 +62,24 @@ public class log extends Furniture {
|
||||
ItemStack stack = new ItemStack(Material.BANNER);
|
||||
stack.setDurability((short) 1);
|
||||
ItemMeta meta = stack.getItemMeta();
|
||||
meta.setDisplayName("<EFBFBD>6Mode: <20>cTop");
|
||||
meta.setDisplayName("$6Mode: $cTop");
|
||||
stack.setItemMeta(meta);
|
||||
isList.add(stack);
|
||||
stack = new ItemStack(Material.BANNER);
|
||||
stack.setDurability((short) 2);
|
||||
meta = stack.getItemMeta();
|
||||
meta.setDisplayName("<EFBFBD>6Mode: <20>cFront I");
|
||||
meta.setDisplayName("$6Mode: $cFront I");
|
||||
stack.setItemMeta(meta);
|
||||
isList.add(stack);
|
||||
stack = new ItemStack(Material.BANNER);
|
||||
stack.setDurability((short) 11);
|
||||
meta = stack.getItemMeta();
|
||||
meta.setDisplayName("<EFBFBD>6Mode: <20>cFront II");
|
||||
meta.setDisplayName("$6Mode: $cFront II");
|
||||
stack.setItemMeta(meta);
|
||||
isList.add(stack);
|
||||
|
||||
meta = permissions.getItemMeta();
|
||||
meta.setDisplayName("<EFBFBD>cChange Permissions (Owner Only)");
|
||||
meta.setDisplayName("$cChange Permissions (Owner Only)");
|
||||
permissions.setItemMeta(meta);
|
||||
}
|
||||
|
||||
@ -186,9 +187,9 @@ public class log extends Furniture {
|
||||
break;
|
||||
}
|
||||
|
||||
fArmorStand standOld = null;
|
||||
fArmorStand standCurrent = null;
|
||||
for(fArmorStand s : getObjID().getPacketList()){
|
||||
fEntity standOld = null;
|
||||
fEntity standCurrent = null;
|
||||
for(fEntity s : getObjID().getPacketList()){
|
||||
if(s.getName().equalsIgnoreCase(oldArmorStand+"")){
|
||||
standOld=s;
|
||||
}else if(s.getName().equalsIgnoreCase(currentArmorStand+"")){
|
||||
@ -235,8 +236,8 @@ public class log extends Furniture {
|
||||
removeItem(p);
|
||||
return;
|
||||
}else if(!p.getInventory().getItemInMainHand().getType().isBlock() && !p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
fArmorStand stand = null;
|
||||
for(fArmorStand s : getObjID().getPacketList()){
|
||||
fEntity stand = null;
|
||||
for(fEntity s : getObjID().getPacketList()){
|
||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||
stand = s;
|
||||
break;
|
||||
@ -245,6 +246,11 @@ public class log extends Furniture {
|
||||
|
||||
if(stand==null){return;}
|
||||
if(stand.getInventory().getItemInMainHand()!=null&&!stand.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
if(p.getInventory().getItemInMainHand()!=null){
|
||||
if(p.getInventory().getItemInMainHand().equals(stand.getItemInMainHand())){
|
||||
return;
|
||||
}
|
||||
}
|
||||
ItemStack is = stand.getInventory().getItemInMainHand();
|
||||
is.setAmount(1);
|
||||
getWorld().dropItem(getLocation(), is);
|
||||
@ -257,8 +263,8 @@ public class log extends Furniture {
|
||||
removeItem(p);
|
||||
return;
|
||||
}else{
|
||||
fArmorStand stand = null;
|
||||
for(fArmorStand s : getObjID().getPacketList()){
|
||||
fEntity stand = null;
|
||||
for(fEntity s : getObjID().getPacketList()){
|
||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||
stand = s;
|
||||
break;
|
||||
@ -268,6 +274,13 @@ public class log extends Furniture {
|
||||
if(stand==null){return;}
|
||||
|
||||
if(stand.getInventory().getItemInMainHand()!=null&&!stand.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
for(fEntity s : getObjID().getPacketList()){
|
||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||
stand = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack is = stand.getInventory().getItemInMainHand();
|
||||
is.setAmount(1);
|
||||
getWorld().dropItem(getLocation(), is);
|
||||
@ -306,8 +319,8 @@ public class log extends Furniture {
|
||||
e.setCancelled(true);
|
||||
Player p = e.getPlayer();
|
||||
|
||||
fArmorStand stand = null;
|
||||
for(fArmorStand s : getObjID().getPacketList()){
|
||||
fEntity stand = null;
|
||||
for(fEntity s : getObjID().getPacketList()){
|
||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||
stand = s;
|
||||
break;
|
||||
|
@ -64,18 +64,18 @@ public class mailBox extends Furniture implements Listener {
|
||||
aspList.add(packet);
|
||||
}
|
||||
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.2, 0), getBlockFace(), -.21, 0D));
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.25, 0), getBlockFace(), -.21, -.0D));
|
||||
as.getInventory().setHelmet(new ItemStack(Material.SMOOTH_BRICK, 1, (short) 0));
|
||||
as.setSmall(true);
|
||||
aspList.add(as);
|
||||
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.2, 0), getBlockFace(), .21, 0D));
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.25, 0), getBlockFace(), .21, 0D));
|
||||
as.getInventory().setHelmet(new ItemStack(Material.SMOOTH_BRICK, 1, (short) 0));
|
||||
as.setSmall(true);
|
||||
aspList.add(as);
|
||||
|
||||
for(int i = 0; i<=4;i++){
|
||||
Location loc = getLutil().getRelativ(middle.clone().add(0, 1.898, 0), getBlockFace(), -.44+.165*i, .43D);
|
||||
Location loc = getLutil().getRelativ(middle.clone().add(0, 1.898, 0), getBlockFace(), -.44+.165*i, .462D);
|
||||
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
|
||||
packet.setSmall(true);
|
||||
//x z y
|
||||
@ -106,7 +106,7 @@ public class mailBox extends Furniture implements Listener {
|
||||
|
||||
BlockFace face = getBlockFace();
|
||||
face = getLutil().yawToFace(getLutil().FaceToYaw(getBlockFace()) + 90);
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.5, 0), face, -.21, -.32D));
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.5, 0), face, -.04, -.55D));
|
||||
as.getInventory().setHelmet(new ItemStack(Material.REDSTONE_TORCH_ON, 1, (short) 0));
|
||||
as.setPose(getLutil().degresstoRad(new EulerAngle(0, 0, 90)), BodyPart.HEAD);
|
||||
as.setName("#ELEMENT#");
|
||||
@ -119,7 +119,7 @@ public class mailBox extends Furniture implements Listener {
|
||||
as.setSmall(true);
|
||||
aspList.add(as);
|
||||
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.40, 0), face.getOppositeFace(), -.1, .34D));
|
||||
as = getManager().createArmorStand(getObjID(), getLutil().getRelativ(middle.clone().add(0, 1.40, 0), face.getOppositeFace(), -.15, .33D));
|
||||
as.getInventory().setItemInMainHand(new ItemStack(Material.WOOD_BUTTON, 1, (short) 0));
|
||||
as.setPose(getLutil().degresstoRad(new EulerAngle(-15,-67, -90)), BodyPart.RIGHT_ARM);
|
||||
as.setSmall(true);
|
||||
|
@ -31,6 +31,7 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.EventType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class sunshade extends Furniture implements Listener{
|
||||
List<Material> matList = Arrays.asList(
|
||||
@ -123,7 +124,7 @@ public class sunshade extends Furniture implements Listener{
|
||||
if(is.getType().equals(Material.BANNER)){
|
||||
e.setCancelled(true);
|
||||
if(isRunning()){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
||||
packet.getInventory().setHelmet(is);
|
||||
}else if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.CARPET)){
|
||||
@ -158,7 +159,7 @@ public class sunshade extends Furniture implements Listener{
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
stopTimer();
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||
@ -183,7 +184,7 @@ public class sunshade extends Furniture implements Listener{
|
||||
if(is.getType().equals(Material.BANNER)){
|
||||
e.setCancelled(true);
|
||||
if(isRunning()){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
||||
packet.getInventory().setHelmet(is);
|
||||
}else if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.CARPET)){
|
||||
@ -223,7 +224,7 @@ public class sunshade extends Furniture implements Listener{
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
stopTimer();
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||
@ -243,11 +244,11 @@ public class sunshade extends Furniture implements Listener{
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().startsWith("#ELEMENT#")){
|
||||
if(!isClose(packet)){
|
||||
Double x = packet.getPose(BodyPart.HEAD).getX();
|
||||
packet.setPose(new EulerAngle(x-.32, 0, 0), BodyPart.HEAD);
|
||||
if(!isClose((fArmorStand) packet)){
|
||||
Double x = ((fArmorStand) packet).getPose(BodyPart.HEAD).getX();
|
||||
((fArmorStand) packet).setPose(new EulerAngle(x-.32, 0, 0), BodyPart.HEAD);
|
||||
}else{
|
||||
stopTimer();
|
||||
return;
|
||||
@ -269,11 +270,11 @@ public class sunshade extends Furniture implements Listener{
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().startsWith("#ELEMENT#")){
|
||||
if(!isOpen(packet)){
|
||||
Double x = packet.getPose(BodyPart.HEAD).getX();
|
||||
packet.setPose(new EulerAngle(x+.32, 0, 0), BodyPart.HEAD);
|
||||
if(!isOpen((fArmorStand) packet)){
|
||||
Double x = ((fArmorStand) packet).getPose(BodyPart.HEAD).getX();
|
||||
((fArmorStand) packet).setPose(new EulerAngle(x+.32, 0, 0), BodyPart.HEAD);
|
||||
}else{
|
||||
stopTimer();
|
||||
return;
|
||||
@ -291,9 +292,9 @@ public class sunshade extends Furniture implements Listener{
|
||||
}
|
||||
|
||||
private void reset(){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(!isOpen(packet)){
|
||||
packet.setPose(new EulerAngle(-3.054, 0, 0), BodyPart.HEAD);
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(!isOpen((fArmorStand) packet)){
|
||||
((fArmorStand) packet).setPose(new EulerAngle(-3.054, 0, 0), BodyPart.HEAD);
|
||||
}
|
||||
}
|
||||
update();
|
||||
@ -312,9 +313,9 @@ public class sunshade extends Furniture implements Listener{
|
||||
}
|
||||
|
||||
private boolean isOpen(){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().startsWith("#ELEMENT#")){
|
||||
if(packet.getPose(BodyPart.HEAD).getX()< -1.85){
|
||||
if(((fArmorStand) packet).getPose(BodyPart.HEAD).getX()< -1.85){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class chair extends Furniture implements Listener{
|
||||
|
||||
@ -110,8 +111,8 @@ public class chair extends Furniture implements Listener{
|
||||
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())){
|
||||
fEntity packet = null;
|
||||
for(fEntity as : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(as.getName().equalsIgnoreCase("#SITZ#")){
|
||||
packet=as;
|
||||
break;
|
||||
|
@ -24,13 +24,14 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.ColorType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class largeTable extends Furniture implements Listener{
|
||||
|
||||
public largeTable(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().startsWith("#TELLER")){
|
||||
tellerIDs.add(packet.getEntityID());
|
||||
}
|
||||
@ -168,7 +169,7 @@ public class largeTable extends Furniture implements Listener{
|
||||
public void setTeller(HashMap<Integer, ItemStack> itemList){
|
||||
int i = 0;
|
||||
for(Integer id : tellerIDs){
|
||||
fArmorStand as = getManager().getfArmorStandByID(id);
|
||||
fEntity as = getManager().getfArmorStandByID(id);
|
||||
as.getInventory().setItemInMainHand(itemList.get(i));
|
||||
i++;
|
||||
}
|
||||
@ -183,10 +184,10 @@ public class largeTable extends Furniture implements Listener{
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
for(Integer id : tellerIDs){
|
||||
fArmorStand asp = getManager().getfArmorStandByID(id);
|
||||
fEntity asp = getManager().getfArmorStandByID(id);
|
||||
if(asp!=null&&asp.getInventory().getItemInMainHand()!=null){
|
||||
if(asp.getName().startsWith("#TELLER")){
|
||||
fArmorStand packet = asp;
|
||||
fEntity packet = asp;
|
||||
e.getLocation().getWorld().dropItem(e.getLocation(), packet.getInventory().getItemInMainHand());
|
||||
}
|
||||
}
|
||||
@ -200,6 +201,7 @@ public class largeTable extends Furniture implements Listener{
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID()==null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
@ -215,11 +217,11 @@ public class largeTable extends Furniture implements Listener{
|
||||
|
||||
public void setTeller(Player player, ItemStack is){
|
||||
BlockFace b = getLutil().yawToFace(player.getLocation().getYaw());
|
||||
fArmorStand as = null;
|
||||
fEntity as = null;
|
||||
if(tellerIDs == null || tellerIDs.isEmpty()){return;}
|
||||
for(Integer id : this.tellerIDs){
|
||||
if(id!=null){
|
||||
fArmorStand armorStand = getManager().getfArmorStandByID(id);
|
||||
fEntity armorStand = getManager().getfArmorStandByID(id);
|
||||
if(armorStand!=null){
|
||||
BlockFace b2 = getLutil().yawToFace(armorStand.getLocation().getYaw());
|
||||
if(b2.equals(b)){
|
||||
@ -232,7 +234,7 @@ public class largeTable extends Furniture implements Listener{
|
||||
|
||||
if(as!=null&&as.getInventory().getItemInMainHand()!= null && as.getInventory().getItemInMainHand().equals(is)){return;}
|
||||
if(as.getInventory().getItemInMainHand()!=null&&!as.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
fArmorStand asp = as;
|
||||
fEntity asp = as;
|
||||
ItemStack item = asp.getInventory().getItemInMainHand();
|
||||
item.setAmount(1);
|
||||
asp.getLocation().getWorld().dropItem(asp.getLocation(), item);
|
||||
@ -256,7 +258,7 @@ public class largeTable extends Furniture implements Listener{
|
||||
HashMap<Integer, ItemStack> teller = new HashMap<Integer, ItemStack>();
|
||||
for(Integer id : tellerIDs){
|
||||
try{
|
||||
fArmorStand as = getManager().getfArmorStandByID(id);
|
||||
fEntity as = getManager().getfArmorStandByID(id);
|
||||
teller.put(teller.size(), as.getInventory().getItemInMainHand());
|
||||
}catch(Exception e){
|
||||
teller.put(teller.size(), new ItemStack(Material.AIR));
|
||||
|
@ -23,6 +23,7 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.ColorType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.EventType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class sofa extends Furniture implements Listener {
|
||||
|
||||
@ -175,7 +176,7 @@ public class sofa extends Furniture implements Listener {
|
||||
}
|
||||
|
||||
private void sit(String s, Player p){
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase(s) && packet.getPassanger() == null){
|
||||
packet.setPassanger(p);
|
||||
packet.update();
|
||||
@ -192,7 +193,7 @@ public class sofa extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!getLib().canBuild(e.getPlayer(), getObjID(), EventType.BREAK)){return;}
|
||||
e.setCancelled(true);
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getPassanger()!=null){
|
||||
packet.eject();
|
||||
packet.update();
|
||||
|
@ -21,6 +21,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class table extends Furniture implements Listener {
|
||||
|
||||
@ -71,7 +72,7 @@ public class table extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||
@ -93,7 +94,7 @@ public class table extends Furniture implements Listener {
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
||||
Itemstack.setAmount(1);
|
||||
|
172
src/de/Ste3et_C0st/Furniture/Objects/light/WaxCandle.java
Normal file
172
src/de/Ste3et_C0st/Furniture/Objects/light/WaxCandle.java
Normal file
@ -0,0 +1,172 @@
|
||||
package de.Ste3et_C0st.Furniture.Objects.light;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
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.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class WaxCandle extends Furniture{
|
||||
|
||||
Block block;
|
||||
fEntity stand;
|
||||
|
||||
public WaxCandle(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
setBlock();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
stand = getObjID().getPacketList().get(0);
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
}
|
||||
|
||||
private void setBlock(){
|
||||
Location center = getLutil().getCenter(getLocation());
|
||||
block = center.getWorld().getBlockAt(center);
|
||||
if(!block.getType().equals(Material.AIR)){getObjID().addBlock(Arrays.asList(block));return;}
|
||||
block.setType(Material.TORCH);
|
||||
getObjID().addBlock(Arrays.asList(block));
|
||||
}
|
||||
|
||||
@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 onFurnitureBlockBreak(FurnitureBlockBreakEvent 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(FurnitureBlockClickEvent 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(e.getPlayer().getInventory().getItemInMainHand()==null) return;
|
||||
if(e.getPlayer().getInventory().getItemInMainHand().getType()==null) return;
|
||||
Player p = e.getPlayer();
|
||||
ItemStack is = p.getInventory().getItemInMainHand();
|
||||
if(is.getType().equals(Material.FLINT_AND_STEEL)){
|
||||
setLight(true);
|
||||
}else if(is.getType().equals(Material.WATER_BUCKET)){
|
||||
setLight(false);
|
||||
}
|
||||
}
|
||||
|
||||
@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(e.getPlayer().getInventory().getItemInMainHand()==null) return;
|
||||
if(e.getPlayer().getInventory().getItemInMainHand().getType()==null) return;
|
||||
Player p = e.getPlayer();
|
||||
ItemStack is = p.getInventory().getItemInMainHand();
|
||||
if(is.getType().equals(Material.FLINT_AND_STEEL)){
|
||||
setLight(true);
|
||||
}else if(is.getType().equals(Material.WATER_BUCKET)){
|
||||
setLight(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void setLight(final boolean bool){
|
||||
if(bool){block.setType(Material.TORCH);}
|
||||
else{block.setType(Material.REDSTONE_TORCH_OFF);}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWaterFlow(BlockFromToEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
Location locTo = e.getToBlock().getLocation();
|
||||
if(getLocation()!=null && locTo.equals(getLocation().getBlock().getLocation())){
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void spawn(Location loc) {
|
||||
setBlock();
|
||||
stand = spawnArmorStand(getCenter().subtract(0, 2, 0));
|
||||
stand.setHelmet(getSkull()).setInvisible(true);
|
||||
send();
|
||||
}
|
||||
|
||||
private String generateSessionKey(int length){
|
||||
String alphabet = new String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
|
||||
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",
|
||||
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzgxMjI2NjU2ZDgyNTI5MWIxZDdlNDU2Yjc0ZWNkY2UyODY3MjE2OTY0MWU2YzM1YjFlMjNiOWI0MDI3NGUifX19"
|
||||
);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
@ -20,6 +20,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class barrels extends Furniture implements Listener {
|
||||
Integer id;
|
||||
@ -56,7 +57,7 @@ public class barrels extends Furniture implements Listener {
|
||||
e.setCancelled(true);
|
||||
Player p = e.getPlayer();
|
||||
if(!p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
fEntity packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getHelmet();
|
||||
is.setAmount(1);
|
||||
@ -82,7 +83,7 @@ public class barrels extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
fEntity packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getHelmet();
|
||||
is.setAmount(1);
|
||||
@ -102,7 +103,7 @@ public class barrels extends Furniture implements Listener {
|
||||
e.setCancelled(true);
|
||||
ItemStack Itemstack = e.getPlayer().getInventory().getItemInMainHand().clone();
|
||||
Itemstack.setAmount(1);
|
||||
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
fEntity packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
|
||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getHelmet();
|
||||
@ -129,7 +130,7 @@ public class barrels extends Furniture implements Listener {
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
fEntity packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||
ItemStack is = packet.getInventory().getHelmet();
|
||||
is.setAmount(1);
|
||||
|
@ -15,7 +15,7 @@ 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;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class campfire_1 extends Furniture implements Listener{
|
||||
|
||||
@ -30,12 +30,13 @@ public class campfire_1 extends Furniture implements Listener{
|
||||
|
||||
@EventHandler
|
||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||
if(getObjID()==null){return;}
|
||||
if(getObjID()==null||e.getID()==null){return;}
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(e.getID()==null) return;
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
packet.setFire(false);
|
||||
Location location = getLocation().clone();
|
||||
location.add(0, 1.2, 0);
|
||||
@ -54,10 +55,10 @@ public class campfire_1 extends Furniture implements Listener{
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||
if(is.getType().equals(Material.WATER_BUCKET)){
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
packet.setFire(false);
|
||||
Location location = getLocation().clone();
|
||||
location.add(0, 1.2, 0);
|
||||
@ -65,7 +66,7 @@ public class campfire_1 extends Furniture implements Listener{
|
||||
}
|
||||
getManager().updateFurniture(getObjID());
|
||||
}else if(is.getType().equals(Material.FLINT_AND_STEEL)){
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
packet.setFire(true);
|
||||
Location location = getLocation().clone();
|
||||
location.add(0, 1.2, 0);
|
||||
|
@ -12,6 +12,7 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import de.Ste3et_C0st.Furniture.Main.main;
|
||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||
@ -21,6 +22,7 @@ import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class campfire_2 extends Furniture implements Listener{
|
||||
List<Material> items = new ArrayList<Material>(
|
||||
@ -155,12 +157,15 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
if(!e.canBuild()){return;}
|
||||
e.setCancelled(true);
|
||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
final ItemStack itemStack = e.getPlayer().getInventory().getItemInMainHand();
|
||||
fArmorStand packet = null;
|
||||
for(fArmorStand pack : aspList){
|
||||
if(pack.isSmall() && pack.isVisible()){
|
||||
packet = pack;
|
||||
for(fEntity pack : aspList){
|
||||
if(pack instanceof fArmorStand){
|
||||
fArmorStand stand = (fArmorStand) pack;
|
||||
if(stand.isSmall() && pack.isInvisible()){
|
||||
packet = stand;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(itemStack.getType().equals(Material.WATER_BUCKET) && packet.isFire()){
|
||||
@ -184,19 +189,22 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
}
|
||||
|
||||
private void setfire(boolean b){
|
||||
for(fArmorStand pack : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(pack.isSmall() && pack.isVisible()){
|
||||
if((pack.getInventory().getHelmet() == null || pack.getInventory().getHelmet().getType().equals(Material.AIR)) &&
|
||||
(pack.getInventory().getItemInMainHand() == null || pack.getInventory().getItemInMainHand().getType().equals(Material.AIR))){
|
||||
pack.setFire(b);
|
||||
Location loc = middle.clone();
|
||||
loc.add(0, 1.3, 0);
|
||||
if(b) getLib().getLightManager().addLight(loc, 15);
|
||||
if(!b) getLib().getLightManager().removeLight(loc);
|
||||
getManager().updateFurniture(getObjID());
|
||||
return;
|
||||
}
|
||||
for(fEntity pack : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(pack instanceof fArmorStand){
|
||||
fArmorStand stand = (fArmorStand) pack;
|
||||
if(stand.isSmall() && pack.isInvisible()){
|
||||
if((pack.getInventory().getHelmet() == null || pack.getInventory().getHelmet().getType().equals(Material.AIR)) &&
|
||||
(pack.getInventory().getItemInMainHand() == null || pack.getInventory().getItemInMainHand().getType().equals(Material.AIR))){
|
||||
pack.setFire(b);
|
||||
Location loc = middle.clone();
|
||||
loc.add(0, 1.3, 0);
|
||||
if(b) getLib().getLightManager().addLight(loc, 15);
|
||||
if(!b) getLib().getLightManager().removeLight(loc);
|
||||
getManager().updateFurniture(getObjID());
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -212,7 +220,7 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
if(isRunning()){
|
||||
Bukkit.getScheduler().cancelTask(timer);
|
||||
timer=null;
|
||||
getWorld().dropItem(middle.clone().add(0, .5, 0), is);
|
||||
getWorld().dropItemNaturally(middle.clone().add(0, 1, 0), is).setVelocity(new Vector().zero());
|
||||
}
|
||||
setfire(false);
|
||||
e.remove();
|
||||
@ -224,18 +232,21 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
Bukkit.getScheduler().cancelTask(timer);
|
||||
timer=null;
|
||||
if(armorS!=null&&armorS.getInventory().getItemInMainHand()!=null&&getItem(armorS.getInventory().getItemInMainHand())!=null){
|
||||
getWorld().dropItem(middle.clone().add(0, .5, 0), getCooked(is));
|
||||
getWorld().dropItemNaturally(middle.clone().add(0, 1, 0), getCooked(is)).setVelocity(new Vector().zero());
|
||||
getObjID().getPacketList().remove(this.armorS);
|
||||
armorS.kill();
|
||||
armorS.delete();
|
||||
armorS=null;
|
||||
}
|
||||
}
|
||||
if(armorS!=null){
|
||||
if(armorS.getInventory().getItemInMainHand()!=null){getWorld().dropItem(middle.clone().add(0, .5, 0), getCooked(is));}
|
||||
if(armorS.getInventory().getItemInMainHand()!=null){getWorld().dropItemNaturally(middle.clone().add(0, 1, 0), getCooked(is)).setVelocity(new Vector().zero());}
|
||||
getObjID().getPacketList().remove(this.armorS);
|
||||
armorS.kill();
|
||||
armorS.delete();
|
||||
armorS=null;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
public ItemStack getItem(ItemStack is){
|
||||
@ -265,7 +276,8 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
this.armorS = getManager().createArmorStand(getObjID(), grill);
|
||||
this.armorS.setInvisible(true);
|
||||
this.armorS.getInventory().setItemInMainHand(is);
|
||||
getManager().send(getObjID());
|
||||
getObjID().getPlayerList().clear();
|
||||
send();
|
||||
this.timer = main.getInstance().getServer().getScheduler().scheduleSyncRepeatingTask(main.getInstance(), new Runnable() {
|
||||
Integer rounds = getLutil().randInt(15, 30);
|
||||
Integer labs = 0;
|
||||
@ -276,7 +288,7 @@ public class campfire_2 extends Furniture implements Listener{
|
||||
if(position>3){position=0;}
|
||||
if(armorS!=null){
|
||||
armorS.setPose(angle[position], BodyPart.RIGHT_ARM);
|
||||
armorS.update();
|
||||
update();
|
||||
}
|
||||
position++;
|
||||
labs++;
|
||||
|
@ -28,6 +28,7 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.EventType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class hammock extends Furniture implements Listener{
|
||||
|
||||
@ -103,7 +104,7 @@ public class hammock extends Furniture implements Listener{
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
Player p = e.getPlayer();
|
||||
ItemStack stack = p.getInventory().getItemInMainHand();
|
||||
|
||||
@ -113,7 +114,7 @@ public class hammock extends Furniture implements Listener{
|
||||
}
|
||||
}
|
||||
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||
if(packet.getPassanger()==null){
|
||||
packet.setPassanger(e.getPlayer());
|
||||
@ -139,7 +140,7 @@ public class hammock extends Furniture implements Listener{
|
||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||
if(e.isCancelled()){return;}
|
||||
if(!e.getID().equals(getObjID())){return;}
|
||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||
Player p = e.getPlayer();
|
||||
ItemStack stack = p.getInventory().getItemInMainHand();
|
||||
if(stack!=null){
|
||||
@ -148,7 +149,7 @@ public class hammock extends Furniture implements Listener{
|
||||
}
|
||||
}
|
||||
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||
if(packet.getPassanger()==null){
|
||||
packet.setPassanger(e.getPlayer());
|
||||
@ -158,12 +159,12 @@ public class hammock extends Furniture implements Listener{
|
||||
}
|
||||
}
|
||||
|
||||
private boolean setColor(Player p,ItemStack stack, Boolean canbuild, List<fArmorStand> aspList){
|
||||
private boolean setColor(Player p,ItemStack stack, Boolean canbuild, List<fEntity> aspList){
|
||||
if(!canbuild){return true;}
|
||||
if(stack!=null){
|
||||
switch (stack.getType()) {
|
||||
case BANNER:
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
||||
packet.getInventory().setHelmet(stack);
|
||||
}
|
||||
@ -172,7 +173,7 @@ public class hammock extends Furniture implements Listener{
|
||||
getManager().updateFurniture(getObjID());
|
||||
return true;
|
||||
case LOG:
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
if(packet.getName().equalsIgnoreCase("#PILLAR#")){
|
||||
packet.getInventory().setHelmet(stack);
|
||||
}
|
||||
@ -182,7 +183,7 @@ public class hammock extends Furniture implements Listener{
|
||||
getManager().updateFurniture(getObjID());
|
||||
return true;
|
||||
case LOG_2:
|
||||
for(fArmorStand packet : aspList){
|
||||
for(fEntity packet : aspList){
|
||||
if(packet.getName().equalsIgnoreCase("#PILLAR#")){
|
||||
packet.getInventory().setHelmet(stack);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.ColorType;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class tent_3 extends Furniture implements Listener{
|
||||
public tent_3(ObjectID id){
|
||||
@ -177,7 +178,7 @@ public class tent_3 extends Furniture implements Listener{
|
||||
if(p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
|
||||
getLib().getColorManager().color(p, e.canBuild(), Material.BANNER, getObjID(), ColorType.BANNER, 1);
|
||||
}else{
|
||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||
packet.setPassanger(p);
|
||||
packet.update();
|
||||
|
@ -20,8 +20,8 @@ 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.Relative;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||
|
||||
public class BearTrap extends Furniture implements Listener{
|
||||
|
||||
@ -31,19 +31,23 @@ public class BearTrap extends Furniture implements Listener{
|
||||
public BearTrap(ObjectID id){
|
||||
super(id);
|
||||
if(isFinish()){
|
||||
for(fArmorStand stand : getfAsList()){
|
||||
for(fEntity stand : getfAsList()){
|
||||
if(stand.getName().equalsIgnoreCase("#IRON1#")){
|
||||
stand1 = stand;
|
||||
stand1 = (fArmorStand) stand;
|
||||
}else if(stand.getName().equalsIgnoreCase("#IRON2#")){
|
||||
stand2 = stand;
|
||||
stand2 = (fArmorStand) stand;
|
||||
}else if(stand.getName().equalsIgnoreCase("#IRON3#")){
|
||||
stand2 = stand;
|
||||
stand3 = (fArmorStand) stand;
|
||||
}else if(stand.getName().equalsIgnoreCase("#IRON4#")){
|
||||
stand2 = stand;
|
||||
stand4 = (fArmorStand) stand;
|
||||
}
|
||||
}
|
||||
setStatus(false);
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
if(stand1==null) return;
|
||||
if(stand2==null) return;
|
||||
if(stand3==null) return;
|
||||
if(stand4==null) return;
|
||||
setStatus(false);
|
||||
return;
|
||||
}
|
||||
spawn(id.getStartLocation());
|
||||
@ -59,7 +63,7 @@ public class BearTrap extends Furniture implements Listener{
|
||||
double offset = .35;
|
||||
Location location = getRelative(getCenter(), 0, .04+offset).add(0, -2.1, 0);
|
||||
location.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(location);
|
||||
stand = spawnArmorStand(location.clone());
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
|
||||
stand.setHelmet(new ItemStack(Material.IRON_FENCE));
|
||||
stand.setName("#IRON1#");
|
||||
@ -68,7 +72,7 @@ public class BearTrap extends Furniture implements Listener{
|
||||
|
||||
location = getRelative(getCenter(), 0, -.04-offset).add(0, -2.1, 0);
|
||||
location.setYaw(getYaw()-90);
|
||||
stand = spawnArmorStand(location);
|
||||
stand = spawnArmorStand(location.clone());
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
|
||||
stand.setHelmet(new ItemStack(Material.IRON_FENCE));
|
||||
stand.setName("#IRON2#");
|
||||
@ -78,7 +82,7 @@ public class BearTrap extends Furniture implements Listener{
|
||||
|
||||
location = getRelative(getCenter(), 0, .04+offset).add(0, -2.25, 0);
|
||||
location.setYaw(getYaw()+90);
|
||||
stand = spawnArmorStand(location);
|
||||
stand = spawnArmorStand(location.clone());
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
|
||||
stand.setName("#IRON3#");
|
||||
stand3 = stand;
|
||||
@ -86,16 +90,11 @@ public class BearTrap extends Furniture implements Listener{
|
||||
|
||||
location = getRelative(getCenter(), 0, -.04-offset).add(0, -2.25, 0);
|
||||
location.setYaw(getYaw()-90);
|
||||
stand = spawnArmorStand(location);
|
||||
stand = spawnArmorStand(location.clone());
|
||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
|
||||
stand.setName("#IRON4#");
|
||||
stand4 = stand;
|
||||
asList.add(stand);
|
||||
|
||||
fArmorStand testStand = stand.clone(new Relative(getCenter(), 0, 2, 0, getBlockFace()));
|
||||
testStand.setGlowing(true);
|
||||
asList.add(testStand);
|
||||
|
||||
for(fArmorStand packet : asList){
|
||||
packet.setInvisible(true);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: DiceFurniture
|
||||
version: 2.6.6
|
||||
version: 2.9.2
|
||||
description: Add some new Objects to the Server
|
||||
author: Ste3et_C0st
|
||||
website: http://dicecraft.de
|
||||
|
1
target/.gitignore
vendored
Normal file
1
target/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/classes/
|
Loading…
Reference in New Issue
Block a user