From e272a97598e2a5db1ff09c922773bcbf8c0b3eba Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Fri, 17 Jan 2025 18:09:07 +0100 Subject: [PATCH] fix motd, crop trampling --- .../globallinkserver/GlobalLinkServer.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java b/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java index 58d45a6..0276cbf 100644 --- a/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java +++ b/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java @@ -25,6 +25,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.PlayerDeathEvent; @@ -120,7 +121,10 @@ public void onEnable() { world.setGameRule(GameRule.SHOW_DEATH_MESSAGES, false); // Other changes - getServer().motd(Component.text("Global Link Server").color(NamedTextColor.AQUA)); + getServer().motd(Component.text("GeyserMC ").color(NamedTextColor.GREEN) + .append(Component.text("Link ").color(NamedTextColor.AQUA)) + .append(Component.text("Server").color(NamedTextColor.WHITE))); + getServer().clearRecipes(); // Make nighttime @@ -192,6 +196,14 @@ public void onFoodLevelChange(FoodLevelChangeEvent event) { } } + @EventHandler + public void onPlayerInteract(PlayerInteractEvent event) { + // Prevent crop trampling + if (event.getAction() == Action.PHYSICAL) { + event.setCancelled(true); + } + } + @EventHandler public void onDeath(PlayerDeathEvent event) { event.deathMessage(null);