doubled the size of arena status displays
This commit is contained in:
1 parent
a91f550153
commit
4add446940
2 files changed
+12
-1
No files matched your search
@@ -23,7 +23,8 @@ final class ArenaSlot {
|
|||||||
|
|
||||||
ArenaSlot(ArenaSettings.Slot settings, World world) {
|
ArenaSlot(ArenaSettings.Slot settings, World world) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.display = Displays.spawn(settings.displayLocation(world));
|
// seen from the tribune across half an arena, so twice the size
|
||||||
|
this.display = Displays.spawn(settings.displayLocation(world), 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateDisplay() {
|
void updateDisplay() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.bukkit.Color;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Display;
|
import org.bukkit.entity.Display;
|
||||||
import org.bukkit.entity.TextDisplay;
|
import org.bukkit.entity.TextDisplay;
|
||||||
|
import org.bukkit.util.Transformation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Floating texts above pads and arenas. They are not saved with the world and come back with every start.
|
* Floating texts above pads and arenas. They are not saved with the world and come back with every start.
|
||||||
@@ -16,6 +17,10 @@ final class Displays {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static TextDisplay spawn(Location location) {
|
static TextDisplay spawn(Location location) {
|
||||||
|
return spawn(location, 1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TextDisplay spawn(Location location, float scale) {
|
||||||
// displays are not saved, they would vanish with an unloaded chunk
|
// displays are not saved, they would vanish with an unloaded chunk
|
||||||
location.getWorld().addPluginChunkTicket(location.getBlockX() >> 4, location.getBlockZ() >> 4, Main.instance());
|
location.getWorld().addPluginChunkTicket(location.getBlockX() >> 4, location.getBlockZ() >> 4, Main.instance());
|
||||||
return location.getWorld().spawn(location, TextDisplay.class, display -> {
|
return location.getWorld().spawn(location, TextDisplay.class, display -> {
|
||||||
@@ -26,6 +31,11 @@ final class Displays {
|
|||||||
display.setBackgroundColor(Color.fromARGB(110, 0, 0, 0));
|
display.setBackgroundColor(Color.fromARGB(110, 0, 0, 0));
|
||||||
display.setLineWidth(220);
|
display.setLineWidth(220);
|
||||||
display.addScoreboardTag(MANAGED_TAG);
|
display.addScoreboardTag(MANAGED_TAG);
|
||||||
|
if(scale != 1f) {
|
||||||
|
Transformation transformation = display.getTransformation();
|
||||||
|
transformation.getScale().set(scale);
|
||||||
|
display.setTransformation(transformation);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user