Skip to content

Commit

Permalink
Update 1.2.46
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox2Code committed May 26, 2024
1 parent 2440803 commit 2b4aeec
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.fox2code.foxloader.client.mixins;

import net.minecraft.src.game.entity.monster.EntityWyvern;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(EntityWyvern.class)
public class MixinEntityWyvern {
@Inject(method = "isCourseTraversable", at = @At("HEAD"), cancellable = true)
public void hotfix_isCourseTraversable(double x, double y, double z, double xyzsqrt, CallbackInfoReturnable<Boolean> cir) {
if (xyzsqrt > Short.MAX_VALUE) {
cir.setReturnValue(Boolean.FALSE);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.fox2code.foxloader.client.mixins;

import net.minecraft.src.client.gui.GuiEditSign;
import net.minecraft.src.game.level.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiEditSign.class)
public class MixinGuiEditSign {
@Redirect(method = "onGuiClosed", at = @At(value = "FIELD",
target = "Lnet/minecraft/src/game/level/World;multiplayerWorld:Z"))
public boolean hotfix_multiplayerWorld(World instance) {
return instance != null && instance.multiplayerWorld;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
import net.minecraft.src.client.Session;
import net.minecraft.src.client.gui.*;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Objects;

@Mixin(GuiMainMenu.class)
public abstract class MixinGuiMainMenu extends GuiScreen {
@Unique private String rainbowUserName;
@Unique private String username;

@Inject(method = "initGui", at = @At(value = "RETURN"))
public void onInitGui(CallbackInfo ci) {
this.controlList.add(new GuiUpdateButton(500, this.width - 62, 2, 60, 20, "Mods"));
Expand All @@ -38,7 +44,11 @@ public void onActionPerformed(GuiButton var1, CallbackInfo ci) {
public String onGetUsername(Session instance) {
final String username = instance.username;
if (ModLoader.Contributors.hasContributorName(username)) {
return ChatColors.RAINBOW + username;
if (!Objects.equals(this.username, username)) {
this.rainbowUserName = ChatColors.RAINBOW + username;
this.username = username;
}
return this.rainbowUserName;
}
return username;
}
Expand Down
2 changes: 2 additions & 0 deletions client/src/main/resources/foxloader.client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
"MixinEntityPlayer",
"MixinEntityPlayerSP",
"MixinEntityRenderer",
"MixinEntityWyvern",
"MixinGameSettings",
"MixinGuiConnecting",
"MixinGuiContainer",
"MixinGuiDebug",
"MixinGuiEditSign",
"MixinGuiIngameMenu",
"MixinGuiMainMenu",
"MixinGuiScreen",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1024m -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8

# FoxLoader properties
foxloader.version=1.2.45
foxloader.version=1.2.46
foxloader.lastReIndevTransformerChanges=1.2.39
# https://www.jitpack.io/#com.fox2code/FoxLoader

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ static EntityPlayerMP toEntityPlayerMP(NetworkPlayer networkPlayer) {
return (EntityPlayerMP) networkPlayer;
}

@SuppressWarnings("unchecked")
static List<EntityPlayerMP> getOnlinePlayers() {
return getGameInstance().configManager.playerEntities;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.fox2code.foxloader.server.mixins;


import net.minecraft.src.game.entity.monster.EntityWyvern;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(EntityWyvern.class)
public class MixinEntityWyvern {
@Inject(method = "isCourseTraversable", at = @At("HEAD"), cancellable = true)
public void hotfix_isCourseTraversable(double x, double y, double z, double xyzsqrt, CallbackInfoReturnable<Boolean> cir) {
if (xyzsqrt > Short.MAX_VALUE) {
cir.setReturnValue(Boolean.FALSE);
}
}
}
1 change: 1 addition & 0 deletions server/src/main/resources/foxloader.server.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"MixinEntityLiving",
"MixinEntityPlayer",
"MixinEntityPlayerMP",
"MixinEntityWyvern",
"MixinItem",
"MixinItemStack",
"MixinMinecraftServer",
Expand Down

0 comments on commit 2b4aeec

Please sign in to comment.