add farm beacon warmup

This commit is contained in:
okx-code
2025-08-25 22:19:26 +01:00
parent fc83162773
commit c1203bd3fe
4 changed files with 22 additions and 9 deletions

View File

@@ -21,9 +21,9 @@ public interface FarmBeacon {
ItemMeta meta = item.getItemMeta();
meta.itemName(Component.text("Farm Beacon", NamedTextColor.LIGHT_PURPLE));
meta.lore(List.of(Component.text("Allows crops to grow larger and more bountiful", NamedTextColor.WHITE),
Component.text("Within a 20 block radius:", NamedTextColor.WHITE),
Component.text("doubles growth times, and", NamedTextColor.WHITE),
Component.text("increase soil fertility +5%", NamedTextColor.WHITE),
Component.text("Increases soil fertility +5%", NamedTextColor.WHITE),
Component.text("within a 20 block radius.", NamedTextColor.WHITE),
Component.text("Takes 6 days to become effective.", NamedTextColor.WHITE),
Component.text("Requires a beacon base and sky exposure", NamedTextColor.WHITE)));
meta.setEnchantmentGlintOverride(true);
meta.setFireResistant(true);

View File

@@ -38,7 +38,7 @@ public class FarmBeaconListener implements Listener {
Block block = event.getBlock();
Beacon type = (Beacon) block.getState(false);
type.getPersistentDataContainer().set(FARM_BEACON_KEY, PersistentDataType.BOOLEAN, true);
type.getPersistentDataContainer().set(FARM_BEACON_KEY, PersistentDataType.LONG, System.currentTimeMillis());
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)