galaxyop.yt

Act as a Senior Java Developer for Spigot/Paper (Version 1.21++). Create a professional-grade plugin titled "Galaxy SmartPhone" using the following specifications:

  1. HARDWARE: Auto-Give & Hard-Lock

The Item: Copper Ingot with CustomModelData: 10001 named <gradient:#5f2c82:#49a09d>Galaxy SmartPhone</gradient>.

The Distribution: Use PlayerJoinEvent. If a player does not have the phone, place it in Hotbar Slot 1 (Index 0).

The Slot Lock: Ensure the item stays in Slot 0 during PlayerRespawnEvent and PlayerWorldChangeEvent.

Persistence: Cancel InventoryClickEvent, PlayerDropItemEvent, and InventoryDragEvent for this item. It must be unremovable and impossible to store in external inventories (chests, hoppers, etc.).

  1. DATA PRIVACY: Isolation & Encryption

Data Isolation: Every player must have a unique data file (e.g., plugins/GalaxySmartPhone/data/[UUID].yml). Cloud Vault and Digital Notes data must be strictly isolated to these files so players can never access another phone's data.

Encrypted Messaging: Within the Contacts App, messages must be processed using a Base64 encoding wrapper before being sent to the recipient. This ensures a layer of privacy distinct from standard global chat.

  1. DESIGN: Custom INVENTORY GUI & Resource Pack Support

The Screen: Use a 54-slot Chest Inventory with the title \uF801 (to allow for custom texture overlays).

Bezel: Fill Columns 1, 2, 8, and 9 with Black Stained Glass Panes named " " for a vertical smartphone look.

App Icons: Each icon must have a unique CustomModelData (starting from 10002) for resource pack support.

  1. THE 13-APP SUITE (Software):

Cloud Vault (Chest): A private 27-slot virtual storage app. Serialize/Deserialize contents to the player's unique .yml file.

GPS (Compass): Shows Coords, Biome, and distance to last death point in the Action Bar.

Vitality (Rabbit Foot): Displays Health %, Hunger, and total blocks walked.

Galaxy Social (Book): A INVENTORY GUI feed displaying the last 5 global server messages.

Flashlight (Glowstone): Toggles a Night Vision effect.

Contacts (Player Head): List of online players; clicking one sends an encrypted private message.

System Clock (Clock): Displays Real-world and In-game time.

Forecast (Sunflower): Displays current weather and duration.

Digital Notes (Paper): A text-save app where a player can store a custom string (e.g., base coordinates).

Radio (Music Disc): Plays a random vanilla music track to the player locally.

Math Calc (Iron Nugget): A chat-based calculator tool.

Server News (Painting): Displays the server's MOTD.

Settings (Comparator): Toggles a 'Silent Mode' (Boolean) to disable phone sounds.

  1. TECHNICAL:

Use PersistentDataContainer to identify the phone.

Use Vault API for permission checks (e.g., galaxyphone.use).

Every app interaction must play Sound.BLOCK_NOTE_BLOCK_XYLOPHONE.

Provide the full Java code, plugin.yml, and instructions on how to structure the data folder.

Kodari AI
KodariApr 18 at 9:16 pm 36,374 (v2)
GalaxySmartPhone
A fully-featured smartphone simulation plugin for Paper 1.21+. Players receive a locked Copper Ingot phone item (CustomModelData: 10001) in hotbar slot 0 that cannot be removed or stored elsewhere. The phone opens a 54-slot GUI with a smartphone bezel style and 13 apps: Cloud Vault (private 27-slot storage), GPS (action bar coords+biome), Vitality, Galaxy Social feed, Flashlight, Contacts (encrypted Base64 messaging), System Clock, Forecast, Digital Notes, Radio, Math Calculator, Server News (MOTD), and Settings (silent mode).

My plan:

  • Build the full GUI framework (InventoryHandler โ†’ InventoryGUI โ†’ GUIManager/GUIListener) then layer managers (Phone, Data, Vault, SocialFeed) on top

  • Create all 4 GUI implementations (PhoneScreen, CloudVault, Contacts, GalaxySocial), a MathEvaluator utility, and two listeners (PhoneListener for hardware lock, ChatListener for interactive apps)

  • Wire everything through the main plugin class with @Getter fields; every manager and state map is pre-planned to avoid cross-file mismatches

All 20 files are created. Hereโ€™s a summary of what was built:


Project Structure

Plain Text
plugins/GalaxySmartPhone/
โ””โ”€โ”€ data/
    โ””โ”€โ”€ [UUID].yml   โ† auto-created per player

Each .yml stores:

  • vault.slot-0 through vault.slot-26 (Cloud Vault โ€” native Bukkit ItemStack serialization)

  • notes (string)

  • silent-mode (boolean)


What was implemented:

System
Detail
Hardware Lock
Phone given on join, locked to slot 0 on respawn & world change. All inventory/drag/drop events that involve the phone are cancelled.
GUI Framework
Full
InventoryHandler โ†’ InventoryGUI โ†’ GUIManager/GUIListener
pipeline with lazy init and auto-unregistration on close.
Phone Screen
54-slot chest with
"\uF801"
title, black glass pane bezel on columns 1,2,8,9, and 13 app icons with unique CustomModelData (10002โ€“10014).
Cloud Vault
27-slot persistent storage, saved on
InventoryCloseEvent
via
DataManager
, phone-item injection blocked.
GPS
Toggle via
BukkitTask
, action bar shows X/Y/Z, biome, and distance to last death location (world-aware).
Contacts + Encryption
Players flow through
contactsWaiting
map; messages are Base64-encoded in transmission and decoded for display.
Math Calc
Custom recursive descent parser handles
+
,
-
,
*
,
/
,
%
,
()
, and negation. Stays active until player types
exit
.
Vault Integration
VaultHook
wraps
Permission
API, falls back to
player.hasPermission()
if unavailable.
Silent Mode
Persisted per-player; all app sounds check
DataManager.isSilentMode()
before playing.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
20 1,526
src/main/java/com/galaxysmartphone/GalaxySmartPhone.java
package com.galaxysmartphone;

import com.galaxysmartphone.inventory.gui.GUIListener;
import com.galaxysmartphone.inventory.gui.GUIManager;
import com.galaxysmartphone.listeners.ChatListener;
import com.galaxysmartphone.listeners.PhoneListener;
import com.galaxysmartphone.managers.DataManager;
import com.galaxysmartphone.managers.PhoneManager;
import com.galaxysmartphone.managers.SocialFeedManager;
import com.galaxysmartphone.managers.VaultHook;
import lombok.Getter;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

import java.util.*;

public class GalaxySmartPhone extends JavaPlugin {

    @Getter
    private static GalaxySmartPhone instance;

    @Getter
    private PhoneManager phoneManager;

    @Getter
    private DataManager dataManager;

    @Getter
    private VaultHook vaultHook;

    @Getter
    private SocialFeedManager socialFeedManager;

    @Getter
    private GUIManager guiManager;

    @Getter
    private final Map<UUID, BukkitTask> gpsTasks = new HashMap<>();

    @Getter
    private final Set<UUID> mathCalcWaiting = new HashSet<>();

    @Getter
    private final Set<UUID> notesWaiting = new HashSet<>();

    @Getter
    private final Map<UUID, UUID> contactsWaiting = new HashMap<>();

    @Getter
    private final Map<UUID, Location> lastDeathLocations = new HashMap<>();

    @Override
    public void onEnable() {
        instance = this;

        this.dataManager = new DataManager(this);

        this.vaultHook = new VaultHook();
        if (!vaultHook.hook()) {
            getLogger().warning("Vault not found or no permission plugin detected. Falling back to Bukkit permissions.");
        }

        this.socialFeedManager = new SocialFeedManager();
        this.phoneManager = new PhoneManager(this);
        this.guiManager = new GUIManager();

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getServer().getPluginManager().registerEvents(new PhoneListener(this), this);
        getServer().getPluginManager().registerEvents(new ChatListener(this), this);

        getServer().getOnlinePlayers().forEach(phoneManager::givePhone);

        getLogger().info("Galaxy SmartPhone enabled successfully.");
    }

    @Override
    public void onDisable() {
        gpsTasks.values().forEach(BukkitTask::cancel);
        gpsTasks.clear();
        getLogger().info("Galaxy SmartPhone disabled.");
    }
}