Skip to content

Commit

Permalink
Updated to 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDerProGamer committed Nov 12, 2024
1 parent 917e1dd commit 22a8fe1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
21 changes: 12 additions & 9 deletions buildSrc/src/main/kotlin/Properties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ object Properties {

/* Paper */
const val paperApiVersion = "1.19"
const val paperMinecraftDevVersion = "1.21"
const val paperDevBundleVersion = "1.21-R0.1-SNAPSHOT"
const val paperMinecraftDevVersion = "1.21.3"
const val paperDevBundleVersion = "1.21.3-R0.1-SNAPSHOT"

/* Fabric (https://fabricmc.net/develop) */
const val fabricLoaderRequiredVersion = "0.14.22"
const val fabricMinecraftDevVersion = "1.21"
const val yarnMappingsDevVersion = "$fabricMinecraftDevVersion+build.7"
const val fabricLoaderDevVersion = "0.15.11"
const val fabricApiDevVersion = "0.100.4+$fabricMinecraftDevVersion"
const val fabricMinecraftDevVersion = "1.21.3"
const val yarnMappingsDevVersion = "$fabricMinecraftDevVersion+build.2"
const val fabricLoaderDevVersion = "0.16.9"
const val fabricApiDevVersion = "0.107.3+$fabricMinecraftDevVersion"

/* Dependencies */
const val voicechatApiVersion = "2.4.11"
const val voicechatModRuntimeVersion = "2.5.16"
const val voicechatApiVersion = "2.5.0"
const val voicechatModRuntimeVersion = "2.5.25"
const val yamlConfigurationVersion = "2.0.2"
const val javaSemverVersion = "0.10.2"
const val gsonVersion = "2.10.1"
Expand All @@ -42,7 +42,10 @@ object Properties {
"1.20.4",
"1.20.5",
"1.20.6",
"1.21"
"1.21",
"1.21.1",
"1.21.2",
"1.21.3"
)

/* Gradle Plugins */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ else if (sender instanceof CommandContext<?> context) {
}

public void sendMessage(Player player, String message) {
((PlayerEntity) player.getPlayer()).sendMessage(toNative(mm(message)));
((PlayerEntity) player.getPlayer()).sendMessage(toNative(mm(message)), false);
}

public String getName(Player player) {
Expand Down Expand Up @@ -149,7 +149,7 @@ private Text toNative(Component component) {

var color = component.color();
if (color != null)
style = style.withColor(TextColor.fromRgb(Integer.parseInt(color.asHexString().substring(1), 16)));
style = style.withColor(net.minecraft.text.TextColor.fromRgb(Integer.parseInt(color.asHexString().substring(1), 16)));

for (var entry : component.decorations().entrySet()) {
var decoration = entry.getKey();
Expand All @@ -170,17 +170,17 @@ private Text toNative(Component component) {

var clickEvent = component.clickEvent();
if (clickEvent != null) {
ClickEvent.Action action = null;
net.minecraft.text.ClickEvent.Action action = null;
switch (clickEvent.action()) {
case OPEN_URL -> action = ClickEvent.Action.OPEN_URL;
case OPEN_FILE -> action = ClickEvent.Action.OPEN_FILE;
case RUN_COMMAND -> action = ClickEvent.Action.RUN_COMMAND;
case SUGGEST_COMMAND -> action = ClickEvent.Action.SUGGEST_COMMAND;
case CHANGE_PAGE -> action = ClickEvent.Action.CHANGE_PAGE;
case COPY_TO_CLIPBOARD -> action = ClickEvent.Action.COPY_TO_CLIPBOARD;
case OPEN_URL -> action = net.minecraft.text.ClickEvent.Action.OPEN_URL;
case OPEN_FILE -> action = net.minecraft.text.ClickEvent.Action.OPEN_FILE;
case RUN_COMMAND -> action = net.minecraft.text.ClickEvent.Action.RUN_COMMAND;
case SUGGEST_COMMAND -> action = net.minecraft.text.ClickEvent.Action.SUGGEST_COMMAND;
case CHANGE_PAGE -> action = net.minecraft.text.ClickEvent.Action.CHANGE_PAGE;
case COPY_TO_CLIPBOARD -> action = net.minecraft.text.ClickEvent.Action.COPY_TO_CLIPBOARD;
default -> warn("Unknown click event action: " + clickEvent.action());
}
style = style.withClickEvent(new ClickEvent(action, clickEvent.value()));
style = style.withClickEvent(new net.minecraft.text.ClickEvent(action, clickEvent.value()));
}

var hoverEvent = component.hoverEvent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import de.maxhenkel.voicechat.api.Position;
import de.maxhenkel.voicechat.api.ServerLevel;
import de.maxhenkel.voicechat.api.ServerPlayer;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
Expand Down Expand Up @@ -56,7 +57,8 @@ public ServerPlayer commandContextToPlayer(CommandContext<?> context) {
}
}
if (nmsEntity == null) return null;
@SuppressWarnings("DataFlowIssue") Entity entity = (Entity) nmsEntity.getBukkitSender(null);
Entity entity = Bukkit.getEntity(nmsEntity.getUUID());
if (entity == null) return null;
return api.createPosition(
entity.getLocation().getX(),
entity.getLocation().getY(),
Expand Down

0 comments on commit 22a8fe1

Please sign in to comment.