Update to 1.19.2
This commit is contained in:
parent
275288447f
commit
dabc717bd4
15 changed files with 33 additions and 492 deletions
|
@ -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();
|
||||
|
|
|
@ -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"))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue