mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-12 18:50:49 +01:00
name fix
This commit is contained in:
parent
260c479ca6
commit
8c2bf1d17c
@ -91,6 +91,7 @@ public class UltimateStacker extends JavaPlugin {
|
||||
|
||||
// Check to make sure the Bukkit version is compatible.
|
||||
if (!checkVersion()) return;
|
||||
|
||||
ConsoleCommandSender console = Bukkit.getConsoleSender();
|
||||
console.sendMessage(TextComponent.formatText("&a============================="));
|
||||
console.sendMessage(TextComponent.formatText("&7UltimateStacker " + this.getDescription().getVersion() + " by &5Brianna <3&7!"));
|
||||
|
@ -7,6 +7,7 @@ import com.songoda.ultimatestacker.spawner.SpawnerStack;
|
||||
import com.songoda.ultimatestacker.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
|
||||
@ -61,7 +62,7 @@ public class HologramHandler {
|
||||
}
|
||||
|
||||
public void processChange(Block block) {
|
||||
if (!block.getType().name().contains("SPAWNER")) return;
|
||||
if (block.getType() != Material.MOB_SPAWNER) return;
|
||||
SpawnerStack spawner = instance.getSpawnerStackManager().getSpawner(block);
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(instance, () -> updateHologram(spawner), 1L);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.songoda.ultimatestacker.utils;
|
||||
|
||||
import com.songoda.arconix.api.methods.formatting.TextComponent;
|
||||
import com.songoda.ultimatestacker.UltimateStacker;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
@ -51,13 +52,12 @@ public class Methods {
|
||||
|
||||
public static String compileSpawnerName(EntityType entityType, int amount) {
|
||||
String nameFormat = UltimateStacker.getInstance().getConfig().getString("Spawners.Name Format");
|
||||
String displayName = TextComponent.formatText(UltimateStacker.getInstance().getItemFile().getConfig().getString("Spawners." + entityType.name() + ".Display Name"));
|
||||
String displayName = TextComponent.formatText(UltimateStacker.getInstance().getSpawnerFile().getConfig().getString("Spawners." + entityType.name() + ".Display Name"));
|
||||
|
||||
nameFormat = nameFormat.replace("{TYPE}", displayName);
|
||||
nameFormat = nameFormat.replace("{AMT}", Integer.toString(amount));
|
||||
|
||||
String info = TextComponent.convertToInvisibleString(amount + ":");
|
||||
|
||||
return info + TextComponent.formatText(nameFormat).trim();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user