This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Snoworange420
committed
Dec 19, 2022
1 parent
5447ebf
commit 8e9dad2
Showing
34 changed files
with
577 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/com/snoworange/mousse/event/listeners/RenderPortalOverlayEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.snoworange.mousse.event.listeners; | ||
|
||
import net.minecraft.client.gui.ScaledResolution; | ||
import net.minecraftforge.fml.common.eventhandler.Cancelable; | ||
import net.minecraftforge.fml.common.eventhandler.Event; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Cancelable | ||
public class RenderPortalOverlayEvent extends Event { | ||
|
||
public float timeInPortal; | ||
public ScaledResolution scaledRes; | ||
public CallbackInfo ci; | ||
|
||
public RenderPortalOverlayEvent(float timeInPortal, ScaledResolution scaledRes, CallbackInfo ci) { | ||
this.timeInPortal = timeInPortal; | ||
this.scaledRes = scaledRes; | ||
this.ci = ci; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/snoworange/mousse/mixin/mixins/MixinGuiIngame.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.snoworange.mousse.mixin.mixins; | ||
|
||
import com.snoworange.mousse.event.listeners.RenderPortalOverlayEvent; | ||
import net.minecraft.client.gui.GuiIngame; | ||
import net.minecraft.client.gui.ScaledResolution; | ||
import net.minecraftforge.common.MinecraftForge; | ||
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({GuiIngame.class}) | ||
public class MixinGuiIngame { | ||
|
||
@Inject(at = @At("HEAD"), method = {"renderPortal"}, cancellable = true) | ||
public void onRenderPortalOverlay(float timeInPortal, ScaledResolution scaledRes, CallbackInfo ci) { | ||
final RenderPortalOverlayEvent event = new RenderPortalOverlayEvent(timeInPortal, scaledRes, ci); | ||
MinecraftForge.EVENT_BUS.post(event); | ||
if (event.isCanceled()) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/com/snoworange/mousse/mixin/mixins/MixinItemStack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.snoworange.mousse.mixin.mixins; | ||
|
||
import com.snoworange.mousse.Main; | ||
import com.snoworange.mousse.module.modules.misc.Tooltip; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
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.Redirect; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ItemStack.class) | ||
public class MixinItemStack { | ||
|
||
//Impact skid lmfao | ||
|
||
@Redirect( | ||
method = {"getTooltip"}, | ||
at = @At( | ||
value = "INVOKE", | ||
target = "net/minecraft/item/ItemStack.isItemDamaged()Z" | ||
) | ||
) | ||
private boolean isItemDamaged(ItemStack itemStack) { | ||
try { | ||
if (Main.moduleManager.getModule("Tooltip").isEnabled() && Tooltip.alwaysDura.isEnable()) { | ||
return true; | ||
} | ||
} catch (NullPointerException nullPointerException) { | ||
Main.sendMessage(nullPointerException.toString()); | ||
nullPointerException.printStackTrace(); | ||
} | ||
|
||
return itemStack.isItemDamaged(); | ||
} | ||
} | ||
//moice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/com/snoworange/mousse/module/modules/combat/AutoTotem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.snoworange.mousse.module.modules.combat; | ||
|
||
import com.snoworange.mousse.module.Category; | ||
import com.snoworange.mousse.module.Module; | ||
import com.snoworange.mousse.util.entity.InventoryUtils; | ||
import net.minecraft.client.gui.inventory.GuiContainer; | ||
import net.minecraft.init.Items; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
|
||
public class AutoTotem extends Module { | ||
|
||
public AutoTotem() { | ||
super("AutoTotem", "totem", Category.COMBAT); | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
super.onEnable(); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
super.onDisable(); | ||
} | ||
|
||
@SubscribeEvent | ||
public void onFastTick(TickEvent event) { | ||
if (this.isEnabled()) { | ||
|
||
if (mc.world != null && mc.player != null && mc.player.getHeldItemOffhand().getItem() != Items.TOTEM_OF_UNDYING && !(mc.currentScreen instanceof GuiContainer)) { | ||
int totemSlot = InventoryUtils.findInv(Items.TOTEM_OF_UNDYING); | ||
if (totemSlot != -1) { | ||
InventoryUtils.swapItem(totemSlot, 45); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.