mirror of
https://github.com/Ste3et/furniture.git
synced 2024-11-22 10:36:12 +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="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/FurnitureLib.jar"/>
|
||||||
<classpathentry kind="lib" path="C:/Plugins/jars/PostalService-1.0.6.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="lib" path="C:/Plugins/jars/spigot.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</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>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</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>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<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:
|
AdventCalender:
|
||||||
|
system-ID: 'AdventCalender'
|
||||||
name: '&cAdventCalender'
|
name: '&cAdventCalender'
|
||||||
material: 383
|
material: 383
|
||||||
glow: true
|
glow: true
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
AdventWreath:
|
AdventWreath:
|
||||||
|
system-ID: 'AdventWreath'
|
||||||
name: '&cAdventWreath'
|
name: '&cAdventWreath'
|
||||||
material: 383
|
material: 383
|
||||||
glow: true
|
glow: true
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Barrels:
|
Barrels:
|
||||||
|
systemID: 'Barrels'
|
||||||
name: '&cBarrels'
|
name: '&cBarrels'
|
||||||
material: 383
|
material: 383
|
||||||
glow: true
|
glow: true
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
BearTrap:
|
BearTrap:
|
||||||
|
system-ID: 'BearTrap'
|
||||||
name: '&cBearTrap'
|
name: '&cBearTrap'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Billboard:
|
Billboard:
|
||||||
|
system-ID: 'Billboard'
|
||||||
name: '&cBillboard'
|
name: '&cBillboard'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
BlackBoard:
|
BlackBoard:
|
||||||
|
system-Name: 'BlackBoard'
|
||||||
name: '&cBlackBoard'
|
name: '&cBlackBoard'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
CactusPlant:
|
CactusPlant:
|
||||||
|
system-ID: 'CactusPlant'
|
||||||
name: '&cCactusPlant'
|
name: '&cCactusPlant'
|
||||||
material: 383
|
material: 383
|
||||||
glow: true
|
glow: true
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Camera:
|
Camera:
|
||||||
|
system-ID: 'Camera'
|
||||||
name: '&cCamera'
|
name: '&cCamera'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
CampChair:
|
CampChair:
|
||||||
|
system-ID: 'CampChair'
|
||||||
name: '&cCampChair'
|
name: '&cCampChair'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Campfire1:
|
Campfire1:
|
||||||
|
system-ID: 'Campfire1'
|
||||||
name: '&cCampfire #1'
|
name: '&cCampfire #1'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Campfire2:
|
Campfire2:
|
||||||
|
system-ID: 'Campfire2'
|
||||||
name: '&cCampfire #2'
|
name: '&cCampfire #2'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
CandyCane:
|
CandyCane:
|
||||||
|
system-ID: 'CandyCane'
|
||||||
name: '&cCandyCane'
|
name: '&cCandyCane'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Catapult:
|
Catapult:
|
||||||
|
system-ID: 'Catapult'
|
||||||
name: '&cCatapult'
|
name: '&cCatapult'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Chair:
|
Chair:
|
||||||
|
system-ID: 'Chair'
|
||||||
name: '&cChair'
|
name: '&cChair'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
ChristmasTree:
|
ChristmasTree:
|
||||||
|
system-ID: 'ChristmasTree'
|
||||||
name: '&cChristmasTree'
|
name: '&cChristmasTree'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Crossbow:
|
Crossbow:
|
||||||
|
system-ID: 'Crossbow'
|
||||||
name: '&cCrossbow'
|
name: '&cCrossbow'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
FireworkLauncher:
|
FireworkLauncher:
|
||||||
|
system-ID: 'FireworkLauncher'
|
||||||
name: '&cFireworkLauncher'
|
name: '&cFireworkLauncher'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
FlowerPot:
|
FlowerPot:
|
||||||
|
system-ID: 'FlowerPot'
|
||||||
name: '&cFlowerPot'
|
name: '&cFlowerPot'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
GraveStone:
|
GraveStone:
|
||||||
|
system-ID: 'GraveStone'
|
||||||
name: '&cGrave Stone'
|
name: '&cGrave Stone'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Hammock:
|
Hammock:
|
||||||
|
system-ID: 'Hammock'
|
||||||
name: '&cHammock'
|
name: '&cHammock'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
HumanSkeleton:
|
HumanSkeleton:
|
||||||
|
system-ID: 'HumanSkeleton'
|
||||||
name: '&cHumanSkeleton'
|
name: '&cHumanSkeleton'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Lantern:
|
Lantern:
|
||||||
|
system-ID: 'Lantern'
|
||||||
name: '&cLantern'
|
name: '&cLantern'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
LargeTable:
|
LargeTable:
|
||||||
|
system-ID: 'LargeTable'
|
||||||
name: '&cLarge Table'
|
name: '&cLarge Table'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Mailbox:
|
MailBox:
|
||||||
|
system-ID: 'MailBox'
|
||||||
name: '&cMailBox'
|
name: '&cMailBox'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SchoolChair:
|
SchoolChair:
|
||||||
|
system-ID: 'SchoolChair'
|
||||||
name: '&cSchoolChair'
|
name: '&cSchoolChair'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SchoolTable:
|
SchoolTable:
|
||||||
|
system-ID: 'SchoolTable'
|
||||||
name: '&cSchoolTable'
|
name: '&cSchoolTable'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SleepingBag:
|
SleepingBag:
|
||||||
|
system-ID: 'SleepingBag'
|
||||||
name: '&cSleepingBag'
|
name: '&cSleepingBag'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SnowGolem:
|
SnowGolem:
|
||||||
|
system-ID: 'SnowGolem'
|
||||||
name: '&cSnowGolem'
|
name: '&cSnowGolem'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Sofa:
|
Sofa:
|
||||||
|
system-ID: 'Sofa'
|
||||||
name: '&cSofa'
|
name: '&cSofa'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Streetlamp:
|
Streetlamp:
|
||||||
|
system-ID: 'Streetlamp'
|
||||||
name: '&cStreetlamp'
|
name: '&cStreetlamp'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Sunshade:
|
Sunshade:
|
||||||
|
system-ID: 'Sunshade'
|
||||||
name: '&cSunshade'
|
name: '&cSunshade'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
TV:
|
TV:
|
||||||
|
system-ID: 'TV'
|
||||||
name: '&cTV'
|
name: '&cTV'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Table:
|
Table:
|
||||||
|
system-ID: 'Table'
|
||||||
name: '&cTable'
|
name: '&cTable'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Tent1:
|
Tent1:
|
||||||
|
system-ID: 'Tent1'
|
||||||
name: '&cTent #1'
|
name: '&cTent #1'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Tent2:
|
Tent2:
|
||||||
|
system-ID: 'Tent2'
|
||||||
name: '&cTent #2'
|
name: '&cTent #2'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Tent3:
|
Tent3:
|
||||||
|
system-ID: 'Tent3'
|
||||||
name: '&cTent #3'
|
name: '&cTent #3'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
TrashCan:
|
TrashCan:
|
||||||
|
system-ID: 'TrashCan'
|
||||||
name: '&cTrashCan'
|
name: '&cTrashCan'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Trunk:
|
Trunk:
|
||||||
|
system-ID: 'Trunk'
|
||||||
name: '&cTrunk'
|
name: '&cTrunk'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
WaterBottle:
|
WaterBottle:
|
||||||
|
system-ID: 'WaterBottle'
|
||||||
name: '&cWaterBottle'
|
name: '&cWaterBottle'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
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:
|
WeaponStand:
|
||||||
|
system-ID: 'WeaponStand'
|
||||||
name: '&cWeaponStand'
|
name: '&cWeaponStand'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Fence:
|
Fence:
|
||||||
|
system-ID: 'Fence'
|
||||||
name: '&cFence'
|
name: '&cFence'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Flag:
|
Flag:
|
||||||
|
system-ID: 'Flag'
|
||||||
name: '&cFlag'
|
name: '&cFlag'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Guillotine:
|
Guillotine:
|
||||||
|
system-ID: 'Guillotine'
|
||||||
name: '&cGuillotine'
|
name: '&cGuillotine'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
glow: false
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
Log:
|
Log:
|
||||||
|
system-ID: 'Log'
|
||||||
name: '&cLog'
|
name: '&cLog'
|
||||||
material: 383
|
material: 383
|
||||||
glow: false
|
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.SchoolTable;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.School.TrashCan;
|
import de.Ste3et_C0st.Furniture.Objects.School.TrashCan;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.christmas.AdventCalender;
|
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.CandyCane;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.christmas.ChristmasTree;
|
import de.Ste3et_C0st.Furniture.Objects.christmas.ChristmasTree;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.christmas.FireworkLauncher;
|
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.SleepingBag;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.garden.TFlowerPot;
|
import de.Ste3et_C0st.Furniture.Objects.garden.TFlowerPot;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.garden.Trunk;
|
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.campchair;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.garden.fance;
|
import de.Ste3et_C0st.Furniture.Objects.garden.fance;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.garden.graveStone;
|
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.largeTable;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.indoor.sofa;
|
import de.Ste3et_C0st.Furniture.Objects.indoor.sofa;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.indoor.table;
|
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.CactusPlant;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.barrels;
|
import de.Ste3et_C0st.Furniture.Objects.outdoor.barrels;
|
||||||
import de.Ste3et_C0st.Furniture.Objects.outdoor.campfire_1;
|
import de.Ste3et_C0st.Furniture.Objects.outdoor.campfire_1;
|
||||||
@ -74,55 +73,59 @@ public class main extends JavaPlugin{
|
|||||||
instance = this;
|
instance = this;
|
||||||
lib = (FurnitureLib) Bukkit.getPluginManager().getPlugin("FurnitureLib");
|
lib = (FurnitureLib) Bukkit.getPluginManager().getPlugin("FurnitureLib");
|
||||||
util = lib.getLocationUtil();
|
util = lib.getLocationUtil();
|
||||||
new Project("Camera", this,getResource("Crafting/Camera.yml"),PlaceableSide.TOP, camera.class).setSize(1, 1, 1, CenterType.RIGHT);
|
if(lib.getDescription().getVersion().startsWith("1.7") || lib.getDescription().getVersion().startsWith("1.6")){
|
||||||
new Project("TV", this,getResource("Crafting/TV.yml"),PlaceableSide.TOP, tv.class).setSize(1, 2, 3, CenterType.CENTER);
|
new Project("Camera", this,getResource("Crafting/Camera.yml"),PlaceableSide.TOP, camera.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("GraveStone", this,getResource("Crafting/GraveStone.yml"),PlaceableSide.TOP, graveStone.class).setSize(1, 2, 3, CenterType.CENTER);
|
new Project("TV", this,getResource("Crafting/TV.yml"),PlaceableSide.TOP, tv.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("GraveStone", this,getResource("Crafting/GraveStone.yml"),PlaceableSide.TOP, graveStone.class).setSize(1, 2, 3, CenterType.CENTER);
|
||||||
new Project("LargeTable", this,getResource("Crafting/LargeTable.yml"),PlaceableSide.TOP, largeTable.class).setSize(2, 1, 2, CenterType.RIGHT);
|
new Project("Chair", this,getResource("Crafting/Chair.yml"),PlaceableSide.TOP, chair.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Lantern", this,getResource("Crafting/Lantern.yml"),PlaceableSide.TOP, lantern.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("LargeTable", this,getResource("Crafting/LargeTable.yml"),PlaceableSide.TOP, largeTable.class).setSize(2, 1, 2, CenterType.RIGHT);
|
||||||
new Project("Sofa", this,getResource("Crafting/Sofa.yml"),PlaceableSide.TOP, sofa.class).setSize(1, 1, 3, CenterType.RIGHT);
|
new Project("Lantern", this,getResource("Crafting/Lantern.yml"),PlaceableSide.TOP, lantern.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Table", this,getResource("Crafting/Table.yml"),PlaceableSide.TOP, table.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Sofa", this,getResource("Crafting/Sofa.yml"),PlaceableSide.TOP, sofa.class).setSize(1, 1, 3, CenterType.RIGHT);
|
||||||
new Project("Barrels", this,getResource("Crafting/Barrels.yml"),PlaceableSide.TOP, barrels.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Table", this,getResource("Crafting/Table.yml"),PlaceableSide.TOP, table.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Campfire1", this,getResource("Crafting/Campfire1.yml"),PlaceableSide.TOP, campfire_1.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("Campfire2", this,getResource("Crafting/Campfire2.yml"),PlaceableSide.TOP, campfire_2.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("Tent1", this,getResource("Crafting/Tent1.yml"),PlaceableSide.TOP, tent_1.class).setSize(4, 3, 5, CenterType.RIGHT);
|
new Project("Campfire2", this,getResource("Crafting/Campfire2.yml"),PlaceableSide.TOP, campfire_2.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Tent2", this,getResource("Crafting/Tent2.yml"),PlaceableSide.TOP, tent_2.class).setSize(4, 3, 5, CenterType.RIGHT);
|
new Project("Tent1", this,getResource("Crafting/Tent1.yml"),PlaceableSide.TOP, tent_1.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("Tent2", this,getResource("Crafting/Tent2.yml"),PlaceableSide.TOP, tent_2.class).setSize(4, 3, 5, CenterType.RIGHT);
|
||||||
new Project("Fence", this, getResource("Crafting/fence.yml"),PlaceableSide.TOP, fance.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Tent3", this,getResource("Crafting/Tent3.yml"),PlaceableSide.TOP, tent_3.class).setSize(3, 2, 3, CenterType.CENTER);
|
||||||
new Project("Sunshade", this, getResource("Crafting/Sunshade.yml"),PlaceableSide.TOP, sunshade.class).setSize(1, 3, 1, CenterType.RIGHT);
|
new Project("Fence", this, getResource("Crafting/fence.yml"),PlaceableSide.TOP, fance.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Streetlamp", this, getResource("Crafting/Streetlamp.yml"),PlaceableSide.TOP, streetlamp.class).setSize(2, 4, 1, CenterType.FRONT);
|
new Project("Sunshade", this, getResource("Crafting/Sunshade.yml"),PlaceableSide.TOP, sunshade.class).setSize(1, 3, 1, CenterType.RIGHT);
|
||||||
new Project("Billboard", this, getResource("Crafting/Billboard.yml"),PlaceableSide.TOP, billboard.class).setSize(1, 3, 3, CenterType.RIGHT);
|
new Project("Streetlamp", this, getResource("Crafting/Streetlamp.yml"),PlaceableSide.TOP, streetlamp.class).setSize(2, 4, 1, CenterType.FRONT);
|
||||||
new Project("Mailbox", this, getResource("Crafting/Mailbox.yml"),PlaceableSide.TOP, mailBox.class).setSize(1, 2, 1, CenterType.RIGHT);
|
new Project("Billboard", this, getResource("Crafting/Billboard.yml"),PlaceableSide.TOP, billboard.class).setSize(1, 3, 3, CenterType.RIGHT);
|
||||||
new Project("WeaponStand", this, getResource("Crafting/WeaponStand.yml"),PlaceableSide.TOP, weaponStand.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Mailbox", this, getResource("Crafting/Mailbox.yml"),PlaceableSide.TOP, mailBox.class).setSize(1, 2, 1, CenterType.RIGHT);
|
||||||
new Project("Hammock", this, getResource("Crafting/Hammock.yml"),PlaceableSide.TOP, hammock.class).setSize(1, 2, 7, CenterType.RIGHT);
|
new Project("WeaponStand", this, getResource("Crafting/WeaponStand.yml"),PlaceableSide.TOP, weaponStand.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("CampChair", this, getResource("Crafting/CampChair.yml"),PlaceableSide.TOP, campchair.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Hammock", this, getResource("Crafting/Hammock.yml"),PlaceableSide.TOP, hammock.class).setSize(1, 2, 7, CenterType.RIGHT);
|
||||||
new Project("CactusPlant", this, getResource("Crafting/CactusPlant.yml"),PlaceableSide.TOP, CactusPlant.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("CampChair", this, getResource("Crafting/CampChair.yml"),PlaceableSide.TOP, campchair.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Guillotine", this, getResource("Crafting/guillotine.yml"),PlaceableSide.TOP, guillotine.class).setSize(1, 5, 2, CenterType.RIGHT);
|
new Project("CactusPlant", this, getResource("Crafting/CactusPlant.yml"),PlaceableSide.TOP, CactusPlant.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Log", this, getResource("Crafting/log.yml"), PlaceableSide.TOP, log.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Guillotine", this, getResource("Crafting/guillotine.yml"),PlaceableSide.TOP, guillotine.class).setSize(1, 5, 2, CenterType.RIGHT);
|
||||||
new Project("FlowerPot", this, getResource("Crafting/FlowerPot.yml"),PlaceableSide.BOTTOM, TFlowerPot.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("Log", this, getResource("Crafting/log.yml"), PlaceableSide.TOP, log.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("WaterBottle", this, getResource("Crafting/WaterBottle.yml"), PlaceableSide.WATER, WaterBottle.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("SleepingBag", this, getResource("Crafting/SleepingBag.yml"), PlaceableSide.TOP, SleepingBag.class).setSize(1, 1, 2, CenterType.RIGHT);
|
||||||
new Project("BearTrap", this, getResource("Crafting/BearTrap.yml"), PlaceableSide.TOP, BearTrap.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("BearTrap", this, getResource("Crafting/BearTrap.yml"), PlaceableSide.TOP, BearTrap.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("Trunk", this, getResource("Crafting/Trunk.yml"), PlaceableSide.TOP, Trunk.class).setSize(1, 1, 4, CenterType.RIGHT);
|
new Project("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("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("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("BlackBoard", this, getResource("Crafting/BlackBoard.yml"), PlaceableSide.SIDE, BlackBoard.class).setSize(1, 2, 3, CenterType.RIGHT);
|
||||||
new Project("TrashCan", this, getResource("Crafting/TrashCan.yml"), PlaceableSide.TOP, TrashCan.class).setSize(1, 1, 1, CenterType.RIGHT);
|
new Project("TrashCan", this, getResource("Crafting/TrashCan.yml"), PlaceableSide.TOP, TrashCan.class).setSize(1, 1, 1, CenterType.RIGHT);
|
||||||
new Project("HumanSkeleton", this, getResource("Crafting/HumanSkeleton.yml"), PlaceableSide.TOP, HumanSkeleton.class).setSize(3, 1, 2, CenterType.RIGHT);
|
new Project("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("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("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("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("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("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("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("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("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("fence", "whiteList", "config.yml");
|
||||||
addDefault("bearTrap", "damage", "damage.yml");
|
addDefault("bearTrap", "damage", "damage.yml");
|
||||||
setDefaults();
|
setDefaults();
|
||||||
setDefaults_2();
|
setDefaults_2();
|
||||||
lib.registerPluginFurnitures(this);
|
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")
|
@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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class Crossbow extends Furniture implements Listener {
|
public class Crossbow extends Furniture implements Listener {
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ public class Crossbow extends Furniture implements Listener {
|
|||||||
if(e.isCancelled()) return;
|
if(e.isCancelled()) return;
|
||||||
if(!e.getID().equals(getObjID())) return;
|
if(!e.getID().equals(getObjID())) return;
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
fArmorStand stand = getArmorStand();
|
fEntity stand = getArmorStand();
|
||||||
if(stand==null){return;}
|
if(stand==null){return;}
|
||||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
if(!hasArrow()||(is!=null&&is.getType()!=null&&is.getType().equals(Material.ARROW))){
|
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.isCancelled()) return;
|
||||||
if(!e.getID().equals(getObjID())) return;
|
if(!e.getID().equals(getObjID())) return;
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
fArmorStand stand = getArmorStand();
|
fEntity stand = getArmorStand();
|
||||||
if(stand==null){return;}
|
if(stand==null){return;}
|
||||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
if(!hasArrow()||(is!=null&&is.getType()!=null&&is.getType().equals(Material.ARROW))){
|
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;
|
return entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeArrow(fArmorStand stand){
|
private void removeArrow(fEntity stand){
|
||||||
ItemStack is = stand.getItemInMainHand();
|
ItemStack is = stand.getItemInMainHand();
|
||||||
if(is.getAmount()-1<=0){
|
if(is.getAmount()-1<=0){
|
||||||
stand.setItemInMainHand(new ItemStack(Material.AIR));
|
stand.setItemInMainHand(new ItemStack(Material.AIR));
|
||||||
@ -210,7 +211,7 @@ public class Crossbow extends Furniture implements Listener {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addArmor(ItemStack is, fArmorStand stand){
|
private void addArmor(ItemStack is, fEntity stand){
|
||||||
if(getArrow()!=null){is.setAmount(getArrow().getAmount());}
|
if(getArrow()!=null){is.setAmount(getArrow().getAmount());}
|
||||||
stand.setItemInMainHand(is);
|
stand.setItemInMainHand(is);
|
||||||
update();
|
update();
|
||||||
@ -218,8 +219,8 @@ public class Crossbow extends Furniture implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fArmorStand getArmorStand(){
|
private fEntity getArmorStand(){
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
||||||
return stand;
|
return stand;
|
||||||
}
|
}
|
||||||
@ -228,7 +229,7 @@ public class Crossbow extends Furniture implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack getArrow(){
|
private ItemStack getArrow(){
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
||||||
if(!(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR))){
|
if(!(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR))){
|
||||||
return stand.getItemInMainHand();
|
return stand.getItemInMainHand();
|
||||||
@ -239,7 +240,7 @@ public class Crossbow extends Furniture implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasArrow(){
|
private boolean hasArrow(){
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
if(stand.getName().equalsIgnoreCase("#ARROW#")){
|
||||||
if(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR)){
|
if(stand.getItemInMainHand()==null||stand.getItemInMainHand().getType()==null||stand.getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
return false;
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class flag extends Furniture implements Listener {
|
public class flag extends Furniture implements Listener {
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ public class flag extends Furniture implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getState(){
|
public int getState(){
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().startsWith("#FLAG")){
|
if(stand.getName().startsWith("#FLAG")){
|
||||||
return Integer.parseInt(stand.getName().split(":")[1]);
|
return Integer.parseInt(stand.getName().split(":")[1]);
|
||||||
}
|
}
|
||||||
@ -91,8 +92,8 @@ public class flag extends Furniture implements Listener {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public fArmorStand getStand(){
|
public fEntity getStand(){
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().startsWith("#FLAG")){
|
if(stand.getName().startsWith("#FLAG")){
|
||||||
return stand;
|
return stand;
|
||||||
}
|
}
|
||||||
@ -100,7 +101,7 @@ public class flag extends Furniture implements Listener {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setState(int i, fArmorStand stand){
|
public void setState(int i, fEntity stand){
|
||||||
if(i<1||i>3){return;}
|
if(i<1||i>3){return;}
|
||||||
if(stand==null){return;}
|
if(stand==null){return;}
|
||||||
switch (i) {
|
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.EventType;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class guillotine extends Furniture implements Listener{
|
public class guillotine extends Furniture implements Listener{
|
||||||
|
|
||||||
@ -83,10 +84,10 @@ public class guillotine extends Furniture implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fArmorStand getByName(String s){
|
private fArmorStand getByName(String s){
|
||||||
for(fArmorStand packets : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(!packets.getName().equalsIgnoreCase("")){
|
if(!packets.getName().equalsIgnoreCase("")){
|
||||||
if(packets.getName().startsWith("#Oblation#")){
|
if(packets.getName().startsWith("#Oblation#")){
|
||||||
return packets;
|
return (fArmorStand) packets;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,15 +98,18 @@ public class guillotine extends Furniture implements Listener{
|
|||||||
armorStandList.clear();
|
armorStandList.clear();
|
||||||
if(packet2==null){packet2 = getByName("#Oblation#");}
|
if(packet2==null){packet2 = getByName("#Oblation#");}
|
||||||
if(packet3==null){packet3 = getByName("#Head#");}
|
if(packet3==null){packet3 = getByName("#Head#");}
|
||||||
for(fArmorStand packets : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packets : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(!packets.getName().equalsIgnoreCase("")){
|
if(packets instanceof fArmorStand){
|
||||||
if(!(packets.getName().startsWith("#Oblation#") && packets.getName().startsWith("#Head#"))){
|
fArmorStand stand = (fArmorStand) packets;
|
||||||
if(packets.getName().startsWith("iron")){
|
if(!packets.getName().equalsIgnoreCase("")){
|
||||||
armorStandList.add(packets);
|
if(!(packets.getName().startsWith("#Oblation#") && packets.getName().startsWith("#Head#"))){
|
||||||
Location loc = getStartLocation(packets.getName());
|
if(packets.getName().startsWith("iron")){
|
||||||
packets.teleport(loc);
|
armorStandList.add(stand);
|
||||||
}else{
|
Location loc = getStartLocation(packets.getName());
|
||||||
packet1 = packets;
|
packets.teleport(loc);
|
||||||
|
}else{
|
||||||
|
packet1 = stand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -447,8 +451,8 @@ public class guillotine extends Furniture implements Listener{
|
|||||||
private boolean canStart(){
|
private boolean canStart(){
|
||||||
if(isRunning()) return false;
|
if(isRunning()) return false;
|
||||||
boolean a = false,b = false,c = false;
|
boolean a = false,b = false,c = false;
|
||||||
a = !packet1.isVisible();
|
a = !packet1.isInvisible();
|
||||||
b = !packet2.isVisible();
|
b = !packet2.isInvisible();
|
||||||
if(packet1.getItemInMainHand()!=null&&!packet1.getItemInMainHand().equals(Material.AIR)){
|
if(packet1.getItemInMainHand()!=null&&!packet1.getItemInMainHand().equals(Material.AIR)){
|
||||||
c = true;
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class weaponStand extends Furniture {
|
public class weaponStand extends Furniture {
|
||||||
|
|
||||||
@ -59,8 +60,8 @@ public class weaponStand extends Furniture {
|
|||||||
if(p!=null){
|
if(p!=null){
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
}
|
}
|
||||||
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
for(fArmorStand packet : asList){
|
for(fEntity packet : asList){
|
||||||
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
||||||
if(packet.getInventory().getItemInMainHand()!=null){
|
if(packet.getInventory().getItemInMainHand()!=null){
|
||||||
if(!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
@ -86,7 +87,7 @@ public class weaponStand extends Furniture {
|
|||||||
|
|
||||||
ItemStack itemstack = p.getInventory().getItemInMainHand();
|
ItemStack itemstack = p.getInventory().getItemInMainHand();
|
||||||
if(itemstack!=null&&matList.contains(itemstack.getType())){
|
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()!=null){
|
||||||
if(packet.getInventory().getHelmet().getType().name().toLowerCase().endsWith("gate")){
|
if(packet.getInventory().getHelmet().getType().name().toLowerCase().endsWith("gate")){
|
||||||
ItemStack itemStack = new ItemStack(itemstack.getType(), 1, (short) 0);
|
ItemStack itemStack = new ItemStack(itemstack.getType(), 1, (short) 0);
|
||||||
@ -110,7 +111,7 @@ public class weaponStand extends Furniture {
|
|||||||
is3.setItemMeta(im3);
|
is3.setItemMeta(im3);
|
||||||
|
|
||||||
inv = Bukkit.createInventory(null, 45, "<EFBFBD>cWeaponBox");
|
inv = Bukkit.createInventory(null, 45, "<EFBFBD>cWeaponBox");
|
||||||
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
|
|
||||||
int j = 1;
|
int j = 1;
|
||||||
for(int i = 0; i<inv.getSize();i++){
|
for(int i = 0; i<inv.getSize();i++){
|
||||||
@ -118,7 +119,7 @@ public class weaponStand extends Furniture {
|
|||||||
if(slotList1.contains(i)){
|
if(slotList1.contains(i)){
|
||||||
inv.setItem(i, is3);
|
inv.setItem(i, is3);
|
||||||
}else if(slotList2.contains(i)){
|
}else if(slotList2.contains(i)){
|
||||||
for(fArmorStand packet : asList){
|
for(fEntity packet : asList){
|
||||||
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
||||||
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
|
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
|
||||||
ItemStack is = new ItemStack(Material.AIR);
|
ItemStack is = new ItemStack(Material.AIR);
|
||||||
@ -169,11 +170,11 @@ public class weaponStand extends Furniture {
|
|||||||
if(inv==null){return;}
|
if(inv==null){return;}
|
||||||
if(!e.getInventory().getTitle().equalsIgnoreCase(inv.getTitle())){return;}
|
if(!e.getInventory().getTitle().equalsIgnoreCase(inv.getTitle())){return;}
|
||||||
|
|
||||||
List<fArmorStand> asList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> asList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
int j = 1;
|
int j = 1;
|
||||||
for(int i = 0; i<inv.getSize();i++){
|
for(int i = 0; i<inv.getSize();i++){
|
||||||
if(slotList2.contains(i)){
|
if(slotList2.contains(i)){
|
||||||
for(fArmorStand packet : asList){
|
for(fEntity packet : asList){
|
||||||
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
if(packet.getName()!=null&&!packet.getName().equalsIgnoreCase("")){
|
||||||
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
|
if(packet.getName().equalsIgnoreCase("#SLOT"+j+"#")){
|
||||||
ItemStack is = inv.getItem(i);
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class BlackBoard extends Furniture implements Listener {
|
public class BlackBoard extends Furniture implements Listener {
|
||||||
public BlackBoard(ObjectID id){
|
public BlackBoard(ObjectID id){
|
||||||
@ -94,7 +95,7 @@ public class BlackBoard extends Furniture implements Listener {
|
|||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
||||||
Itemstack.setAmount(1);
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class SchoolChair extends Furniture implements Listener {
|
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(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(getObjID())){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.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
if(packet.getPassanger()==null){
|
if(packet.getPassanger()==null){
|
||||||
packet.setPassanger(e.getPlayer());
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class SchoolTable extends Furniture implements Listener {
|
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.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||||
@ -63,7 +64,7 @@ public class SchoolTable extends Furniture implements Listener {
|
|||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
||||||
Itemstack.setAmount(1);
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class TrashCan extends Furniture implements Listener {
|
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.getID().equals(getObjID())) return;
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
fArmorStand stand = null;
|
fEntity stand = null;
|
||||||
for(fArmorStand s : getfAsList()){
|
for(fEntity s : getfAsList()){
|
||||||
if(s.getName().equalsIgnoreCase("#TRASH#")){
|
if(s.getName().equalsIgnoreCase("#TRASH#")){
|
||||||
stand = s;break;
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class AdventCalender extends Furniture implements Listener {
|
public class AdventCalender extends Furniture implements Listener {
|
||||||
double sub = .9;
|
double sub = .9;
|
||||||
@ -228,7 +229,7 @@ public class AdventCalender extends Furniture implements Listener {
|
|||||||
|
|
||||||
public void load(){
|
public void load(){
|
||||||
config conf = new config();
|
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;
|
if(file == null) return;
|
||||||
for(int i = 1; i<32;i++){
|
for(int i = 1; i<32;i++){
|
||||||
if(file.isSet(i+"")){
|
if(file.isSet(i+"")){
|
||||||
@ -241,7 +242,7 @@ public class AdventCalender extends Furniture implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
conf = new config();
|
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 == null) return;
|
||||||
if(!file.isSet("Players")) return;
|
if(!file.isSet("Players")) return;
|
||||||
for(String s : file.getConfigurationSection("Players").getKeys(false)){
|
for(String s : file.getConfigurationSection("Players").getKeys(false)){
|
||||||
@ -253,17 +254,17 @@ public class AdventCalender extends Furniture implements Listener {
|
|||||||
|
|
||||||
public void save(int i){
|
public void save(int i){
|
||||||
config conf = new config();
|
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));
|
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){
|
public void savePlayer(UUID uuid){
|
||||||
if(uuid != null){
|
if(uuid != null){
|
||||||
config conf = new config();
|
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);
|
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){
|
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);
|
if(is!=null) inv.setContents(is);
|
||||||
p.openInventory(inv);
|
p.openInventory(inv);
|
||||||
}
|
}
|
||||||
@ -397,9 +398,9 @@ public class AdventCalender extends Furniture implements Listener {
|
|||||||
if(currentDay==getDay()){return;}
|
if(currentDay==getDay()){return;}
|
||||||
if(getfAsList()==null) return;
|
if(getfAsList()==null) return;
|
||||||
ItemStack[] is = getStack();
|
ItemStack[] is = getStack();
|
||||||
fArmorStand stand1= null;
|
fEntity stand1= null;
|
||||||
fArmorStand stand2 = null;
|
fEntity stand2 = null;
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().equalsIgnoreCase("#Advent1#")){
|
if(stand.getName().equalsIgnoreCase("#Advent1#")){
|
||||||
stand1 = stand;
|
stand1 = stand;
|
||||||
}else if(stand.getName().equalsIgnoreCase("#Advent2#")){
|
}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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class AdventWreath extends Furniture implements Listener {
|
public class AdventWreath extends Furniture implements Listener {
|
||||||
double sub = .9;
|
double sub = .9;
|
||||||
@ -64,7 +65,7 @@ public class AdventWreath extends Furniture implements Listener {
|
|||||||
String str = stand.getName();
|
String str = stand.getName();
|
||||||
if(str.startsWith("Fire") || str.startsWith("Torch")){
|
if(str.startsWith("Fire") || str.startsWith("Torch")){
|
||||||
int i = Integer.parseInt(str.split(":")[1]);
|
int i = Integer.parseInt(str.split(":")[1]);
|
||||||
for(fArmorStand fstand : getfAsList()){
|
for(fEntity fstand : getfAsList()){
|
||||||
if(fstand.getName().equalsIgnoreCase("Fire:" + i)){
|
if(fstand.getName().equalsIgnoreCase("Fire:" + i)){
|
||||||
if(!fstand.getName().endsWith("Burn")){
|
if(!fstand.getName().endsWith("Burn")){
|
||||||
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
fstand.sendParticle(fstand.getLocation().clone().add(0, .93, 0), 26, true);
|
||||||
@ -77,7 +78,7 @@ public class AdventWreath extends Furniture implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void load(){
|
private void load(){
|
||||||
for(fArmorStand fstand : getfAsList()){
|
for(fEntity fstand : getfAsList()){
|
||||||
if(fstand.getName().startsWith("Fire:")){
|
if(fstand.getName().startsWith("Fire:")){
|
||||||
if(fstand.getName().endsWith("Burn")){
|
if(fstand.getName().endsWith("Burn")){
|
||||||
if(!fstand.isParticlePlayed()){
|
if(!fstand.isParticlePlayed()){
|
||||||
@ -207,7 +208,7 @@ public class AdventWreath extends Furniture implements Listener {
|
|||||||
loc.subtract(0, .5, 0);
|
loc.subtract(0, .5, 0);
|
||||||
|
|
||||||
for(int i = 0; i<j;i++){
|
for(int i = 0; i<j;i++){
|
||||||
loc.setYaw((float) l);
|
loc.setYaw((float) l + 180);
|
||||||
fArmorStand stand = spawnArmorStand(loc);
|
fArmorStand stand = spawnArmorStand(loc);
|
||||||
stand.setHelmet(stack);
|
stand.setHelmet(stack);
|
||||||
stand.setInvisible(true);
|
stand.setInvisible(true);
|
||||||
|
@ -50,7 +50,7 @@ public class CandyCane extends Furniture implements Listener {
|
|||||||
GameProfile profile = new GameProfile(UUID.randomUUID(), generateSessionKey(10));
|
GameProfile profile = new GameProfile(UUID.randomUUID(), generateSessionKey(10));
|
||||||
Property textures = new Property(
|
Property textures = new Property(
|
||||||
"textures",
|
"textures",
|
||||||
"eyJ0aW1lc3RhbXAiOjE0NDc5NDgyNDcwODQsInByb2ZpbGVJZCI6IjBlNGUzZmIwMTY4ZjRmMWI4NDM3ZjM5ZWYxNTdhZjk0IiwicHJvZmlsZU5hbWUiOiJDb29raWVNYWtlcjIwMDAiLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMDgxYWI4MDdjZDRhZTcxZWYyYjI2MzdiNWQ3MWM1ZDZjYTRjNzdjNWQ1YTQ1Mjc1MjRlNzYzZWM5ZWVlIn19fQ=="
|
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNjM2Y3ODFjOTIzYTI4ODdmMTRjMWVlYTExMDUwMTY2OTY2ZjI2MDI1Nzg0MDFmMTQ1MWU2MDk3Yjk3OWRmIn19fQ"
|
||||||
);
|
);
|
||||||
profile.getProperties().put(textures.getName(), textures);
|
profile.getProperties().put(textures.getName(), textures);
|
||||||
|
|
||||||
|
@ -16,12 +16,14 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.FireworkMeta;
|
import org.bukkit.inventory.meta.FireworkMeta;
|
||||||
import org.bukkit.util.EulerAngle;
|
import org.bukkit.util.EulerAngle;
|
||||||
|
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class FireworkLauncher extends Furniture implements Listener {
|
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() == null || getObjID() == null) return;
|
||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!canBuild(e.getPlayer())){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.getName().equalsIgnoreCase("#FIREWORK#")){
|
||||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||||
@ -63,8 +65,8 @@ public class FireworkLauncher extends Furniture implements Listener {
|
|||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!canBuild(e.getPlayer())){return;}
|
if(!canBuild(e.getPlayer())){return;}
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
fArmorStand stand = null;
|
fEntity stand = null;
|
||||||
for(fArmorStand st : getfAsList()){
|
for(fEntity st : getfAsList()){
|
||||||
if(st.getName().equalsIgnoreCase("#FIREWORK#")){
|
if(st.getName().equalsIgnoreCase("#FIREWORK#")){
|
||||||
stand = st;
|
stand = st;
|
||||||
break;
|
break;
|
||||||
@ -109,7 +111,7 @@ public class FireworkLauncher extends Furniture implements Listener {
|
|||||||
return ThreadLocalRandom.current().nextDouble(min, max);
|
return ThreadLocalRandom.current().nextDouble(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canLaunch(fArmorStand stand){
|
public boolean canLaunch(fEntity stand){
|
||||||
if(stand.getItemInMainHand()!=null){
|
if(stand.getItemInMainHand()!=null){
|
||||||
if(stand.getItemInMainHand().getType().equals(Material.FIREWORK)){
|
if(stand.getItemInMainHand().getType().equals(Material.FIREWORK)){
|
||||||
return true;
|
return true;
|
||||||
@ -118,14 +120,14 @@ public class FireworkLauncher extends Furniture implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItem(fArmorStand stand, ItemStack is){
|
public void setItem(fEntity stand, ItemStack is){
|
||||||
ItemStack stack = is.clone();
|
ItemStack stack = is.clone();
|
||||||
stack.setAmount(1);
|
stack.setAmount(1);
|
||||||
stand.setItemInMainHand(stack);
|
stand.setItemInMainHand(stack);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drop(fArmorStand stand){
|
public void drop(fEntity stand){
|
||||||
if(stand.getItemInMainHand()!=null){
|
if(stand.getItemInMainHand()!=null){
|
||||||
getWorld().dropItem(getCenter(), stand.getItemInMainHand());
|
getWorld().dropItem(getCenter(), stand.getItemInMainHand());
|
||||||
stand.setItemInMainHand(new ItemStack(Material.AIR));
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class streetlamp extends Furniture implements Listener{
|
public class streetlamp extends Furniture implements Listener{
|
||||||
|
|
||||||
@ -180,14 +181,14 @@ public class streetlamp extends Furniture implements Listener{
|
|||||||
|
|
||||||
private void setLight(Boolean b){
|
private void setLight(Boolean b){
|
||||||
if(!b){
|
if(!b){
|
||||||
fArmorStand packet = getPacket();
|
fEntity packet = getPacket();
|
||||||
if(packet==null) return;
|
if(packet==null) return;
|
||||||
packet.getInventory().setHelmet(new ItemStack(Material.REDSTONE_LAMP_OFF));
|
packet.getInventory().setHelmet(new ItemStack(Material.REDSTONE_LAMP_OFF));
|
||||||
getManager().updateFurniture(getObjID());
|
getManager().updateFurniture(getObjID());
|
||||||
FurnitureLib.getInstance().getLightManager().removeLight(light);
|
FurnitureLib.getInstance().getLightManager().removeLight(light);
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
fArmorStand packet = getPacket();
|
fEntity packet = getPacket();
|
||||||
if(packet==null) return;
|
if(packet==null) return;
|
||||||
packet.getInventory().setHelmet(new ItemStack(Material.GLOWSTONE));
|
packet.getInventory().setHelmet(new ItemStack(Material.GLOWSTONE));
|
||||||
getManager().updateFurniture(getObjID());
|
getManager().updateFurniture(getObjID());
|
||||||
@ -196,8 +197,8 @@ public class streetlamp extends Furniture implements Listener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fArmorStand getPacket(){
|
private fEntity getPacket(){
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#LAMP#")){
|
if(packet.getName().equalsIgnoreCase("#LAMP#")){
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
@ -206,7 +207,7 @@ public class streetlamp extends Furniture implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isOn(){
|
private boolean isOn(){
|
||||||
for(fArmorStand as : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity as : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(as.getName().equalsIgnoreCase("#LAMP#")){
|
if(as.getName().equalsIgnoreCase("#LAMP#")){
|
||||||
switch (as.getInventory().getHelmet().getType()) {
|
switch (as.getInventory().getHelmet().getType()) {
|
||||||
case REDSTONE_LAMP_OFF: return false;
|
case REDSTONE_LAMP_OFF: return false;
|
||||||
@ -239,7 +240,7 @@ public class streetlamp extends Furniture implements Listener{
|
|||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Boolean isOn = isOn();
|
Boolean isOn = isOn();
|
||||||
fArmorStand packet = getPacket();
|
fEntity packet = getPacket();
|
||||||
if(packet==null) return;
|
if(packet==null) return;
|
||||||
if(redstone) return;
|
if(redstone) return;
|
||||||
if(isOn){
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class SleepingBag extends Furniture implements Listener {
|
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(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(getObjID())){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.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
if(packet.getPassanger()==null){
|
if(packet.getPassanger()==null){
|
||||||
packet.setPassanger(e.getPlayer());
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class Trunk extends Furniture implements Listener {
|
public class Trunk extends Furniture implements Listener {
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ public class Trunk extends Furniture implements Listener {
|
|||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
ItemStack stack = e.getPlayer().getInventory().getItemInMainHand();
|
ItemStack stack = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
stack.setAmount(1);
|
stack.setAmount(1);
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().startsWith("#TO")){
|
if(stand.getName().startsWith("#TO")){
|
||||||
stand.setHelmet(stack);
|
stand.setHelmet(stack);
|
||||||
}
|
}
|
||||||
@ -72,7 +73,7 @@ public class Trunk extends Furniture implements Listener {
|
|||||||
|
|
||||||
private void setPassanger(fArmorStand stand, Player p){
|
private void setPassanger(fArmorStand stand, Player p){
|
||||||
int i = Integer.parseInt(stand.getName().split(":")[1]);
|
int i = Integer.parseInt(stand.getName().split(":")[1]);
|
||||||
for(fArmorStand as : getfAsList()){
|
for(fEntity as : getfAsList()){
|
||||||
if(as.getName().equalsIgnoreCase("#Sitz:" + i)){
|
if(as.getName().equalsIgnoreCase("#Sitz:" + i)){
|
||||||
if(as.getPassanger()==null){
|
if(as.getPassanger()==null){
|
||||||
as.setPassanger(p);
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class WaterBottle extends Furniture implements Listener {
|
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(!e.getID().equals(getObjID())){return;}
|
||||||
if(!canInteract(e.getPlayer())){return;}
|
if(!canInteract(e.getPlayer())){return;}
|
||||||
Material data = e.getPlayer().getInventory().getItemInMainHand().getType();
|
Material data = e.getPlayer().getInventory().getItemInMainHand().getType();
|
||||||
fArmorStand stand = removeItem();
|
fEntity stand = removeItem();
|
||||||
if(matList.contains(data)){
|
if(matList.contains(data)){
|
||||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
@ -71,9 +72,9 @@ public class WaterBottle extends Furniture implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fArmorStand removeItem(){
|
private fEntity removeItem(){
|
||||||
fArmorStand fstand = null;
|
fEntity fstand = null;
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().equalsIgnoreCase("#ITEM#")){
|
if(stand.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
fstand = stand;
|
fstand = stand;
|
||||||
if(stand.getItemInMainHand()!=null&&!stand.getItemInMainHand().equals(Material.AIR)){
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class campchair extends Furniture implements Listener {
|
public class campchair extends Furniture implements Listener {
|
||||||
public campchair(ObjectID id){
|
public campchair(ObjectID id){
|
||||||
@ -47,7 +48,7 @@ public class campchair extends Furniture implements Listener {
|
|||||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(getObjID())){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.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
if(packet.getPassanger()==null){
|
if(packet.getPassanger()==null){
|
||||||
packet.setPassanger(e.getPlayer());
|
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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class fance extends Furniture implements Listener{
|
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(
|
List<Material> matList = Arrays.asList(
|
||||||
Material.SPRUCE_FENCE,
|
Material.SPRUCE_FENCE,
|
||||||
Material.BIRCH_FENCE,
|
Material.BIRCH_FENCE,
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
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.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureClickEvent;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.Utilitis.LocationUtil;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
import de.Ste3et_C0st.FurnitureLib.main.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.BodyPart;
|
||||||
@ -33,11 +35,12 @@ public class graveStone extends Furniture implements Listener{
|
|||||||
public graveStone(ObjectID id){
|
public graveStone(ObjectID id){
|
||||||
super(id);
|
super(id);
|
||||||
if(isFinish()){
|
if(isFinish()){
|
||||||
setBlock();
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||||
|
setBlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
spawn(id.getStartLocation());
|
spawn(id.getStartLocation());
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||||
setBlock();
|
setBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,6 +48,7 @@ public class graveStone extends Furniture implements Listener{
|
|||||||
Block sign;
|
Block sign;
|
||||||
String[] lines = new String[4];
|
String[] lines = new String[4];
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void setBlock(){
|
private void setBlock(){
|
||||||
Location location = getLocation().clone();
|
Location location = getLocation().clone();
|
||||||
if(getBlockFace().equals(BlockFace.WEST)){location = getLutil().getRelativ(location, getBlockFace(), .0, -1.02);}
|
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;
|
this.signLoc = sign;
|
||||||
|
|
||||||
if(!sign.getBlock().getType().equals(Material.WALL_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{
|
}else{
|
||||||
this.sign = sign.getBlock();
|
this.sign = sign.getBlock();
|
||||||
}
|
}
|
||||||
@ -115,7 +124,6 @@ public class graveStone extends Furniture implements Listener{
|
|||||||
asp.setBasePlate(false);
|
asp.setBasePlate(false);
|
||||||
}
|
}
|
||||||
send();
|
send();
|
||||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOW)
|
@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.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class log extends Furniture {
|
public class log extends Furniture {
|
||||||
|
|
||||||
Block b;
|
Block b;
|
||||||
int mode = 0;
|
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 pane = new ItemStack(Material.STAINED_GLASS_PANE);
|
||||||
ItemStack permissions = new ItemStack(Material.ARROW);
|
ItemStack permissions = new ItemStack(Material.ARROW);
|
||||||
List<ItemStack> isList = new ArrayList<ItemStack>();
|
List<ItemStack> isList = new ArrayList<ItemStack>();
|
||||||
@ -45,7 +46,7 @@ public class log extends Furniture {
|
|||||||
b = getLocation().getBlock();
|
b = getLocation().getBlock();
|
||||||
getObjID().addBlock(Arrays.asList(b));
|
getObjID().addBlock(Arrays.asList(b));
|
||||||
ItemMeta meta = pane.getItemMeta();
|
ItemMeta meta = pane.getItemMeta();
|
||||||
meta.setDisplayName("<EFBFBD>c");
|
meta.setDisplayName("$c");
|
||||||
pane.setItemMeta(meta);
|
pane.setItemMeta(meta);
|
||||||
pane.setDurability((short) 15);
|
pane.setDurability((short) 15);
|
||||||
pane.setItemMeta(meta);
|
pane.setItemMeta(meta);
|
||||||
@ -61,24 +62,24 @@ public class log extends Furniture {
|
|||||||
ItemStack stack = new ItemStack(Material.BANNER);
|
ItemStack stack = new ItemStack(Material.BANNER);
|
||||||
stack.setDurability((short) 1);
|
stack.setDurability((short) 1);
|
||||||
ItemMeta meta = stack.getItemMeta();
|
ItemMeta meta = stack.getItemMeta();
|
||||||
meta.setDisplayName("<EFBFBD>6Mode: <20>cTop");
|
meta.setDisplayName("$6Mode: $cTop");
|
||||||
stack.setItemMeta(meta);
|
stack.setItemMeta(meta);
|
||||||
isList.add(stack);
|
isList.add(stack);
|
||||||
stack = new ItemStack(Material.BANNER);
|
stack = new ItemStack(Material.BANNER);
|
||||||
stack.setDurability((short) 2);
|
stack.setDurability((short) 2);
|
||||||
meta = stack.getItemMeta();
|
meta = stack.getItemMeta();
|
||||||
meta.setDisplayName("<EFBFBD>6Mode: <20>cFront I");
|
meta.setDisplayName("$6Mode: $cFront I");
|
||||||
stack.setItemMeta(meta);
|
stack.setItemMeta(meta);
|
||||||
isList.add(stack);
|
isList.add(stack);
|
||||||
stack = new ItemStack(Material.BANNER);
|
stack = new ItemStack(Material.BANNER);
|
||||||
stack.setDurability((short) 11);
|
stack.setDurability((short) 11);
|
||||||
meta = stack.getItemMeta();
|
meta = stack.getItemMeta();
|
||||||
meta.setDisplayName("<EFBFBD>6Mode: <20>cFront II");
|
meta.setDisplayName("$6Mode: $cFront II");
|
||||||
stack.setItemMeta(meta);
|
stack.setItemMeta(meta);
|
||||||
isList.add(stack);
|
isList.add(stack);
|
||||||
|
|
||||||
meta = permissions.getItemMeta();
|
meta = permissions.getItemMeta();
|
||||||
meta.setDisplayName("<EFBFBD>cChange Permissions (Owner Only)");
|
meta.setDisplayName("$cChange Permissions (Owner Only)");
|
||||||
permissions.setItemMeta(meta);
|
permissions.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,9 +187,9 @@ public class log extends Furniture {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fArmorStand standOld = null;
|
fEntity standOld = null;
|
||||||
fArmorStand standCurrent = null;
|
fEntity standCurrent = null;
|
||||||
for(fArmorStand s : getObjID().getPacketList()){
|
for(fEntity s : getObjID().getPacketList()){
|
||||||
if(s.getName().equalsIgnoreCase(oldArmorStand+"")){
|
if(s.getName().equalsIgnoreCase(oldArmorStand+"")){
|
||||||
standOld=s;
|
standOld=s;
|
||||||
}else if(s.getName().equalsIgnoreCase(currentArmorStand+"")){
|
}else if(s.getName().equalsIgnoreCase(currentArmorStand+"")){
|
||||||
@ -235,8 +236,8 @@ public class log extends Furniture {
|
|||||||
removeItem(p);
|
removeItem(p);
|
||||||
return;
|
return;
|
||||||
}else if(!p.getInventory().getItemInMainHand().getType().isBlock() && !p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
}else if(!p.getInventory().getItemInMainHand().getType().isBlock() && !p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
fArmorStand stand = null;
|
fEntity stand = null;
|
||||||
for(fArmorStand s : getObjID().getPacketList()){
|
for(fEntity s : getObjID().getPacketList()){
|
||||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||||
stand = s;
|
stand = s;
|
||||||
break;
|
break;
|
||||||
@ -245,6 +246,11 @@ public class log extends Furniture {
|
|||||||
|
|
||||||
if(stand==null){return;}
|
if(stand==null){return;}
|
||||||
if(stand.getInventory().getItemInMainHand()!=null&&!stand.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
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();
|
ItemStack is = stand.getInventory().getItemInMainHand();
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
getWorld().dropItem(getLocation(), is);
|
getWorld().dropItem(getLocation(), is);
|
||||||
@ -257,8 +263,8 @@ public class log extends Furniture {
|
|||||||
removeItem(p);
|
removeItem(p);
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
fArmorStand stand = null;
|
fEntity stand = null;
|
||||||
for(fArmorStand s : getObjID().getPacketList()){
|
for(fEntity s : getObjID().getPacketList()){
|
||||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||||
stand = s;
|
stand = s;
|
||||||
break;
|
break;
|
||||||
@ -268,6 +274,13 @@ public class log extends Furniture {
|
|||||||
if(stand==null){return;}
|
if(stand==null){return;}
|
||||||
|
|
||||||
if(stand.getInventory().getItemInMainHand()!=null&&!stand.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
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();
|
ItemStack is = stand.getInventory().getItemInMainHand();
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
getWorld().dropItem(getLocation(), is);
|
getWorld().dropItem(getLocation(), is);
|
||||||
@ -306,8 +319,8 @@ public class log extends Furniture {
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
|
|
||||||
fArmorStand stand = null;
|
fEntity stand = null;
|
||||||
for(fArmorStand s : getObjID().getPacketList()){
|
for(fEntity s : getObjID().getPacketList()){
|
||||||
if(s.getName().equalsIgnoreCase(mode+"")){
|
if(s.getName().equalsIgnoreCase(mode+"")){
|
||||||
stand = s;
|
stand = s;
|
||||||
break;
|
break;
|
||||||
|
@ -64,18 +64,18 @@ public class mailBox extends Furniture implements Listener {
|
|||||||
aspList.add(packet);
|
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.getInventory().setHelmet(new ItemStack(Material.SMOOTH_BRICK, 1, (short) 0));
|
||||||
as.setSmall(true);
|
as.setSmall(true);
|
||||||
aspList.add(as);
|
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.getInventory().setHelmet(new ItemStack(Material.SMOOTH_BRICK, 1, (short) 0));
|
||||||
as.setSmall(true);
|
as.setSmall(true);
|
||||||
aspList.add(as);
|
aspList.add(as);
|
||||||
|
|
||||||
for(int i = 0; i<=4;i++){
|
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);
|
fArmorStand packet = getManager().createArmorStand(getObjID(), loc);
|
||||||
packet.setSmall(true);
|
packet.setSmall(true);
|
||||||
//x z y
|
//x z y
|
||||||
@ -106,7 +106,7 @@ public class mailBox extends Furniture implements Listener {
|
|||||||
|
|
||||||
BlockFace face = getBlockFace();
|
BlockFace face = getBlockFace();
|
||||||
face = getLutil().yawToFace(getLutil().FaceToYaw(getBlockFace()) + 90);
|
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.getInventory().setHelmet(new ItemStack(Material.REDSTONE_TORCH_ON, 1, (short) 0));
|
||||||
as.setPose(getLutil().degresstoRad(new EulerAngle(0, 0, 90)), BodyPart.HEAD);
|
as.setPose(getLutil().degresstoRad(new EulerAngle(0, 0, 90)), BodyPart.HEAD);
|
||||||
as.setName("#ELEMENT#");
|
as.setName("#ELEMENT#");
|
||||||
@ -119,7 +119,7 @@ public class mailBox extends Furniture implements Listener {
|
|||||||
as.setSmall(true);
|
as.setSmall(true);
|
||||||
aspList.add(as);
|
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.getInventory().setItemInMainHand(new ItemStack(Material.WOOD_BUTTON, 1, (short) 0));
|
||||||
as.setPose(getLutil().degresstoRad(new EulerAngle(-15,-67, -90)), BodyPart.RIGHT_ARM);
|
as.setPose(getLutil().degresstoRad(new EulerAngle(-15,-67, -90)), BodyPart.RIGHT_ARM);
|
||||||
as.setSmall(true);
|
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.EventType;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class sunshade extends Furniture implements Listener{
|
public class sunshade extends Furniture implements Listener{
|
||||||
List<Material> matList = Arrays.asList(
|
List<Material> matList = Arrays.asList(
|
||||||
@ -123,7 +124,7 @@ public class sunshade extends Furniture implements Listener{
|
|||||||
if(is.getType().equals(Material.BANNER)){
|
if(is.getType().equals(Material.BANNER)){
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
if(isRunning()){return;}
|
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)){
|
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
||||||
packet.getInventory().setHelmet(is);
|
packet.getInventory().setHelmet(is);
|
||||||
}else if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.CARPET)){
|
}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;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
stopTimer();
|
stopTimer();
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||||
@ -183,7 +184,7 @@ public class sunshade extends Furniture implements Listener{
|
|||||||
if(is.getType().equals(Material.BANNER)){
|
if(is.getType().equals(Material.BANNER)){
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
if(isRunning()){return;}
|
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)){
|
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
||||||
packet.getInventory().setHelmet(is);
|
packet.getInventory().setHelmet(is);
|
||||||
}else if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.CARPET)){
|
}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;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
stopTimer();
|
stopTimer();
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||||
@ -243,11 +244,11 @@ public class sunshade extends Furniture implements Listener{
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try{
|
try{
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().startsWith("#ELEMENT#")){
|
if(packet.getName().startsWith("#ELEMENT#")){
|
||||||
if(!isClose(packet)){
|
if(!isClose((fArmorStand) packet)){
|
||||||
Double x = packet.getPose(BodyPart.HEAD).getX();
|
Double x = ((fArmorStand) packet).getPose(BodyPart.HEAD).getX();
|
||||||
packet.setPose(new EulerAngle(x-.32, 0, 0), BodyPart.HEAD);
|
((fArmorStand) packet).setPose(new EulerAngle(x-.32, 0, 0), BodyPart.HEAD);
|
||||||
}else{
|
}else{
|
||||||
stopTimer();
|
stopTimer();
|
||||||
return;
|
return;
|
||||||
@ -269,11 +270,11 @@ public class sunshade extends Furniture implements Listener{
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try{
|
try{
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().startsWith("#ELEMENT#")){
|
if(packet.getName().startsWith("#ELEMENT#")){
|
||||||
if(!isOpen(packet)){
|
if(!isOpen((fArmorStand) packet)){
|
||||||
Double x = packet.getPose(BodyPart.HEAD).getX();
|
Double x = ((fArmorStand) packet).getPose(BodyPart.HEAD).getX();
|
||||||
packet.setPose(new EulerAngle(x+.32, 0, 0), BodyPart.HEAD);
|
((fArmorStand) packet).setPose(new EulerAngle(x+.32, 0, 0), BodyPart.HEAD);
|
||||||
}else{
|
}else{
|
||||||
stopTimer();
|
stopTimer();
|
||||||
return;
|
return;
|
||||||
@ -291,9 +292,9 @@ public class sunshade extends Furniture implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void reset(){
|
private void reset(){
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(!isOpen(packet)){
|
if(!isOpen((fArmorStand) packet)){
|
||||||
packet.setPose(new EulerAngle(-3.054, 0, 0), BodyPart.HEAD);
|
((fArmorStand) packet).setPose(new EulerAngle(-3.054, 0, 0), BodyPart.HEAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
@ -312,9 +313,9 @@ public class sunshade extends Furniture implements Listener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isOpen(){
|
private boolean isOpen(){
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().startsWith("#ELEMENT#")){
|
if(packet.getName().startsWith("#ELEMENT#")){
|
||||||
if(packet.getPose(BodyPart.HEAD).getX()< -1.85){
|
if(((fArmorStand) packet).getPose(BodyPart.HEAD).getX()< -1.85){
|
||||||
return false;
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class chair extends Furniture implements Listener{
|
public class chair extends Furniture implements Listener{
|
||||||
|
|
||||||
@ -110,8 +111,8 @@ public class chair extends Furniture implements Listener{
|
|||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(e.getID() == null || getObjID() == null) return;
|
if(e.getID() == null || getObjID() == null) return;
|
||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
fArmorStand packet = null;
|
fEntity packet = null;
|
||||||
for(fArmorStand as : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity as : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(as.getName().equalsIgnoreCase("#SITZ#")){
|
if(as.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
packet=as;
|
packet=as;
|
||||||
break;
|
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.ColorType;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class largeTable extends Furniture implements Listener{
|
public class largeTable extends Furniture implements Listener{
|
||||||
|
|
||||||
public largeTable(ObjectID id){
|
public largeTable(ObjectID id){
|
||||||
super(id);
|
super(id);
|
||||||
if(isFinish()){
|
if(isFinish()){
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().startsWith("#TELLER")){
|
if(packet.getName().startsWith("#TELLER")){
|
||||||
tellerIDs.add(packet.getEntityID());
|
tellerIDs.add(packet.getEntityID());
|
||||||
}
|
}
|
||||||
@ -168,7 +169,7 @@ public class largeTable extends Furniture implements Listener{
|
|||||||
public void setTeller(HashMap<Integer, ItemStack> itemList){
|
public void setTeller(HashMap<Integer, ItemStack> itemList){
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Integer id : tellerIDs){
|
for(Integer id : tellerIDs){
|
||||||
fArmorStand as = getManager().getfArmorStandByID(id);
|
fEntity as = getManager().getfArmorStandByID(id);
|
||||||
as.getInventory().setItemInMainHand(itemList.get(i));
|
as.getInventory().setItemInMainHand(itemList.get(i));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -183,10 +184,10 @@ public class largeTable extends Furniture implements Listener{
|
|||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
for(Integer id : tellerIDs){
|
for(Integer id : tellerIDs){
|
||||||
fArmorStand asp = getManager().getfArmorStandByID(id);
|
fEntity asp = getManager().getfArmorStandByID(id);
|
||||||
if(asp!=null&&asp.getInventory().getItemInMainHand()!=null){
|
if(asp!=null&&asp.getInventory().getItemInMainHand()!=null){
|
||||||
if(asp.getName().startsWith("#TELLER")){
|
if(asp.getName().startsWith("#TELLER")){
|
||||||
fArmorStand packet = asp;
|
fEntity packet = asp;
|
||||||
e.getLocation().getWorld().dropItem(e.getLocation(), packet.getInventory().getItemInMainHand());
|
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()==null){return;}
|
||||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
|
if(e.getID()==null) return;
|
||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
@ -215,11 +217,11 @@ public class largeTable extends Furniture implements Listener{
|
|||||||
|
|
||||||
public void setTeller(Player player, ItemStack is){
|
public void setTeller(Player player, ItemStack is){
|
||||||
BlockFace b = getLutil().yawToFace(player.getLocation().getYaw());
|
BlockFace b = getLutil().yawToFace(player.getLocation().getYaw());
|
||||||
fArmorStand as = null;
|
fEntity as = null;
|
||||||
if(tellerIDs == null || tellerIDs.isEmpty()){return;}
|
if(tellerIDs == null || tellerIDs.isEmpty()){return;}
|
||||||
for(Integer id : this.tellerIDs){
|
for(Integer id : this.tellerIDs){
|
||||||
if(id!=null){
|
if(id!=null){
|
||||||
fArmorStand armorStand = getManager().getfArmorStandByID(id);
|
fEntity armorStand = getManager().getfArmorStandByID(id);
|
||||||
if(armorStand!=null){
|
if(armorStand!=null){
|
||||||
BlockFace b2 = getLutil().yawToFace(armorStand.getLocation().getYaw());
|
BlockFace b2 = getLutil().yawToFace(armorStand.getLocation().getYaw());
|
||||||
if(b2.equals(b)){
|
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!=null&&as.getInventory().getItemInMainHand()!= null && as.getInventory().getItemInMainHand().equals(is)){return;}
|
||||||
if(as.getInventory().getItemInMainHand()!=null&&!as.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(as.getInventory().getItemInMainHand()!=null&&!as.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
fArmorStand asp = as;
|
fEntity asp = as;
|
||||||
ItemStack item = asp.getInventory().getItemInMainHand();
|
ItemStack item = asp.getInventory().getItemInMainHand();
|
||||||
item.setAmount(1);
|
item.setAmount(1);
|
||||||
asp.getLocation().getWorld().dropItem(asp.getLocation(), item);
|
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>();
|
HashMap<Integer, ItemStack> teller = new HashMap<Integer, ItemStack>();
|
||||||
for(Integer id : tellerIDs){
|
for(Integer id : tellerIDs){
|
||||||
try{
|
try{
|
||||||
fArmorStand as = getManager().getfArmorStandByID(id);
|
fEntity as = getManager().getfArmorStandByID(id);
|
||||||
teller.put(teller.size(), as.getInventory().getItemInMainHand());
|
teller.put(teller.size(), as.getInventory().getItemInMainHand());
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
teller.put(teller.size(), new ItemStack(Material.AIR));
|
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.EventType;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class sofa extends Furniture implements Listener {
|
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){
|
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){
|
if(packet.getName().equalsIgnoreCase(s) && packet.getPassanger() == null){
|
||||||
packet.setPassanger(p);
|
packet.setPassanger(p);
|
||||||
packet.update();
|
packet.update();
|
||||||
@ -192,7 +193,7 @@ public class sofa extends Furniture implements Listener {
|
|||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!getLib().canBuild(e.getPlayer(), getObjID(), EventType.BREAK)){return;}
|
if(!getLib().canBuild(e.getPlayer(), getObjID(), EventType.BREAK)){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getPassanger()!=null){
|
if(packet.getPassanger()!=null){
|
||||||
packet.eject();
|
packet.eject();
|
||||||
packet.update();
|
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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class table extends Furniture implements Listener {
|
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.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
if(packet.getInventory().getItemInMainHand()!=null&&!packet.getInventory().getItemInMainHand().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getItemInMainHand();
|
ItemStack is = packet.getInventory().getItemInMainHand();
|
||||||
@ -93,7 +94,7 @@ public class table extends Furniture implements Listener {
|
|||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
if(p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
if(packet.getName().equalsIgnoreCase("#ITEM#")){
|
||||||
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
ItemStack Itemstack = p.getInventory().getItemInMainHand().clone();
|
||||||
Itemstack.setAmount(1);
|
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.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class barrels extends Furniture implements Listener {
|
public class barrels extends Furniture implements Listener {
|
||||||
Integer id;
|
Integer id;
|
||||||
@ -56,7 +57,7 @@ public class barrels extends Furniture implements Listener {
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
if(!p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
if(!p.getInventory().getItemInMainHand().getType().isBlock()&&!p.getInventory().getItemInMainHand().getType().equals(Material.AIR)){return;}
|
||||||
fArmorStand packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
fEntity packet = getManager().getfArmorStandByObjectID(getObjID()).get(0);
|
||||||
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getHelmet();
|
ItemStack is = packet.getInventory().getHelmet();
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
@ -82,7 +83,7 @@ public class barrels extends Furniture implements Listener {
|
|||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
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)){
|
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getHelmet();
|
ItemStack is = packet.getInventory().getHelmet();
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
@ -102,7 +103,7 @@ public class barrels extends Furniture implements Listener {
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
ItemStack Itemstack = e.getPlayer().getInventory().getItemInMainHand().clone();
|
ItemStack Itemstack = e.getPlayer().getInventory().getItemInMainHand().clone();
|
||||||
Itemstack.setAmount(1);
|
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)){
|
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getHelmet();
|
ItemStack is = packet.getInventory().getHelmet();
|
||||||
@ -129,7 +130,7 @@ public class barrels extends Furniture implements Listener {
|
|||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
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)){
|
if(packet.getInventory().getHelmet()!=null&&!packet.getInventory().getHelmet().getType().equals(Material.AIR)){
|
||||||
ItemStack is = packet.getInventory().getHelmet();
|
ItemStack is = packet.getInventory().getHelmet();
|
||||||
is.setAmount(1);
|
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.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
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{
|
public class campfire_1 extends Furniture implements Listener{
|
||||||
|
|
||||||
@ -30,12 +30,13 @@ public class campfire_1 extends Furniture implements Listener{
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onFurnitureBreak(FurnitureBreakEvent e){
|
public void onFurnitureBreak(FurnitureBreakEvent e){
|
||||||
if(getObjID()==null){return;}
|
if(getObjID()==null||e.getID()==null){return;}
|
||||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
|
if(e.getID()==null) return;
|
||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
packet.setFire(false);
|
packet.setFire(false);
|
||||||
Location location = getLocation().clone();
|
Location location = getLocation().clone();
|
||||||
location.add(0, 1.2, 0);
|
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.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
ItemStack is = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
if(is.getType().equals(Material.WATER_BUCKET)){
|
if(is.getType().equals(Material.WATER_BUCKET)){
|
||||||
for(fArmorStand packet : aspList){
|
for(fEntity packet : aspList){
|
||||||
packet.setFire(false);
|
packet.setFire(false);
|
||||||
Location location = getLocation().clone();
|
Location location = getLocation().clone();
|
||||||
location.add(0, 1.2, 0);
|
location.add(0, 1.2, 0);
|
||||||
@ -65,7 +66,7 @@ public class campfire_1 extends Furniture implements Listener{
|
|||||||
}
|
}
|
||||||
getManager().updateFurniture(getObjID());
|
getManager().updateFurniture(getObjID());
|
||||||
}else if(is.getType().equals(Material.FLINT_AND_STEEL)){
|
}else if(is.getType().equals(Material.FLINT_AND_STEEL)){
|
||||||
for(fArmorStand packet : aspList){
|
for(fEntity packet : aspList){
|
||||||
packet.setFire(true);
|
packet.setFire(true);
|
||||||
Location location = getLocation().clone();
|
Location location = getLocation().clone();
|
||||||
location.add(0, 1.2, 0);
|
location.add(0, 1.2, 0);
|
||||||
|
@ -12,6 +12,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.EulerAngle;
|
import org.bukkit.util.EulerAngle;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import de.Ste3et_C0st.Furniture.Main.main;
|
import de.Ste3et_C0st.Furniture.Main.main;
|
||||||
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
import de.Ste3et_C0st.FurnitureLib.Events.FurnitureBreakEvent;
|
||||||
@ -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.BodyPart;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class campfire_2 extends Furniture implements Listener{
|
public class campfire_2 extends Furniture implements Listener{
|
||||||
List<Material> items = new ArrayList<Material>(
|
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.getID().equals(getObjID())){return;}
|
||||||
if(!e.canBuild()){return;}
|
if(!e.canBuild()){return;}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
final ItemStack itemStack = e.getPlayer().getInventory().getItemInMainHand();
|
final ItemStack itemStack = e.getPlayer().getInventory().getItemInMainHand();
|
||||||
fArmorStand packet = null;
|
fArmorStand packet = null;
|
||||||
for(fArmorStand pack : aspList){
|
for(fEntity pack : aspList){
|
||||||
if(pack.isSmall() && pack.isVisible()){
|
if(pack instanceof fArmorStand){
|
||||||
packet = pack;
|
fArmorStand stand = (fArmorStand) pack;
|
||||||
|
if(stand.isSmall() && pack.isInvisible()){
|
||||||
|
packet = stand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(itemStack.getType().equals(Material.WATER_BUCKET) && packet.isFire()){
|
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){
|
private void setfire(boolean b){
|
||||||
for(fArmorStand pack : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity pack : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(pack.isSmall() && pack.isVisible()){
|
if(pack instanceof fArmorStand){
|
||||||
if((pack.getInventory().getHelmet() == null || pack.getInventory().getHelmet().getType().equals(Material.AIR)) &&
|
fArmorStand stand = (fArmorStand) pack;
|
||||||
(pack.getInventory().getItemInMainHand() == null || pack.getInventory().getItemInMainHand().getType().equals(Material.AIR))){
|
if(stand.isSmall() && pack.isInvisible()){
|
||||||
pack.setFire(b);
|
if((pack.getInventory().getHelmet() == null || pack.getInventory().getHelmet().getType().equals(Material.AIR)) &&
|
||||||
Location loc = middle.clone();
|
(pack.getInventory().getItemInMainHand() == null || pack.getInventory().getItemInMainHand().getType().equals(Material.AIR))){
|
||||||
loc.add(0, 1.3, 0);
|
pack.setFire(b);
|
||||||
if(b) getLib().getLightManager().addLight(loc, 15);
|
Location loc = middle.clone();
|
||||||
if(!b) getLib().getLightManager().removeLight(loc);
|
loc.add(0, 1.3, 0);
|
||||||
getManager().updateFurniture(getObjID());
|
if(b) getLib().getLightManager().addLight(loc, 15);
|
||||||
return;
|
if(!b) getLib().getLightManager().removeLight(loc);
|
||||||
}
|
getManager().updateFurniture(getObjID());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,7 +220,7 @@ public class campfire_2 extends Furniture implements Listener{
|
|||||||
if(isRunning()){
|
if(isRunning()){
|
||||||
Bukkit.getScheduler().cancelTask(timer);
|
Bukkit.getScheduler().cancelTask(timer);
|
||||||
timer=null;
|
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);
|
setfire(false);
|
||||||
e.remove();
|
e.remove();
|
||||||
@ -224,18 +232,21 @@ public class campfire_2 extends Furniture implements Listener{
|
|||||||
Bukkit.getScheduler().cancelTask(timer);
|
Bukkit.getScheduler().cancelTask(timer);
|
||||||
timer=null;
|
timer=null;
|
||||||
if(armorS!=null&&armorS.getInventory().getItemInMainHand()!=null&&getItem(armorS.getInventory().getItemInMainHand())!=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.kill();
|
||||||
armorS.delete();
|
armorS.delete();
|
||||||
armorS=null;
|
armorS=null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(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.kill();
|
||||||
armorS.delete();
|
armorS.delete();
|
||||||
armorS=null;
|
armorS=null;
|
||||||
}
|
}
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getItem(ItemStack is){
|
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 = getManager().createArmorStand(getObjID(), grill);
|
||||||
this.armorS.setInvisible(true);
|
this.armorS.setInvisible(true);
|
||||||
this.armorS.getInventory().setItemInMainHand(is);
|
this.armorS.getInventory().setItemInMainHand(is);
|
||||||
getManager().send(getObjID());
|
getObjID().getPlayerList().clear();
|
||||||
|
send();
|
||||||
this.timer = main.getInstance().getServer().getScheduler().scheduleSyncRepeatingTask(main.getInstance(), new Runnable() {
|
this.timer = main.getInstance().getServer().getScheduler().scheduleSyncRepeatingTask(main.getInstance(), new Runnable() {
|
||||||
Integer rounds = getLutil().randInt(15, 30);
|
Integer rounds = getLutil().randInt(15, 30);
|
||||||
Integer labs = 0;
|
Integer labs = 0;
|
||||||
@ -276,7 +288,7 @@ public class campfire_2 extends Furniture implements Listener{
|
|||||||
if(position>3){position=0;}
|
if(position>3){position=0;}
|
||||||
if(armorS!=null){
|
if(armorS!=null){
|
||||||
armorS.setPose(angle[position], BodyPart.RIGHT_ARM);
|
armorS.setPose(angle[position], BodyPart.RIGHT_ARM);
|
||||||
armorS.update();
|
update();
|
||||||
}
|
}
|
||||||
position++;
|
position++;
|
||||||
labs++;
|
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.EventType;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class hammock extends Furniture implements Listener{
|
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(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
ItemStack stack = p.getInventory().getItemInMainHand();
|
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.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
if(packet.getPassanger()==null){
|
if(packet.getPassanger()==null){
|
||||||
packet.setPassanger(e.getPlayer());
|
packet.setPassanger(e.getPlayer());
|
||||||
@ -139,7 +140,7 @@ public class hammock extends Furniture implements Listener{
|
|||||||
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;}
|
||||||
if(e.isCancelled()){return;}
|
if(e.isCancelled()){return;}
|
||||||
if(!e.getID().equals(getObjID())){return;}
|
if(!e.getID().equals(getObjID())){return;}
|
||||||
List<fArmorStand> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
List<fEntity> aspList = getManager().getfArmorStandByObjectID(getObjID());
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
ItemStack stack = p.getInventory().getItemInMainHand();
|
ItemStack stack = p.getInventory().getItemInMainHand();
|
||||||
if(stack!=null){
|
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.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
if(packet.getPassanger()==null){
|
if(packet.getPassanger()==null){
|
||||||
packet.setPassanger(e.getPlayer());
|
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(!canbuild){return true;}
|
||||||
if(stack!=null){
|
if(stack!=null){
|
||||||
switch (stack.getType()) {
|
switch (stack.getType()) {
|
||||||
case BANNER:
|
case BANNER:
|
||||||
for(fArmorStand packet : aspList){
|
for(fEntity packet : aspList){
|
||||||
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
if(packet.getInventory().getHelmet()!=null&&packet.getInventory().getHelmet().getType().equals(Material.BANNER)){
|
||||||
packet.getInventory().setHelmet(stack);
|
packet.getInventory().setHelmet(stack);
|
||||||
}
|
}
|
||||||
@ -172,7 +173,7 @@ public class hammock extends Furniture implements Listener{
|
|||||||
getManager().updateFurniture(getObjID());
|
getManager().updateFurniture(getObjID());
|
||||||
return true;
|
return true;
|
||||||
case LOG:
|
case LOG:
|
||||||
for(fArmorStand packet : aspList){
|
for(fEntity packet : aspList){
|
||||||
if(packet.getName().equalsIgnoreCase("#PILLAR#")){
|
if(packet.getName().equalsIgnoreCase("#PILLAR#")){
|
||||||
packet.getInventory().setHelmet(stack);
|
packet.getInventory().setHelmet(stack);
|
||||||
}
|
}
|
||||||
@ -182,7 +183,7 @@ public class hammock extends Furniture implements Listener{
|
|||||||
getManager().updateFurniture(getObjID());
|
getManager().updateFurniture(getObjID());
|
||||||
return true;
|
return true;
|
||||||
case LOG_2:
|
case LOG_2:
|
||||||
for(fArmorStand packet : aspList){
|
for(fEntity packet : aspList){
|
||||||
if(packet.getName().equalsIgnoreCase("#PILLAR#")){
|
if(packet.getName().equalsIgnoreCase("#PILLAR#")){
|
||||||
packet.getInventory().setHelmet(stack);
|
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.ColorType;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.entity.fArmorStand;
|
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 class tent_3 extends Furniture implements Listener{
|
||||||
public tent_3(ObjectID id){
|
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)){
|
if(p.getInventory().getItemInMainHand().getType().equals(Material.INK_SACK)){
|
||||||
getLib().getColorManager().color(p, e.canBuild(), Material.BANNER, getObjID(), ColorType.BANNER, 1);
|
getLib().getColorManager().color(p, e.canBuild(), Material.BANNER, getObjID(), ColorType.BANNER, 1);
|
||||||
}else{
|
}else{
|
||||||
for(fArmorStand packet : getManager().getfArmorStandByObjectID(getObjID())){
|
for(fEntity packet : getManager().getfArmorStandByObjectID(getObjID())){
|
||||||
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
if(packet.getName().equalsIgnoreCase("#SITZ#")){
|
||||||
packet.setPassanger(p);
|
packet.setPassanger(p);
|
||||||
packet.update();
|
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.Furniture;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
import de.Ste3et_C0st.FurnitureLib.main.ObjectID;
|
||||||
import de.Ste3et_C0st.FurnitureLib.main.Type.SQLAction;
|
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.fArmorStand;
|
||||||
|
import de.Ste3et_C0st.FurnitureLib.main.entity.fEntity;
|
||||||
|
|
||||||
public class BearTrap extends Furniture implements Listener{
|
public class BearTrap extends Furniture implements Listener{
|
||||||
|
|
||||||
@ -31,19 +31,23 @@ public class BearTrap extends Furniture implements Listener{
|
|||||||
public BearTrap(ObjectID id){
|
public BearTrap(ObjectID id){
|
||||||
super(id);
|
super(id);
|
||||||
if(isFinish()){
|
if(isFinish()){
|
||||||
for(fArmorStand stand : getfAsList()){
|
for(fEntity stand : getfAsList()){
|
||||||
if(stand.getName().equalsIgnoreCase("#IRON1#")){
|
if(stand.getName().equalsIgnoreCase("#IRON1#")){
|
||||||
stand1 = stand;
|
stand1 = (fArmorStand) stand;
|
||||||
}else if(stand.getName().equalsIgnoreCase("#IRON2#")){
|
}else if(stand.getName().equalsIgnoreCase("#IRON2#")){
|
||||||
stand2 = stand;
|
stand2 = (fArmorStand) stand;
|
||||||
}else if(stand.getName().equalsIgnoreCase("#IRON3#")){
|
}else if(stand.getName().equalsIgnoreCase("#IRON3#")){
|
||||||
stand2 = stand;
|
stand3 = (fArmorStand) stand;
|
||||||
}else if(stand.getName().equalsIgnoreCase("#IRON4#")){
|
}else if(stand.getName().equalsIgnoreCase("#IRON4#")){
|
||||||
stand2 = stand;
|
stand4 = (fArmorStand) stand;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setStatus(false);
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
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;
|
return;
|
||||||
}
|
}
|
||||||
spawn(id.getStartLocation());
|
spawn(id.getStartLocation());
|
||||||
@ -59,7 +63,7 @@ public class BearTrap extends Furniture implements Listener{
|
|||||||
double offset = .35;
|
double offset = .35;
|
||||||
Location location = getRelative(getCenter(), 0, .04+offset).add(0, -2.1, 0);
|
Location location = getRelative(getCenter(), 0, .04+offset).add(0, -2.1, 0);
|
||||||
location.setYaw(getYaw()+90);
|
location.setYaw(getYaw()+90);
|
||||||
stand = spawnArmorStand(location);
|
stand = spawnArmorStand(location.clone());
|
||||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
|
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
|
||||||
stand.setHelmet(new ItemStack(Material.IRON_FENCE));
|
stand.setHelmet(new ItemStack(Material.IRON_FENCE));
|
||||||
stand.setName("#IRON1#");
|
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 = getRelative(getCenter(), 0, -.04-offset).add(0, -2.1, 0);
|
||||||
location.setYaw(getYaw()-90);
|
location.setYaw(getYaw()-90);
|
||||||
stand = spawnArmorStand(location);
|
stand = spawnArmorStand(location.clone());
|
||||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
|
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(90, 0, 0)));
|
||||||
stand.setHelmet(new ItemStack(Material.IRON_FENCE));
|
stand.setHelmet(new ItemStack(Material.IRON_FENCE));
|
||||||
stand.setName("#IRON2#");
|
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 = getRelative(getCenter(), 0, .04+offset).add(0, -2.25, 0);
|
||||||
location.setYaw(getYaw()+90);
|
location.setYaw(getYaw()+90);
|
||||||
stand = spawnArmorStand(location);
|
stand = spawnArmorStand(location.clone());
|
||||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
|
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
|
||||||
stand.setName("#IRON3#");
|
stand.setName("#IRON3#");
|
||||||
stand3 = stand;
|
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 = getRelative(getCenter(), 0, -.04-offset).add(0, -2.25, 0);
|
||||||
location.setYaw(getYaw()-90);
|
location.setYaw(getYaw()-90);
|
||||||
stand = spawnArmorStand(location);
|
stand = spawnArmorStand(location.clone());
|
||||||
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
|
stand.setHeadPose(getLutil().degresstoRad(new EulerAngle(0, 0, 0)));
|
||||||
stand.setName("#IRON4#");
|
stand.setName("#IRON4#");
|
||||||
stand4 = stand;
|
stand4 = stand;
|
||||||
asList.add(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){
|
for(fArmorStand packet : asList){
|
||||||
packet.setInvisible(true);
|
packet.setInvisible(true);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: DiceFurniture
|
name: DiceFurniture
|
||||||
version: 2.6.6
|
version: 2.9.2
|
||||||
description: Add some new Objects to the Server
|
description: Add some new Objects to the Server
|
||||||
author: Ste3et_C0st
|
author: Ste3et_C0st
|
||||||
website: http://dicecraft.de
|
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