mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-22 00:19:30 +00:00
Added glowing: true/false option for boss config
This commit is contained in:
@@ -233,6 +233,12 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
|
|||||||
@Getter
|
@Getter
|
||||||
private final Map<EntityDamageEvent.DamageCause, Double> incomingMultipliers;
|
private final Map<EntityDamageEvent.DamageCause, Double> incomingMultipliers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boss glowing effect.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
private final boolean isGlowing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently living bosses of this type.
|
* The currently living bosses of this type.
|
||||||
*/
|
*/
|
||||||
@@ -313,6 +319,7 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
|
|||||||
this.config = config;
|
this.config = config;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.livingBosses = new HashMap<>();
|
this.livingBosses = new HashMap<>();
|
||||||
|
this.isGlowing = this.getConfig().getBool("glowing");
|
||||||
|
|
||||||
this.displayName = this.getConfig().getString("name");
|
this.displayName = this.getConfig().getString("name");
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import org.bukkit.boss.BarFlag;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -98,6 +100,8 @@ public class LivingEcoBoss extends PluginDependent<EcoPlugin> {
|
|||||||
entity.setPersistent(true);
|
entity.setPersistent(true);
|
||||||
entity.setRemoveWhenFarAway(false);
|
entity.setRemoveWhenFarAway(false);
|
||||||
|
|
||||||
|
if (boss.isGlowing()) entity.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, Integer.MAX_VALUE, 1, false, false, false));
|
||||||
|
|
||||||
if (boss.getTimeToLive() > 0) {
|
if (boss.getTimeToLive() > 0) {
|
||||||
entity.setMetadata("death-time", this.getPlugin().getMetadataValueFactory().create(System.currentTimeMillis() + (boss.getTimeToLive() * 1000L)));
|
entity.setMetadata("death-time", this.getPlugin().getMetadataValueFactory().create(System.currentTimeMillis() + (boss.getTimeToLive() * 1000L)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ attack-damage: 50
|
|||||||
movement-speed: 2
|
movement-speed: 2
|
||||||
follow-range: 15
|
follow-range: 15
|
||||||
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
||||||
|
glowing: false # Should this boss have glowing effect
|
||||||
|
|
||||||
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
||||||
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ attack-damage: 30
|
|||||||
movement-speed: 1.2
|
movement-speed: 1.2
|
||||||
follow-range: 20
|
follow-range: 20
|
||||||
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
||||||
|
glowing: false # Should this boss have glowing effect
|
||||||
|
|
||||||
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
||||||
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ attack-damage: 90
|
|||||||
movement-speed: 1.5
|
movement-speed: 1.5
|
||||||
follow-range: 16
|
follow-range: 16
|
||||||
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
||||||
|
glowing: false # Should this boss have glowing effect
|
||||||
|
|
||||||
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
||||||
auto-spawn-locations: [] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
auto-spawn-locations: [] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ attack-damage: 70
|
|||||||
movement-speed: 1.3
|
movement-speed: 1.3
|
||||||
follow-range: 15
|
follow-range: 15
|
||||||
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
time-to-live: 120 # Time to live before auto despawn, in seconds. Set to -1 to disable.
|
||||||
|
glowing: false # Should this boss have glowing effect
|
||||||
|
|
||||||
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
auto-spawn-interval: -1 # Time between auto spawns in ticks (20 ticks in a second) - Set to -1 to disable.
|
||||||
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
auto-spawn-locations: [ ] # Formatted as world:x:y:z - for example world_nether:100:10:100
|
||||||
|
|||||||
Reference in New Issue
Block a user