-
Notifications
You must be signed in to change notification settings - Fork 0
Home
VillagerUnknown's Platform is a library intended to simplify the development of, and versioning between, multiple Minecraft Mods.
Platform's load cycle ensures that Platform is always loaded by Minecraft before any mods using Platform.
-
Platform.init_platformmethod runs once when Platform is initialized. It registers the network payloads and adds any features for Platform (currently only the commands). -
Platform.init_modmethod runs for every mod when the mod is initialized. It reports information about the mod to the server log (currently only the MOD_ID and version).
Platform includes Type Adapters to serialize/deserialize json strings.
- OptionalGlobalPosTypeAdapter for Optional<GlobalPos> objects
- WorldPositionsMapTypeAdapter for Map<String, Set<BlockPos>> objects
Platform includes classes to help create and load files containing lists.
- StringsList for List<String> objects
Platform includes network payloads used by the Util packages in the library. These may be removed in the future when I find the vanilla methods.
- NarratorMessagePayload sends a packet to the client for the narrator to read.
- SendPlayerToMainMenuPayload sends a packet to the client to show the main menu.
- ShowPlayerGameMenuPayload sends a packet to the client to show the game menu.
- ToastMessagePayload sends a packet to the client to show a toast message.
Platform includes timers that can hold additional data.
- TickTimer creates a timer for game ticks.
Platform includes a variety of utilities in the Util package. These are essentially the helpers of the library.
-
ClientUtil provides methods for interacting with the client. For example: sending the client to the main menu, showing the game menu, and disconnecting a player.
-
EntityUtil provides methods for interacting with entities. For example: playing sounds, spawning particles, and adding status effects.
-
GsonUtil provides methods for using the Type Adapters with Gson.
-
LanguageUtil provides methods for working with translations.
-
ListUtil provides some default lists.
-
MessageUtil provides methods for sending messages to chat and showing action bar messages.
-
PositionUtil provides methods for working with positions.
-
RegistryUtil provides methods for working with the registries.
Classes in the Util package are expected to change in early versions.
I'm new to modding Minecraft. That means that there are probably vanilla ways, and more efficient ways, to accomplish things that I've added extra code to accomplish. That's fine. As I learn new things, and the appropriate way to do things, I'll update the code in Platform.