Skip to content

Commit

Permalink
fix motd, crop trampling
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Jan 17, 2025
1 parent 40793f0 commit e272a97
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e272a97

Please sign in to comment.