Skip to content

Commit

Permalink
Updated to Minecraft 1.19.1 and 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kir-Antipov committed Aug 6, 2022
1 parent 53da605 commit e821350
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ dependencies {

modImplementation "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}"
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
modImplementation "dev.emi:trinkets:${project.trinkets_version}"
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
modCompileOnly("io.github.ladysnake:requiem-api:${project.requiem_version}", { transitive false })
modImplementation "maven.modrinth:origins:${project.origins_version}"
modImplementation "com.github.apace100:apoli:${project.apoli_version}"
modCompileOnly "maven.modrinth:origins:${project.origins_version}"
modCompileOnly "com.github.apace100:apoli:${project.apoli_version}"
modCompileOnly "maven.modrinth:haema:${project.haema_version}"
}

Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.14.7
minecraft_version=1.19.1
yarn_mappings=1.19.1+build.6
loader_version=0.14.9

# Mod Properties
mod_version=4.3
maven_group=dev.kir
archives_base_name=sync

# Dependencies
fabric_version=0.55.2+1.19
fabric_version=0.58.5+1.19.1
tr_energy_version=2.2.0
satin_version=1.8.0
cloth_version=7.0.65
modmenu_version=4.0.0
satin_version=1.9.0
cloth_version=8.0.75
modmenu_version=4.0.6
trinkets_version=3.4.0
requiem_version=2.0.0-beta.8
origins_version=1.6.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.network.message.MessageSender;
import net.minecraft.network.message.MessageType;
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
import net.minecraft.sound.SoundEvent;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.world.GameMode;

import java.util.List;
Expand All @@ -30,7 +27,7 @@
public class Technoblade extends AbstractClientPlayerEntity {
private static final Identifier TECHNOBLADE_SKIN = Sync.locate("textures/entity/technoblade.png");
private static final GameProfile TECHNOBLADE_GAME_PROFILE = new GameProfile(UUID.fromString("b876ec32-e396-476b-a115-8438d83c67d4"), "Technoblade");
private static final PlayerListEntry TECHNOBLADE_PLAYER_LIST_ENTRY = new PlayerListEntry(new PlayerListS2CPacket.Entry(TECHNOBLADE_GAME_PROFILE, 0, GameMode.CREATIVE, null, null), null);
private static final PlayerListEntry TECHNOBLADE_PLAYER_LIST_ENTRY = new PlayerListEntry(new PlayerListS2CPacket.Entry(TECHNOBLADE_GAME_PROFILE, 0, GameMode.CREATIVE, null, null), null, false);
// Feel free to add new quotes to this list if you are reading this
private static final List<Text> TECHNOBLADE_QUOTES = Stream.of(
"so long nerds",
Expand Down Expand Up @@ -103,7 +100,7 @@ public Text getRandomQuote() {

public void speak() {
Text quote = this.getRandomQuote();
MinecraftClient.getInstance().inGameHud.onChatMessage(BuiltinRegistries.MESSAGE_TYPE.get(MessageType.CHAT), quote, new MessageSender(this.uuid, this.getDisplayName()));
MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.translatable("chat.type.text", this.getDisplayName(), quote.getString()));
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/kir/sync/entity/ShellEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private static PlayerListEntry getPlayerEntry(ShellState state) {
}

if (entry == null) {
entry = new PlayerListEntry(new PlayerListS2CPacket.Entry(new GameProfile(state.getOwnerUuid(), state.getOwnerName()), 0, null, null, null), client.getServicesSignatureVerifier());
entry = new PlayerListEntry(new PlayerListS2CPacket.Entry(new GameProfile(state.getOwnerUuid(), state.getOwnerName()), 0, null, null, null), client.getServicesSignatureVerifier(), false);
}

PLAYER_ENTRY_CACHE.put(state.getOwnerUuid(), entry);
Expand Down
26 changes: 12 additions & 14 deletions src/main/java/dev/kir/sync/mixin/ServerPlayerEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtList;
import net.minecraft.network.PacketCallbacks;
import net.minecraft.network.encryption.PlayerPublicKey;
import net.minecraft.network.message.MessageType;
import net.minecraft.network.packet.s2c.play.*;
import net.minecraft.scoreboard.AbstractTeam;
import net.minecraft.server.MinecraftServer;
Expand Down Expand Up @@ -338,23 +338,21 @@ public boolean updateKillableEntityPostDeath() {
@Unique
private void sendDeathMessageInChat() {
Text text = this.getDamageTracker().getDeathMessage();
this.networkHandler.sendPacket(new DeathMessageS2CPacket(this.getDamageTracker(), text), (future) -> {
if (!future.isSuccess()) {
String truncatedText = text.asTruncatedString(256);
Text tooLong = Text.translatable("death.attack.message_too_long", (Text.literal(truncatedText)).formatted(Formatting.YELLOW));
Text magic = (Text.translatable("death.attack.even_more_magic", this.getDisplayName())).styled((style) -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, tooLong)));
this.networkHandler.sendPacket(new DeathMessageS2CPacket(this.getDamageTracker(), magic));
}
});
AbstractTeam team = this.getScoreboardTeam();
if (team != null && team.getDeathMessageVisibilityRule() != AbstractTeam.VisibilityRule.ALWAYS) {
if (team.getDeathMessageVisibilityRule() == AbstractTeam.VisibilityRule.HIDE_FOR_OTHER_TEAMS) {
this.networkHandler.sendPacket(new DeathMessageS2CPacket(this.getDamageTracker(), text), PacketCallbacks.of(() -> {
String truncatedString = text.asTruncatedString(256);
Text messageWasTooLong = Text.translatable("death.attack.message_too_long", Text.literal(truncatedString).formatted(Formatting.YELLOW));
Text magic = Text.translatable("death.attack.even_more_magic", this.getDisplayName()).styled((style) -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, messageWasTooLong)));
return new DeathMessageS2CPacket(this.getDamageTracker(), magic);
}));
AbstractTeam abstractTeam = this.getScoreboardTeam();
if (abstractTeam != null && abstractTeam.getDeathMessageVisibilityRule() != AbstractTeam.VisibilityRule.ALWAYS) {
if (abstractTeam.getDeathMessageVisibilityRule() == AbstractTeam.VisibilityRule.HIDE_FOR_OTHER_TEAMS) {
this.server.getPlayerManager().sendToTeam(this, text);
} else if (team.getDeathMessageVisibilityRule() == AbstractTeam.VisibilityRule.HIDE_FOR_OWN_TEAM) {
} else if (abstractTeam.getDeathMessageVisibilityRule() == AbstractTeam.VisibilityRule.HIDE_FOR_OWN_TEAM) {
this.server.getPlayerManager().sendToOtherTeams(this, text);
}
} else {
this.server.getPlayerManager().broadcast(text, MessageType.SYSTEM);
this.server.getPlayerManager().broadcast(text, false);
}
}

Expand Down

0 comments on commit e821350

Please sign in to comment.