From 613a8603d081589684c9f54133cae9b7a398c759 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 28 Sep 2022 18:55:13 +0200 Subject: Revert "Rename .java to .kt" This reverts commit e4df99ecf701d249a6a34e1ce0bd4aeb2252da39. --- .../transformers/AccessorGuiPlayerTabOverlay.java | 12 ++++++ .../transformers/AccessorGuiPlayerTabOverlay.kt | 12 ------ .../transformers/MixinNetHandlerPlayClient.java | 24 +++++++++++ .../transformers/MixinNetHandlerPlayClient.kt | 24 ----------- .../mixins/transformers/MixinNetworkManager.java | 20 ++++++++++ .../mixins/transformers/MixinNetworkManager.kt | 20 ---------- .../mixins/transformers/MixinRenderItem.java | 46 ++++++++++++++++++++++ .../mixins/transformers/MixinRenderItem.kt | 46 ---------------------- .../mixins/transformers/MixinRenderManager.java | 19 +++++++++ .../mixins/transformers/MixinRenderManager.kt | 19 --------- .../renderer/MixinRendererLivingEntity.java | 35 ++++++++++++++++ .../renderer/MixinRendererLivingEntity.kt | 35 ---------------- 12 files changed, 156 insertions(+), 156 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.kt (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java new file mode 100644 index 000000000..41091580e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java @@ -0,0 +1,12 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import net.minecraft.client.gui.GuiPlayerTabOverlay; +import net.minecraft.util.IChatComponent; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(GuiPlayerTabOverlay.class) +public interface AccessorGuiPlayerTabOverlay { + @Accessor("footer") + IChatComponent getFooter(); +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.kt b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.kt deleted file mode 100644 index 41091580e..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.kt +++ /dev/null @@ -1,12 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers; - -import net.minecraft.client.gui.GuiPlayerTabOverlay; -import net.minecraft.util.IChatComponent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(GuiPlayerTabOverlay.class) -public interface AccessorGuiPlayerTabOverlay { - @Accessor("footer") - IChatComponent getFooter(); -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.java new file mode 100644 index 000000000..bd4107369 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.java @@ -0,0 +1,24 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import at.hannibal2.skyhanni.mixins.hooks.NetHandlerPlayClientHookKt; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.network.Packet; +import net.minecraft.network.play.INetHandlerPlayClient; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(value = NetHandlerPlayClient.class, priority = 1001) +public abstract class MixinNetHandlerPlayClient implements INetHandlerPlayClient { + + @Shadow + private WorldClient clientWorldController; + + @Inject(method = "addToSendQueue", at = @At("HEAD"), cancellable = true) + private void onSendPacket(Packet packet, CallbackInfo ci) { + NetHandlerPlayClientHookKt.onSendPacket(packet, ci); + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.kt b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.kt deleted file mode 100644 index bd4107369..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetHandlerPlayClient.kt +++ /dev/null @@ -1,24 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers; - -import at.hannibal2.skyhanni.mixins.hooks.NetHandlerPlayClientHookKt; -import net.minecraft.client.multiplayer.WorldClient; -import net.minecraft.client.network.NetHandlerPlayClient; -import net.minecraft.network.Packet; -import net.minecraft.network.play.INetHandlerPlayClient; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(value = NetHandlerPlayClient.class, priority = 1001) -public abstract class MixinNetHandlerPlayClient implements INetHandlerPlayClient { - - @Shadow - private WorldClient clientWorldController; - - @Inject(method = "addToSendQueue", at = @At("HEAD"), cancellable = true) - private void onSendPacket(Packet packet, CallbackInfo ci) { - NetHandlerPlayClientHookKt.onSendPacket(packet, ci); - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.java new file mode 100644 index 000000000..459da17a1 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.java @@ -0,0 +1,20 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import at.hannibal2.skyhanni.mixins.hooks.NetworkManagerHookKt; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +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.CallbackInfo; + +@Mixin(value = NetworkManager.class, priority = 1001) +public abstract class MixinNetworkManager extends SimpleChannelInboundHandler> { + + @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true) + private void onReceivePacket(ChannelHandlerContext context, Packet packet, CallbackInfo ci) { + NetworkManagerHookKt.onReceivePacket(context, packet, ci); + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.kt b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.kt deleted file mode 100644 index 459da17a1..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNetworkManager.kt +++ /dev/null @@ -1,20 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers; - -import at.hannibal2.skyhanni.mixins.hooks.NetworkManagerHookKt; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -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.CallbackInfo; - -@Mixin(value = NetworkManager.class, priority = 1001) -public abstract class MixinNetworkManager extends SimpleChannelInboundHandler> { - - @Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true) - private void onReceivePacket(ChannelHandlerContext context, Packet packet, CallbackInfo ci) { - NetworkManagerHookKt.onReceivePacket(context, packet, ci); - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java new file mode 100644 index 000000000..ebd3161ce --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.java @@ -0,0 +1,46 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import at.hannibal2.skyhanni.mixins.hooks.RenderItemHookKt; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +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.CallbackInfo; + +@Mixin(RenderItem.class) +public abstract class MixinRenderItem { + + // @Inject(method = "renderItemIntoGUI", at = @At("HEAD")) + // private void renderRarity(ItemStack stack, int x, int y, CallbackInfo ci) { + // RenderItemHookKt.renderRarity(stack, x, y, ci); + // } + + @Inject(method = "renderItemOverlayIntoGUI", at = @At("RETURN")) + private void renderItemOverlayPost(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text, CallbackInfo ci) { + RenderItemHookKt.renderItemOverlayPost(fr, stack, xPosition, yPosition, text, ci); + } + + // @Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.scale(FFF)V", shift = At.Shift.AFTER)) + // private void renderItemPre(ItemStack stack, IBakedModel model, CallbackInfo ci) { + // RenderItemHookKt.renderItemPre(stack, model, ci); + // } + // + // @Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderEffect(Lnet/minecraft/client/resources/model/IBakedModel;)V", shift = At.Shift.BEFORE), cancellable = true) + // private void modifyGlintRendering(ItemStack stack, IBakedModel model, CallbackInfo ci) { + // RenderItemHookKt.modifyGlintRendering(stack, model, ci); + // } + + @Inject(method = "renderEffect", at = @At("HEAD"), cancellable = true) + public void onRenderEffect(CallbackInfo ci) { + if (RenderItemHookKt.getSkipGlint()) { + ci.cancel(); + } + } + + @Inject(method = "renderItemIntoGUI", at = @At("RETURN")) + public void renderItemReturn(ItemStack stack, int x, int y, CallbackInfo ci) { + RenderItemHookKt.renderItemReturn(stack, x, y, ci); + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.kt b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.kt deleted file mode 100644 index ebd3161ce..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderItem.kt +++ /dev/null @@ -1,46 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers; - -import at.hannibal2.skyhanni.mixins.hooks.RenderItemHookKt; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.item.ItemStack; -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.CallbackInfo; - -@Mixin(RenderItem.class) -public abstract class MixinRenderItem { - - // @Inject(method = "renderItemIntoGUI", at = @At("HEAD")) - // private void renderRarity(ItemStack stack, int x, int y, CallbackInfo ci) { - // RenderItemHookKt.renderRarity(stack, x, y, ci); - // } - - @Inject(method = "renderItemOverlayIntoGUI", at = @At("RETURN")) - private void renderItemOverlayPost(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text, CallbackInfo ci) { - RenderItemHookKt.renderItemOverlayPost(fr, stack, xPosition, yPosition, text, ci); - } - - // @Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "net/minecraft/client/renderer/GlStateManager.scale(FFF)V", shift = At.Shift.AFTER)) - // private void renderItemPre(ItemStack stack, IBakedModel model, CallbackInfo ci) { - // RenderItemHookKt.renderItemPre(stack, model, ci); - // } - // - // @Inject(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderEffect(Lnet/minecraft/client/resources/model/IBakedModel;)V", shift = At.Shift.BEFORE), cancellable = true) - // private void modifyGlintRendering(ItemStack stack, IBakedModel model, CallbackInfo ci) { - // RenderItemHookKt.modifyGlintRendering(stack, model, ci); - // } - - @Inject(method = "renderEffect", at = @At("HEAD"), cancellable = true) - public void onRenderEffect(CallbackInfo ci) { - if (RenderItemHookKt.getSkipGlint()) { - ci.cancel(); - } - } - - @Inject(method = "renderItemIntoGUI", at = @At("RETURN")) - public void renderItemReturn(ItemStack stack, int x, int y, CallbackInfo ci) { - RenderItemHookKt.renderItemReturn(stack, x, y, ci); - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.java new file mode 100644 index 000000000..e36b87195 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.java @@ -0,0 +1,19 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import at.hannibal2.skyhanni.mixins.hooks.RenderManagerHookKt; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +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(RenderManager.class) +public class MixinRenderManager { + + @Inject(method = "shouldRender", at = @At("HEAD"), cancellable = true) + private void shouldRender(Entity entityIn, ICamera camera, double camX, double camY, double camZ, CallbackInfoReturnable cir) { + RenderManagerHookKt.shouldRender(entityIn, camera, camX, camY, camZ, cir); + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.kt b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.kt deleted file mode 100644 index e36b87195..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinRenderManager.kt +++ /dev/null @@ -1,19 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers; - -import at.hannibal2.skyhanni.mixins.hooks.RenderManagerHookKt; -import net.minecraft.client.renderer.culling.ICamera; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.entity.Entity; -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(RenderManager.class) -public class MixinRenderManager { - - @Inject(method = "shouldRender", at = @At("HEAD"), cancellable = true) - private void shouldRender(Entity entityIn, ICamera camera, double camX, double camY, double camZ, CallbackInfoReturnable cir) { - RenderManagerHookKt.shouldRender(entityIn, camera, camX, camY, camZ, cir); - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java new file mode 100644 index 000000000..657636e87 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java @@ -0,0 +1,35 @@ +package at.hannibal2.skyhanni.mixins.transformers.renderer; + +import at.hannibal2.skyhanni.events.RenderMobColoredEvent; +import at.hannibal2.skyhanni.events.ResetEntityHurtEvent; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import org.objectweb.asm.Opcodes; +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.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(RendererLivingEntity.class) +public abstract class MixinRendererLivingEntity extends Render { + protected MixinRendererLivingEntity(RenderManager renderManager) { + super(renderManager); + } + + @Inject(method = "getColorMultiplier", at = @At("HEAD"), cancellable = true) + private void setColorMultiplier(T entity, float lightBrightness, float partialTickTime, CallbackInfoReturnable cir) { + RenderMobColoredEvent event = new RenderMobColoredEvent(entity, 0); + event.postAndCatch(); + cir.setReturnValue(event.getColor()); + } + + @Redirect(method = "setBrightness", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/EntityLivingBase;hurtTime:I", opcode = Opcodes.GETFIELD)) + private int changeHurtTime(EntityLivingBase entity) { + ResetEntityHurtEvent event = new ResetEntityHurtEvent(entity, false); + event.postAndCatch(); + return event.getShouldReset() ? 0 : entity.hurtTime; + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.kt b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.kt deleted file mode 100644 index 657636e87..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.kt +++ /dev/null @@ -1,35 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers.renderer; - -import at.hannibal2.skyhanni.events.RenderMobColoredEvent; -import at.hannibal2.skyhanni.events.ResetEntityHurtEvent; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.entity.RendererLivingEntity; -import net.minecraft.entity.EntityLivingBase; -import org.objectweb.asm.Opcodes; -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.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Mixin(RendererLivingEntity.class) -public abstract class MixinRendererLivingEntity extends Render { - protected MixinRendererLivingEntity(RenderManager renderManager) { - super(renderManager); - } - - @Inject(method = "getColorMultiplier", at = @At("HEAD"), cancellable = true) - private void setColorMultiplier(T entity, float lightBrightness, float partialTickTime, CallbackInfoReturnable cir) { - RenderMobColoredEvent event = new RenderMobColoredEvent(entity, 0); - event.postAndCatch(); - cir.setReturnValue(event.getColor()); - } - - @Redirect(method = "setBrightness", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/EntityLivingBase;hurtTime:I", opcode = Opcodes.GETFIELD)) - private int changeHurtTime(EntityLivingBase entity) { - ResetEntityHurtEvent event = new ResetEntityHurtEvent(entity, false); - event.postAndCatch(); - return event.getShouldReset() ? 0 : entity.hurtTime; - } -} \ No newline at end of file -- cgit