Add particles, sounds, and debug logging
- Added block particles (BLOCK_CRACK) when placing blocks - Added block placement sounds - Added extensive debug logging for locale item loading - Will help diagnose why GUI shows stone items
This commit is contained in:
parent
03ee678b68
commit
dbe4e7786c
2 changed files with 28 additions and 4 deletions
|
|
@ -204,9 +204,20 @@ public class Locales {
|
|||
|
||||
@NotNull
|
||||
private static Item buildItem(@NotNull FileConfiguration config, @NotNull String path, String... replace) {
|
||||
String material = config.getString("%s.material".formatted(path), "STONE");
|
||||
String name = applyReplacements(config.getString("%s.name".formatted(path), ""), replace);
|
||||
String lore = applyReplacements(config.getString("%s.lore".formatted(path), ""), replace);
|
||||
String materialPath = "%s.material".formatted(path);
|
||||
String namePath = "%s.name".formatted(path);
|
||||
String lorePath = "%s.lore".formatted(path);
|
||||
|
||||
String material = config.getString(materialPath, "STONE");
|
||||
String name = applyReplacements(config.getString(namePath, ""), replace);
|
||||
String lore = applyReplacements(config.getString(lorePath, ""), replace);
|
||||
|
||||
// Debug logging
|
||||
if ("STONE".equals(material)) {
|
||||
LoParkour.getPlugin().getLogger().warning("Material defaulted to STONE for path: " + path);
|
||||
LoParkour.getPlugin().getLogger().warning(" Tried: " + materialPath + " = " + config.getString(materialPath));
|
||||
LoParkour.getPlugin().getLogger().warning(" Available keys: " + config.getKeys(true));
|
||||
}
|
||||
|
||||
Material mat = Materials.parse(material);
|
||||
if (mat == null) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package dev.loki.loparkour.generator.jump;
|
||||
|
||||
import dev.loki.loparkour.generator.ParkourGenerator;
|
||||
import dev.loki.loparkour.player.ParkourPlayer;
|
||||
import dev.loki.loparkour.schematic.lpschem.LPSchematic;
|
||||
import dev.loki.loparkour.util.Probs;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
@ -115,8 +118,18 @@ public class BlockPlacer {
|
|||
}
|
||||
|
||||
/** Prefer no neighbor physics to avoid fragile vanilla multi-block checks in empty worlds. */
|
||||
private static void placeBlockData(@NotNull Block block, @NotNull BlockData data) {
|
||||
private void placeBlockData(@NotNull Block block, @NotNull BlockData data) {
|
||||
block.setBlockData(data, false);
|
||||
|
||||
// Play effects for all players
|
||||
Location loc = block.getLocation().add(0.5, 0.5, 0.5);
|
||||
for (ParkourPlayer player : generator.getPlayers()) {
|
||||
// Spawn particles
|
||||
player.player.spawnParticle(Particle.BLOCK_CRACK, loc, 10, 0.3, 0.3, 0.3, 0.1, data);
|
||||
|
||||
// Play sound
|
||||
player.player.playSound(loc, Sound.BLOCK_STONE_PLACE, 0.5f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue