-
Notifications
You must be signed in to change notification settings - Fork 34
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
Showing
6 changed files
with
90 additions
and
3 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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/pwn/noobs/trouserstreak/mixin/InventoryScreenMixin.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,37 @@ | ||
package pwn.noobs.trouserstreak.mixin; | ||
|
||
import meteordevelopment.meteorclient.systems.modules.Modules; | ||
import pwn.noobs.trouserstreak.modules.*; | ||
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; | ||
import net.minecraft.client.gui.screen.ingame.InventoryScreen; | ||
import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider; | ||
import net.minecraft.client.gui.widget.ButtonWidget; | ||
import net.minecraft.entity.player.PlayerInventory; | ||
import net.minecraft.screen.PlayerScreenHandler; | ||
import net.minecraft.screen.slot.Slot; | ||
import net.minecraft.screen.slot.SlotActionType; | ||
import net.minecraft.text.Text; | ||
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(InventoryScreen.class) | ||
public abstract class InventoryScreenMixin extends AbstractInventoryScreen<PlayerScreenHandler> implements RecipeBookProvider { | ||
public InventoryScreenMixin(PlayerScreenHandler container, PlayerInventory playerInventory, Text name) { | ||
super(container, playerInventory, name); | ||
} | ||
|
||
@Inject(method = {"init"}, at = { @At("TAIL") }) | ||
protected void init(final CallbackInfo ci) { | ||
if(Modules.get().isActive(DupeModule.class)) { | ||
addDrawableChild(new ButtonWidget(x + 124, height / 2 - 24, 48, 20, Text.literal("1.17Dupe"), b -> dupe())); | ||
} | ||
} | ||
|
||
private void dupe() | ||
{ | ||
Slot outputSlot = handler.slots.get(0); | ||
onMouseClick(outputSlot, outputSlot.id, 0, SlotActionType.THROW); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/pwn/noobs/trouserstreak/modules/DupeModule.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,46 @@ | ||
package pwn.noobs.trouserstreak.modules; | ||
|
||
import meteordevelopment.meteorclient.events.entity.DropItemsEvent; | ||
import meteordevelopment.meteorclient.events.game.OpenScreenEvent; | ||
import meteordevelopment.meteorclient.events.meteor.KeyEvent; | ||
import meteordevelopment.meteorclient.events.meteor.MouseButtonEvent; | ||
import meteordevelopment.meteorclient.events.packets.PacketEvent; | ||
import meteordevelopment.meteorclient.events.world.TickEvent; | ||
import meteordevelopment.meteorclient.mixin.CloseHandledScreenC2SPacketAccessor; | ||
import meteordevelopment.meteorclient.mixin.HandledScreenAccessor; | ||
import meteordevelopment.meteorclient.settings.*; | ||
import meteordevelopment.meteorclient.systems.modules.Categories; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
import meteordevelopment.meteorclient.utils.Utils; | ||
import meteordevelopment.meteorclient.utils.misc.Keybind; | ||
import meteordevelopment.meteorclient.utils.misc.input.KeyAction; | ||
import meteordevelopment.meteorclient.utils.network.MeteorExecutor; | ||
import meteordevelopment.meteorclient.utils.player.*; | ||
import meteordevelopment.orbit.EventHandler; | ||
import net.minecraft.client.gui.screen.ingame.HandledScreen; | ||
import net.minecraft.client.gui.screen.ingame.InventoryScreen; | ||
import net.minecraft.entity.EquipmentSlot; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.item.ArmorItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket; | ||
import net.minecraft.screen.GenericContainerScreenHandler; | ||
import net.minecraft.screen.ScreenHandler; | ||
import net.minecraft.screen.slot.Slot; | ||
import net.minecraft.screen.slot.SlotActionType; | ||
import org.lwjgl.glfw.GLFW; | ||
import pwn.noobs.trouserstreak.Trouser; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
public class DupeModule extends Module { | ||
private final SettingGroup sgGeneral = settings.getDefaultGroup(); | ||
|
||
|
||
public DupeModule() { | ||
super(Trouser.Main, "1.17InventoryDupe", "Enable/Disable 1.17 InvDupe button."); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{ | ||
"required": true, | ||
"package": "pwn.noobs.trouserstreak.mixins", | ||
"package": "pwn.noobs.trouserstreak.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"mixins": [ | ||
"InventoryScreenMixin" | ||
] | ||
} |