mirror of
https://github.com/songoda/EpicBosses.git
synced 2025-01-12 18:20:40 +01:00
1.0.0-SNAPSHOT-U166
+ Added HolographicDisplays support + Set up Holograms for the boss/minion names above them
This commit is contained in:
parent
ec073be198
commit
e4fceb2fb7
.idea/libraries
TODOplugin-modules/Core
pom.xml@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.gmail.filoghost.holographicdisplays:holographicdisplays-api:2.3.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/gmail/filoghost/holographicdisplays/holographicdisplays-api/2.3.0/holographicdisplays-api-2.3.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/gmail/filoghost/holographicdisplays/holographicdisplays-api/2.3.0/holographicdisplays-api-2.3.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/gmail/filoghost/holographicdisplays/holographicdisplays-api/2.3.0/holographicdisplays-api-2.3.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
3
TODO
3
TODO
@ -9,8 +9,7 @@
|
|||||||
01:00 -> Wilderness - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance
|
01:00 -> Wilderness - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance
|
||||||
01:00 -> Spawner - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance
|
01:00 -> Spawner - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance
|
||||||
00:30 -> Connect the /boss time [section] to the AutoSpawns timer (can only be applied to Interval AutoSpawns)
|
00:30 -> Connect the /boss time [section] to the AutoSpawns timer (can only be applied to Interval AutoSpawns)
|
||||||
00:30 -> Add support for HolographicDisplays placeholder as the entityName for bosses and minions
|
|
||||||
01:00 -> Add a new branch for the plugin and add support for Legacy version
|
01:00 -> Add a new branch for the plugin and add support for Legacy version
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
15:45 hrs
|
15:15 hrs
|
@ -22,6 +22,8 @@ Hooks:
|
|||||||
Factions:
|
Factions:
|
||||||
enabled: false
|
enabled: false
|
||||||
useWarzoneSpawnRegion: false
|
useWarzoneSpawnRegion: false
|
||||||
|
HolographicDisplays:
|
||||||
|
enabled: false
|
||||||
StackMob:
|
StackMob:
|
||||||
enabled: false
|
enabled: false
|
||||||
WorldGuard:
|
WorldGuard:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.songoda.epicbosses;
|
package com.songoda.epicbosses;
|
||||||
|
|
||||||
import com.songoda.epicbosses.container.MinionEntityContainer;
|
import com.songoda.epicbosses.container.MinionEntityContainer;
|
||||||
|
import com.songoda.epicbosses.utils.dependencies.HolographicDisplayHelper;
|
||||||
import com.songoda.epicbosses.utils.dependencies.VaultHelper;
|
import com.songoda.epicbosses.utils.dependencies.VaultHelper;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import com.songoda.epicbosses.api.BossAPI;
|
import com.songoda.epicbosses.api.BossAPI;
|
||||||
@ -61,6 +62,7 @@ public class CustomBosses extends JavaPlugin implements IReloadable {
|
|||||||
@Getter private YmlFileHandler langFileHandler, editorFileHandler, configFileHandler;
|
@Getter private YmlFileHandler langFileHandler, editorFileHandler, configFileHandler;
|
||||||
@Getter private FileConfiguration lang, editor, config;
|
@Getter private FileConfiguration lang, editor, config;
|
||||||
|
|
||||||
|
@Getter private HolographicDisplayHelper holographicDisplayHelper;
|
||||||
@Getter private VaultHelper vaultHelper;
|
@Getter private VaultHelper vaultHelper;
|
||||||
|
|
||||||
@Getter private boolean debug = false;
|
@Getter private boolean debug = false;
|
||||||
@ -75,7 +77,9 @@ public class CustomBosses extends JavaPlugin implements IReloadable {
|
|||||||
Debug.setPlugin(this);
|
Debug.setPlugin(this);
|
||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
vaultHelper = new VaultHelper();
|
|
||||||
|
this.vaultHelper = new VaultHelper();
|
||||||
|
this.holographicDisplayHelper = new HolographicDisplayHelper();
|
||||||
|
|
||||||
long beginMs = System.currentTimeMillis();
|
long beginMs = System.currentTimeMillis();
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.songoda.epicbosses.mechanics.boss;
|
package com.songoda.epicbosses.mechanics.boss;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.CustomBosses;
|
||||||
import com.songoda.epicbosses.entity.BossEntity;
|
import com.songoda.epicbosses.entity.BossEntity;
|
||||||
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
||||||
import com.songoda.epicbosses.entity.elements.MainStatsElement;
|
import com.songoda.epicbosses.entity.elements.MainStatsElement;
|
||||||
@ -12,11 +13,11 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
* @author Charles Cullen
|
* @author Charles Cullen
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 27-Jun-18
|
* @since 27-Jun-18
|
||||||
*
|
|
||||||
* TODO: Make a hologram above name instead of using default CustomName
|
|
||||||
*/
|
*/
|
||||||
public class NameMechanic implements IBossMechanic {
|
public class NameMechanic implements IBossMechanic {
|
||||||
|
|
||||||
|
private CustomBosses plugin = CustomBosses.get();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) {
|
public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) {
|
||||||
if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false;
|
if(activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false;
|
||||||
@ -29,8 +30,15 @@ public class NameMechanic implements IBossMechanic {
|
|||||||
if(livingEntity == null) return false;
|
if(livingEntity == null) return false;
|
||||||
|
|
||||||
if(customName != null) {
|
if(customName != null) {
|
||||||
livingEntity.setCustomName(StringUtils.get().translateColor(customName));
|
String formattedName = StringUtils.get().translateColor(customName);
|
||||||
livingEntity.setCustomNameVisible(true);
|
|
||||||
|
if(CustomBosses.get().getConfig().getBoolean("Hooks.HolographicDisplays.enabled", false) && this.plugin.getHolographicDisplayHelper().isConnected()) {
|
||||||
|
this.plugin.getHolographicDisplayHelper().createHologram(livingEntity, formattedName);
|
||||||
|
livingEntity.setCustomNameVisible(false);
|
||||||
|
} else {
|
||||||
|
livingEntity.setCustomName(formattedName);
|
||||||
|
livingEntity.setCustomNameVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.songoda.epicbosses.mechanics.minions;
|
package com.songoda.epicbosses.mechanics.minions;
|
||||||
|
|
||||||
|
import com.songoda.epicbosses.CustomBosses;
|
||||||
import com.songoda.epicbosses.entity.MinionEntity;
|
import com.songoda.epicbosses.entity.MinionEntity;
|
||||||
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
import com.songoda.epicbosses.entity.elements.EntityStatsElement;
|
||||||
import com.songoda.epicbosses.entity.elements.MainStatsElement;
|
import com.songoda.epicbosses.entity.elements.MainStatsElement;
|
||||||
@ -12,11 +13,11 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
* @author Charles Cullen
|
* @author Charles Cullen
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 27-Jun-18
|
* @since 27-Jun-18
|
||||||
*
|
|
||||||
* TODO: Make a hologram above name instead of using default CustomName
|
|
||||||
*/
|
*/
|
||||||
public class NameMechanic implements IMinionMechanic {
|
public class NameMechanic implements IMinionMechanic {
|
||||||
|
|
||||||
|
private CustomBosses plugin = CustomBosses.get();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) {
|
public boolean applyMechanic(MinionEntity minionEntity, ActiveMinionHolder activeMinionHolder) {
|
||||||
if(activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) return false;
|
if(activeMinionHolder.getLivingEntityMap() == null || activeMinionHolder.getLivingEntityMap().isEmpty()) return false;
|
||||||
@ -29,8 +30,15 @@ public class NameMechanic implements IMinionMechanic {
|
|||||||
if(livingEntity == null) return false;
|
if(livingEntity == null) return false;
|
||||||
|
|
||||||
if(customName != null) {
|
if(customName != null) {
|
||||||
livingEntity.setCustomName(StringUtils.get().translateColor(customName));
|
String formattedName = StringUtils.get().translateColor(customName);
|
||||||
livingEntity.setCustomNameVisible(true);
|
|
||||||
|
if(CustomBosses.get().getConfig().getBoolean("Hooks.HolographicDisplays.enabled", false) && this.plugin.getHolographicDisplayHelper().isConnected()) {
|
||||||
|
this.plugin.getHolographicDisplayHelper().createHologram(livingEntity, formattedName);
|
||||||
|
livingEntity.setCustomNameVisible(false);
|
||||||
|
} else {
|
||||||
|
livingEntity.setCustomName(formattedName);
|
||||||
|
livingEntity.setCustomNameVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.songoda.epicbosses.utils.dependencies;
|
||||||
|
|
||||||
|
import com.gmail.filoghost.holographicdisplays.api.Hologram;
|
||||||
|
import com.gmail.filoghost.holographicdisplays.api.HologramsAPI;
|
||||||
|
import com.songoda.epicbosses.CustomBosses;
|
||||||
|
import com.songoda.epicbosses.utils.IHelper;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Charles Cullen
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 02-Jan-19
|
||||||
|
*/
|
||||||
|
public class HolographicDisplayHelper implements IHelper {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConnected() {
|
||||||
|
return Bukkit.getPluginManager().getPlugin("HolographicDisplays") != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createHologram(LivingEntity livingEntity, String line) {
|
||||||
|
CustomBosses plugin = CustomBosses.get();
|
||||||
|
Hologram hologram = HologramsAPI.createHologram(plugin, livingEntity.getEyeLocation());
|
||||||
|
|
||||||
|
hologram.insertTextLine(1, line);
|
||||||
|
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if(!livingEntity.isDead()) {
|
||||||
|
hologram.teleport(livingEntity.getEyeLocation());
|
||||||
|
} else {
|
||||||
|
hologram.delete();
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.runTaskTimer(plugin, 1L, 1L);
|
||||||
|
}
|
||||||
|
}
|
12
pom.xml
12
pom.xml
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
|
<!--<plugin.version>maven-version-number-SNAPSHOT-U90</plugin.version>-->
|
||||||
<plugin.version>1.0.0-U165</plugin.version>
|
<plugin.version>1.0.0-U166</plugin.version>
|
||||||
<plugin.name>EpicBosses</plugin.name>
|
<plugin.name>EpicBosses</plugin.name>
|
||||||
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
|
||||||
<plugin.author>AMinecraftDev</plugin.author>
|
<plugin.author>AMinecraftDev</plugin.author>
|
||||||
@ -69,9 +69,19 @@
|
|||||||
<version>1.2</version>
|
<version>1.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.gmail.filoghost.holographicdisplays</groupId>
|
||||||
|
<artifactId>holographicdisplays-api</artifactId>
|
||||||
|
<version>2.3.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>filoghost-repo</id>
|
||||||
|
<url>https://ci.filoghost.me/plugin/repository/everything/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>private</id>
|
<id>private</id>
|
||||||
<url>http://repo.songoda.com/repository/private/</url>
|
<url>http://repo.songoda.com/repository/private/</url>
|
||||||
|
Loading…
Reference in New Issue
Block a user