patcher -> silent

This commit is contained in:
kirillsaint 2023-07-03 15:40:59 +06:00
parent 31d6483c72
commit 3576395d83
21 changed files with 29 additions and 29 deletions

View File

@ -23,7 +23,7 @@ public class BlockModelRendererAmbientOcclusionFaceMixin {
//#endif //#endif
) )
) )
private boolean patcher$betterSmoothLighting(Block block) { private boolean silent$betterSmoothLighting(Block block) {
//#if MC==10809 //#if MC==10809
return !block.isVisuallyOpaque() || block.getLightOpacity() == 0; return !block.isVisuallyOpaque() || block.getLightOpacity() == 0;
//#else //#else

View File

@ -16,7 +16,7 @@ public class C17PacketCustomPayloadMixin {
private PacketBuffer data; private PacketBuffer data;
@Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayServer;)V", at = @At("TAIL")) @Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayServer;)V", at = @At("TAIL"))
private void patcher$releaseData(INetHandlerPlayServer handler, CallbackInfo ci) { private void silent$releaseData(INetHandlerPlayServer handler, CallbackInfo ci) {
if (this.data != null) { if (this.data != null) {
this.data.release(); this.data.release();
} }

View File

@ -23,7 +23,7 @@ public class EffectRendererMixin {
target = "Lnet/minecraft/client/particle/EntityFX;renderParticle(Lnet/minecraft/client/renderer/WorldRenderer;Lnet/minecraft/entity/Entity;FFFFFF)V" target = "Lnet/minecraft/client/particle/EntityFX;renderParticle(Lnet/minecraft/client/renderer/WorldRenderer;Lnet/minecraft/entity/Entity;FFFFFF)V"
) )
) )
private void patcher$cullParticles( private void silent$cullParticles(
EntityFX instance, WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, EntityFX instance, WorldRenderer worldRendererIn, Entity entityIn, float partialTicks,
float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ
) { ) {
@ -36,7 +36,7 @@ public class EffectRendererMixin {
method = "updateEffectAlphaLayer", method = "updateEffectAlphaLayer",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/EffectRenderer;tickParticle(Lnet/minecraft/client/particle/EntityFX;)V", shift = At.Shift.AFTER) at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/EffectRenderer;tickParticle(Lnet/minecraft/client/particle/EntityFX;)V", shift = At.Shift.AFTER)
) )
private EntityFX patcher$checkIfCulled(EntityFX entityFX) { private EntityFX silent$checkIfCulled(EntityFX entityFX) {
if (ParticleCulling.camera != null) { if (ParticleCulling.camera != null) {
((EntityFXExt) entityFX).setCullState(ParticleCulling.camera.isBoundingBoxInFrustum( ((EntityFXExt) entityFX).setCullState(ParticleCulling.camera.isBoundingBoxInFrustum(
//#if MC==10809 //#if MC==10809

View File

@ -18,7 +18,7 @@ import java.util.Iterator;
public class EntityLivingBaseMixin { public class EntityLivingBaseMixin {
@Inject(method = "updatePotionEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/potion/PotionEffect;onUpdate(Lnet/minecraft/entity/EntityLivingBase;)Z"), @Inject(method = "updatePotionEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/potion/PotionEffect;onUpdate(Lnet/minecraft/entity/EntityLivingBase;)Z"),
locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true) locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true)
private void patcher$checkPotionEffect(CallbackInfo ci, private void silent$checkPotionEffect(CallbackInfo ci,
//#if MC==10809 //#if MC==10809
Iterator<Integer> iterator, Integer integer, Iterator<Integer> iterator, Integer integer,
//#else //#else

View File

@ -19,7 +19,7 @@ public class EntityPacketsMixin {
cancellable = true, cancellable = true,
remap = false remap = false
) )
private void patcher$addNullCheck(World worldIn, CallbackInfoReturnable<Entity> cir) { private void silent$addNullCheck(World worldIn, CallbackInfoReturnable<Entity> cir) {
if (worldIn == null) { if (worldIn == null) {
cir.setReturnValue(null); cir.setReturnValue(null);
} }

View File

@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
public class EntityXPOrbMixin { public class EntityXPOrbMixin {
//#if MC==10809 //#if MC==10809
@Redirect(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;getEyeHeight()F")) @Redirect(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;getEyeHeight()F"))
private float patcher$lowerHeight(EntityPlayer entityPlayer) { private float silent$lowerHeight(EntityPlayer entityPlayer) {
return (float) (entityPlayer.getEyeHeight() / 2.0D); return (float) (entityPlayer.getEyeHeight() / 2.0D);
} }
//#endif //#endif

View File

@ -13,7 +13,7 @@ public class GuiGameOverMixin {
@Shadow private int enableButtonsTimer; @Shadow private int enableButtonsTimer;
@Inject(method = "initGui", at = @At("HEAD")) @Inject(method = "initGui", at = @At("HEAD"))
private void patcher$allowClickable(CallbackInfo ci) { private void silent$allowClickable(CallbackInfo ci) {
this.enableButtonsTimer = 0; this.enableButtonsTimer = 0;
} }
//#endif //#endif

View File

@ -11,12 +11,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(targets = "net.minecraft.client.gui.GuiScreenOptionsSounds$Button") @Mixin(targets = "net.minecraft.client.gui.GuiScreenOptionsSounds$Button")
public class GuiScreenOptionsSoundsMixin { public class GuiScreenOptionsSoundsMixin {
@Redirect(method = "mouseDragged(Lnet/minecraft/client/Minecraft;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/GameSettings;saveOptions()V")) @Redirect(method = "mouseDragged(Lnet/minecraft/client/Minecraft;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/GameSettings;saveOptions()V"))
private void patcher$cancelSaving(GameSettings instance) { private void silent$cancelSaving(GameSettings instance) {
// no-op // no-op
} }
@Inject(method = "mouseReleased(II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/audio/SoundHandler;playSound(Lnet/minecraft/client/audio/ISound;)V")) @Inject(method = "mouseReleased(II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/audio/SoundHandler;playSound(Lnet/minecraft/client/audio/ISound;)V"))
private void patcher$save(int mouseX, int mouseY, CallbackInfo ci) { private void silent$save(int mouseX, int mouseY, CallbackInfo ci) {
Minecraft.getMinecraft().gameSettings.saveOptions(); Minecraft.getMinecraft().gameSettings.saveOptions();
} }
} }

View File

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(GuiScreenResourcePacks.class) @Mixin(GuiScreenResourcePacks.class)
public class GuiScreenResourcePacksMixin { public class GuiScreenResourcePacksMixin {
@Inject(method = "actionPerformed", at = @At(value = "INVOKE", target = "Ljava/util/Collections;reverse(Ljava/util/List;)V", remap = false)) @Inject(method = "actionPerformed", at = @At(value = "INVOKE", target = "Ljava/util/Collections;reverse(Ljava/util/List;)V", remap = false))
private void patcher$clearHandles(CallbackInfo ci) { private void silent$clearHandles(CallbackInfo ci) {
ResourcePackRepository repository = Minecraft.getMinecraft().getResourcePackRepository(); ResourcePackRepository repository = Minecraft.getMinecraft().getResourcePackRepository();
for (ResourcePackRepository.Entry entry : repository.getRepositoryEntries()) { for (ResourcePackRepository.Entry entry : repository.getRepositoryEntries()) {
IResourcePack current = repository.getResourcePackInstance(); IResourcePack current = repository.getResourcePackInstance();

View File

@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(LayerWitherAura.class) @Mixin(LayerWitherAura.class)
public class LayerWitherAuraMixin { public class LayerWitherAuraMixin {
@Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityWither;FFFFFFF)V", at = @At("TAIL")) @Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityWither;FFFFFFF)V", at = @At("TAIL"))
private void patcher$fixDepth(CallbackInfo ci) { private void silent$fixDepth(CallbackInfo ci) {
GlStateManager.depthMask(true); GlStateManager.depthMask(true);
} }
} }

View File

@ -13,7 +13,7 @@ public class MinecraftServerMixin {
at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ServerStatusResponse;setFavicon(Ljava/lang/String;)V", shift = At.Shift.AFTER), at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ServerStatusResponse;setFavicon(Ljava/lang/String;)V", shift = At.Shift.AFTER),
ordinal = 1 ordinal = 1
) )
private ByteBuf patcher$releaseByteBuf(ByteBuf buf1) { private ByteBuf silent$releaseByteBuf(ByteBuf buf1) {
buf1.release(); buf1.release();
return buf1; return buf1;
} }

View File

@ -36,7 +36,7 @@ public class NetHandlerPlayClientMixin {
//#if MC==10809 //#if MC==10809
@Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true) @Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true)
private void patcher$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) { private void silent$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) {
if (!NetHandlerPlayClientHook.validateResourcePackUrl((NetHandlerPlayClient) (Object) this, packetIn)) { if (!NetHandlerPlayClientHook.validateResourcePackUrl((NetHandlerPlayClient) (Object) this, packetIn)) {
ci.cancel(); ci.cancel();
} }
@ -46,7 +46,7 @@ public class NetHandlerPlayClientMixin {
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to locate sign at ", ordinal = 0)), slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to locate sign at ", ordinal = 0)),
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;addChatMessage(Lnet/minecraft/util/IChatComponent;)V", ordinal = 0) at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;addChatMessage(Lnet/minecraft/util/IChatComponent;)V", ordinal = 0)
) )
private void patcher$removeDebugMessage(EntityPlayerSP instance, IChatComponent component) { private void silent$removeDebugMessage(EntityPlayerSP instance, IChatComponent component) {
// No-op // No-op
} }
//#endif //#endif

View File

@ -14,7 +14,7 @@ public class NodeProcessorMixin {
@Shadow protected IBlockAccess blockaccess; @Shadow protected IBlockAccess blockaccess;
@Inject(method = "postProcess", at = @At("HEAD")) @Inject(method = "postProcess", at = @At("HEAD"))
private void patcher$cleanupBlockAccess(CallbackInfo ci) { private void silent$cleanupBlockAccess(CallbackInfo ci) {
this.blockaccess = null; this.blockaccess = null;
} }
//#endif //#endif

View File

@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
public class PacketThreadUtilMixin { public class PacketThreadUtilMixin {
@SuppressWarnings({"rawtypes", "unchecked"}) @SuppressWarnings({"rawtypes", "unchecked"})
@Redirect(method = "run", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/Packet;processPacket(Lnet/minecraft/network/INetHandler;)V")) @Redirect(method = "run", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/Packet;processPacket(Lnet/minecraft/network/INetHandler;)V"))
private void patcher$ignorePacketsFromClosedConnections(Packet packet, INetHandler handler) { private void silent$ignorePacketsFromClosedConnections(Packet packet, INetHandler handler) {
if (handler instanceof NetHandlerPlayClient) { if (handler instanceof NetHandlerPlayClient) {
if (((NetHandlerPlayClient) handler).getNetworkManager().isChannelOpen()) { if (((NetHandlerPlayClient) handler).getNetworkManager().isChannelOpen()) {
packet.processPacket(handler); packet.processPacket(handler);

View File

@ -34,7 +34,7 @@ public class RenderGlobalMixin {
} }
@ModifyVariable(method = "getVisibleFacings", name = "visgraph", at = @At(value = "STORE", ordinal = 0)) @ModifyVariable(method = "getVisibleFacings", name = "visgraph", at = @At(value = "STORE", ordinal = 0))
private VisGraph patcher$setLimitScan(VisGraph visgraph) { private VisGraph silent$setLimitScan(VisGraph visgraph) {
((VisGraphExt) visgraph).silent$setLimitScan(true); ((VisGraphExt) visgraph).silent$setLimitScan(true);
return visgraph; return visgraph;
} }

View File

@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(RenderItemFrame.class) @Mixin(RenderItemFrame.class)
public class RenderItemFrameMixin { public class RenderItemFrameMixin {
@Inject(method = "doRender(Lnet/minecraft/entity/item/EntityItemFrame;DDDFF)V", at = @At("HEAD"), cancellable = true) @Inject(method = "doRender(Lnet/minecraft/entity/item/EntityItemFrame;DDDFF)V", at = @At("HEAD"), cancellable = true)
private void patcher$cancelRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { private void silent$cancelRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
if (Client.getInstance().getSettingsManager().getSettingByClass(FPSBoostMod.class, "Hide Item Frames").getValBoolean()) { if (Client.getInstance().getSettingsManager().getSettingByClass(FPSBoostMod.class, "Hide Item Frames").getValBoolean()) {
ci.cancel(); ci.cancel();
return; return;

View File

@ -15,7 +15,7 @@ public class S3FPacketCustomPayloadMixin {
@Shadow private PacketBuffer data; @Shadow private PacketBuffer data;
@Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayClient;)V", at = @At("TAIL")) @Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayClient;)V", at = @At("TAIL"))
private void patcher$releaseData(INetHandlerPlayClient handler, CallbackInfo ci) { private void silent$releaseData(INetHandlerPlayClient handler, CallbackInfo ci) {
if (this.data != null) { if (this.data != null) {
this.data.release(); this.data.release();
} }

View File

@ -18,34 +18,34 @@ public abstract class ScoreboardMixin {
@Shadow public abstract ScorePlayerTeam getTeam(String p_96508_1_); @Shadow public abstract ScorePlayerTeam getTeam(String p_96508_1_);
@Inject(method = "removeTeam", at = @At("HEAD"), cancellable = true) @Inject(method = "removeTeam", at = @At("HEAD"), cancellable = true)
private void patcher$checkIfTeamIsNull(ScorePlayerTeam team, CallbackInfo ci) { private void silent$checkIfTeamIsNull(ScorePlayerTeam team, CallbackInfo ci) {
if (team == null) ci.cancel(); if (team == null) ci.cancel();
} }
@Redirect(method = "removeTeam", at = @At(value = "INVOKE", target = "Ljava/util/Map;remove(Ljava/lang/Object;)Ljava/lang/Object;", ordinal = 0, remap = false)) @Redirect(method = "removeTeam", at = @At(value = "INVOKE", target = "Ljava/util/Map;remove(Ljava/lang/Object;)Ljava/lang/Object;", ordinal = 0, remap = false))
private <K, V> V patcher$checkIfRegisteredNameIsNull(Map<K, V> instance, K o) { private <K, V> V silent$checkIfRegisteredNameIsNull(Map<K, V> instance, K o) {
if (o != null) return instance.remove(o); if (o != null) return instance.remove(o);
return null; return null;
} }
@Inject(method = "removeObjective", at = @At("HEAD"), cancellable = true) @Inject(method = "removeObjective", at = @At("HEAD"), cancellable = true)
private void patcher$checkIfObjectiveIsNull(ScoreObjective objective, CallbackInfo ci) { private void silent$checkIfObjectiveIsNull(ScoreObjective objective, CallbackInfo ci) {
if (objective == null) ci.cancel(); if (objective == null) ci.cancel();
} }
@Redirect(method = "removeObjective", at = @At(value = "INVOKE", target = "Ljava/util/Map;remove(Ljava/lang/Object;)Ljava/lang/Object;", ordinal = 0, remap = false)) @Redirect(method = "removeObjective", at = @At(value = "INVOKE", target = "Ljava/util/Map;remove(Ljava/lang/Object;)Ljava/lang/Object;", ordinal = 0, remap = false))
private <K, V> V patcher$checkIfNameIsNull(Map<K, V> instance, K o) { private <K, V> V silent$checkIfNameIsNull(Map<K, V> instance, K o) {
if (o != null) return instance.remove(o); if (o != null) return instance.remove(o);
return null; return null;
} }
@Inject(method = "createTeam", at = @At(value = "CONSTANT", args = "stringValue=A team with the name '"), cancellable = true) @Inject(method = "createTeam", at = @At(value = "CONSTANT", args = "stringValue=A team with the name '"), cancellable = true)
private void patcher$returnExistingTeam(String name, CallbackInfoReturnable<ScorePlayerTeam> cir) { private void silent$returnExistingTeam(String name, CallbackInfoReturnable<ScorePlayerTeam> cir) {
cir.setReturnValue(this.getTeam(name)); cir.setReturnValue(this.getTeam(name));
} }
@Inject(method = "removePlayerFromTeam", at = @At(value = "CONSTANT", args = "stringValue=Player is either on another team or not on any team. Cannot remove from team '"), cancellable = true) @Inject(method = "removePlayerFromTeam", at = @At(value = "CONSTANT", args = "stringValue=Player is either on another team or not on any team. Cannot remove from team '"), cancellable = true)
private void patcher$silenceException(CallbackInfo ci) { private void silent$silenceException(CallbackInfo ci) {
ci.cancel(); ci.cancel();
} }
} }

View File

@ -53,7 +53,7 @@ public abstract class SoundManagerMixin {
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to play unknown soundEvent: {}", ordinal = 0)), slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to play unknown soundEvent: {}", ordinal = 0)),
at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V", ordinal = 0, remap = false) at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V", ordinal = 0, remap = false)
) )
private void patcher$silenceWarning(Logger instance, Marker marker, String s, Object[] objects) { private void silent$silenceWarning(Logger instance, Marker marker, String s, Object[] objects) {
// No-op // No-op
} }
} }

View File

@ -22,7 +22,7 @@ public class TileEntitySkullRendererMixin {
//#if MC==10809 //#if MC==10809
@Inject(method = "renderSkull", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V")) @Inject(method = "renderSkull", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V"))
private void patcher$enableBlending(CallbackInfo ci) { private void silent$enableBlending(CallbackInfo ci) {
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
} }

View File

@ -16,7 +16,7 @@ public class VertexBufferMixin {
// inject at INVOKE rather than HEAD as OptiFine changes this method for its Render Regions option // inject at INVOKE rather than HEAD as OptiFine changes this method for its Render Regions option
@Inject(method = "bufferData", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/vertex/VertexBuffer;bindBuffer()V"), cancellable = true) @Inject(method = "bufferData", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/vertex/VertexBuffer;bindBuffer()V"), cancellable = true)
private void patcher$ignoreRemovedBuffers(ByteBuffer byteBuffer, CallbackInfo ci) { private void silent$ignoreRemovedBuffers(ByteBuffer byteBuffer, CallbackInfo ci) {
if (this.glBufferId == -1) { if (this.glBufferId == -1) {
ci.cancel(); ci.cancel();
} }