Update to 1.19.2

This commit is contained in:
Tara Piccari 2024-01-31 17:57:01 -07:00
parent 275288447f
commit dabc717bd4
15 changed files with 33 additions and 492 deletions

View file

@ -10,6 +10,10 @@ public class ChatColorFactory {
public String build(){
return built;
}
/**
* Resets the color builder
*/
public void reset()
{
built="";
@ -18,6 +22,11 @@ public class ChatColorFactory {
public ColorBuilder(){}
}
private ColorBuilder instance;
/**
* Resets the chat color builder
* @return The current builder
*/
public ChatColorFactory reset()
{
instance.reset();

View file

@ -199,7 +199,7 @@ public class ChestGUI
{
updateUtilityButtons();
MinecraftForge.EVENT_BUS.post(new OpenGUIEvent(id, player, this));
NetworkHooks.openGui(ServerUtilities.getPlayerByID(player.toString()), new SimpleMenuProvider(ChestGUIMenu.getServerMenu(this), ChatHelpers.macro(((MenuTitle != "") ? MenuTitle : "No Title"))));
NetworkHooks.openScreen(ServerUtilities.getPlayerByID(player.toString()), new SimpleMenuProvider(ChestGUIMenu.getServerMenu(this), ChatHelpers.macro(((MenuTitle != "") ? MenuTitle : "No Title"))));
}
}

View file

@ -23,7 +23,7 @@ import net.minecraftforge.fml.common.Mod;
public class ForgeEventHandlers {
@SubscribeEvent
public void onPlayerTick(LivingEvent.LivingUpdateEvent ev)
public void onPlayerTick(LivingEvent.LivingTickEvent ev)
{
if(ServerUtilities.isClient()) return;

View file

@ -50,20 +50,20 @@ public class ModMessages {
net.messageBuilder(S2CPlaySoundPacket.class, PACKET_ID.getAndIncrement(), NetworkDirection.PLAY_TO_CLIENT)
.decoder(S2CPlaySoundPacket::new)
.encoder(S2CPlaySoundPacket::toBytes)
.consumer(S2CPlaySoundPacket::handle)
.consumerMainThread(S2CPlaySoundPacket::handle)
.add();
net.messageBuilder(S2CCloseChestGUI.class, PACKET_ID.getAndIncrement(), NetworkDirection.PLAY_TO_CLIENT)
.decoder(S2CCloseChestGUI::new)
.encoder(S2CCloseChestGUI::toBytes)
.consumer(S2CCloseChestGUI::handle)
.consumerMainThread(S2CCloseChestGUI::handle)
.add();
net.messageBuilder(S2CServerAvailable.class, PACKET_ID.getAndIncrement(),
NetworkDirection.PLAY_TO_CLIENT)
.decoder(S2CServerAvailable::new)
.encoder(S2CServerAvailable::toBytes)
.consumer(S2CServerAvailable::handle)
.consumerMainThread(S2CServerAvailable::handle)
.add();
}

View file

@ -18,7 +18,7 @@ import net.minecraftforge.common.MinecraftForge;
/**
* A libZontreck user profile
*<p></p>
*<p>
* This is used to contain common player data, as well as be capable of serializing the player's data and sending to/from the client.
*/
public class Profile {

View file

@ -13,7 +13,7 @@ import net.minecraftforge.registries.RegistryObject;
public class ModMenuTypes
{
public static DeferredRegister<MenuType<?>> REGISTRY = DeferredRegister.create(ForgeRegistries.CONTAINERS, LibZontreck.MOD_ID);
public static DeferredRegister<MenuType<?>> REGISTRY = DeferredRegister.create(ForgeRegistries.MENU_TYPES, LibZontreck.MOD_ID);
public static RegistryObject<MenuType<ChestGUIMenu>> CHEST_GUI_MENU = registerMenuType(ChestGUIMenu::new, "chestgui");

View file

@ -111,7 +111,7 @@ public class ChatHelpers {
*/
public static MutableComponent macro(String input, String... inputs)
{
return new TextComponent(macroize(input,inputs));
return Component.literal(macroize(input,inputs));
}
/**
* Returns the output with colors applied, and chat entries replaced using [number] as the format

View file

@ -40,7 +40,7 @@ public class ServerUtilities
channel.messageBuilder(type, ModMessages.id(), packet.getDirection())
.decoder(decoder)
.encoder(X::toBytes)
.consumer(X::handle)
.consumerMainThread(X::handle)
.add();
}

View file

@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[40,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="GPLv2"
@ -51,7 +51,7 @@ modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[40,)" #mandatory
versionRange="[43,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
@ -61,6 +61,6 @@ side="BOTH"
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.18.2,1.19)"
versionRange="[1.19,1.20)"
ordering="NONE"
side="BOTH"