Skip to content

Commit b87f6ba

Browse files
committed
Update to 1.19.4
1 parent aa5ab90 commit b87f6ba

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

gradle.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/use
6-
minecraft_version=1.19.2
7-
yarn_mappings=1.19.2+build.28
6+
minecraft_version=1.19.4
7+
yarn_mappings=1.19.4+build.2
88
loader_version=0.16.9
9-
fabric_version=0.77.0+1.19.2
9+
fabric_version=0.87.2+1.19.4
1010

1111
# Mod Properties
1212
mod_version = 2.0.0
1313
maven_group = com.lx862.svrutil
1414
archives_base_name = svrutil
1515

1616
# Dependencies
17-
placeholder_api_version = 2.0.0-pre.1+1.19.2
17+
placeholder_api_version = 2.1.0+1.19.4

src/main/java/com/lx862/svrutil/commands/playsoundarea.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
import net.minecraft.command.argument.IdentifierArgumentType;
99
import net.minecraft.command.argument.Vec3ArgumentType;
1010
import net.minecraft.command.suggestion.SuggestionProviders;
11-
import net.minecraft.network.packet.s2c.play.PlaySoundIdS2CPacket;
11+
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
12+
import net.minecraft.registry.entry.RegistryEntry;
1213
import net.minecraft.server.command.CommandManager;
1314
import net.minecraft.server.command.ServerCommandSource;
1415
import net.minecraft.server.network.ServerPlayerEntity;
1516
import net.minecraft.sound.SoundCategory;
17+
import net.minecraft.sound.SoundEvent;
1618
import net.minecraft.util.Identifier;
1719
import net.minecraft.util.math.Box;
1820

@@ -44,7 +46,7 @@ private static int execute(CommandContext<ServerCommandSource> context, float vo
4446
Identifier sound = IdentifierArgumentType.getIdentifier(context, "sound");
4547

4648
for (ServerPlayerEntity player : playersInRange) {
47-
player.networkHandler.sendPacket(new PlaySoundIdS2CPacket(sound, SoundCategory.MASTER, player.getPos(), volume, pitch, player.getWorld().getRandom().nextLong()));
49+
player.networkHandler.sendPacket(new PlaySoundS2CPacket(RegistryEntry.of(SoundEvent.of(sound)), SoundCategory.MASTER, player.getPos().x, player.getPos().y, player.getPos().z, volume, pitch, player.getWorld().getRandom().nextLong()));
4850
}
4951
return 1;
5052
}

src/main/java/com/lx862/svrutil/mixin/ItemFrameMixin.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.entity.decoration.AbstractDecorationEntity;
88
import net.minecraft.entity.decoration.ItemFrameEntity;
99
import net.minecraft.entity.player.PlayerEntity;
10+
import net.minecraft.registry.tag.DamageTypeTags;
1011
import net.minecraft.util.ActionResult;
1112
import net.minecraft.util.Hand;
1213
import net.minecraft.world.World;
@@ -32,7 +33,7 @@ public void canStayAttached(CallbackInfoReturnable<Boolean> cir) {
3233
@Inject(method = "damage", at = @At("HEAD"), cancellable = true)
3334
public void damage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
3435
if(FeatureSet.VANILLA_MECHANICS.feature.enabled && ((VanillaMechanicsFeature) FeatureSet.VANILLA_MECHANICS.feature).getImmutableItemFrame()) {
35-
if(source.isExplosive() || source.isProjectile()) {
36+
if(!source.isIn(DamageTypeTags.BYPASSES_INVULNERABILITY) && !source.isSourceCreativePlayer()) {
3637
cir.setReturnValue(false);
3738
}
3839
}

src/main/java/com/lx862/svrutil/mixin/MessageCommandMixin.java

+15-18
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@
44
import com.lx862.svrutil.commands.afk;
55
import com.lx862.svrutil.feature.FancyMessageFeature;
66
import com.lx862.svrutil.feature.FeatureSet;
7-
import net.minecraft.command.argument.MessageArgumentType;
7+
import net.minecraft.network.message.SignedMessage;
88
import net.minecraft.server.command.MessageCommand;
99
import net.minecraft.server.command.ServerCommandSource;
1010
import net.minecraft.server.network.ServerPlayerEntity;
1111
import net.minecraft.sound.SoundCategory;
1212
import net.minecraft.sound.SoundEvent;
13-
import net.minecraft.sound.SoundEvents;
1413
import net.minecraft.text.Text;
1514
import net.minecraft.util.Formatting;
1615
import net.minecraft.util.Identifier;
1716
import org.spongepowered.asm.mixin.Mixin;
1817
import org.spongepowered.asm.mixin.injection.At;
1918
import org.spongepowered.asm.mixin.injection.Inject;
20-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
19+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2120

2221
import java.util.Collection;
2322
import java.util.List;
2423

2524
@Mixin(MessageCommand.class)
2625
public class MessageCommandMixin {
2726
@Inject(method = "execute", at = @At("HEAD"), cancellable = true)
28-
private static void execute(ServerCommandSource source, Collection<ServerPlayerEntity> targets, MessageArgumentType.SignedMessage signedMessage, CallbackInfoReturnable<Integer> cir) {
27+
private static void execute(ServerCommandSource source, Collection<ServerPlayerEntity> targets, SignedMessage message, CallbackInfo ci) {
2928
String playerName = source.getName();
3029

3130
SvrUtil.lastReply.put(source.getName(), targets.stream().map(e -> e.getGameProfile().getName()).toList());
@@ -35,24 +34,22 @@ private static void execute(ServerCommandSource source, Collection<ServerPlayerE
3534
}
3635

3736
if(FeatureSet.FANCY_MESSAGE.feature.enabled) {
38-
signedMessage.decorate(source, message -> {
39-
for(ServerPlayerEntity target : targets) {
40-
Text msgContent = message.getContent();
37+
for(ServerPlayerEntity target : targets) {
38+
Text msgContent = message.getContent();
4139

42-
source.sendFeedback(Text.literal(String.format("§6[me §r-> §6%s]: ", target.getGameProfile().getName())).append(msgContent), false);
43-
target.sendMessage(Text.literal(String.format("§6[%s §r-> §6me]: ", playerName)).append(msgContent), false);
40+
source.sendFeedback(Text.literal(String.format("§6[me §r-> §6%s]: ", target.getGameProfile().getName())).append(msgContent), false);
41+
target.sendMessage(Text.literal(String.format("§6[%s §r-> §6me]: ", playerName)).append(msgContent), false);
4442

45-
Identifier soundEffect = ((FancyMessageFeature)FeatureSet.FANCY_MESSAGE.feature).getMessageSound();
46-
if(soundEffect != null) {
47-
target.playSound(new SoundEvent(soundEffect), SoundCategory.MASTER, 1, 1);
48-
}
43+
Identifier soundEffect = ((FancyMessageFeature)FeatureSet.FANCY_MESSAGE.feature).getMessageSound();
44+
if(soundEffect != null) {
45+
target.playSound(SoundEvent.of(soundEffect), SoundCategory.MASTER, 1, 1);
46+
}
4947

50-
if(afk.afkList.containsKey(target.getUuid()) && source.isExecutedByPlayer()) {
51-
source.getPlayer().sendMessageToClient(Text.literal("").append(target.getDisplayName()).append(" are AFK and may not be available at the moment.").formatted(Formatting.YELLOW), true);
52-
}
48+
if(afk.afkList.containsKey(target.getUuid()) && source.isExecutedByPlayer()) {
49+
source.getPlayer().sendMessageToClient(Text.literal("").append(target.getDisplayName()).append(" are AFK and may not be available at the moment.").formatted(Formatting.YELLOW), true);
5350
}
54-
});
55-
cir.setReturnValue(1);
51+
}
52+
ci.cancel();
5653
}
5754
}
5855
}

src/main/java/com/lx862/svrutil/mixin/PlayerManagerMixin.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import com.lx862.svrutil.feature.Feature;
66
import com.lx862.svrutil.feature.FeatureSet;
77
import com.mojang.authlib.GameProfile;
8-
import net.minecraft.network.Packet;
8+
import net.minecraft.network.packet.Packet;
99
import net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket;
1010

11+
import net.minecraft.registry.RegistryKey;
1112
import net.minecraft.server.PlayerManager;
1213
import net.minecraft.server.network.ServerPlayerEntity;
1314
import net.minecraft.text.Text;
14-
import net.minecraft.util.registry.RegistryKey;
1515
import net.minecraft.world.World;
1616
import org.spongepowered.asm.mixin.Final;
1717
import org.spongepowered.asm.mixin.Mixin;

0 commit comments

Comments
 (0)