3.0.0.1 - Restarted

+ Restarted the project
+ Added BossAPI
+ Added BossEntity
+ Added BossManager
+ Added CustomEntityModel
This commit is contained in:
AMinecraftDev 2017-09-06 02:58:16 +08:00
parent 24079c208e
commit 869e16a0e7
55 changed files with 317 additions and 1761 deletions

View File

@ -34,12 +34,12 @@
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="Core" target="1.8" />
<module name="Core" target="1.5" />
<module name="custombosses" target="1.5" />
<module name="FactionsM" target="1.8" />
<module name="FactionsOne" target="1.8" />
<module name="FactionsUUID" target="1.8" />
<module name="PluginAPI" target="1.8" />
<module name="FactionsM" target="1.5" />
<module name="FactionsOne" target="1.5" />
<module name="FactionsUUID" target="1.5" />
<module name="PluginAPI" target="1.5" />
</bytecodeTargetLevel>
</component>
</project>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft:FactionsOne:1.2.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsOne/1.2.1/FactionsOne-1.2.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsOne/1.2.1/FactionsOne-1.2.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsOne/1.2.1/FactionsOne-1.2.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft:FactionsUUID:1.6.9.5-U0.1.20">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsUUID/1.6.9.5-U0.1.20/FactionsUUID-1.6.9.5-U0.1.20.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsUUID/1.6.9.5-U0.1.20/FactionsUUID-1.6.9.5-U0.1.20-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/FactionsUUID/1.6.9.5-U0.1.20/FactionsUUID-1.6.9.5-U0.1.20-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft.factions:Factions:2.9.1-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/Factions/2.9.1-SNAPSHOT/Factions-2.9.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/Factions/2.9.1-SNAPSHOT/Factions-2.9.1-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/factions/Factions/2.9.1-SNAPSHOT/Factions-2.9.1-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.massivecraft.massivecore:MassiveCore:2.9.1-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/massivecore/MassiveCore/2.9.1-SNAPSHOT/MassiveCore-2.9.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/massivecore/MassiveCore/2.9.1-SNAPSHOT/MassiveCore-2.9.1-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/massivecraft/massivecore/MassiveCore/2.9.1-SNAPSHOT/MassiveCore-2.9.1-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://C:/target/classes" />
<output-test url="file://C:/target/test-classes" />
<content url="file://$MODULE_DIR$">
@ -9,28 +9,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="PluginAPI" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.massivecraft.factions:Factions:2.9.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.massivecraft.massivecore:MassiveCore:2.9.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.spigotmc:spigot:1.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldguard:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.spigot:bukkit-classloader-check:1.8-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.8.6-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.opencsv:opencsv:2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:10.0.1" level="project" />
</component>
</module>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://C:/target/classes" />
<output-test url="file://C:/target/test-classes" />
<content url="file://$MODULE_DIR$">
@ -9,27 +9,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="PluginAPI" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.massivecraft:FactionsOne:1.2.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.spigotmc:spigot:1.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldguard:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.spigot:bukkit-classloader-check:1.8-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.8.6-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.opencsv:opencsv:2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:10.0.1" level="project" />
</component>
</module>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://C:/target/classes" />
<output-test url="file://C:/target/test-classes" />
<content url="file://$MODULE_DIR$">
@ -9,27 +9,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="PluginAPI" scope="PROVIDED" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.massivecraft:FactionsUUID:1.6.9.5-U0.1.20" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.spigotmc:spigot:1.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldguard:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.spigot:bukkit-classloader-check:1.8-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.8.6-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.opencsv:opencsv:2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:10.0.1" level="project" />
</component>
</module>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://C:/target/classes" />
<output-test url="file://C:/target/test-classes" />
<content url="file://$MODULE_DIR$">
@ -9,25 +9,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.spigotmc:spigot:1.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldguard:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.spigot:bukkit-classloader-check:1.8-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.8.6-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.opencsv:opencsv:2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:10.0.1" level="project" />
</component>
</module>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/../../target/classes" />
<output-test url="file://$MODULE_DIR$/../../target/test-classes" />
<content url="file://$MODULE_DIR$">
@ -9,29 +9,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="FactionsM" />
<orderEntry type="module" module-name="FactionsUUID" />
<orderEntry type="module" module-name="FactionsOne" />
<orderEntry type="module" module-name="PluginAPI" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.spigotmc:spigot:1.11.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldguard:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.spigot:bukkit-classloader-check:1.8-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.8.6-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:commandbook:2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.opencsv:opencsv:2.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:10.0.1" level="project" />
</component>
</module>

View File

@ -1,55 +0,0 @@
AutoSpawns:
'1':
Coords:
world: world
x: 0
y: 150
z: 0
PossibleSpawns:
- SKELETON
- ZOMBIE
- GIANT
Settings:
spawnIfChunkNotLoaded: false
maxSpawned: 1
bossesPerInterval: 1
spawnRate: 30m
spawnType: INTERVAL
holographicPlaceholder: '{custombosses_1}'
Messages:
onSpawn: []
Intervals:
'10':
- '&e&l(!) &bThe boss (#1) is about to spawn in {0} seconds!'
'60':
- '&e&l(!) &bThe boss (#1) is about to spawn in {0} seconds!'
'300':
- '&e&l(!) &bThe boss (#1) is about to spawn in 5 minutes!'
'2':
Coords:
world: world
x: 0
y: 150
z: 0
PossibleSpawns:
- SKELETON
Settings:
spawnIfChunkNotLoaded: false
maxSpawned: 1
bossesPerInterval: 1
spawnRate: 1m
spawnType: INTERVAL
holographicPlaceholder: '{custombosses_2}'
Messages:
onSpawn: []
Intervals:
'10':
- '&e&l(!) &bThe boss (#2) is about to spawn in {0} seconds!'
'30':
- '&e&l(!) &bThe boss (#2) is about to spawn in {0} seconds!'

View File

@ -1,135 +0,0 @@
Bosses:
#SKELETON BOSS CONFIGURATION SECTION
SKELETON:
Item:
type: '383:51'
name: '&6&lSkeleton King Boss Spawn Egg'
lore:
- '&7Right click a block to spawn'
- '&7the boss as that location.'
Boss:
targetType: VANILLA
type: SKELETON
name: '&6&l&nSkeleton King Boss'
health: 80
Armor:
type: GOLD
enchants:
- PROTECTION_ENVIRONMENTAL:4
- DURABILITY:3
Weapon:
type: DIAMOND_SWORD
enchants:
- KNOCKBACK:3
- DURABILITY:3
Head:
owner: AMinecraftDev
Potions:
'1':
type: DAMAGE_RESISTANCE
level: 3
duration: -1
Skills:
overallChance: 30.0
message: '&6&l{0} &7used &e{1}'
delay: 30s
list:
- 30:KNOCKBACK1
- 40:CAGE1
- 70:CAGE2
Drops:
NaturalDrops: false
DropTable: SkeletonTable1
Messages:
onSpawn:
- '&4'
- '&a&lA &6&l{boss} &a&lhas been spawned in the warzone!'
- '&4'
onDeath:
message:
- '&4'
- '&8&m---------&8&l[ &a&l{boss}&r &a&lKilled &8&l]&r&8&m---------'
- '&aKillers: &r{format}'
format: ' &6&l{position} &e{player} &7(&b{%}%&7) /n'
Taunts:
delay: 30s
messages:
- '&7Muahahahaha you can never beat me.'
- '&7You think that hurts someone like me?!'
Commands:
onSpawn:
- 'say onSpawn random command: {player} spawned me.'
onDeath:
- 'say onDeath random command: {player}'
#ZOMBIE BOSS CONFIGURATION SECTION
ZOMBIE:
Item:
type: '383:54'
name: '&2&lZombie King Boss Spawn Egg'
lore:
- '&7Right click a block to spawn'
- '&7the boss as that location.'
Boss:
targetType: DAMAGE
type: ZOMBIE
name: '&2&l&nZombie King Boss'
health: 100
Weapon:
type: DIAMOND_AXE
enchants:
- KNOCKBACK:3
- DURABILITY:3
Drops:
NaturalDrops: false
DropTable: ZombieTable1
Messages:
onSpawn:
- '&4'
- '&a&lA &6&l{boss} &a&lhas been spawned in the warzone!'
- '&4'
onDeath:
message:
- '&4'
- '&8&m---------&8&l[ &a&l{boss}&r &a&lKilled &8&l]&r&8&m---------'
- '&aKillers: &r{format}'
format: ' &6&l{position} &e{player} &7(&b{%}%&7) /n'
Taunts:
delay: 30s
messages:
- '&7Muahahahaha you can never beat me.'
- '&7You think that hurts someone like me?!'
Commands:
onSpawn:
- 'say onSpawn random command: {player} spawned me.'
onDeath:
- 'say onDeath random command: {player}'
#GIANT BOSS CONFIGURATION SECTION
GIANT:
Item:
type: '383:54'
name: '&b&lGiant Zombie Boss Spawn Egg'
lore:
- '&7Right click a block to spawn'
- '&7the boss as that location.'
Boss:
targetType: DAMAGE
type: GIANT
name: '&b&l&nGiant King Boss'
health: 100
Drops:
NaturalDrops: false
DropTable: GiantTable1
Messages:
onSpawn:
- '&4'
- '&a&lA &6&l{boss} &a&lhas been spawned in the warzone!'
- '&4'
onDeath:
message:
- '&4'
- '&8&m---------&8&l[ &a&l{boss}&r &a&lKilled &8&l]&r&8&m---------'
- '&aKillers: &r{format}'
format: ' &6&l{position} &e{player} &7(&b{%}%&7) /n'

View File

@ -1,102 +0,0 @@
Settings:
AutoSpawns:
enabled: true
sectionToTimeInCommand: '1'
BroadcastRange:
onDeath: -1
onHealth: 150
onSkill: 150
onSpawn: -1
onSpawnCommand: 0
onTaunt: 150
CommandsEnabled:
Help: true
KillAll: true
List: true
Reload: true
Spawn: true
Time: true
HealthBar:
ActionBar:
enabled: true
message: '&6{0}&7 has &c{1}/{2} health.'
BossBar:
enabled: false
message: '&6{0}'
useHealthBar: true
onSpawn:
Regions:
enabled: true
spawnRegions:
- 'spawn_region1'
blockedRegions:
- 'blocked_region1'
Worlds:
enabled: false
blockedWorlds:
- 'world_nether'
- 'world_the_end'
onSkill:
minionsPerSpawn: 5
maxMinionsPerBoss: 10
disableCageBreak: true
onDeath:
noReward:
onLava: true
onDrown: false
onSuffocate: false
GUI:
EggExtraLore:
- '&8&m-----------------------------------'
- '&7'
- '&6&lGet this egg:'
- '&f/giveegg {0} {1} [amount]'
- '&7'
- '&8&m-----------------------------------'
Inventory:
name: '&6&lCustom Bosses'
slots: 54
Items:
'54':
type: PAPER
name: '&e&lNext Page ->'
lore:
- '&7Click this to go to the &enext'
- '&epage&7, if there is one.'
NextPage: true
'53':
type: 102
name: '&e'
lore: []
'52':
type: 102
name: '&e'
lore: []
'51':
type: 102
name: '&e'
lore: []
'50':
type: 102
name: '&e'
lore: []
'49':
type: 102
name: '&e'
lore: []
'48':
type: 102
name: '&e'
lore: []
'47':
type: 102
name: '&e'
lore: []
'46':
type: PAPER
name: '&e&l<- Previous Page'
lore:
- '&7Click this to go the &eprevious'
- '&epage&7, if there is one.'
PreviousPage: true

View File

@ -1,144 +0,0 @@
#
# -----------------------------------------------------------------------------------------------------------------------------------------
#
SkeletonTable1: # Used in the identifier in bosses.yml
'1': # The position for rewards (1st most damage).
RequiredPercent: 20.0 # The required % to get this reward
RandomCustomDrop: false # Choose Random Custom Drops or go in order?
MaxCustomDrops: 5 # The maximum amount of custom drops.
customDrops: # The custom drops list.
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false # Choose Random Commands or go in order?
MaxCommands: 5 # The maximum amount of commands.
commands: # The commands list.
- '50: eco give %player% 500' # The 50: represents the chance of the command occurring, and after the ': ' is the command.
- '50: eco give %player% 2500' # If you are using the chance system you MUST put a space between the : and the commmand.
'2': # The position for rewards (2nd most damage).
RequiredPercent: 20.0 # The required % to get this reward
RandomCustomDrop: false # Choose Random Custom Drops or go in order?
MaxCustomDrops: 5 # The maximum amount of custom drops.
customDrops: # The custom drops list.
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false # Choose Random Commands or go in order?
MaxCommands: 5 # The maximum amount of commands.
commands: # The commands list.
- '50: eco give %player% 500' # The 50: represents the chance of the command occurring, and after the ': ' is the command.
- '50: eco give %player% 2500' # If you are using the chance system you MUST put a space between the : and the commmand.
'3': # The position for rewards (3rd most damage).
RequiredPercent: 20.0 # The required % to get this reward
RandomCustomDrop: false # Choose Random Custom Drops or go in order?
MaxCustomDrops: 5 # The maximum amount of custom drops.
customDrops: # The custom drops list.
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false # Choose Random Commands or go in order?
MaxCommands: 5 # The maximum amount of commands.
commands: # The commands list.
- '50: eco give %player% 500' # The 50: represents the chance of the command occurring, and after the ': ' is the command.
- '50: eco give %player% 2500' # If you are using the chance system you MUST put a space between the : and the commmand.
#
# -----------------------------------------------------------------------------------------------------------------------------------------
#
ZombieTable1:
'1':
RequiredPercent: 10.0
RandomCustomDrop: false
MaxCustomDrops: 5
customDrops:
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false
MaxCommands: 5
commands:
- '50: eco give %player% 5000'
- '50: eco give %player% 10000'
'2':
RequiredPercent: 10.0
RandomCustomDrop: false
MaxCustomDrops: 5
customDrops:
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false
MaxCommands: 5
commands:
- '50: eco give %player% 4000'
- '50: eco give %player% 7500'
'3':
RequiredPercent: 10.0
RandomCustomDrop: false
MaxCustomDrops: 5
customDrops:
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false
MaxCommands: 5
commands:
- '50: eco give %player% 300'
- '50: eco give %player% 5000'
#
# -----------------------------------------------------------------------------------------------------------------------------------------
#
GiantTable1:
'1':
RequiredPercent: 10.0
RandomCustomDrop: false
MaxCustomDrops: 5
customDrops:
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false
MaxCommands: 5
commands:
- '50: eco give %player% 10000'
- '50: eco give %player% 50000'
'2':
RequiredPercent: 10.0
RandomCustomDrop: false
MaxCustomDrops: 5
customDrops:
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false
MaxCommands: 5
commands:
- '50: eco give %player% 5000'
- '50: eco give %player% 25000'
'3':
RequiredPercent: 10.0
RandomCustomDrop: false
MaxCustomDrops: 5
customDrops:
- 'Chance:50 Item:Item1'
- 'Chance:50 Item:Item2'
RandomCommand: false
MaxCommands: 5
commands:
- '50: eco give %player% 5000'
- '50: eco give %player% 25000'
#
# -----------------------------------------------------------------------------------------------------------------------------------------
#

View File

@ -1,18 +0,0 @@
Item1:
amount: 1
type: STONE
name: '&5Epic Stone'
lore:
- '&7This stone is'
- '&7Lucky.'
enchants:
- DURABILITY:3
- DAMAGE_ALL:5
Item2:
amount: 5
type: WOOD
name: '&5Epic wood'
lore:
- '&7This wood is'
- '&7hard.'

View File

@ -1 +0,0 @@
# The configuration for all Messages.

View File

@ -1,4 +0,0 @@
name: CustomBosses
main: net.aminecraftdev.custombosses.CustomBosses
version: ${project.version}
author: AMinecraftDev

View File

@ -1,193 +0,0 @@
#---------------------------------------------------------------------------------------------------------------------------------
# Available skill modes:
#
# ALL - The skill will be applied to everyone within the radius.
# RANDOM - The skill will be applied to random people within the radius, with a 50% chance per person for it to happen to them.
# ONE - Will only effect the closest person to the boss.
# BOSS - The skill will only effect the boss.
#
#---------------------------------------------------------------------------------------------------------------------------------
# Available skill types:
#
# POTION - It's just a potion effect so it'll just apply the specified potions to the player.
# CUSTOM - It's a custom skill which requires a custom .java class, when this is used please add "customType: {type}" on the line
# underneath the type.
# COMMAND - Just runs specified commands in the commands list.
#
#---------------------------------------------------------------------------------------------------------------------------------
Skills:
BLIND1:
mode: ALL
type: POTION
radius: 10
Potions:
'1':
type: POISON
level: 1
duration: 5
'2':
type: BLINDNESS
level: 1
duration: 5
BLIND2:
mode: ALL
type: POTION
radius: 10
Potions:
'1':
type: POISON
level: 2
duration: 5
'2':
type: BLINDNESS
level: 2
duration: 5
CAGE1:
mode: ALL
type: CUSTOM
customType: CAGE
radius: 10
Cage:
Flat: IRON_BLOCK
Wall: IRON_FENCE
Inside: STATIONARY_LAVA
CAGE2:
mode: ALL
type: CUSTOM
customType: CAGE
radius: 10
Cage:
Flat: IRON_BLOCK
Wall: IRON_FENCE
Inside: STATIONARY_WATER
KNOCKBACK1:
mode: ALL
type: CUSTOM
customType: KNOCKBACK
radius: 10
multiplier: 2.5
KNOCKBACK2:
mode: ALL
type: CUSTOM
customType: KNOCKBACK
radius: 10
multiplier: 5
DISARM1:
mode: ONE
type: CUSTOM
customType: DISARM
radius: 10
WARP1:
mode: ONE
type: CUSTOM
customType: WARP
radius: 10
EXPLOSION1:
mode: ALL
type: POTION
radius: 2
Potions:
'1':
type: WITHER
level: 3
duration: 5
MINIONS1:
mode: BOSS
type: CUSTOM
customType: MINIONS
radius: 10
Boss:
type: ZOMBIE
name: '&a&lMinion Goblin'
health: 40
Armor:
type: LEATHER
enchants:
- PROTECTION_ENVIRONMENTAL:4
- DURABILITY:3
Weapon:
type: STONE
enchants:
- DAMAGE_ALL:10
- DURABILITY:3
Potions:
'1':
type: SPEED
level: 10
duration: -1
MINIONS2:
mode: BOSS
type: CUSTOM
customType: MINIONS
radius: 10
Boss:
type: SKELETON
name: '&a&lMinion Goblin'
health: 40
Armor:
type: LEATHER
enchants:
- PROTECTION_ENVIRONMENTAL:4
- DURABILITY:3
Weapon:
type: STONE
enchants:
- DAMAGE_ALL:10
- DURABILITY:3
Potions:
'1':
type: SPEED
level: 10
duration: -1
INSIDIOUS1:
mode: ALL
type: CUSTOM
customType: INSIDIOUS
radius: 10
burnDuration: 4
INSIDIOUS2:
mode: ALL
type: CUSTOM
customType: INSIDIOUS
radius: 10
burnDuration: 6
LOOT1:
mode: RANDOM
type: COMMAND
radius: 10
commands:
- '40:eco give {p} 100'
- '60:eco give {p} 1000'
LOOT2:
mode: RANDOM
type: COMMAND
radius: 10
commands:
- '40:eco give {p} 200'
- '60:eco give {p} 2000'

View File

@ -3,7 +3,7 @@ package net.aminecraftdev.custombosses;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
* @since 06-Sep-17
*/
public class CustomBosses {
}

View File

@ -0,0 +1,52 @@
package net.aminecraftdev.custombosses.api;
import net.aminecraftdev.custombosses.handlers.BossEntity;
import net.aminecraftdev.custombosses.managers.BossManager;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 06-Sep-17
*/
public class BossAPI {
public boolean createBoss(String entityType, double health, String identifier) {
try {
EntityType.valueOf(entityType);
} catch (IllegalArgumentException ex) {
return false;
}
if(BossManager.isBossEntitySet(identifier)) return false;
EntityType eType = EntityType.valueOf(entityType);
BossEntity bossEntity = new BossEntity(eType, health, identifier);
BossManager.addBossEntity(bossEntity);
return true;
}
public LivingEntity spawnBoss(String identifier, Location location) {
if(!BossManager.isBossEntitySet(identifier)) return null;
BossEntity bossEntity = BossManager.getBossEntity(identifier);
return bossEntity.createNewBossEntity(location);
}
public LivingEntity spawnMinion(String identifier, Location location) {
if(!BossManager.isBossEntitySet(identifier)) return null;
BossEntity bossEntity = BossManager.getBossEntity(identifier);
return bossEntity.createNewMinionEntity(location);
}
public BossEntity getBoss(String identifier) {
return BossManager.getBossEntity(identifier);
}
}

View File

@ -1,23 +0,0 @@
package net.aminecraftdev.custombosses.commands;
import net.aminecraftdev.custombosses.innerapi.command.SubCommand;
import net.aminecraftdev.custombosses.utils.Message;
import org.bukkit.command.CommandSender;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossHelpCmd extends SubCommand<CommandSender> {
public BossHelpCmd(String subCommand) {
super(subCommand);
}
@Override
public void execute(CommandSender sender, String[] args) {
Message.BossCommand_Help.msg(sender);
return;
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.commands;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossKillAllCmd {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.commands;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossListCmd {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.commands;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossReloadCmd {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.commands;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossSpawnCmd {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.commands;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossTimeCmd {
}

View File

@ -1,54 +0,0 @@
package net.aminecraftdev.custombosses.commands.base;
import net.aminecraftdev.custombosses.innerapi.command.SubCommand;
import net.aminecraftdev.custombosses.innerapi.command.SubCommandBuilder;
import net.aminecraftdev.custombosses.innerapi.command.builder.CommandService;
import net.aminecraftdev.custombosses.innerapi.command.builder.attributes.*;
import net.aminecraftdev.custombosses.utils.Message;
import org.bukkit.command.CommandSender;
import java.util.HashSet;
import java.util.Set;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
@Name("boss")
@Alias({"bosses", "custombosses", "customboss"})
@Permission("bosses.command.use")
@Description("Access all boss related features of CustomBosses.")
@NoPermission("&cI'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.")
public class BossCmd extends CommandService<CommandSender> implements SubCommandBuilder<CommandSender> {
private final Set<SubCommand<CommandSender>> subCommands = new HashSet<>();
public BossCmd() {
super(BossCmd.class);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(args.length == 0) {
Message.BossCommand_Help.msg(sender);
return;
}
for(SubCommand<CommandSender> subCommand : subCommands) {
if(subCommand.getSubCommand().equalsIgnoreCase(args[0])) {
subCommand.execute(sender, args);
return;
}
}
Message.BossCommand_Help.msg(sender);
return;
}
@Override
public void register(SubCommand<CommandSender> subCommand) {
subCommands.add(subCommand);
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.events;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossDamageEvent {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.events;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossDeathEvent {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.events;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossSkillEvent {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.events;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossSpawnEvent {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.handlers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class AutoSpawnHandler {
}

View File

@ -0,0 +1,26 @@
package net.aminecraftdev.custombosses.handlers;
import net.aminecraftdev.custombosses.models.CustomEntityModel;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import java.util.List;
import java.util.Map;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 06-Sep-17
*/
public class BossEntity extends CustomEntityModel {
public BossEntity(EntityType entityType, double health, String identifier) {
super(entityType, health, identifier);
}
public BossEntity(EntityType entityType, Map<Integer, ItemStack> equipment, List<String> description, List<PotionEffect> defaultPotionEffects, ItemStack itemStackInMainHand, ItemStack itemStackInOffHand, String identifier, double health, String name) {
super(entityType, equipment, description, defaultPotionEffects, itemStackInMainHand, itemStackInOffHand, identifier, health, name);
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.handlers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class MinionHandler {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.handlers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class TauntHandler {
}

View File

@ -1,129 +0,0 @@
package net.aminecraftdev.custombosses.handlers.builders;
import net.aminecraftdev.custombosses.innerapi.reflection.ReflectionUtils;
import org.bukkit.Location;
import org.bukkit.entity.*;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class EntityHandler extends ReflectionUtils {
public final LivingEntity getBaseEntity(String type, Location location) {
LivingEntity livingEntity = null;
EntityType entityType = null;
if(type.equalsIgnoreCase("WITHER_SKELETON")) livingEntity = getWitherSkeleton(location);
else if(type.equalsIgnoreCase("ELDER_GUARDIAN")) livingEntity = getElderGuardian(location);
else if(type.equalsIgnoreCase("KILLER_BUNNY")) livingEntity = getKillerBunny(location);
else if(type.equalsIgnoreCase("ZOMBIE")) livingEntity = getZombie(location);
else if(type.equalsIgnoreCase("BABY_ZOMBIE")) livingEntity = getBabyZombie(location);
else if(type.equalsIgnoreCase("PIG_ZOMBIE")) livingEntity = getPigZombie(location);
else if(type.equalsIgnoreCase("BABY_PIG_ZOMBIE")) livingEntity = getBabyPigZombie(location);
else if(type.contains(":")) {
String[] split = type.split(":");
if(split[0].equalsIgnoreCase("SLIME")) {
livingEntity = getSlime(location, Integer.valueOf(split[1]));
} else if(split[0].equalsIgnoreCase("MAGMA_CUBE")) {
livingEntity = getMagmaCube(location, Integer.valueOf(split[1]));
} else {
if(EntityType.valueOf(type).equals(null)) {
/* ADD A DEBUG MESSAGE HERE */
return null;
}
}
} else {
if(EntityType.valueOf(type).equals(null)) {
/* ADD A DEBUG MESSAGE HERE */
return null;
}
entityType = EntityType.valueOf(type);
}
if(livingEntity == null) {
if(entityType == EntityType.SLIME) getSlime(location, 10);
else if(entityType == EntityType.MAGMA_CUBE) getSlime(location, 10);
else {
livingEntity = (LivingEntity) location.getWorld().spawn(location, entityType.getEntityClass());
}
}
return livingEntity;
}
private LivingEntity getWitherSkeleton(Location location) {
if(getAPIVersion().startsWith("v1_11_R")) {
return (LivingEntity) location.getWorld().spawn(location, EntityType.WITHER_SKELETON.getEntityClass());
} else {
Skeleton skeleton = (Skeleton) location.getWorld().spawn(location, EntityType.SKELETON.getEntityClass());
skeleton.setSkeletonType(Skeleton.SkeletonType.WITHER);
return skeleton;
}
}
private LivingEntity getElderGuardian(Location location) {
if(getAPIVersion().startsWith("v1_11_R")) {
return (LivingEntity) location.getWorld().spawn(location, EntityType.ELDER_GUARDIAN.getEntityClass());
} else {
Guardian guardian = (Guardian) location.getWorld().spawn(location, EntityType.GUARDIAN.getEntityClass());
guardian.setElder(true);
return guardian;
}
}
private LivingEntity getKillerBunny(Location location) {
Rabbit rabbit = (Rabbit) location.getWorld().spawn(location, EntityType.RABBIT.getEntityClass());
rabbit.setRabbitType(Rabbit.Type.THE_KILLER_BUNNY);
return rabbit;
}
private LivingEntity getBabyZombie(Location location) {
Zombie zombie = (Zombie) location.getWorld().spawn(location, EntityType.ZOMBIE.getEntityClass());
zombie.setBaby(true);
return zombie;
}
private LivingEntity getZombie(Location location) {
Zombie zombie = (Zombie) location.getWorld().spawn(location, EntityType.ZOMBIE.getEntityClass());
zombie.setBaby(false);
return zombie;
}
private LivingEntity getBabyPigZombie(Location location) {
PigZombie pigZombie = (PigZombie) location.getWorld().spawn(location, EntityType.PIG_ZOMBIE.getEntityClass());
pigZombie.setBaby(true);
return pigZombie;
}
private LivingEntity getPigZombie(Location location) {
PigZombie pigZombie = (PigZombie) location.getWorld().spawn(location, EntityType.PIG_ZOMBIE.getEntityClass());
pigZombie.setBaby(false);
return pigZombie;
}
private LivingEntity getSlime(Location location, int size) {
Slime slime = (Slime) location.getWorld().spawn(location, EntityType.SLIME.getEntityClass());
slime.setSize(size);
return slime;
}
private LivingEntity getMagmaCube(Location location, int size) {
MagmaCube magmaCube = (MagmaCube) location.getWorld().spawn(location, EntityType.MAGMA_CUBE.getEntityClass());
magmaCube.setSize(size);
return magmaCube;
}
}

View File

@ -1,77 +0,0 @@
package net.aminecraftdev.custombosses.handlers.builders;
import net.aminecraftdev.custombosses.innerapi.itemstack.ItemStackUtils;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class EquipmentHandler {
public void applyEquipment(LivingEntity livingEntity, ConfigurationSection configurationSection) {
Map<Enchantment, Integer> mapOfEnchants = getMapOfEnchants(configurationSection);
String type = configurationSection.getString("type").toUpperCase();
if(configurationSection.getName().equalsIgnoreCase("Armor")) {
String innerType = type + "_HELMET";
livingEntity.getEquipment().setHelmet(getArmour(innerType, mapOfEnchants));
innerType = type + "_CHESTPLATE";
livingEntity.getEquipment().setChestplate(getArmour(innerType, mapOfEnchants));
innerType = type + "_LEGGINGS";
livingEntity.getEquipment().setLeggings(getArmour(innerType, mapOfEnchants));
innerType = type + "_BOOTS";
livingEntity.getEquipment().setBoots(getArmour(innerType, mapOfEnchants));
} else {
ItemStack itemStack = new ItemStack(ItemStackUtils.getType(type));
itemStack.addUnsafeEnchantments(mapOfEnchants);
livingEntity.getEquipment().setItemInHand(itemStack);
}
}
public void applySkull(LivingEntity livingEntity, ConfigurationSection configurationSection) {
String owner = configurationSection.getString("owner");
ItemStack itemStack = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta();
skullMeta.setOwner(owner);
itemStack.setItemMeta(skullMeta);
livingEntity.getEquipment().setHelmet(itemStack);
}
private Map<Enchantment, Integer> getMapOfEnchants(ConfigurationSection configurationSection) {
Map<Enchantment, Integer> enchantmentIntegerMap = new HashMap<>();
List<String> enchantsList = configurationSection.getStringList("enchants");
for(String s : enchantsList) {
String[] spl = s.split(":");
String ench = spl[0];
int level = Integer.parseInt(spl[1]);
enchantmentIntegerMap.put(Enchantment.getByName(ench), level);
}
return enchantmentIntegerMap;
}
private ItemStack getArmour(String type, Map<Enchantment, Integer> enchantments) {
ItemStack itemStack = new ItemStack(ItemStackUtils.getType(type));
itemStack.addUnsafeEnchantments(enchantments);
return itemStack;
}
}

View File

@ -1,140 +0,0 @@
package net.aminecraftdev.custombosses.handlers.mobs;
import net.aminecraftdev.custombosses.handlers.mobs.interfaces.IDamageHandler;
import net.aminecraftdev.custombosses.handlers.mobs.interfaces.IKillHandler;
import net.aminecraftdev.custombosses.handlers.mobs.interfaces.IMobHandler;
import net.aminecraftdev.custombosses.handlers.mobs.interfaces.ISpawnHandler;
import net.aminecraftdev.custombosses.innerapi.message.MessageUtils;
import net.aminecraftdev.custombosses.managers.BossManager;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import java.util.UUID;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class BossEntity implements IMobHandler, ISpawnHandler, IDamageHandler, IKillHandler {
private boolean hasSkills, hasTaunts, hasCommands, hasMessages, isAutoBoss;
private ConfigurationSection configurationSection;
private LivingEntity livingEntity;
private BossManager bossManager;
private boolean isBossSpawned;
private double maxHealth;
private UUID uuid;
//private Set<Skill> skills = new HashSet<>();
//private List<String> taunts = new ArrayList<>();
public BossEntity(ConfigurationSection configurationSection, BossManager bossManager, boolean isAutoBoss) {
this.hasSkills = this.configurationSection.contains("Skills");
this.hasTaunts = this.configurationSection.contains("Taunts");
this.hasCommands = this.configurationSection.contains("Commands");
this.hasMessages = this.configurationSection.contains("Messages");
this.configurationSection = configurationSection;
this.bossManager = bossManager;
this.isBossSpawned = false;
this.isAutoBoss = isAutoBoss;
}
@Override
public ConfigurationSection getConfigurationSection() {
return configurationSection;
}
@Override
public double getMaxHealth() {
return maxHealth;
}
@Override
public double getCurrentHealth() {
return livingEntity.getHealth();
}
@Override
public UUID getUniqueId() {
return uuid;
}
@Override
public boolean isAutoBoss() {
return isAutoBoss;
}
@Override
public void spawn(Location location) {
spawnBoss(location);
spawnMessage(location);
}
@Override
public void spawnBoss(Location location) {
if(this.isBossSpawned) {
/* ADD DEBUG MESSAGE HERE */
return;
}
ConfigurationSection bossConfigurationSection = configurationSection.getConfigurationSection("Boss");
String type = bossConfigurationSection.getString("type");
String targetType = bossConfigurationSection.getString("targetType");
String name = bossConfigurationSection.contains("name")? bossConfigurationSection.getString("name") : "";
double health = bossConfigurationSection.getDouble("health");
this.livingEntity = this.bossManager.getEntityHandler().getBaseEntity(type, location);
this.livingEntity.setCustomName(MessageUtils.translateString(name));
this.livingEntity.setCustomNameVisible(true);
this.livingEntity.setMaxHealth(health);
this.livingEntity.setHealth(health);
this.livingEntity.setRemoveWhenFarAway(false);
this.livingEntity.setCanPickupItems(false);
if(bossConfigurationSection.contains("Armor")) this.bossManager.getEquipmentHandler().applyEquipment(this.livingEntity, bossConfigurationSection.getConfigurationSection("Armor"));
if(bossConfigurationSection.contains("Weapon")) this.bossManager.getEquipmentHandler().applyEquipment(this.livingEntity, bossConfigurationSection.getConfigurationSection("Weapon"));
if(bossConfigurationSection.contains("Head")) this.bossManager.getEquipmentHandler().applySkull(this.livingEntity, bossConfigurationSection.getConfigurationSection("Head"));
if(bossConfigurationSection.contains("Potions")) this.bossManager.applyPotionEffects(this.livingEntity, bossConfigurationSection.getConfigurationSection("Potions"));
this.maxHealth = health;
this.livingEntity.getEquipment().setHelmetDropChance(0.0F);
this.livingEntity.getEquipment().setChestplateDropChance(0.0F);
this.livingEntity.getEquipment().setLeggingsDropChance(0.0F);
this.livingEntity.getEquipment().setBootsDropChance(0.0F);
/* HANDLE TARGET SYSTEM HERE */
this.uuid = this.livingEntity.getUniqueId();
}
@Override
public void spawnMessage(Location location) {
if(!hasMessages) return;
if(!configurationSection.contains("Messages.onSpawn")) return;
}
@Override
public void onDamage(Player damager, int damage) {
}
@Override
public void kill(Location location) {
}
@Override
public void killBoss(Location location) {
}
@Override
public void killMessage(Location location) {
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.handlers.mobs;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class MinionEntity {
}

View File

@ -1,14 +0,0 @@
package net.aminecraftdev.custombosses.handlers.mobs.interfaces;
import org.bukkit.entity.Player;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public interface IDamageHandler {
void onDamage(Player damager, int damage);
}

View File

@ -1,16 +0,0 @@
package net.aminecraftdev.custombosses.handlers.mobs.interfaces;
import org.bukkit.Location;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public interface IKillHandler {
void killBoss(Location location);
void killMessage(Location location);
}

View File

@ -1,29 +0,0 @@
package net.aminecraftdev.custombosses.handlers.mobs.interfaces;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import java.util.UUID;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public interface IMobHandler {
ConfigurationSection getConfigurationSection();
double getMaxHealth();
double getCurrentHealth();
UUID getUniqueId();
boolean isAutoBoss();
void spawn(Location location);
void kill(Location location);
}

View File

@ -1,16 +0,0 @@
package net.aminecraftdev.custombosses.handlers.mobs.interfaces;
import org.bukkit.Location;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public interface ISpawnHandler {
void spawnBoss(Location location);
void spawnMessage(Location location);
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.managers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class AutoSpawnManager {
}

View File

@ -1,55 +1,29 @@
package net.aminecraftdev.custombosses.managers;
import net.aminecraftdev.custombosses.handlers.builders.EntityHandler;
import net.aminecraftdev.custombosses.handlers.builders.EquipmentHandler;
import net.aminecraftdev.custombosses.handlers.mobs.BossEntity;
import net.aminecraftdev.custombosses.handlers.mobs.MinionEntity;
import net.aminecraftdev.custombosses.innerapi.PotionUtils;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import net.aminecraftdev.custombosses.handlers.BossEntity;
import java.util.HashSet;
import java.util.Set;
import java.util.HashMap;
import java.util.Map;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
* @since 06-Sep-17
*/
public class BossManager {
private static final Set<BossEntity> BOSSES = new HashSet<>();
private static final Set<MinionEntity> MINIONS = new HashSet<>();
private EntityHandler entityHandler;
private EquipmentHandler equipmentHandler;
private static final Map<String, BossEntity> MAP_OF_BOSSES = new HashMap<>();
public BossManager() {
this.entityHandler = new EntityHandler();
this.equipmentHandler = new EquipmentHandler();
public static boolean isBossEntitySet(String identifier) {
return MAP_OF_BOSSES.containsKey(identifier);
}
public EntityHandler getEntityHandler() {
return entityHandler;
public static void addBossEntity(BossEntity bossEntity) {
MAP_OF_BOSSES.put(bossEntity.getIdentifier(), bossEntity);
}
public EquipmentHandler getEquipmentHandler() {
return equipmentHandler;
public static BossEntity getBossEntity(String identifier) {
return MAP_OF_BOSSES.getOrDefault(identifier, null);
}
public void applyPotionEffects(LivingEntity livingEntity, ConfigurationSection configurationSection) {
for(String s : configurationSection.getKeys(false)) {
PotionEffect potionEffect = PotionUtils.getPotionEffect(configurationSection.getConfigurationSection(s));
if(potionEffect == null) continue;
livingEntity.addPotionEffect(potionEffect);
}
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.managers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class ItemManager {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.managers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class MinionManager {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.managers;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class SkillManager {
}

View File

@ -0,0 +1,216 @@
package net.aminecraftdev.custombosses.models;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import java.util.*;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 06-Sep-17
*/
public class CustomEntityModel {
private List<PotionEffect> defaultPotionEffects = new ArrayList<>();
private Map<UUID, Location> spawnedLocations = new HashMap<>();
private Map<Integer, ItemStack> equipment = new HashMap<>();
private Set<LivingEntity> minionsSpawned = new HashSet<>();
private Set<LivingEntity> bossesSpawned = new HashSet<>();
private List<String> description = new ArrayList<>();
private ItemStack itemStackInMainHand;
private ItemStack itemStackInOffHand;
private boolean canDropEquipment;
private EntityType entityType;
private String identifier;
private double health;
private String name;
public CustomEntityModel(EntityType entityType, double health, String identifier) {
this(entityType, null, null, null, null, null, identifier, health, null);
}
public CustomEntityModel(EntityType entityType, Map<Integer, ItemStack> equipment, List<String> description, List<PotionEffect> defaultPotionEffects, ItemStack itemStackInMainHand, ItemStack itemStackInOffHand, String identifier, double health, String name) {
this.entityType = entityType;
this.identifier = identifier;
setItemStackInMainHand(itemStackInMainHand);
setItemStackInOffHand(itemStackInOffHand);
setMaxHealth(health);
setName(name);
if(equipment != null) equipment.forEach((integer, itemStack) -> setEquipment(integer, itemStack));
if(description != null) setDescription(description);
if(this.defaultPotionEffects != null) defaultPotionEffects.forEach(potionEffect -> addDefaultPotionEffects(potionEffect));
}
public String getIdentifier() {
return identifier;
}
public List<PotionEffect> getDefaultPotionEffects() {
return new ArrayList<>(defaultPotionEffects);
}
public void addDefaultPotionEffects(PotionEffect potionEffect) {
defaultPotionEffects.add(potionEffect);
}
public Set<LivingEntity> getBossesSpawned() {
return new HashSet<>(bossesSpawned);
}
public Set<LivingEntity> getMinionsSpawned() {
return new HashSet<>(minionsSpawned);
}
public Map<UUID, Location> getSpawnedLocations() {
return new HashMap<>(spawnedLocations);
}
public Map<Integer, ItemStack> getEquipment() {
return new HashMap<>(equipment);
}
public void setEquipment(int slot, ItemStack itemStack) {
if(slot > 3) return;
equipment.put(slot, itemStack);
}
public List<String> getDescription() {
return new ArrayList<>(description);
}
public void setDescription(List<String> description) {
this.description = description;
}
public void addDescription(String line) {
description.add(line);
}
public ItemStack getItemStackInMainHand() {
return itemStackInMainHand;
}
public void setItemStackInMainHand(ItemStack itemStack) {
this.itemStackInMainHand = itemStack;
}
public ItemStack getItemStackInOffHand() {
return itemStackInOffHand;
}
public void setItemStackInOffHand(ItemStack itemStack) {
this.itemStackInOffHand = itemStack;
}
public double getMaxHealth() {
return health;
}
public void setMaxHealth(double health) {
this.health = health;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public EntityType getEntityType() {
return entityType;
}
public boolean canDropEquipment() {
return canDropEquipment;
}
public void setCanDropEquipment(boolean bool) {
this.canDropEquipment = bool;
}
public LivingEntity createNewBossEntity(Location location) {
LivingEntity livingEntity = createNewEntity(location);
bossesSpawned.add(livingEntity);
spawnedLocations.put(livingEntity.getUniqueId(), location);
return livingEntity;
}
public LivingEntity createNewMinionEntity(Location location) {
LivingEntity livingEntity = createNewEntity(location);
minionsSpawned.add(livingEntity);
return livingEntity;
}
private LivingEntity createNewEntity(Location location) {
LivingEntity livingEntity = (LivingEntity) location.getWorld().spawn(location, entityType.getEntityClass());
EntityEquipment entityEquipment = livingEntity.getEquipment();
livingEntity.setMaxHealth(getMaxHealth());
livingEntity.setHealth(getMaxHealth());
if(getName() != null) {
livingEntity.setCustomName(getName());
livingEntity.setCustomNameVisible(true);
}
if(getItemStackInMainHand() != null) {
entityEquipment.setItemInMainHand(getItemStackInMainHand());
if(!canDropEquipment()) entityEquipment.setItemInMainHandDropChance(0);
}
if(getItemStackInOffHand() != null) {
entityEquipment.setItemInOffHand(getItemStackInOffHand());
if(!canDropEquipment()) entityEquipment.setItemInOffHandDropChance(0);
}
if(!getEquipment().isEmpty()) {
if(equipment.containsKey(0)) {
entityEquipment.setHelmet(equipment.get(0));
if(!canDropEquipment()) entityEquipment.setHelmetDropChance(0);
}
if(equipment.containsKey(1)) {
entityEquipment.setChestplate(equipment.get(1));
if(!canDropEquipment()) entityEquipment.setChestplateDropChance(0);
}
if(equipment.containsKey(2)) {
entityEquipment.setLeggings(equipment.get(2));
if(!canDropEquipment()) entityEquipment.setLeggingsDropChance(0);
}
if(equipment.containsKey(3)) {
entityEquipment.setBoots(equipment.get(3));
if(!canDropEquipment()) entityEquipment.setBootsDropChance(0);
}
}
if(!getDefaultPotionEffects().isEmpty()) {
livingEntity.addPotionEffects(defaultPotionEffects);
}
return livingEntity;
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.target;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public interface ITarget {
}

View File

@ -1,18 +0,0 @@
package net.aminecraftdev.custombosses.target;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public enum TargetTypes {
VANILLA(),
DAMAGE(),
INTERVAL();
TargetTypes() {
}
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.target.types;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class TargetDamage {
}

View File

@ -1,9 +0,0 @@
package net.aminecraftdev.custombosses.target.types;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public class TargetInterval {
}

View File

@ -1,201 +0,0 @@
package net.aminecraftdev.custombosses.utils;
import net.aminecraftdev.custombosses.innerapi.message.MessageUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
/**
* @author AMinecraftDev
* @version 1.0.0
* @since 31-May-17
*/
public enum Message {
BossCommand_Help(
" &4\n" +
"&7&m-----------------&b&l[ &a&lCustomBosses&r &b&l]&7&m-----------------&r\n" +
" &4\n" +
"&6/boss spawn (type) (x) (y) (z) (world) &e&m-&f&o Spawn a boss at the coordinates.\n" +
"&7/boss spawn (type) (player) &e&m-&f&o Spawn a boss on a player.\n" +
"&6/boss time &e&m-&f&o View the time until the next boss auto-spawn.\n" +
"&6/boss reload &e&m-&f&o Reloads the YML files for CustomBosses.\n" +
"&6/boss killall &e&m-&f&o Kills all currently spawned bosses/minions.\n" +
"&6/boss list &e&m-&f&o Opens a GUI with all the available boss eggs.\n" +
"&6/giveegg (player) (boss) [amount] &e&m-&f&o Gives the specified player a boss egg.\n" +
" &4\n" +
"&7&m-----------------&b&l[ &a&lCustomBosses&r &b&l]&7&m-----------------&r\n" +
" &4"),
BossCommand_KillAll_Blocked("&c&l[!] &cThe KillAll command is blocked!"),
BossCommand_KillAll_Killed("&a&l[!] &fYou've killed &e{0}&f bosses/minions."),
BossCommand_List("&a&l[!] &fYou are now viewing all custom bosses."),
BossCommand_Reload("&a&l[!] &fYou just reloaded the files for CustomBosses."),
BossCommand_Spawn_InvalidBoss("&c&l[!] &cThe specified boss doesn't exist!"),
BossCommand_Spawn_InvalidLocation("&c&l[!] &cThe specified location is invalid!"),
BossCommand_Spawn_InvalidWorld("&c&l[!] &cThe specified world doesn't exist!"),
BossCommand_Spawn_Spawned("&a&l[!] &fYou have spawned a &e{0}&f boss at &e{1}&f."),
BossCommand_Time_Display("&a&l[!] &fThere is currently &e{0}&f left till next spawn."),
BossCommand_Time_NotEnabled("&c&l[!] &cThe boss time command has been disabled."),
GiveEggCommand_Given_Receiver("&a&l[!] &fYou have received &e{0}x&f boss egg(s)."),
GiveEggCommand_Given_Sender("&a&l[!] &fYou have given &e{0}x&f boss egg(s) to &e{1}&f."),
GiveEggCommand_Help(
" &4\n" +
"&7&m-----------------&b&l[ &a&lCustomBosses&r &b&l]&7&m-----------------&r\n" +
" &4\n" +
"&6/boss spawn (type) (x) (y) (z) (world) &e&m-&f&o Spawn a boss at the coordinates.\n" +
"&7/boss spawn (type) (player) &e&m-&f&o Spawn a boss on a player.\n" +
"&6/boss time &e&m-&f&o View the time until the next boss auto-spawn.\n" +
"&6/boss reload &e&m-&f&o Reloads the YML files for CustomBosses.\n" +
"&6/boss killall &e&m-&f&o Kills all currently spawned bosses/minions.\n" +
"&6/boss list &e&m-&f&o Opens a GUI with all the available boss eggs.\n" +
"&6/giveegg (player) (boss) [amount] &e&m-&f&o Gives the specified player a boss egg.\n" +
" &4\n" +
"&7&m-----------------&b&l[ &a&lCustomBosses&r &b&l]&7&m-----------------&r\n" +
" &4"),
GiveEggCommand_InvalidBoss("&c&l[!] &cThe specified boss doesn't exist!"),
Settings_InvalidNumber("&c&l[!] &cYou have specified an invalid number!"),
Settings_InventorySpace("&c&l[!] &cYou do not have enough inventory space for that!"),
Settings_ItemStack_Max("&c&l[!] &cThe maximum ItemStack size is 64!"),
Settings_ItemStack_Min("&c&l[!] &cThe minimum ItemStack size is 1!"),
Settings_ItemStack_Null("&c&l[!] &cThe specified ItemStack cannot be null or air!"),
Settings_MustBePlayer("&c&l[!] &cYou must be a player to use that feature!"),
Settings_NotOnline("&c&l[!] &cThe player you specified is offline or doesn't exist!");
private String path;
private String msg;
private static FileConfiguration LANG;
Message(String string) {
this.path = "Messages." + this.name().replace("_", ".");
this.msg = string;
}
public static void setFile(FileConfiguration configuration) {
LANG = configuration;
}
@Override
public String toString() {
String s = ChatColor.translateAlternateColorCodes('&', LANG.getString(this.path, msg));
return s;
}
public String toString(Object... args) {
String s = ChatColor.translateAlternateColorCodes('&', LANG.getString(this.path, msg));
return getMessageReplaced(s, args);
}
public String getDefault() {
return this.msg;
}
public String getPath() {
return this.path;
}
public void msg(CommandSender p, Object... order) {
String s = toString();
if(s.contains("\n")) {
String[] split = s.split("\n");
for(String inner : split) {
messageString(p, inner, order);
}
} else {
messageString(p, s, order);
}
}
public void broadcast(Object... order) {
String s = toString();
if(s.contains("\n")) {
String[] split = s.split("\n");
for(String s1 : split) {
for(Player player : Bukkit.getOnlinePlayers()) {
messageString(player, s1, order);
}
}
} else {
for(Player player : Bukkit.getOnlinePlayers()) {
messageString(player, s, order);
}
}
}
/**
*
* Private Enum methods
*
*
*/
private void messageString(CommandSender player, String s, Object... order) {
if(s.equalsIgnoreCase("")) return;
if(s.contains("{c}")) {
MessageUtils.sendCenteredMessage(player, getMessageReplaced(s, order).replace("{c}", ""));
} else {
player.sendMessage(getMessageReplaced(s, order));
}
}
private String getMessageReplaced(String s, Object... order) {
int current = 0;
for(Object object : order) {
String placeholder = "{" + current + "}";
if(s.contains(placeholder)) {
if(object instanceof CommandSender) {
s = s.replace(placeholder, ((CommandSender) object).getName());
}
if(object instanceof Location) {
Location location = (Location) object;
String repl = location.getWorld().getName() + ", " + location.getBlockX() + ", " + location.getBlockY() + ", " + location.getBlockZ();
s = s.replace(placeholder, repl);
}
if(object instanceof String) {
s = s.replace(placeholder, MessageUtils.translateString((String) object));
}
if(object instanceof Integer) {
s = s.replace(placeholder, ""+object);
}
if(object instanceof ItemStack) {
s = s.replace(placeholder, getItemStackName((ItemStack) object));
}
}
current++;
}
return s;
}
private String getItemStackName(ItemStack itemStack) {
String name = itemStack.getType().toString().replace("_", " ");
if(itemStack.hasItemMeta() && itemStack.getItemMeta().hasDisplayName()) {
return itemStack.getItemMeta().getDisplayName();
}
return name;
}
}

View File

@ -7,7 +7,7 @@
<groupId>net.aminecraftdev.custombosses</groupId>
<artifactId>CustomBosses</artifactId>
<packaging>pom</packaging>
<version>3.0.0.0</version>
<version>3.0.0.1</version>
<modules>
<module>api-modules/FactionsM</module>
<module>api-modules/FactionsOne</module>