Finalize mod downgrade to 1.18.2

This commit is contained in:
Aria 2023-02-22 02:15:57 -07:00
parent 7657509044
commit 954642b922
5 changed files with 22 additions and 9 deletions

View file

@ -5,5 +5,5 @@ org.gradle.daemon=false
mc_version=1.18.2
forge_version=40.2.1
myversion=1.0.4.8
myversion=1.0.4.9
parchment_version=2022.11.06

View file

@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.server.ServerStartedEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@ -51,7 +52,7 @@ public class LibZontreck {
public static class ForgeEventBus
{
@SubscribeEvent
public void onPlayerTick(LivingEvent.LivingTickEvent ev)
public void onPlayerTick(LivingUpdateEvent ev)
{
if(ev.getEntity().level.isClientSide)return;

View file

@ -1,17 +1,33 @@
package dev.zontreck.libzontreck.chat;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.HoverEvent;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.HoverEvent.Action;
import net.minecraft.world.item.ItemStack;
/*
* Because of some weird behavior with java not liking that both HoverEvent and ClickEvent have an Action implementation, these must both be in a custom factory here where Action can be imported by itself in both files
*/
public class HoverTip {
/**
* This will return a hover event that shows a string of text when hovered over
* @param text
* @return
*/
public static HoverEvent get(String text)
{
return new HoverEvent(Action.SHOW_TEXT, Component.literal(text));
return new HoverEvent(Action.SHOW_TEXT, new TextComponent(text));
}
/**
* Returns a hover event that shows an item when hovered over
* @param is
* @return
*/
public static HoverEvent getItem(ItemStack is)
{
return new HoverEvent(Action.SHOW_ITEM, new HoverEvent.ItemStackInfo(is));
}
}

View file

@ -1,7 +1,5 @@
package dev.zontreck.libzontreck.vectors;
import com.mojang.authlib.yggdrasil.response.UserAttributesResponse.ProfanityFilterPreferences;
import dev.zontreck.libzontreck.LibZontreck;
import dev.zontreck.libzontreck.exceptions.InvalidDeserialization;
import dev.zontreck.libzontreck.exceptions.InvalidSideException;
@ -11,8 +9,6 @@ import net.minecraft.nbt.NbtUtils;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.FilteredText;
import net.minecraft.util.datafix.fixes.FilteredSignsFix;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;

View file

@ -19,7 +19,7 @@ modId="libzontreck" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="1.0.4.8" #mandatory
version="1.0.4.9" #mandatory
# A display name for the mod
displayName="LibZontreck" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/