Don't remap logging functions
This commit is contained in:
@@ -12,24 +12,24 @@ import java.util.Objects;
|
|||||||
@Mixin(ClientPlayNetworkHandler.class)
|
@Mixin(ClientPlayNetworkHandler.class)
|
||||||
public class DisableCommonPacketWarnings {
|
public class DisableCommonPacketWarnings {
|
||||||
|
|
||||||
@Redirect(method = "onCustomPayload", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V"))
|
@Redirect(method = "onCustomPayload", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V", remap = false))
|
||||||
public void onCustomPacket(Logger instance, String s, Object o) {
|
public void onCustomPacket(Logger instance, String s, Object o) {
|
||||||
if (!Objects.equals(o, Identifier.of("badlion", "mods"))) {
|
if (!Objects.equals(o, Identifier.of("badlion", "mods"))) {
|
||||||
instance.warn(s, o);
|
instance.warn(s, o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "onEntityPassengersSet", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;)V"))
|
@Redirect(method = "onEntityPassengersSet", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;)V", remap = false))
|
||||||
public void onUnknownPassenger(Logger instance, String s) {
|
public void onUnknownPassenger(Logger instance, String s) {
|
||||||
// Ignore passenger data for unknown entities, since HyPixel just sends a lot of those.
|
// Ignore passenger data for unknown entities, since HyPixel just sends a lot of those.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "onTeam", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;[Ljava/lang/Object;)V"))
|
@Redirect(method = "onTeam", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;[Ljava/lang/Object;)V", remap = false))
|
||||||
public void onOnTeam(Logger instance, String s, Object[] objects) {
|
public void onOnTeam(Logger instance, String s, Object[] objects) {
|
||||||
// Ignore data for unknown teams, since HyPixel just sends a lot of invalid team data.
|
// Ignore data for unknown teams, since HyPixel just sends a lot of invalid team data.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Redirect(method = "onPlayerList", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V"))
|
@Redirect(method = "onPlayerList", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V", remap = false))
|
||||||
public void onOnPlayerList(Logger instance, String s, Object o) {
|
public void onOnPlayerList(Logger instance, String s, Object o) {
|
||||||
// Ignore invalid player info, since HyPixel just sends a lot of invalid player info
|
// Ignore invalid player info, since HyPixel just sends a lot of invalid player info
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
|
|
||||||
@Mixin(FishingBobberEntity.class)
|
@Mixin(FishingBobberEntity.class)
|
||||||
public class DisableInvalidFishingHook {
|
public class DisableInvalidFishingHook {
|
||||||
@Redirect(method = "onSpawnPacket", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V"))
|
@Redirect(method = "onSpawnPacket", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false))
|
||||||
public void onOnSpawnPacket(Logger instance, String s, Object o, Object o1) {
|
public void onOnSpawnPacket(Logger instance, String s, Object o, Object o1) {
|
||||||
// Don't warn for broken fishing hooks, since HyPixel sends a bunch of those
|
// Don't warn for broken fishing hooks, since HyPixel sends a bunch of those
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
|
|
||||||
@Mixin(Scoreboard.class)
|
@Mixin(Scoreboard.class)
|
||||||
public class MixinScoreboard {
|
public class MixinScoreboard {
|
||||||
@Redirect(method = "addTeam", at=@At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V"))
|
@Redirect(method = "addTeam", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V", remap = false))
|
||||||
public void onExistingteam(Logger instance, String s, Object o) {
|
public void onExistingteam(Logger instance, String s, Object o) {
|
||||||
// Ignore creations of existing teams
|
// Ignore creations of existing teams
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user