Skip to content

Commit a5f5260

Browse files
committed
Added Legacy PvP
1 parent 30ea43c commit a5f5260

File tree

8 files changed

+11
-10
lines changed

8 files changed

+11
-10
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
## SimpleClient %version%
2-
- Fixed server IP in Discord integration
2+
- Made server IP in Discord integration lower case
3+
- Added LegacyPvP for >=1.19.4<br>Can be enabled by the server

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ org.gradle.jvmargs=-Xmx2G
33
org.gradle.parallel=true
44

55
# SimpleClient
6-
simpleclient_version=0.3.3
6+
simpleclient_version=0.3.4
77
discord_game_sdk_version=v0.5.5

simpleclient-1.19.4/src/main/java/simpleclient/SimpleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void onInitializeClient() {
5555
if (mc.player != null && mc.level != null) {
5656
if (DiscordRPC.INSTANCE.getIngameTimestamp() == null) DiscordRPC.INSTANCE.setIngameTimestamp(Instant.now());
5757
if (mc.getSingleplayerServer() == null) {
58-
return DiscordRPC.activity("Multiplayer", mc.getCurrentServer().ip, DiscordRPC.INSTANCE.getIngameTimestamp());
58+
return DiscordRPC.activity("Multiplayer", mc.getCurrentServer().ip.toLowerCase(), DiscordRPC.INSTANCE.getIngameTimestamp());
5959
} else {
6060
String gamemode = mc.player.isCreative() ? "Creative Mode" : mc.player.isSpectator() ? "Spectator Mode" : "Survival Mode";
6161
return DiscordRPC.activity("Singleplayer", gamemode, DiscordRPC.INSTANCE.getIngameTimestamp());

simpleclient-1.19.4/src/main/java/simpleclient/mixin/feature/legacypvp/GuiMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package simpleclient.mixin.feature.legacypvp;
22

3+
import com.mojang.blaze3d.vertex.PoseStack;
34
import net.minecraft.client.AttackIndicatorStatus;
45
import net.minecraft.client.Minecraft;
56
import net.minecraft.client.gui.Gui;
6-
import net.minecraft.client.gui.GuiGraphics;
77
import org.spongepowered.asm.mixin.Final;
88
import org.spongepowered.asm.mixin.Mixin;
99
import org.spongepowered.asm.mixin.Shadow;
@@ -20,15 +20,15 @@ abstract class GuiMixin {
2020
private AttackIndicatorStatus attackIndicator;
2121

2222
@Inject(at = @At(value = "HEAD"), method = "render")
23-
public void render1(GuiGraphics guiGraphics, float patrialTicks, CallbackInfo ci) {
23+
public void render1(PoseStack poseStack, float patrialTicks, CallbackInfo ci) {
2424
if (LegacyPvP.ENABLED) {
2525
attackIndicator = minecraft.options.attackIndicator().get();
2626
minecraft.options.attackIndicator().set(AttackIndicatorStatus.OFF);
2727
}
2828
}
2929

3030
@Inject(at = @At(value = "TAIL"), method = "render")
31-
public void render2(GuiGraphics guiGraphics, float partialTicks, CallbackInfo ci) {
31+
public void render2(PoseStack poseStack, float partialTicks, CallbackInfo ci) {
3232
if (LegacyPvP.ENABLED) minecraft.options.attackIndicator().set(attackIndicator);
3333
}
3434
}

simpleclient-1.19.4/src/main/java/simpleclient/mixin/feature/legacypvp/PlayerItemInHandLayerMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void transformBlocking(PoseStack poseStack, boolean leftHand) {
7575

7676
@Unique
7777
private void transformInverse(LivingEntity entity, ItemStack itemStack, ItemDisplayContext context, PoseStack poseStack, boolean leftHand) {
78-
BakedModel model = Minecraft.getInstance().getItemRenderer().getModel(itemStack, entity.level(), entity, 0);
78+
BakedModel model = Minecraft.getInstance().getItemRenderer().getModel(itemStack, entity.level, entity, 0);
7979
transformInverse(model.getTransforms().getTransform(context), leftHand, poseStack);
8080
}
8181

simpleclient-1.20.1/src/main/java/simpleclient/SimpleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void onInitializeClient() {
5353
if (mc.player != null && mc.level != null) {
5454
if (DiscordRPC.INSTANCE.getIngameTimestamp() == null) DiscordRPC.INSTANCE.setIngameTimestamp(Instant.now());
5555
if (mc.getSingleplayerServer() == null) {
56-
return DiscordRPC.activity("Multiplayer", mc.getCurrentServer().ip, DiscordRPC.INSTANCE.getIngameTimestamp());
56+
return DiscordRPC.activity("Multiplayer", mc.getCurrentServer().ip.toLowerCase(), DiscordRPC.INSTANCE.getIngameTimestamp());
5757
} else {
5858
String gamemode = mc.player.isCreative() ? "Creative Mode" : mc.player.isSpectator() ? "Spectator Mode" : "Survival Mode";
5959
return DiscordRPC.activity("Singleplayer", gamemode, DiscordRPC.INSTANCE.getIngameTimestamp());

simpleclient-1.20/src/main/java/simpleclient/SimpleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void onInitializeClient() {
4848
if (mc.player != null && mc.level != null) {
4949
if (DiscordRPC.INSTANCE.getIngameTimestamp() == null) DiscordRPC.INSTANCE.setIngameTimestamp(Instant.now());
5050
if (mc.getSingleplayerServer() == null) {
51-
return DiscordRPC.activity("Multiplayer", mc.getCurrentServer().ip, DiscordRPC.INSTANCE.getIngameTimestamp());
51+
return DiscordRPC.activity("Multiplayer", mc.getCurrentServer().ip.toLowerCase(), DiscordRPC.INSTANCE.getIngameTimestamp());
5252
} else {
5353
String gamemode = mc.player.isCreative() ? "Creative Mode" : mc.player.isSpectator() ? "Spectator Mode" : "Survival Mode";
5454
return DiscordRPC.activity("Singleplayer", gamemode, DiscordRPC.INSTANCE.getIngameTimestamp());

simpleclient-1.8.9/src/main/java/simpleclient/SimpleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void onInitializeClient() {
4848
if (mc.player != null && mc.world != null) {
4949
if (DiscordRPC.INSTANCE.getIngameTimestamp() == null) DiscordRPC.INSTANCE.setIngameTimestamp(Instant.now());
5050
if (mc.getServer() == null) {;
51-
return DiscordRPC.activity("Multiplayer", mc.getCurrentServerEntry().address, DiscordRPC.INSTANCE.getIngameTimestamp());
51+
return DiscordRPC.activity("Multiplayer", mc.getCurrentServerEntry().address.toLowerCase(), DiscordRPC.INSTANCE.getIngameTimestamp());
5252
} else {
5353
PlayerListEntry entry = mc.getNetworkHandler().getPlayerListEntry(mc.player.getGameProfile().getId());
5454
LevelInfo.GameMode mode = entry.getGameMode();

0 commit comments

Comments
 (0)