0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 01:12:13 +02:00

Unlock Operator Utilities tab

This commit is contained in:
Alexander01998 2022-11-17 13:07:36 +01:00
parent f1d1765a89
commit 5bdd246a0f
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2014-2022 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.mixin;
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;
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.CreativeScreenHandler;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import net.wurstclient.WurstClient;
@Mixin(CreativeInventoryScreen.class)
public abstract class CreativeInventoryScreenMixin
extends AbstractInventoryScreen<CreativeScreenHandler>
{
private CreativeInventoryScreenMixin(WurstClient wurst,
CreativeScreenHandler screenHandler, PlayerInventory playerInventory,
Text text)
{
super(screenHandler, playerInventory, text);
}
@Inject(at = @At("HEAD"),
method = "shouldShowOperatorTab(Lnet/minecraft/entity/player/PlayerEntity;)Z",
cancellable = true)
private void onShouldShowOperatorTab(PlayerEntity player,
CallbackInfoReturnable<Boolean> cir)
{
if(WurstClient.INSTANCE.isEnabled())
cir.setReturnValue(true);
}
}

View File

@ -24,6 +24,7 @@
"ClientPlayerInteractionManagerMixin",
"ClientPlayNetworkHandlerMixin",
"ContainerScreen54Mixin",
"CreativeInventoryScreenMixin",
"CustomPayloadC2SPacketAccessor",
"DeathScreenMixin",
"DirectConnectScreenMixin",