Skip to content

Commit

Permalink
fixing backport
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Aug 15, 2022
1 parent 0ec86fd commit 3e5805a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ loader_version=0.13.3
fabric_version=0.47.8+1.18.2

# Mod Properties
mod_version = 1.8.2
maven_group = org.samo_lego
mod_version=1.9.0+1.18.2
maven_group=org.samo_lego
archives_base_name = fabrictailor

# Dependencies
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/samo_lego/fabrictailor/FabricTailor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.fabricmc.loader.api.FabricLoader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.client.KeyMapping;
import org.lwjgl.glfw.GLFW;
import org.samo_lego.fabrictailor.client.screen.SkinChangeScreen;
import org.samo_lego.fabrictailor.network.NetworkHandler;
import org.samo_lego.fabrictailor.util.TranslatedText;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.authlib.properties.Property;
import net.minecraft.client.gui.GuiComponent;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import org.samo_lego.fabrictailor.network.SkinPackets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.authlib.properties.Property;
import net.minecraft.client.gui.GuiComponent;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import org.samo_lego.fabrictailor.network.SkinPackets;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.samo_lego.fabrictailor.client.screen.tabs;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.ItemStack;
import org.samo_lego.fabrictailor.util.TranslatedText;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.authlib.properties.Property;
import net.minecraft.client.gui.GuiComponent;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import org.samo_lego.fabrictailor.network.SkinPackets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.ChatFormatting;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import org.samo_lego.fabrictailor.casts.TailoredPlayer;
import org.samo_lego.fabrictailor.util.TextTranslations;
import org.samo_lego.fabrictailor.util.TranslatedText;

import static org.samo_lego.fabrictailor.FabricTailor.MOD_ID;
import static org.samo_lego.fabrictailor.FabricTailor.THREADPOOL;
Expand Down Expand Up @@ -78,10 +78,10 @@ public static void changeSkinPacket(MinecraftServer server, ServerPlayer player,
((TailoredPlayer) player).setSkin(value, signature, true);
} else {
// Prevent skin change spamming
MutableComponent timeLeft = Component.literal(String.valueOf((config.skinChangeTimer * 1000 - now + lastChange) / 1000))
MutableComponent timeLeft = new TextComponent(String.valueOf((config.skinChangeTimer * 1000 - now + lastChange) / 1000))
.withStyle(ChatFormatting.LIGHT_PURPLE);
player.displayClientMessage(
TextTranslations.create("command.fabrictailor.skin.timer.please_wait", timeLeft)
new TranslatedText("command.fabrictailor.skin.timer.please_wait", timeLeft)
.withStyle(ChatFormatting.RED),
false
);
Expand All @@ -97,8 +97,8 @@ public static void defaultSkinPacket(MinecraftServer server, ServerPlayer player
config.defaultSkin.signature = signature;
config.save();

player.sendSystemMessage(
TextTranslations.create("command.fabrictailor.config.defaultSkin").withStyle(ChatFormatting.GREEN));
player.sendMessage(new TranslatedText("command.fabrictailor.config.defaultSkin").withStyle(ChatFormatting.GREEN),
player.getUUID());
}
}
}

0 comments on commit 3e5805a

Please sign in to comment.