file_name
stringlengths 6
86
| file_path
stringlengths 45
249
| content
stringlengths 47
6.26M
| file_size
int64 47
6.26M
| language
stringclasses 1
value | extension
stringclasses 1
value | repo_name
stringclasses 767
values | repo_stars
int64 8
14.4k
| repo_forks
int64 0
1.17k
| repo_open_issues
int64 0
788
| repo_created_at
stringclasses 767
values | repo_pushed_at
stringclasses 767
values |
---|---|---|---|---|---|---|---|---|---|---|---|
MixinClientCommandHandler.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/patcher/bugfixes/MixinClientCommandHandler.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.patcher.bugfixes;
import net.minecraft.command.ICommandSender;
import net.minecraftforge.client.ClientCommandHandler;
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.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Locale;
@Mixin(ClientCommandHandler.class)
public class MixinClientCommandHandler {
@SuppressWarnings("UnresolvedMixinReference")
@ModifyArg(method = {"executeCommand", "func_71556_a"}, at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;", remap = false), remap = false)
private Object makeLowerCaseForGet(Object s) {
if (s instanceof String) {
return ((String) s).toLowerCase(Locale.ENGLISH);
}
return s;
}
@SuppressWarnings("UnresolvedMixinReference")
@Inject(method = {"executeCommand", "func_71556_a"}, at = @At("HEAD"), cancellable = true, remap = false)
private void checkForSlash(ICommandSender sender, String message, CallbackInfoReturnable<Integer> cir) {
if (!message.trim().startsWith("/")) {
cir.setReturnValue(0);
}
}
}
| 1,533 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinItemModelMesher.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/patcher/bugfixes/MixinItemModelMesher.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.patcher.bugfixes;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Final;
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.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(ItemModelMesher.class)
public class MixinItemModelMesher {
@Shadow @Final private ModelManager modelManager;
@Inject(method = "getItemModel(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/resources/model/IBakedModel;", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true)
private void returnMissingModel(ItemStack stack, CallbackInfoReturnable<IBakedModel> cir, Item item) {
if (item == null) {
cir.setReturnValue(this.modelManager.getMissingModel());
}
}
}
| 1,512 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinServerList.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/patcher/bugfixes/MixinServerList.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.patcher.bugfixes;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.ServerList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.util.List;
@Mixin(ServerList.class)
public abstract class MixinServerList {
private static final Logger patcher$logger = LogManager.getLogger("Patcher/ServerList");
@Shadow @Final
private List<ServerData> servers;
@Shadow public abstract void saveServerList();
/**
* @author LlamaLad7
* @reason resolve NPE
*/
@Overwrite
public ServerData getServerData(int index) {
try {
return this.servers.get(index);
} catch (Exception e) {
patcher$logger.error("Failed to get server data.", e);
return null;
}
}
/**
* @author LlamaLad7
* @reason resolve NPE
*/
@Overwrite
public void removeServerData(int index) {
try {
this.servers.remove(index);
} catch (Exception e) {
patcher$logger.error("Failed to remove server data.", e);
}
}
/**
* @author LlamaLad7
* @reason resolve NPE
*/
@Overwrite
public void addServerData(ServerData server) {
try {
this.servers.add(server);
} catch (Exception e) {
patcher$logger.error("Failed to add server data.", e);
}
}
/**
* @author LlamaLad7
* @reason resolve NPE
*/
@Overwrite
public void swapServers(int p_78857_1_, int p_78857_2_) {
try {
ServerData serverdata = this.getServerData(p_78857_1_);
this.servers.set(p_78857_1_, this.getServerData(p_78857_2_));
this.servers.set(p_78857_2_, serverdata);
this.saveServerList();
} catch (Exception e) {
patcher$logger.error("Failed to swap servers.", e);
}
}
/**
* @author LlamaLad7
* @reason resolve NPE
*/
@Overwrite
public void func_147413_a(int index, ServerData server) {
try {
this.servers.set(index, server);
} catch (Exception e) {
patcher$logger.error("Failed to set server data.", e);
}
}
}
| 2,678 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinCommandHandler.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/patcher/bugfixes/MixinCommandHandler.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.patcher.bugfixes;
import net.minecraft.command.CommandHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import java.util.Locale;
@Mixin(CommandHandler.class)
public class MixinCommandHandler {
@ModifyArg(method = "executeCommand", at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;", remap = false))
private Object makeLowerCaseForGet(Object s) {
if (s instanceof String)
return ((String) s).toLowerCase(Locale.ENGLISH);
return s;
}
@ModifyArg(method = "registerCommand", at = @At(value = "INVOKE", target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", remap = false), index = 0)
private Object makeLowerCaseForPut(Object s) {
if (s instanceof String)
return ((String) s).toLowerCase(Locale.ENGLISH);
return s;
}
}
| 1,226 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MinecraftForgeClientAccessor.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/accessors/MinecraftForgeClientAccessor.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.accessors;
import com.google.common.cache.LoadingCache;
import net.minecraft.client.renderer.RegionRenderCache;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
import org.spongepowered.asm.mixin.gen.Accessor;
import net.minecraftforge.client.MinecraftForgeClient;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(MinecraftForgeClient.class)
public interface MinecraftForgeClientAccessor {
@SuppressWarnings("UnstableApiUsage")
@Accessor(remap = false)
static LoadingCache<Pair<World, BlockPos>, RegionRenderCache> getRegionCache() {
throw new AssertionError();
}
}
| 902 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinMinecraft.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/client/MixinMinecraft.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.client;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.util.AttackOrder;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.*;
import net.ccbluex.liquidbounce.features.module.modules.combat.AutoClicker;
import net.ccbluex.liquidbounce.features.module.modules.exploit.AbortBreaking;
import net.ccbluex.liquidbounce.features.module.modules.exploit.MultiActions;
import net.ccbluex.liquidbounce.features.module.modules.misc.Patcher;
import net.ccbluex.liquidbounce.features.module.modules.world.FastPlace;
import net.ccbluex.liquidbounce.injection.forge.mixins.accessors.MinecraftForgeClientAccessor;
import net.ccbluex.liquidbounce.ui.client.GuiMainMenu;
//import net.ccbluex.liquidbounce.ui.client.GuiWelcome;
import net.ccbluex.liquidbounce.utils.CPSCounter;
import net.ccbluex.liquidbounce.utils.render.IconUtils;
//import net.ccbluex.liquidbounce.utils.render.MiniMapRegister;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.main.GameConfiguration;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.stream.IStream;
import net.minecraft.client.resources.IReloadableResourceManager;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Util;
import net.minecraftforge.client.MinecraftForgeClient;
import org.apache.commons.lang3.SystemUtils;
import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.nio.ByteBuffer;
@Mixin(Minecraft.class)
public abstract class MixinMinecraft {
@Shadow
public GuiScreen currentScreen;
@Shadow
private boolean fullscreen;
@Shadow
public boolean skipRenderWorld;
@Shadow
private int leftClickCounter;
@Shadow
public MovingObjectPosition objectMouseOver;
@Shadow
public WorldClient theWorld;
@Shadow
public EntityPlayerSP thePlayer;
@Shadow
public EffectRenderer effectRenderer;
@Shadow public EntityRenderer entityRenderer;
@Shadow
public PlayerControllerMP playerController;
@Shadow
public int displayWidth;
@Shadow
public int displayHeight;
@Shadow
public int rightClickDelayTimer;
@Shadow
public GameSettings gameSettings;
@Shadow
public abstract IResourceManager getResourceManager();
@Inject(method = "<init>", at = @At("RETURN"))
public void injectConstructor(GameConfiguration p_i45547_1_, CallbackInfo ci) {
try {
ViaForge.getInstance().start();
} catch (Exception e) {
e.printStackTrace();
}
}
@Inject(method = "run", at = @At("HEAD"))
private void init(CallbackInfo callbackInfo) {
if(displayWidth < 1067)
displayWidth = 1067;
if(displayHeight < 622)
displayHeight = 622;
}
@Inject(method = "startGame", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;checkGLError(Ljava/lang/String;)V", ordinal = 2, shift = At.Shift.AFTER))
private void startGame(CallbackInfo callbackInfo) {
LiquidBounce.INSTANCE.startClient();
}
@Inject(method = "createDisplay", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setTitle(Ljava/lang/String;)V", shift = At.Shift.AFTER))
private void createDisplay(CallbackInfo callbackInfo) {
Display.setTitle(LiquidBounce.CLIENT_NAME + " build " + LiquidBounce.CLIENT_VERSION);
}
@Inject(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At("HEAD"))
private void clearLoadedMaps(WorldClient worldClientIn, String loadingMessage, CallbackInfo ci) {
if (worldClientIn != this.theWorld) {
this.entityRenderer.getMapItemRenderer().clearLoadedMaps();
}
}
@SuppressWarnings("UnstableApiUsage")
@Inject(
method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V",
at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;theWorld:Lnet/minecraft/client/multiplayer/WorldClient;", opcode = Opcodes.PUTFIELD, shift = At.Shift.AFTER)
)
private void clearRenderCache(CallbackInfo ci) {
//noinspection ResultOfMethodCallIgnored
MinecraftForgeClient.getRenderPass(); // Ensure class is loaded, strange accessor issue
MinecraftForgeClientAccessor.getRegionCache().invalidateAll();
MinecraftForgeClientAccessor.getRegionCache().cleanUp();
}
@Redirect(
method = "runGameLoop",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/stream/IStream;func_152935_j()V")
)
private void skipTwitchCode1(IStream instance) {
// No-op
}
@Redirect(
method = "runGameLoop",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/stream/IStream;func_152922_k()V")
)
private void skipTwitchCode2(IStream instance) {
// No-op
}
@Inject(method = "displayGuiScreen", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/GuiScreen;", shift = At.Shift.AFTER))
private void displayGuiScreen(CallbackInfo callbackInfo) {
if(currentScreen instanceof net.minecraft.client.gui.GuiMainMenu || (currentScreen != null && currentScreen.getClass().getName().startsWith("net.labymod") && currentScreen.getClass().getSimpleName().equals("ModGuiMainMenu"))) {
currentScreen = new GuiMainMenu();
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
currentScreen.setWorldAndResolution(Minecraft.getMinecraft(), scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight());
skipRenderWorld = false;
}
LiquidBounce.eventManager.callEvent(new ScreenEvent(currentScreen));
}
private long lastFrame = getTime();
@Inject(method = "runGameLoop", at = @At("HEAD"))
private void runGameLoop(final CallbackInfo callbackInfo) {
final long currentTime = getTime();
final int deltaTime = (int) (currentTime - lastFrame);
lastFrame = currentTime;
RenderUtils.deltaTime = deltaTime;
}
public long getTime() {
return (Sys.getTime() * 1000) / Sys.getTimerResolution();
}
@Inject(method = "runTick", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;joinPlayerCounter:I", shift = At.Shift.BEFORE))
private void onTick(final CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new TickEvent());
}
@Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;dispatchKeypresses()V", shift = At.Shift.AFTER))
private void onKey(CallbackInfo callbackInfo) {
if(Keyboard.getEventKeyState() && currentScreen == null)
LiquidBounce.eventManager.callEvent(new KeyEvent(Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey()));
}
@Inject(method = "sendClickBlockToController", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MovingObjectPosition;getBlockPos()Lnet/minecraft/util/BlockPos;"))
private void onClickBlock(CallbackInfo callbackInfo) {
if(this.leftClickCounter == 0 && theWorld.getBlockState(objectMouseOver.getBlockPos()).getBlock().getMaterial() != Material.air) {
LiquidBounce.eventManager.callEvent(new ClickBlockEvent(objectMouseOver.getBlockPos(), this.objectMouseOver.sideHit));
}
}
@Inject(method = "setWindowIcon", at = @At("HEAD"), cancellable = true)
private void setWindowIcon(CallbackInfo callbackInfo) {
if(Util.getOSType() != Util.EnumOS.OSX) {
final ByteBuffer[] liquidBounceFavicon = IconUtils.getFavicon();
if(liquidBounceFavicon != null) {
Display.setIcon(liquidBounceFavicon);
callbackInfo.cancel();
}
}
}
@Inject(method = "shutdown", at = @At("HEAD"))
private void shutdown(CallbackInfo callbackInfo) {
LiquidBounce.INSTANCE.stopClient();
}
@Inject(method = "clickMouse", at = @At("HEAD"))
private void clickMouse(CallbackInfo callbackInfo) {
CPSCounter.registerClick(CPSCounter.MouseButton.LEFT);
if (Patcher.noHitDelay.get() || LiquidBounce.moduleManager.getModule(AutoClicker.class).getState())
leftClickCounter = 0;
}
@Redirect(
method = "clickMouse",
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;swingItem()V")
)
private void fixAttackOrder_VanillaSwing() {
AttackOrder.sendConditionalSwing(this.objectMouseOver);
}
@Redirect(
method = "clickMouse",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/PlayerControllerMP;attackEntity(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/entity/Entity;)V")
)
private void fixAttackOrder_VanillaAttack() {
AttackOrder.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit);
}
@Inject(method = "middleClickMouse", at = @At("HEAD"))
private void middleClickMouse(CallbackInfo ci) {
CPSCounter.registerClick(CPSCounter.MouseButton.MIDDLE);
}
@Inject(method = "rightClickMouse", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;rightClickDelayTimer:I", shift = At.Shift.AFTER))
private void rightClickMouse(final CallbackInfo callbackInfo) {
CPSCounter.registerClick(CPSCounter.MouseButton.RIGHT);
final FastPlace fastPlace = (FastPlace) LiquidBounce.moduleManager.getModule(FastPlace.class);
if (fastPlace.getState())
rightClickDelayTimer = fastPlace.getSpeedValue().get();
}
@Inject(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At("HEAD"))
private void loadWorld(WorldClient p_loadWorld_1_, String p_loadWorld_2_, final CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new WorldEvent(p_loadWorld_1_));
}
@Inject(method = "toggleFullscreen", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setFullscreen(Z)V", remap = false))
private void resolveScreenState(CallbackInfo ci) {
if (!this.fullscreen && SystemUtils.IS_OS_WINDOWS) {
Display.setResizable(false);
Display.setResizable(true);
}
}
@Redirect(method = "dispatchKeypresses", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Keyboard;getEventCharacter()C", remap = false))
private char resolveForeignKeyboards() {
return (char) (Keyboard.getEventCharacter() + 256);
}
/**
* @author CCBlueX
*/
@Overwrite
private void sendClickBlockToController(boolean leftClick) {
if(!leftClick)
this.leftClickCounter = 0;
if (this.leftClickCounter <= 0 && (!this.thePlayer.isUsingItem() || LiquidBounce.moduleManager.getModule(MultiActions.class).getState())) {
if(leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
BlockPos blockPos = this.objectMouseOver.getBlockPos();
if(this.leftClickCounter == 0)
LiquidBounce.eventManager.callEvent(new ClickBlockEvent(blockPos, this.objectMouseOver.sideHit));
if(this.theWorld.getBlockState(blockPos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockPos, this.objectMouseOver.sideHit)) {
this.effectRenderer.addBlockHitEffects(blockPos, this.objectMouseOver.sideHit);
this.thePlayer.swingItem();
}
} else if (!LiquidBounce.moduleManager.getModule(AbortBreaking.class).getState()) {
this.playerController.resetBlockRemoving();
}
}
}
/**
* @author CCBlueX
*/
@ModifyConstant(method = "getLimitFramerate", constant = @Constant(intValue = 30))
public int getLimitFramerate(int constant) {
return 60;
}
} | 13,458 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinResourcePackRepository.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/client/MixinResourcePackRepository.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.client;
import com.google.common.collect.Lists;
import net.minecraft.client.resources.ResourcePackRepository;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.comparator.LastModifiedFileComparator;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import java.io.File;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@Mixin(ResourcePackRepository.class)
public class MixinResourcePackRepository {
@Shadow
@Final
private File dirServerResourcepacks;
@Shadow
@Final
private static Logger logger;
@SuppressWarnings("ResultOfMethodCallIgnored")
@Inject(method = "deleteOldServerResourcesPacks", at = @At("HEAD"))
private void createDirectory(CallbackInfo ci) {
if (!this.dirServerResourcepacks.exists())
this.dirServerResourcepacks.mkdirs();
}
/**
* @author Mojang
* @reason Fix a bug
*/
@Overwrite
private void deleteOldServerResourcesPacks() {
try {
List<File> lvt_1_1_ = Lists.newArrayList(FileUtils.listFiles(this.dirServerResourcepacks, TrueFileFilter.TRUE, null));
Collections.sort(lvt_1_1_, LastModifiedFileComparator.LASTMODIFIED_REVERSE);
int lvt_2_1_ = 0;
Iterator lvt_3_1_ = lvt_1_1_.iterator();
while(lvt_3_1_.hasNext()) {
File lvt_4_1_ = (File) lvt_3_1_.next();
if(lvt_2_1_++ >= 10) {
logger.info("Deleting old server resource pack " + lvt_4_1_.getName());
FileUtils.deleteQuietly(lvt_4_1_);
}
}
}catch(final Throwable e) {
e.printStackTrace();
}
}
} | 2,340 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinMovementInputFromOptions.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/client/MixinMovementInputFromOptions.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.client;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.movement.NoSlow;
import net.minecraft.util.MovementInputFromOptions;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(MovementInputFromOptions.class)
public class MixinMovementInputFromOptions {
@ModifyConstant(method = "updatePlayerMoveState", constant = @Constant(doubleValue = 0.3D, ordinal = 0))
public double noSlowSneakStrafe(double constant) {
return (LiquidBounce.moduleManager != null
&& LiquidBounce.moduleManager.getModule(NoSlow.class) != null
&& LiquidBounce.moduleManager.getModule(NoSlow.class).getState()) ? LiquidBounce.moduleManager.getModule(NoSlow.class).getSneakStrafeMultiplier().get() : 0.3D;
}
@ModifyConstant(method = "updatePlayerMoveState", constant = @Constant(doubleValue = 0.3D, ordinal = 1))
public double noSlowSneakForward(double constant) {
return (LiquidBounce.moduleManager != null
&& LiquidBounce.moduleManager.getModule(NoSlow.class) != null
&& LiquidBounce.moduleManager.getModule(NoSlow.class).getState()) ? LiquidBounce.moduleManager.getModule(NoSlow.class).getSneakForwardMultiplier().get() : 0.3D;
}
}
| 1,633 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGameSettings.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/client/MixinGameSettings.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.client;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(GameSettings.class)
public class MixinGameSettings {
/**
* @author asbyth
* @reason Resolve Chat Key bound to a unicode char causing crashes while creative inventory is opened (MC-102867)
*/
@Overwrite
public static boolean isKeyDown(KeyBinding key) {
int keyCode = key.getKeyCode();
if (keyCode != 0 && keyCode < 256) {
return keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode);
} else {
return false;
}
}
}
| 1,036 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinCrashReport.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/crash/MixinCrashReport.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.crash;
import net.minecraft.crash.CrashReport;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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(CrashReport.class)
public class MixinCrashReport {
/*
@Inject(method = "populateEnvironment", at = @At("TAIL"))
private void injectCrashEnv(CallbackInfo callbackInfo) {
wdl.WDLHooks.onCrashReportPopulateEnvironment((CrashReport) (Object) this);
}
*/
} | 869 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinNetworkPlayerInfo.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetworkPlayerInfo.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.network;
import com.mojang.authlib.GameProfile;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.misc.NameProtect;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.Final;
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.CallbackInfoReturnable;
import java.util.Objects;
@Mixin(NetworkPlayerInfo.class)
public class MixinNetworkPlayerInfo {
@Shadow
@Final
private GameProfile gameProfile;
@Inject(method = "getLocationSkin", cancellable = true, at = @At("HEAD"))
private void injectSkinProtect(CallbackInfoReturnable<ResourceLocation> cir) {
NameProtect nameProtect = LiquidBounce.moduleManager.getModule(NameProtect.class);
if (nameProtect.getState() && nameProtect.skinProtectValue.get()) {
if (nameProtect.allPlayersValue.get() || Objects.equals(gameProfile.getId(), Minecraft.getMinecraft().getSession().getProfile().getId())) {
cir.setReturnValue(DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId()));
cir.cancel();
}
}
}
} | 1,714 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinNetworkManagerChInit.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetworkManagerChInit.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.network;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.connection.UserConnectionImpl;
import com.viaversion.viaversion.protocol.ProtocolPipelineImpl;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.handler.CommonTransformer;
import de.enzaxd.viaforge.handler.DecodeHandler;
import de.enzaxd.viaforge.handler.EncodeHandler;
import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel;
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(targets = "net.minecraft.network.NetworkManager$5")
public abstract class MixinNetworkManagerChInit {
@Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel && ViaForge.getInstance().getVersion() != ViaForge.SHARED_VERSION) {
UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user);
channel.pipeline()
.addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new EncodeHandler(user))
.addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new DecodeHandler(user));
}
}
}
| 1,677 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinNetworkManager.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetworkManager.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.network;
import io.netty.channel.ChannelHandlerContext;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.PacketEvent;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.utils.PacketUtils;
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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(NetworkManager.class)
public class MixinNetworkManager {
@Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true)
private void read(ChannelHandlerContext context, Packet<?> packet, CallbackInfo callback) {
final PacketEvent event = new PacketEvent(packet);
LiquidBounce.eventManager.callEvent(event);
if(event.isCancelled())
callback.cancel();
}
@Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
private void send(Packet<?> packet, CallbackInfo callback) {
if (PacketUtils.handleSendPacket(packet)) return;
final PacketEvent event = new PacketEvent(packet);
LiquidBounce.eventManager.callEvent(event);
if(event.isCancelled())
callback.cancel();
}
/**
* show player head in tab bar
* @author Liulihaocai, FDPClient
*/
@Inject(method = "getIsencrypted", at = @At("HEAD"), cancellable = true)
private void injectEncryption(CallbackInfoReturnable<Boolean> cir) {
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if(hud != null && hud.getTabHead().get()) {
cir.setReturnValue(true);
}
}
} | 2,140 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinNetHandlerPlayClient.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetHandlerPlayClient.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.network;
import io.netty.buffer.Unpooled;
import java.util.UUID;
import java.util.List;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.EntityDamageEvent;
import net.ccbluex.liquidbounce.event.EntityMovementEvent;
import net.ccbluex.liquidbounce.features.module.modules.misc.AntiExploit;
import net.ccbluex.liquidbounce.features.module.modules.misc.Patcher;
import net.ccbluex.liquidbounce.features.special.AntiForge;
import net.ccbluex.liquidbounce.ui.client.clickgui.ClickGui;
import net.ccbluex.liquidbounce.ui.client.hud.designer.GuiHudDesigner;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.minecraft.client.ClientBrandRetriever;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiDownloadTerrain;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.PacketThreadUtil;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.network.play.client.C19PacketResourcePackStatus;
import net.minecraft.network.play.server.*;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.WorldSettings;
import org.spongepowered.asm.mixin.Final;
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.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(NetHandlerPlayClient.class)
public abstract class MixinNetHandlerPlayClient {
@Shadow
@Final
private NetworkManager netManager;
@Shadow
private Minecraft gameController;
@Shadow
private WorldClient clientWorldController;
@Shadow
public int currentServerMaxPlayers;
@Shadow
public abstract NetworkPlayerInfo getPlayerInfo(UUID p_175102_1_);
@Inject(method = "handleSpawnPlayer", at = @At("HEAD"), cancellable = true)
private void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn, CallbackInfo callbackInfo) {
if (Patcher.silentNPESP.get()) {
try {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, (NetHandlerPlayClient) (Object) this, gameController);
double d0 = (double)packetIn.getX() / 32.0D;
double d1 = (double)packetIn.getY() / 32.0D;
double d2 = (double)packetIn.getZ() / 32.0D;
float f = (float)(packetIn.getYaw() * 360) / 256.0F;
float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(gameController.theWorld, getPlayerInfo(packetIn.getPlayer()).getGameProfile());
entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double)(entityotherplayermp.serverPosX = packetIn.getX());
entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double)(entityotherplayermp.serverPosY = packetIn.getY());
entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double)(entityotherplayermp.serverPosZ = packetIn.getZ());
int i = packetIn.getCurrentItemID();
if (i == 0)
{
entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null;
}
else
{
entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0);
}
entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp);
List<DataWatcher.WatchableObject> list = packetIn.func_148944_c();
if (list != null)
{
entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list);
}
} catch (Exception e) {
// ignore
}
callbackInfo.cancel();
}
}
@Inject(method = "handleCloseWindow", at = @At("HEAD"), cancellable = true)
private void handleCloseWindow(final S2EPacketCloseWindow packetIn, final CallbackInfo callbackInfo) {
if (this.gameController.currentScreen instanceof ClickGui
|| this.gameController.currentScreen instanceof GuiHudDesigner
|| this.gameController.currentScreen instanceof GuiChat)
callbackInfo.cancel();
}
@Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true)
private void handleResourcePack(final S48PacketResourcePackSend p_handleResourcePack_1_, final CallbackInfo callbackInfo) {
final String url = p_handleResourcePack_1_.getURL();
final String hash = p_handleResourcePack_1_.getHash();
final AntiExploit antiExploit = LiquidBounce.moduleManager.getModule(AntiExploit.class);
try {
final String scheme = new URI(url).getScheme();
final boolean isLevelProtocol = "level".equals(scheme);
if(!"http".equals(scheme) && !"https".equals(scheme) && !isLevelProtocol)
throw new URISyntaxException(url, "Wrong protocol");
if(isLevelProtocol && (url.contains("..") || !url.endsWith(".zip"))) {
String s2 = url.substring("level://".length());
File file1 = new File(this.gameController.mcDataDir, "saves");
File file2 = new File(file1, s2);
if (file2.isFile() && !url.toLowerCase().contains("liquidbounce")) {
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.ACCEPTED)); // perform like vanilla
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
} else {
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
if (antiExploit.getState() && antiExploit.getNotifyValue().get()) {
ClientUtils.displayChatMessage("§8[§9§lLiquidBounce+§8] §6Resourcepack exploit detected.");
ClientUtils.displayChatMessage("§8[§9§lLiquidBounce+§8] §7Exploit target directory: §r" + url);
throw new IllegalStateException("Invalid levelstorage resourcepack path");
} else {
callbackInfo.cancel(); // despite not having it enabled we still prevents anything from illegally checking files in your computer.
}
}
} catch (final URISyntaxException e) {
ClientUtils.getLogger().error("Failed to handle resource pack", e);
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
callbackInfo.cancel();
} catch (final IllegalStateException e) {
ClientUtils.getLogger().error("Failed to handle resource pack", e);
callbackInfo.cancel();
}
}
@Inject(method = "handleJoinGame", at = @At("HEAD"), cancellable = true)
private void handleJoinGameWithAntiForge(S01PacketJoinGame packetIn, final CallbackInfo callbackInfo) {
if(!AntiForge.enabled || !AntiForge.blockFML || Minecraft.getMinecraft().isIntegratedServerRunning())
return;
PacketThreadUtil.checkThreadAndEnqueue(packetIn, (NetHandlerPlayClient) (Object) this, gameController);
this.gameController.playerController = new PlayerControllerMP(gameController, (NetHandlerPlayClient) (Object) this);
this.clientWorldController = new WorldClient((NetHandlerPlayClient) (Object) this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
this.gameController.loadWorld(this.clientWorldController);
this.gameController.thePlayer.dimension = packetIn.getDimension();
this.gameController.displayGuiScreen(new GuiDownloadTerrain((NetHandlerPlayClient) (Object) this));
this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
this.currentServerMaxPlayers = packetIn.getMaxPlayers();
this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
this.gameController.playerController.setGameType(packetIn.getGameType());
this.gameController.gameSettings.sendSettingsToServer();
this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
callbackInfo.cancel();
}
@Inject(method = "handleEntityMovement", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;onGround:Z"))
private void handleEntityMovementEvent(S14PacketEntity packetIn, final CallbackInfo callbackInfo) {
final Entity entity = packetIn.getEntity(this.clientWorldController);
if(entity != null)
LiquidBounce.eventManager.callEvent(new EntityMovementEvent(entity));
}
@Inject(method = "handleEntityStatus", at = @At("HEAD"))
public void handleDamagePacket(S19PacketEntityStatus packetIn, CallbackInfo callbackInfo) {
if (packetIn.getOpCode() == 2) {
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null) {
LiquidBounce.eventManager.callEvent(new EntityDamageEvent(entity));
if (entity instanceof EntityPlayer)
LiquidBounce.hud.handleDamage((EntityPlayer) entity);
}
}
}
@Redirect(
method = "handleUpdateSign",
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)
)
private void removeDebugMessage(EntityPlayerSP instance, IChatComponent component) {
}
@Inject(method={"handleAnimation"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleAnimation(S0BPacketAnimation s0BPacketAnimation, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleEntityTeleport"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleEntityTeleport(S18PacketEntityTeleport s18PacketEntityTeleport, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleEntityMovement"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleEntityMovement(S14PacketEntity s14PacketEntity, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleEntityHeadLook"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleEntityHeadLook(S19PacketEntityHeadLook s19PacketEntityHeadLook, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleEntityProperties"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleEntityProperties(S20PacketEntityProperties s20PacketEntityProperties, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleEntityMetadata"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleEntityMetadata(S1CPacketEntityMetadata s1CPacketEntityMetadata, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleEntityEquipment"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleEntityEquipment(S04PacketEntityEquipment s04PacketEntityEquipment, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleDestroyEntities"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleDestroyEntities(S13PacketDestroyEntities s13PacketDestroyEntities, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleScoreboardObjective"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift=At.Shift.AFTER)}, cancellable=true)
private void handleScoreboardObjective(S3BPacketScoreboardObjective s3BPacketScoreboardObjective, CallbackInfo callbackInfo) {
this.cancelIfNull(this.clientWorldController, callbackInfo);
}
@Inject(method={"handleConfirmTransaction"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/play/server/S32PacketConfirmTransaction;getWindowId()I", ordinal=0)}, cancellable=true, locals=LocalCapture.CAPTURE_FAILEXCEPTION)
private void handleConfirmTransaction(S32PacketConfirmTransaction s32PacketConfirmTransaction, CallbackInfo callbackInfo, Container container, EntityPlayer entityPlayer) {
this.cancelIfNull(entityPlayer, callbackInfo);
}
@Inject(method={"handleSoundEffect"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V")}, cancellable=true)
private void handleSoundEffect(S29PacketSoundEffect s29PacketSoundEffect, CallbackInfo callbackInfo) {
this.cancelIfNull(this.gameController.theWorld, callbackInfo);
}
@Inject(method={"handleTimeUpdate"}, at={@At(value="INVOKE", target="Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V")}, cancellable=true)
private void handleTimeUpdate(S03PacketTimeUpdate s03PacketTimeUpdate, CallbackInfo callbackInfo) {
this.cancelIfNull(this.gameController.theWorld, callbackInfo);
}
private <T> void cancelIfNull(T t, CallbackInfo callbackInfo) {
if (t == null) {
callbackInfo.cancel();
}
}
}
| 17,347 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiSpectator.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiSpectator.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.Render2DEvent;
import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer;
import net.minecraft.client.gui.GuiSpectator;
import net.minecraft.client.gui.ScaledResolution;
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(GuiSpectator.class)
public class MixinGuiSpectator {
@Inject(method = "renderTooltip", at = @At("RETURN"))
private void renderTooltipPost(ScaledResolution p_175264_1_, float p_175264_2_, CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new Render2DEvent(p_175264_2_));
AWTFontRenderer.Companion.garbageCollectionTick();
}
} | 1,091 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinServerSelectionList.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinServerSelectionList.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.gui.GuiListExtended;
import net.minecraft.client.gui.ServerListEntryLanDetected;
import net.minecraft.client.gui.ServerSelectionList;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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.CallbackInfoReturnable;
import java.util.List;
@Mixin(ServerSelectionList.class)
public abstract class MixinServerSelectionList extends GuiSlot {
public MixinServerSelectionList(Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn) {
super(mcIn, width, height, topIn, bottomIn, slotHeightIn);
}
@Shadow @Final private List<ServerListEntryLanDetected> serverListLan;
@Shadow @Final private GuiListExtended.IGuiListEntry lanScanEntry;
/**
* @author CCBlueX
*/
@Overwrite
protected int getScrollBarX() {
return this.width - 5;
}
@Inject(
method = "getListEntry",
at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/ServerSelectionList;serverListLan:Ljava/util/List;"),
cancellable = true
)
private void resolveIndexError(int index, CallbackInfoReturnable<GuiListExtended.IGuiListEntry> cir) {
if (index >= this.serverListLan.size())
cir.setReturnValue(this.lanScanEntry);
}
}
| 1,857 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiKeyBindingList.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiKeyBindingList.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiKeyBindingList;
import net.minecraft.client.gui.GuiSlot;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(GuiKeyBindingList.class)
public abstract class MixinGuiKeyBindingList extends GuiSlot {
public MixinGuiKeyBindingList(Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn) {
super(mcIn, width, height, topIn, bottomIn, slotHeightIn);
}
/**
* @author CCBlueX
*/
@Overwrite
protected int getScrollBarX() {
return this.width - 5;
}
} | 887 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiDisconnected.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiDisconnected.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import com.google.gson.JsonObject;
import com.mojang.authlib.Agent;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import com.thealtening.AltService;
import com.thealtening.api.TheAltening;
import com.thealtening.api.data.AccountData;
import me.liuli.elixir.account.CrackedAccount;
import me.liuli.elixir.account.MinecraftAccount;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.SessionEvent;
import net.ccbluex.liquidbounce.features.special.AntiForge;
import net.ccbluex.liquidbounce.features.special.AutoReconnect;
import net.ccbluex.liquidbounce.ui.client.altmanager.GuiAltManager;
import net.ccbluex.liquidbounce.ui.client.altmanager.menus.GuiLoginProgress;
import net.ccbluex.liquidbounce.ui.client.altmanager.menus.altgenerator.GuiTheAltening;
import net.ccbluex.liquidbounce.ui.font.Fonts;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.ccbluex.liquidbounce.utils.ServerUtils;
import net.ccbluex.liquidbounce.utils.SessionUtils;
import net.ccbluex.liquidbounce.utils.misc.RandomUtils;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.Session;
import net.minecraftforge.fml.client.config.GuiSlider;
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;
import java.net.Proxy;
import java.text.DecimalFormat;
import java.util.List;
import java.util.Random;
@Mixin(GuiDisconnected.class)
public abstract class MixinGuiDisconnected extends MixinGuiScreen {
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#0");
@Shadow
private int field_175353_i;
private GuiButton reconnectButton;
private GuiSlider autoReconnectDelaySlider;
private GuiButton forgeBypassButton;
private int reconnectTimer;
@Inject(method = "initGui", at = @At("RETURN"))
private void initGui(CallbackInfo callbackInfo) {
reconnectTimer = 0;
SessionUtils.handleConnection();
buttonList.add(reconnectButton = new GuiButton(1, this.width / 2 - 100, this.height / 2 + field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 22, 98, 20, "Reconnect"));
this.drawReconnectDelaySlider();
buttonList.add(new GuiButton(3, this.width / 2 - 100, this.height / 2 + field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 44, 98, 20, GuiTheAltening.Companion.getApiKey().isEmpty() ? "Random alt" : "New TheAltening alt"));
buttonList.add(new GuiButton(4, this.width / 2 + 2, this.height / 2 + field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 44, 98, 20, "Random cracked"));
buttonList.add(forgeBypassButton = new GuiButton(5, this.width / 2 - 100, this.height / 2 + field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 66, "AntiForge: " + (AntiForge.enabled ? "On" : "Off")));
updateSliderText();
}
@Inject(method = "actionPerformed", at = @At("HEAD"))
private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
switch (button.id) {
case 1:
ServerUtils.connectToLastServer();
break;
case 3:
if (!GuiTheAltening.Companion.getApiKey().isEmpty()) {
final String apiKey = GuiTheAltening.Companion.getApiKey();
final TheAltening theAltening = new TheAltening(apiKey);
try {
final AccountData account = theAltening.getAccountData();
GuiAltManager.Companion.getAltService().switchService(AltService.EnumAltService.THEALTENING);
final YggdrasilUserAuthentication yggdrasilUserAuthentication = new YggdrasilUserAuthentication(new YggdrasilAuthenticationService(Proxy.NO_PROXY, ""), Agent.MINECRAFT);
yggdrasilUserAuthentication.setUsername(account.getToken());
yggdrasilUserAuthentication.setPassword(LiquidBounce.CLIENT_NAME);
yggdrasilUserAuthentication.logIn();
mc.session = new Session(yggdrasilUserAuthentication.getSelectedProfile().getName(), yggdrasilUserAuthentication.getSelectedProfile().getId().toString(), yggdrasilUserAuthentication.getAuthenticatedToken(), "mojang");
LiquidBounce.eventManager.callEvent(new SessionEvent());
ServerUtils.connectToLastServer();
break;
} catch (final Throwable throwable) {
ClientUtils.getLogger().error("Failed to login into random account from TheAltening.", throwable);
}
}
final List<MinecraftAccount> accounts = LiquidBounce.fileManager.accountsConfig.getAccounts();
if (accounts.isEmpty())
break;
final MinecraftAccount minecraftAccount = accounts.get(new Random().nextInt(accounts.size()));
mc.displayGuiScreen(new GuiLoginProgress(minecraftAccount, () -> {
mc.addScheduledTask(() -> {
LiquidBounce.eventManager.callEvent(new SessionEvent());
ServerUtils.connectToLastServer();
});
return null;
}, e -> {
mc.addScheduledTask(() -> {
final JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("text", e.getMessage());
mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), e.getMessage(), IChatComponent.Serializer.jsonToComponent(jsonObject.toString())));
});
return null;
}, () -> null));
break;
case 4:
final CrackedAccount crackedAccount = new CrackedAccount();
crackedAccount.setName(RandomUtils.randomString(RandomUtils.nextInt(5, 16)));
crackedAccount.update();
mc.session = new Session(crackedAccount.getSession().getUsername(), crackedAccount.getSession().getUuid(),
crackedAccount.getSession().getToken(), crackedAccount.getSession().getType());
LiquidBounce.eventManager.callEvent(new SessionEvent());
ServerUtils.connectToLastServer();
break;
case 5:
AntiForge.enabled = !AntiForge.enabled;
forgeBypassButton.displayString = "AntiForge: " + (AntiForge.enabled ? "On" : "Off");
LiquidBounce.fileManager.saveConfig(LiquidBounce.fileManager.valuesConfig);
break;
}
}
@Override
public void updateScreen() {
if (AutoReconnect.INSTANCE.isEnabled()) {
reconnectTimer++;
if (reconnectTimer > AutoReconnect.INSTANCE.getDelay() / 50)
ServerUtils.connectToLastServer();
}
}
@Inject(method = "drawScreen", at = @At("RETURN"))
private void drawScreen(CallbackInfo callbackInfo) {
if (AutoReconnect.INSTANCE.isEnabled()) {
this.updateReconnectButton();
}
Fonts.fontSFUI40.drawCenteredString("Username: §7"+ this.mc.session.getUsername() +"§r, Server: §7"+ServerUtils.serverData.serverIP, this.width / 2F, this.height / 2F + field_175353_i / 2F + this.fontRendererObj.FONT_HEIGHT + 96, -1, true);
Fonts.fontSFUI40.drawCenteredString("Play time: §7" + SessionUtils.getFormatLastSessionTime(), this.width / 2F, this.height / 2F + field_175353_i / 2F + this.fontRendererObj.FONT_HEIGHT * 2F + 98, -1, true);
}
private void drawReconnectDelaySlider() {
buttonList.add(autoReconnectDelaySlider =
new GuiSlider(2, this.width / 2 + 2, this.height / 2 + field_175353_i / 2
+ this.fontRendererObj.FONT_HEIGHT + 22, 98, 20, "Auto: ",
"ms", AutoReconnect.MIN, AutoReconnect.MAX, AutoReconnect.INSTANCE.getDelay(), false, true,
guiSlider -> {
AutoReconnect.INSTANCE.setDelay(guiSlider.getValueInt());
this.reconnectTimer = 0;
this.updateReconnectButton();
this.updateSliderText();
}));
}
private void updateSliderText() {
if (this.autoReconnectDelaySlider == null)
return;
if (!AutoReconnect.INSTANCE.isEnabled()) {
this.autoReconnectDelaySlider.displayString = "Auto: Off";
} else {
this.autoReconnectDelaySlider.displayString = "Auto: " + DECIMAL_FORMAT.format(AutoReconnect.INSTANCE.getDelay() / 1000.0) + "s";
}
}
private void updateReconnectButton() {
if (reconnectButton != null)
reconnectButton.displayString = "Reconnect" + (AutoReconnect.INSTANCE.isEnabled() ? " (" + (AutoReconnect.INSTANCE.getDelay() / 1000 - reconnectTimer / 20) + ")" : "");
}
} | 9,699 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiContainer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiContainer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.features.module.modules.player.InvManager;
import net.ccbluex.liquidbounce.features.module.modules.world.ChestStealer;
import net.ccbluex.liquidbounce.utils.render.EaseUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.Display;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(GuiContainer.class)
public abstract class MixinGuiContainer extends MixinGuiScreen {
@Shadow
protected int xSize;
@Shadow
protected int ySize;
@Shadow
protected int guiLeft;
@Shadow
protected int guiTop;
@Shadow
protected abstract boolean checkHotbarKeys(int keyCode);
@Shadow private int dragSplittingButton;
@Shadow private int dragSplittingRemnant;
private GuiButton stealButton, chestStealerButton, invManagerButton, killAuraButton;
private float progress = 0F;
private long lastMS = 0L;
@Inject(method = "initGui", at = @At("HEAD"), cancellable = true)
public void injectInitGui(CallbackInfo callbackInfo){
GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen;
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
int firstY = 0;
if (guiScreen instanceof GuiChest) {
switch (hud.getContainerButton().get()) {
case "TopLeft":
if (LiquidBounce.moduleManager.getModule(KillAura.class).getState()) {
buttonList.add(killAuraButton = new GuiButton(1024576, 5, 5, 140, 20, "Disable KillAura"));
firstY += 20;
}
if (LiquidBounce.moduleManager.getModule(InvManager.class).getState()) {
buttonList.add(invManagerButton = new GuiButton(321123, 5, 5 + firstY, 140, 20, "Disable InvManager"));
firstY += 20;
}
if (LiquidBounce.moduleManager.getModule(ChestStealer.class).getState()) {
buttonList.add(chestStealerButton = new GuiButton(727, 5, 5 + firstY, 140, 20, "Disable Stealer"));
firstY += 20;
}
buttonList.add(stealButton = new GuiButton(1234123, 5, 5 + firstY, 140, 20, "Steal this chest"));
break;
case "TopRight":
if (LiquidBounce.moduleManager.getModule(KillAura.class).getState()) {
buttonList.add(killAuraButton = new GuiButton(1024576, width - 145, 5, 140, 20, "Disable KillAura"));
firstY += 20;
}
if (LiquidBounce.moduleManager.getModule(InvManager.class).getState()) {
buttonList.add(invManagerButton = new GuiButton(321123, width - 145, 5 + firstY, 140, 20, "Disable InvManager"));
firstY += 20;
}
if (LiquidBounce.moduleManager.getModule(ChestStealer.class).getState()) {
buttonList.add(chestStealerButton = new GuiButton(727, width - 145, 5 + firstY, 140, 20, "Disable Stealer"));
firstY += 20;
}
buttonList.add(stealButton = new GuiButton(1234123, width - 145, 5 + firstY, 140, 20, "Steal this chest"));
break;
}
}
lastMS = System.currentTimeMillis();
progress = 0F;
}
@Override
protected void injectedActionPerformed(GuiButton button) {
ChestStealer chestStealer = LiquidBounce.moduleManager.getModule(ChestStealer.class);
if (button.id == 1024576)
LiquidBounce.moduleManager.getModule(KillAura.class).setState(false);
if (button.id == 321123)
LiquidBounce.moduleManager.getModule(InvManager.class).setState(false);
if (button.id == 727)
chestStealer.setState(false);
if (button.id == 1234123 && !chestStealer.getState()) {
chestStealer.setContentReceived(mc.thePlayer.openContainer.windowId);
chestStealer.setOnce(true);
chestStealer.setState(true);
}
}
@Inject(method = "drawScreen", at = @At("HEAD"), cancellable = true)
private void drawScreenHead(CallbackInfo callbackInfo){
final Animations animMod = LiquidBounce.moduleManager.getModule(Animations.class);
ChestStealer chestStealer = LiquidBounce.moduleManager.getModule(ChestStealer.class);
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
final Minecraft mc = Minecraft.getMinecraft();
if (progress >= 1F) progress = 1F;
else progress = (float)(System.currentTimeMillis() - lastMS) / (float) animMod.animTimeValue.get();
double trueAnim = EaseUtils.easeOutQuart(progress);
if (hud.getContainerBackground().get()
&& (!(mc.currentScreen instanceof GuiChest)
|| !chestStealer.getState()
|| !chestStealer.getSilenceValue().get()
|| chestStealer.getStillDisplayValue().get()))
RenderUtils.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680);
boolean checkFullSilence = chestStealer.getState() && chestStealer.getSilenceValue().get() && !chestStealer.getStillDisplayValue().get();
if (animMod != null && animMod.getState() && !(mc.currentScreen instanceof GuiChest && checkFullSilence)) {
GL11.glPushMatrix();
switch (animMod.guiAnimations.get()) {
case "Zoom":
GL11.glTranslated((1 - trueAnim) * (width / 2D), (1 - trueAnim) * (height / 2D), 0D);
GL11.glScaled(trueAnim, trueAnim, trueAnim);
break;
case "Slide":
switch (animMod.hSlideValue.get()) {
case "Right":
GL11.glTranslated((1 - trueAnim) * -width, 0D, 0D);
break;
case "Left":
GL11.glTranslated((1 - trueAnim) * width, 0D, 0D);
break;
}
switch (animMod.vSlideValue.get()) {
case "Upward":
GL11.glTranslated(0D, (1 - trueAnim) * height, 0D);
break;
case "Downward":
GL11.glTranslated(0D, (1 - trueAnim) * -height, 0D);
break;
}
break;
case "Smooth":
GL11.glTranslated((1 - trueAnim) * -width, (1 - trueAnim) * -height / 4F, 0D);
break;
}
}
try {
GuiScreen guiScreen = mc.currentScreen;
if (stealButton != null) stealButton.enabled = !chestStealer.getState();
if (killAuraButton != null) killAuraButton.enabled = LiquidBounce.moduleManager.getModule(KillAura.class).getState();
if (chestStealerButton != null) chestStealerButton.enabled = chestStealer.getState();
if (invManagerButton != null) invManagerButton.enabled = LiquidBounce.moduleManager.getModule(InvManager.class).getState();
if(chestStealer.getState() && chestStealer.getSilenceValue().get() && guiScreen instanceof GuiChest) {
mc.setIngameFocus();
mc.currentScreen = guiScreen;
//hide GUI
if (chestStealer.getShowStringValue().get() && !chestStealer.getStillDisplayValue().get()) {
String tipString = "Stealing... Press Esc to stop.";
mc.fontRendererObj.drawString(tipString,
(width / 2F) - (mc.fontRendererObj.getStringWidth(tipString) / 2F) - 0.5F,
(height / 2F) + 30, 0, false);
mc.fontRendererObj.drawString(tipString,
(width / 2F) - (mc.fontRendererObj.getStringWidth(tipString) / 2F) + 0.5F,
(height / 2F) + 30, 0, false);
mc.fontRendererObj.drawString(tipString,
(width / 2F) - (mc.fontRendererObj.getStringWidth(tipString) / 2F),
(height / 2F) + 29.5F, 0, false);
mc.fontRendererObj.drawString(tipString,
(width / 2F) - (mc.fontRendererObj.getStringWidth(tipString) / 2F),
(height / 2F) + 30.5F, 0, false);
mc.fontRendererObj.drawString(tipString,
(width / 2F) - (mc.fontRendererObj.getStringWidth(tipString) / 2F),
(height / 2F) + 30, 0xffffffff, false);
}
if (!chestStealer.getOnce() && !chestStealer.getStillDisplayValue().get())
callbackInfo.cancel();
}
} catch (Exception e) {
//e.printStackTrace();
}
}
@Override
protected boolean shouldRenderBackground() {
return false;
}
@Inject(method = "drawScreen", at = @At("RETURN"))
public void drawScreenReturn(CallbackInfo callbackInfo) {
final Animations animMod = LiquidBounce.moduleManager.getModule(Animations.class);
ChestStealer chestStealer = LiquidBounce.moduleManager.getModule(ChestStealer.class);
final Minecraft mc = Minecraft.getMinecraft();
boolean checkFullSilence = chestStealer.getState() && chestStealer.getSilenceValue().get() && !chestStealer.getStillDisplayValue().get();
if (animMod != null && animMod.getState() && !(mc.currentScreen instanceof GuiChest && checkFullSilence))
GL11.glPopMatrix();
}
@Inject(method = "mouseClicked", at = @At("HEAD"), cancellable = true)
private void checkCloseClick(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) {
if (mouseButton - 100 == mc.gameSettings.keyBindInventory.getKeyCode()) {
mc.thePlayer.closeScreen();
ci.cancel();
}
}
@Inject(method = "mouseClicked", at = @At("TAIL"))
private void checkHotbarClicks(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) {
checkHotbarKeys(mouseButton - 100);
}
@Inject(method = "updateDragSplitting", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;copy()Lnet/minecraft/item/ItemStack;"), cancellable = true)
private void fixRemnants(CallbackInfo ci) {
if (this.dragSplittingButton == 2) {
this.dragSplittingRemnant = mc.thePlayer.inventory.getItemStack().getMaxStackSize();
ci.cancel();
}
}
} | 11,889 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiScreenOptionsSounds.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiScreenOptionsSounds.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
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.CallbackInfo;
@Mixin(targets = "net.minecraft.client.gui.GuiScreenOptionsSounds$Button")
public class MixinGuiScreenOptionsSounds {
// don't send a packet for every frame the slider is dragged, instead save that for when the slider is released
@Redirect(method = "mouseDragged(Lnet/minecraft/client/Minecraft;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/GameSettings;saveOptions()V"))
private void cancelSaving(GameSettings instance) {
// no-op
}
@Inject(method = "mouseReleased(II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/audio/SoundHandler;playSound(Lnet/minecraft/client/audio/ISound;)V"))
private void save(int mouseX, int mouseY, CallbackInfo ci) {
Minecraft.getMinecraft().gameSettings.saveOptions();
}
}
| 1,404 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGui.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGui.java | /*
* LiquidBounce+ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/WYSI-Foundation/LiquidBouncePlus/
*
* This code was taken from UnlegitMC/FDPClient. Please credit them if you use this in your repository.
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.gui.Gui;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(Gui.class)
public abstract class MixinGui {
@Shadow public abstract void drawTexturedModalRect(float xCoord, float yCoord, int minU, int minV, int maxU, int maxV);
@Shadow protected float zLevel;
}
| 701 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiButtonExt.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiButtonExt.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.ui.font.Fonts;
import net.ccbluex.liquidbounce.utils.AnimationUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.MathHelper;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import java.awt.*;
import org.lwjgl.opengl.GL11;
@Mixin(GuiButtonExt.class)
public abstract class MixinGuiButtonExt extends GuiButton {
private float bright;
private float moveX = 0F;
private float cut;
private float alpha;
public MixinGuiButtonExt(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) {
super(p_i1020_1_, p_i1020_2_, p_i1020_3_, p_i1020_4_);
}
public MixinGuiButtonExt(int p_i46323_1_, int p_i46323_2_, int p_i46323_3_, int p_i46323_4_,
int p_i46323_5_, String p_i46323_6_) {
super(p_i46323_1_, p_i46323_2_, p_i46323_3_, p_i46323_4_, p_i46323_5_, p_i46323_6_);
}
/**
* @author CCBlueX
*/
@Overwrite
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (visible) {
final FontRenderer fontRenderer =
mc.getLanguageManager().isCurrentLocaleUnicode() ? mc.fontRendererObj : Fonts.font40;
hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition &&
mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
final int delta = RenderUtils.deltaTime;
final float speedDelta = 0.01F * delta;
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if (hud == null) return;
if (enabled && hovered) {
// LiquidBounce
cut += 0.05F * delta;
if (cut >= 4) cut = 4;
alpha += 0.3F * delta;
if (alpha >= 210) alpha = 210;
// LiquidBounce+
moveX = AnimationUtils.animate(this.width - 2.4F, moveX, speedDelta);
} else {
// LiquidBounce
cut -= 0.05F * delta;
if (cut <= 0) cut = 0;
alpha -= 0.3F * delta;
if (alpha <= 120) alpha = 120;
// LiquidBounce+
moveX = AnimationUtils.animate(0F, moveX, speedDelta);
}
float roundCorner = (float) Math.max(0F, 2.4F + moveX - (this.width - 2.4F));
switch (hud.getGuiButtonStyle().get().toLowerCase()) {
case "minecraft":
mc.getTextureManager().bindTexture(buttonTextures);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.hovered);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.blendFunc(770, 771);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
if (!this.enabled)
{
j = 10526880;
}
else if (this.hovered)
{
j = 16777120;
}
this.drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
break;
case "liquidbounce":
Gui.drawRect(this.xPosition + (int) this.cut, this.yPosition,
this.xPosition + this.width - (int) this.cut, this.yPosition + this.height,
this.enabled ? new Color(0F, 0F, 0F, this.alpha / 255F).getRGB() :
new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB());
break;
case "rounded":
RenderUtils.originalRoundedRect(this.xPosition, this.yPosition,
this.xPosition + this.width, this.yPosition + this.height, 2F,
this.enabled ? new Color(0F, 0F, 0F, this.alpha / 255F).getRGB() :
new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB());
break;
case "liquidbounce+":
RenderUtils.drawRoundedRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 2.4F, new Color(0, 0, 0, 150).getRGB());
RenderUtils.customRounded(this.xPosition, this.yPosition, this.xPosition + 2.4F + moveX, this.yPosition + this.height, 2.4F, roundCorner, roundCorner, 2.4F, (this.enabled ? new Color(0, 111, 255) : new Color(71, 71, 71)).getRGB());
break;
}
if (hud.getGuiButtonStyle().get().equalsIgnoreCase("minecraft")) return;
mc.getTextureManager().bindTexture(buttonTextures);
mouseDragged(mc, mouseX, mouseY);
fontRenderer.drawStringWithShadow(displayString,
(float) ((this.xPosition + this.width / 2) -
fontRenderer.getStringWidth(displayString) / 2),
this.yPosition + (this.height - 5) / 2F - 2, 14737632);
GlStateManager.resetColor();
}
}
}
| 6,081 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiIngameForge.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiIngameForge.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*;
import net.minecraft.client.Minecraft;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.utils.AnimationUtils;
import net.ccbluex.liquidbounce.utils.render.EaseUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.lwjgl.opengl.GL11;
@Mixin(GuiIngameForge.class)
public abstract class MixinGuiIngameForge extends MixinGuiInGame {
@Shadow(remap = false)
abstract boolean pre(ElementType type);
@Shadow(remap = false)
abstract void post(ElementType type);
public float xScale = 0F;
@Inject(
method = "renderChat",
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/eventhandler/EventBus;post(Lnet/minecraftforge/fml/common/eventhandler/Event;)Z", ordinal = 0, remap = false)),
at = @At(value = "RETURN", ordinal = 0),
remap = false
)
private void fixProfilerSectionNotEnding(int width, int height, CallbackInfo ci) {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.mcProfiler.getNameOfLastSection().endsWith("chat"))
mc.mcProfiler.endSection();
}
@Inject(method = "renderExperience", at = @At("HEAD"), remap = false)
private void enableExperienceAlpha(int filled, int top, CallbackInfo ci) {
GlStateManager.enableAlpha();
}
@Inject(method = "renderExperience", at = @At("RETURN"), remap = false)
private void disableExperienceAlpha(int filled, int top, CallbackInfo ci) {
GlStateManager.disableAlpha();
}
@Overwrite(remap = false)
protected void renderPlayerList(int width, int height) {
final Minecraft mc = Minecraft.getMinecraft();
ScoreObjective scoreobjective = mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0);
NetHandlerPlayClient handler = mc.thePlayer.sendQueue;
if (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null)
{
xScale = AnimationUtils.animate((mc.gameSettings.keyBindPlayerList.isKeyDown() ? 100F : 0F), xScale, Animations.tabAnimations.get().equalsIgnoreCase("none") ? 1F : 0.0125F * RenderUtils.deltaTime);
float rescaled = xScale / 100F;
boolean displayable = rescaled > 0F;
this.overlayPlayerList.updatePlayerList(displayable);
if (!displayable || pre(PLAYER_LIST)) return;
GlStateManager.pushMatrix();
switch (Animations.tabAnimations.get().toLowerCase()) {
case "zoom":
GlStateManager.translate(width / 2F * (1F - rescaled), 0F, 0F);
GlStateManager.scale(rescaled, rescaled, rescaled);
break;
case "slide":
GlStateManager.scale(1F, rescaled, 1F);
break;
case "none":
break;
}
this.overlayPlayerList.renderPlayerlist(width, mc.theWorld.getScoreboard(), scoreobjective);
GlStateManager.popMatrix();
post(PLAYER_LIST);
}
else
{
this.overlayPlayerList.updatePlayerList(false);
}
}
} | 4,443 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiLanguage.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiLanguage.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.gui.GuiLanguage;
import net.minecraft.client.gui.GuiScreen;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(GuiLanguage.class)
public class MixinGuiLanguage extends GuiScreen {
@Override
public void onGuiClosed() {
mc.ingameGUI.getChatGUI().refreshChat();
}
}
| 561 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiChat.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiChat.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.utils.AnimationUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.ccbluex.liquidbounce.utils.render.Stencil;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.util.IChatComponent;
import org.lwjgl.input.Mouse;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import java.awt.*;
import java.util.Comparator;
import java.util.List;
@Mixin(GuiChat.class)
public abstract class MixinGuiChat extends MixinGuiScreen {
@Shadow
protected GuiTextField inputField;
@Shadow
private List<String> foundPlayerNames;
@Shadow
private boolean waitingOnAutocomplete;
private float yPosOfInputField;
private float fade = 0;
@Shadow
public abstract void onAutocompleteResponse(String[] p_onAutocompleteResponse_1_);
@Inject(method = "initGui", at = @At("RETURN"))
private void init(CallbackInfo callbackInfo) {
inputField.yPosition = height + 1;
yPosOfInputField = inputField.yPosition;
}
@Inject(method = "keyTyped", at = @At("RETURN"))
private void updateLength(CallbackInfo callbackInfo) {
if (!inputField.getText().startsWith(String.valueOf(LiquidBounce.commandManager.getPrefix()))) return;
LiquidBounce.commandManager.autoComplete(inputField.getText());
if (!inputField.getText().startsWith(LiquidBounce.commandManager.getPrefix() + "lc"))
inputField.setMaxStringLength(10000);
else
inputField.setMaxStringLength(100);
}
@Inject(method = "updateScreen", at = @At("HEAD"))
private void updateScreen(CallbackInfo callbackInfo) {
final int delta = RenderUtils.deltaTime;
if (fade < 14) fade = AnimationUtils.animate(14F, fade, 0.025F * delta);
if (fade > 14) fade = 14;
if (yPosOfInputField > height - 12) yPosOfInputField = AnimationUtils.animate(height - 12, yPosOfInputField, 0.025F * (12F / 14F) * delta);
if (yPosOfInputField < height - 12) yPosOfInputField = height - 12;
inputField.yPosition = (int) yPosOfInputField;
}
@Inject(method = "autocompletePlayerNames", at = @At("HEAD"))
private void prioritizeClientFriends(final CallbackInfo callbackInfo) {
foundPlayerNames.sort(
Comparator.comparing(s -> !LiquidBounce.fileManager.friendsConfig.isFriend(s)));
}
/**
* Adds client command auto completion and cancels sending an auto completion request packet
* to the server if the message contains a client command.
*
* @author NurMarvin
*/
@Inject(method = "sendAutocompleteRequest", at = @At("HEAD"), cancellable = true)
private void handleClientCommandCompletion(String full, final String ignored, CallbackInfo callbackInfo) {
if (LiquidBounce.commandManager.autoComplete(full)) {
waitingOnAutocomplete = true;
String[] latestAutoComplete = LiquidBounce.commandManager.getLatestAutoComplete();
if (full.toLowerCase().endsWith(latestAutoComplete[latestAutoComplete.length - 1].toLowerCase()))
return;
this.onAutocompleteResponse(latestAutoComplete);
callbackInfo.cancel();
}
}
/**
* Add this callback, to check if the User complete a Playername or a Liquidbounce command.
* To fix this bug: https://github.com/CCBlueX/LiquidBounce1.8-Issues/issues/3795
*
* @author derech1e
*/
@Inject(method = "onAutocompleteResponse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;autocompletePlayerNames(F)V", shift = At.Shift.BEFORE), cancellable = true)
private void onAutocompleteResponse(String[] autoCompleteResponse, CallbackInfo callbackInfo) {
if (LiquidBounce.commandManager.getLatestAutoComplete().length != 0) callbackInfo.cancel();
}
/**
* @author CCBlueX
*/
@Overwrite
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if (hud.getCmdBorderValue().get() && !inputField.getText().isEmpty() && inputField.getText().startsWith(String.valueOf(LiquidBounce.commandManager.getPrefix()))) {
Stencil.write(true);
RenderUtils.drawRect(2F, this.height - fade, this.width - 2, this.height - fade + 12, Integer.MIN_VALUE);
Stencil.erase(false);
RenderUtils.drawRect(1F, this.height - fade - 1, this.width - 1, this.height - fade + 13, new Color(20, 110, 255).getRGB());
Stencil.dispose();
} else
RenderUtils.drawRect(2F, this.height - fade, this.width - 2, this.height - fade + 12, Integer.MIN_VALUE);
this.inputField.drawTextBox();
if (LiquidBounce.commandManager.getLatestAutoComplete().length > 0 && !inputField.getText().isEmpty() && inputField.getText().startsWith(String.valueOf(LiquidBounce.commandManager.getPrefix()))) {
String[] latestAutoComplete = LiquidBounce.commandManager.getLatestAutoComplete();
String[] textArray = inputField.getText().split(" ");
String trimmedString = latestAutoComplete[0].replaceFirst("(?i)" + textArray[textArray.length - 1], "");
mc.fontRendererObj.drawStringWithShadow(trimmedString, inputField.xPosition + mc.fontRendererObj.getStringWidth(inputField.getText()), inputField.yPosition, new Color(165, 165, 165).getRGB());
}
IChatComponent ichatcomponent =
this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY());
if (ichatcomponent != null)
this.handleComponentHover(ichatcomponent, mouseX, mouseY);
}
}
| 6,409 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiAchievement.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiAchievement.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.NoAchievements;
import net.minecraft.client.gui.achievement.GuiAchievement;
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(GuiAchievement.class)
public class MixinGuiAchievement {
@Inject(method = "updateAchievementWindow", at = @At("HEAD"), cancellable = true)
private void injectAchievements(CallbackInfo ci) {
if (LiquidBounce.moduleManager != null
&& LiquidBounce.moduleManager.getModule(NoAchievements.class) != null
&& LiquidBounce.moduleManager.getModule(NoAchievements.class).getState())
ci.cancel();
}
}
| 1,105 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiGameOver.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiGameOver.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.gui.GuiGameOver;
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(GuiGameOver.class)
public class MixinGuiGameOver {
@Shadow private int enableButtonsTimer;
@Inject(method = "initGui", at = @At("HEAD"))
private void allowClickable(CallbackInfo ci) {
this.enableButtonsTimer = 0;
}
}
| 801 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiScreenResourcePacks.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiScreenResourcePacks.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreenResourcePacks;
import net.minecraft.client.resources.IResourcePack;
import net.minecraft.client.resources.ResourcePackRepository;
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(GuiScreenResourcePacks.class)
public class MixinGuiScreenResourcePacks {
@Inject(method = "actionPerformed", at = @At(value = "INVOKE", target = "Ljava/util/Collections;reverse(Ljava/util/List;)V", remap = false))
private void clearHandles(CallbackInfo ci) {
ResourcePackRepository repository = Minecraft.getMinecraft().getResourcePackRepository();
for (ResourcePackRepository.Entry entry : repository.getRepositoryEntries()) {
IResourcePack current = repository.getResourcePackInstance();
if (current == null || !entry.getResourcePackName().equals(current.getPackName()))
entry.closeResourcePack();
}
}
}
| 1,363 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiEditSign.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiEditSign.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiEditSign;
import net.minecraft.event.ClickEvent;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.ChatAllowedCharacters;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import java.awt.*;
import java.io.IOException;
@Mixin(GuiEditSign.class)
public class MixinGuiEditSign extends GuiScreen {
@Shadow
private int editLine;
@Shadow
private TileEntitySign tileSign;
@Shadow
private GuiButton doneBtn;
private boolean enabled;
private GuiButton toggleButton;
private GuiTextField signCommand1;
private GuiTextField signCommand2;
private GuiTextField signCommand3;
private GuiTextField signCommand4;
@Inject(method = "initGui", at = @At("RETURN"))
private void initGui(final CallbackInfo callbackInfo) {
buttonList.add(toggleButton = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 145, enabled ? "Disable Formatting codes" : "Enable Formatting codes"));
this.signCommand1 = new GuiTextField(0, fontRendererObj, this.width / 2 - 100, height - 15, 200, 10);
this.signCommand2 = new GuiTextField(1, fontRendererObj, this.width / 2 - 100, height - 15 * 2, 200, 10);
this.signCommand3 = new GuiTextField(2, fontRendererObj, this.width / 2 - 100, height - 15 * 3, 200, 10);
this.signCommand4 = new GuiTextField(3, fontRendererObj, this.width / 2 - 100, height - 15 * 4, 200, 10);
this.signCommand1.setText("");
this.signCommand2.setText("");
this.signCommand3.setText("");
this.signCommand4.setText("");
}
@Inject(method = "actionPerformed", at = @At("HEAD"))
private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
switch(button.id) {
case 0:
if(!signCommand1.getText().isEmpty())
tileSign.signText[0].setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, signCommand1.getText())));
if(!signCommand2.getText().isEmpty())
tileSign.signText[1].setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, signCommand2.getText())));
if(!signCommand3.getText().isEmpty())
tileSign.signText[2].setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, signCommand3.getText())));
if(!signCommand4.getText().isEmpty())
tileSign.signText[3].setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, signCommand4.getText())));
break;
case 1:
enabled = !enabled;
toggleButton.displayString = enabled ? "Disable Formatting codes" : "Enable Formatting codes";
break;
}
}
@Inject(method = "drawScreen", at = @At("RETURN"))
private void drawFields(CallbackInfo callbackInfo) {
fontRendererObj.drawString("§c§lCommands §7(§f§l1.8§7)", width / 2 - 100, height - 15 * 5, Color.WHITE.getRGB());
signCommand1.drawTextBox();
signCommand2.drawTextBox();
signCommand3.drawTextBox();
signCommand4.drawTextBox();
}
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
this.signCommand1.mouseClicked(mouseX, mouseY, mouseButton);
this.signCommand2.mouseClicked(mouseX, mouseY, mouseButton);
this.signCommand3.mouseClicked(mouseX, mouseY, mouseButton);
this.signCommand4.mouseClicked(mouseX, mouseY, mouseButton);
super.mouseClicked(mouseX, mouseY, mouseButton);
}
/**
* @author CCBlueX
*/
@Overwrite
protected void keyTyped(char typedChar, int keyCode) throws IOException {
this.signCommand1.textboxKeyTyped(typedChar, keyCode);
this.signCommand2.textboxKeyTyped(typedChar, keyCode);
this.signCommand3.textboxKeyTyped(typedChar, keyCode);
this.signCommand4.textboxKeyTyped(typedChar, keyCode);
if(signCommand1.isFocused() || signCommand2.isFocused() || signCommand3.isFocused() || signCommand4.isFocused())
return;
if(keyCode == 200) {
this.editLine = this.editLine - 1 & 3;
}
if(keyCode == 208 || keyCode == 28 || keyCode == 156) {
this.editLine = this.editLine + 1 & 3;
}
String s = this.tileSign.signText[this.editLine].getUnformattedText();
if(keyCode == 14 && s.length() > 0) {
s = s.substring(0, s.length() - 1);
}
if((ChatAllowedCharacters.isAllowedCharacter(typedChar) || (enabled && typedChar == '§')) && this.fontRendererObj.getStringWidth(s + typedChar) <= 90) {
s = s + typedChar;
}
this.tileSign.signText[this.editLine] = new ChatComponentText(s);
if(keyCode == 1) {
this.actionPerformed(this.doneBtn);
}
}
}
| 5,752 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiNewChat.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiNewChat.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.misc.Patcher;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.ui.font.Fonts;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.ccbluex.liquidbounce.utils.render.EaseUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ChatLine;
import net.minecraft.client.gui.GuiNewChat;
import net.minecraft.client.gui.GuiUtilRenderComponents;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.awt.Color;
@Mixin(GuiNewChat.class)
public abstract class MixinGuiNewChat {
private float displayPercent, animationPercent = 0F;
private int lineBeingDrawn, newLines;
@Shadow
@Final
private Minecraft mc;
@Shadow
public abstract int getLineCount();
@Shadow
@Final
private List<ChatLine> drawnChatLines;
@Shadow
public abstract boolean getChatOpen();
@Shadow
public abstract float getChatScale();
@Shadow
public abstract int getChatWidth();
@Shadow
private int scrollPos;
@Shadow
private boolean isScrolled;
@Shadow
public abstract void deleteChatLine(int p_deleteChatLine_1_);
@Shadow
@Final
private List<ChatLine> chatLines;
@Shadow
public abstract void scroll(int p_scroll_1_);
@Shadow
public abstract void printChatMessageWithOptionalDeletion(IChatComponent chatComponent, int chatLineId);
private String lastMessage;
private int sameMessageAmount;
private int line;
private HUD hud;
private final HashMap<String,String> stringCache=new HashMap<>();
private void checkHud() {
if (hud == null)
hud = LiquidBounce.moduleManager.getModule(HUD.class);
}
@Redirect(method = "deleteChatLine", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/ChatLine;getChatLineID()I"))
private int checkIfChatLineIsNull(ChatLine instance) {
if (instance == null) return -1;
return instance.getChatLineID();
}
@Overwrite
public void printChatMessage(IChatComponent chatComponent) {
checkHud();
if(!hud.getChatCombineValue().get()) {
printChatMessageWithOptionalDeletion(chatComponent, this.line);
return;
}
String text=fixString(chatComponent.getFormattedText());
if (text.equals(this.lastMessage)) {
(Minecraft.getMinecraft()).ingameGUI.getChatGUI().deleteChatLine(this.line);
this.sameMessageAmount++;
this.lastMessage = text;
chatComponent.appendText(ChatFormatting.WHITE + " (" + "x" + this.sameMessageAmount + ")");
} else {
this.sameMessageAmount = 1;
this.lastMessage = text;
}
this.line++;
if (this.line > 256)
this.line = 0;
printChatMessageWithOptionalDeletion(chatComponent, this.line);
}
@Inject(method = "printChatMessageWithOptionalDeletion", at = @At("HEAD"))
private void resetPercentage(CallbackInfo ci) {
displayPercent = 0F;
}
@Overwrite
public void drawChat(int updateCounter) {
checkHud();
boolean canFont = hud.getState() && hud.getFontChatValue().get();
if (Patcher.chatPosition.get()) {
GlStateManager.pushMatrix();
GlStateManager.translate(0, -12, 0);
}
if (this.mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) {
int i = this.getLineCount();
boolean flag = false;
int j = 0;
int k = this.drawnChatLines.size();
float f = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F;
if (k > 0) {
if (this.getChatOpen()) {
flag = true;
}
if (this.isScrolled || !hud.getState() || !hud.getChatAnimationValue().get()) {
displayPercent = 1F;
} else if (displayPercent < 1F) {
displayPercent += hud.getChatAnimationSpeedValue().get() / 10F * RenderUtils.deltaTime;
displayPercent = MathHelper.clamp_float(displayPercent, 0F, 1F);
}
float t = displayPercent;
animationPercent = MathHelper.clamp_float(1F - (--t) * t * t * t, 0F, 1F);
float f1 = this.getChatScale();
int l = MathHelper.ceiling_float_int((float)this.getChatWidth() / f1);
GlStateManager.pushMatrix();
if (hud.getState() && hud.getChatAnimationValue().get())
GlStateManager.translate(0F, (1F - animationPercent) * 9F * this.getChatScale(), 0F);
GlStateManager.translate(2.0F, 20.0F, 0.0F);
GlStateManager.scale(f1, f1, 1.0F);
int i1;
int j1;
int l1;
for(i1 = 0; i1 + this.scrollPos < this.drawnChatLines.size() && i1 < i; ++i1) {
ChatLine chatline = this.drawnChatLines.get(i1 + this.scrollPos);
lineBeingDrawn = i1 + this.scrollPos;
if (chatline != null) {
j1 = updateCounter - chatline.getUpdatedCounter();
if (j1 < 200 || flag) {
double d0 = (double)j1 / 200.0D;
d0 = 1.0D - d0;
d0 *= 10.0D;
d0 = MathHelper.clamp_double(d0, 0.0D, 1.0D);
d0 *= d0;
l1 = (int)(255.0D * d0);
if (flag) {
l1 = 255;
}
l1 = (int)((float)l1 * f);
++j;
//Animation part
if (l1 > 3) {
int i2 = 0;
int j2 = -i1 * 9;
if(hud.getState() && hud.getChatRectValue().get()) {
if (hud.getChatAnimationValue().get() && lineBeingDrawn <= newLines && !flag)
RenderUtils.drawRect(i2, j2 - 9, i2 + l + 4, j2, new Color(0F, 0F, 0F, animationPercent * ((float)d0 / 2F)).getRGB());
else
RenderUtils.drawRect(i2, j2 - 9, i2 + l + 4, j2, l1 / 2 << 24);
}
GlStateManager.resetColor();
GlStateManager.color(1F, 1F, 1F, 1F);
String s = fixString(chatline.getChatComponent().getFormattedText());
GlStateManager.enableBlend();
if (hud.getState() && hud.getChatAnimationValue().get() && lineBeingDrawn <= newLines)
(canFont?hud.getFontType().get():this.mc.fontRendererObj).drawString(s, (float)i2, (float)(j2 - 8), new Color(1F, 1F, 1F, animationPercent * (float)d0).getRGB(), true);
else
(canFont?hud.getFontType().get():this.mc.fontRendererObj).drawString(s, (float)i2, (float)(j2 - 8), 16777215 + (l1 << 24), true);
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
}
}
}
}
if (flag) {
i1 = this.mc.fontRendererObj.FONT_HEIGHT;
GlStateManager.translate(-3.0F, 0.0F, 0.0F);
int l2 = k * i1 + k;
j1 = j * i1 + j;
int j3 = this.scrollPos * j1 / k;
int k1 = j1 * j1 / l2;
if (l2 != j1) {
l1 = j3 > 0 ? 170 : 96;
int l3 = this.isScrolled ? 13382451 : 3355562;
RenderUtils.drawRect(0, -j3, 2, -j3 - k1, l3 + (l1 << 24));
RenderUtils.drawRect(2, -j3, 1, -j3 - k1, 13421772 + (l1 << 24));
}
}
GlStateManager.popMatrix();
}
}
if (Patcher.chatPosition.get())
GlStateManager.popMatrix();
}
private String fixString(String str) {
if (stringCache.containsKey(str)) return stringCache.get(str);
str = str.replaceAll("\uF8FF", "");//remove air chars
StringBuilder sb = new StringBuilder();
for (char c : str.toCharArray()) {
if ((int) c > (33 + 65248) && (int) c < (128 + 65248))
sb.append(Character.toChars((int) c - 65248));
else
sb.append(c);
}
String result = sb.toString();
stringCache.put(str, result);
return result;
}
@ModifyVariable(method = "setChatLine", at = @At("STORE"), ordinal = 0)
private List<IChatComponent> setNewLines(List<IChatComponent> original) {
newLines = original.size() - 1;
return original;
}
@Overwrite
public IChatComponent getChatComponent(int p_146236_1_, int p_146236_2_) {
checkHud();
boolean flagFont = hud.getState() && hud.getFontChatValue().get();
if (!this.getChatOpen()) {
return null;
} else {
ScaledResolution sc = new ScaledResolution(this.mc);
int scaleFactor = sc.getScaleFactor();
float chatScale = this.getChatScale();
int mX = p_146236_1_ / scaleFactor - 3;
int mY = p_146236_2_ / scaleFactor - 27 - (Patcher.chatPosition.get() ? 12 : 0);
mX = MathHelper.floor_float((float) mX / chatScale);
mY = MathHelper.floor_float((float) mY / chatScale);
if (mX >= 0 && mY >= 0) {
int lineCount = Math.min(this.getLineCount(), this.drawnChatLines.size());
if (mX <= MathHelper.floor_float((float) this.getChatWidth() / this.getChatScale()) && mY < (flagFont?hud.getFontType().get():this.mc.fontRendererObj).FONT_HEIGHT * lineCount + lineCount) {
int line = mY / (flagFont?hud.getFontType().get():this.mc.fontRendererObj).FONT_HEIGHT + this.scrollPos;
if (line >= 0 && line < this.drawnChatLines.size()) {
ChatLine chatLine = (ChatLine) this.drawnChatLines.get(line);
int maxWidth = 0;
Iterator iter = chatLine.getChatComponent().iterator();
while (iter.hasNext()) {
IChatComponent iterator = (IChatComponent) iter.next();
if (iterator instanceof ChatComponentText) {
maxWidth += (flagFont?hud.getFontType().get():this.mc.fontRendererObj).getStringWidth(GuiUtilRenderComponents.func_178909_a(((ChatComponentText) iterator).getChatComponentText_TextValue(), false));
if (maxWidth > mX) {
return iterator;
}
}
}
}
return null;
} else {
return null;
}
} else {
return null;
}
}
}
} | 12,673 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiScreen.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiScreen.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.misc.HoverDetails;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.ui.client.GuiBackground;
import net.ccbluex.liquidbounce.utils.render.ParticleUtils;
import net.ccbluex.liquidbounce.utils.render.shader.shaders.BackgroundShader;
import net.ccbluex.liquidbounce.utils.render.shader.shaders.BackgroundDarkShader;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.event.ClickEvent;
import net.minecraft.event.HoverEvent;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.IChatComponent;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
@Mixin(GuiScreen.class)
public abstract class MixinGuiScreen {
@Shadow
public Minecraft mc;
@Shadow
protected List<GuiButton> buttonList;
@Shadow
public int width;
@Shadow
public int height;
@Shadow
protected FontRenderer fontRendererObj;
@Shadow
public void updateScreen() {
}
@Shadow
public abstract void handleComponentHover(IChatComponent component, int x, int y);
@Shadow
protected abstract void drawHoveringText(List<String> textLines, int x, int y);
@Redirect(method = "handleKeyboardInput", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Keyboard;getEventKeyState()Z", remap = false))
private boolean checkCharacter() {
return Keyboard.getEventKey() == 0 && Keyboard.getEventCharacter() >= ' ' || Keyboard.getEventKeyState();
}
@Inject(method = "drawWorldBackground", at = @At("HEAD"), cancellable = true)
private void drawWorldBackground(final CallbackInfo callbackInfo) {
if (!shouldRenderBackground()) {
callbackInfo.cancel();
return;
}
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if(hud.getInventoryParticle().get() && mc.thePlayer != null) {
final ScaledResolution scaledResolution = new ScaledResolution(mc);
final int width = scaledResolution.getScaledWidth();
final int height = scaledResolution.getScaledHeight();
ParticleUtils.drawParticles(Mouse.getX() * width / mc.displayWidth, height - Mouse.getY() * height / mc.displayHeight - 1);
}
}
/**
* @author CCBlueX & TheMosKau
*/
@Inject(method = "drawBackground", at = @At("HEAD"), cancellable = true)
private void drawClientBackground(final CallbackInfo callbackInfo) {
GlStateManager.disableLighting();
GlStateManager.disableFog();
if(GuiBackground.Companion.getEnabled()) {
if (LiquidBounce.INSTANCE.getBackground() == null) {
if(!LiquidBounce.INSTANCE.getdarkMode()) {
BackgroundShader.BACKGROUND_SHADER.startShader();
final Tessellator instance = Tessellator.getInstance();
final WorldRenderer worldRenderer = instance.getWorldRenderer();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(0, height, 0.0D).endVertex();
worldRenderer.pos(width, height, 0.0D).endVertex();
worldRenderer.pos(width, 0, 0.0D).endVertex();
worldRenderer.pos(0, 0, 0.0D).endVertex();
instance.draw();
BackgroundShader.BACKGROUND_SHADER.stopShader();
} else {
BackgroundShader.BACKGROUND_SHADER.startShader();
final Tessellator instance = Tessellator.getInstance();
final WorldRenderer worldRenderer = instance.getWorldRenderer();
worldRenderer.begin(7, DefaultVertexFormats.POSITION);
worldRenderer.pos(0, height, 0.0D).endVertex();
worldRenderer.pos(width, height, 0.0D).endVertex();
worldRenderer.pos(width, 0, 0.0D).endVertex();
worldRenderer.pos(0, 0, 0.0D).endVertex();
instance.draw();
BackgroundShader.BACKGROUND_SHADER.stopShader();
}
}else{
final ScaledResolution scaledResolution = new ScaledResolution(mc);
final int width = scaledResolution.getScaledWidth();
final int height = scaledResolution.getScaledHeight();
mc.getTextureManager().bindTexture(LiquidBounce.INSTANCE.getBackground());
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
Gui.drawScaledCustomSizeModalRect(0, 0, 0.0F, 0.0F, width, height, width, height, width, height);
}
if (GuiBackground.Companion.getParticles())
ParticleUtils.drawParticles(Mouse.getX() * width / mc.displayWidth, height - Mouse.getY() * height / mc.displayHeight - 1);
callbackInfo.cancel();
}
}
@Inject(method = "drawBackground", at = @At("RETURN"))
private void drawParticles(final CallbackInfo callbackInfo) {
if(GuiBackground.Companion.getParticles())
ParticleUtils.drawParticles(Mouse.getX() * width / mc.displayWidth, height - Mouse.getY() * height / mc.displayHeight - 1);
}
@Inject(method = "sendChatMessage(Ljava/lang/String;Z)V", at = @At("HEAD"), cancellable = true)
private void messageSend(String msg, boolean addToChat, final CallbackInfo callbackInfo) {
if (msg.startsWith(String.valueOf(LiquidBounce.commandManager.getPrefix())) && addToChat) {
this.mc.ingameGUI.getChatGUI().addToSentMessages(msg);
LiquidBounce.commandManager.executeCommands(msg);
callbackInfo.cancel();
}
}
@Inject(method = "handleComponentHover", at = @At("HEAD"))
private void handleHoverOverComponent(IChatComponent component, int x, int y, final CallbackInfo callbackInfo) {
if (component == null || component.getChatStyle().getChatClickEvent() == null || !LiquidBounce.moduleManager.getModule(HoverDetails.class).getState())
return;
final ChatStyle chatStyle = component.getChatStyle();
final ClickEvent clickEvent = chatStyle.getChatClickEvent();
final HoverEvent hoverEvent = chatStyle.getChatHoverEvent();
drawHoveringText(Collections.singletonList("§c§l" + clickEvent.getAction().getCanonicalName().toUpperCase() + ": §a" + clickEvent.getValue()), x, y - (hoverEvent != null ? 17 : 0));
}
/**
* @author CCBlueX (superblaubeere27)
* @reason Making it possible for other mixins to receive actions
*/
@Inject(method = "actionPerformed", at = @At("RETURN"))
protected void injectActionPerformed(GuiButton button, CallbackInfo callbackInfo) {
this.injectedActionPerformed(button);
}
protected boolean shouldRenderBackground() {
return true;
}
protected void injectedActionPerformed(GuiButton button) {
}
}
| 7,997 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiIngameMenu.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiIngameMenu.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.ui.client.GuiKeybindHelper;
import net.ccbluex.liquidbounce.utils.ServerUtils;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiIngameMenu;
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(GuiIngameMenu.class)
public abstract class MixinGuiIngameMenu extends MixinGuiScreen {
@Inject(method = "initGui", at = @At("RETURN"))
private void initGui(CallbackInfo callbackInfo) {
if(!this.mc.isIntegratedServerRunning())
this.buttonList.add(new GuiButton(1337, this.width / 2 - 100, this.height / 4 + 128, "Reconnect"));
this.buttonList.add(new GuiButton(727, this.width / 2 - 100, this.height - 30, "Keybind Helper"));
}
@Inject(method = "actionPerformed", at = @At("HEAD"))
private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
if(button.id == 1337) {
mc.theWorld.sendQuittingDisconnectingPacket();
ServerUtils.connectToLastServer();
}
if (button.id == 727)
mc.displayGuiScreen(new GuiKeybindHelper((GuiIngameMenu) (Object) this));
}
} | 1,551 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiInGame.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiInGame.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.Render2DEvent;
import net.ccbluex.liquidbounce.features.module.modules.render.AntiBlind;
import net.ccbluex.liquidbounce.features.module.modules.render.Crosshair;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.features.module.modules.misc.AutoHypixel;
import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer;
import net.ccbluex.liquidbounce.utils.ClassUtils;
import net.ccbluex.liquidbounce.utils.render.ColorUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.GuiPlayerTabOverlay;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.scoreboard.ScoreObjective;
import org.spongepowered.asm.mixin.Final;
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.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.lwjgl.opengl.GL11;
@Mixin(GuiIngame.class)
public abstract class MixinGuiInGame extends MixinGui {
@Shadow
protected abstract void renderHotbarItem(int index, int xPos, int yPos, float partialTicks, EntityPlayer player);
@Shadow @Final
protected static ResourceLocation widgetsTexPath;
@Shadow public GuiPlayerTabOverlay overlayPlayerList;
@Inject(method = "showCrosshair", at = @At("HEAD"), cancellable = true)
private void injectCrosshair(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
final Crosshair crossHair = LiquidBounce.moduleManager.getModule(Crosshair.class);
if (crossHair.getState() && crossHair.noVanillaCH.get())
callbackInfoReturnable.setReturnValue(false);
}
@Inject(method = "renderScoreboard", at = @At("HEAD"), cancellable = true)
private void renderScoreboard(ScoreObjective scoreObjective, ScaledResolution scaledResolution, CallbackInfo callbackInfo) {
if (scoreObjective != null) AutoHypixel.gameMode = ColorUtils.stripColor(scoreObjective.getDisplayName());
final AntiBlind antiBlind = LiquidBounce.moduleManager.getModule(AntiBlind.class);
if ((antiBlind.getState() && antiBlind.getScoreBoard().get()) || LiquidBounce.moduleManager.getModule(HUD.class).getState())
callbackInfo.cancel();
}
@ModifyConstant(method = "renderScoreboard", constant = @Constant(intValue = 553648127))
private int fixTextBlending(int original) {
return -1;
}
@Inject(method = "renderBossHealth", at = @At("HEAD"), cancellable = true)
private void renderBossHealth(CallbackInfo callbackInfo) {
final AntiBlind antiBlind = LiquidBounce.moduleManager.getModule(AntiBlind.class);
if (antiBlind.getState() && antiBlind.getBossHealth().get())
callbackInfo.cancel();
}
@Inject(method = "renderTooltip", at = @At("HEAD"), cancellable = true)
private void renderTooltip(ScaledResolution sr, float partialTicks, CallbackInfo callbackInfo) {
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if(Minecraft.getMinecraft().getRenderViewEntity() instanceof EntityPlayer && hud.getState() && (hud.getBlackHotbarValue().get() || hud.getAnimHotbarValue().get())) {
final Minecraft mc = Minecraft.getMinecraft();
EntityPlayer entityPlayer = (EntityPlayer) mc.getRenderViewEntity();
boolean blackHB = hud.getBlackHotbarValue().get();
int middleScreen = sr.getScaledWidth() / 2;
float posInv = hud.getAnimPos(entityPlayer.inventory.currentItem * 20F);
GlStateManager.resetColor();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(widgetsTexPath);
float f = this.zLevel;
this.zLevel = -90.0F;
GlStateManager.resetColor();
if (blackHB) {
RenderUtils.originalRoundedRect(middleScreen - 91, sr.getScaledHeight() - 2, middleScreen + 91, sr.getScaledHeight() - 22, 3F, Integer.MIN_VALUE);
RenderUtils.originalRoundedRect(middleScreen - 91 + posInv, sr.getScaledHeight() - 2, middleScreen - 91 + posInv + 22, sr.getScaledHeight() - 22, 3F, Integer.MAX_VALUE);
} else {
this.drawTexturedModalRect(middleScreen - 91F, sr.getScaledHeight() - 22, 0, 0, 182, 22);
this.drawTexturedModalRect(middleScreen - 91F + posInv - 1, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
}
this.zLevel = f;
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
RenderHelper.enableGUIStandardItemLighting();
for (int j = 0; j < 9; ++j) {
int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
int l = sr.getScaledHeight() - 19 - (blackHB ? 1 : 0);
this.renderHotbarItem(j, k, l, partialTicks, entityPlayer);
}
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();
GlStateManager.resetColor();
LiquidBounce.eventManager.callEvent(new Render2DEvent(partialTicks));
AWTFontRenderer.Companion.garbageCollectionTick();
callbackInfo.cancel();
}
}
@Inject(method = "renderTooltip", at = @At("TAIL"))
private void renderTooltipPost(ScaledResolution sr, float partialTicks, CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new Render2DEvent(partialTicks));
AWTFontRenderer.Companion.garbageCollectionTick();
}
@Inject(method = "renderPumpkinOverlay", at = @At("HEAD"), cancellable = true)
private void renderPumpkinOverlay(final CallbackInfo callbackInfo) {
final AntiBlind antiBlind = LiquidBounce.moduleManager.getModule(AntiBlind.class);
if(antiBlind.getState() && antiBlind.getPumpkinEffect().get())
callbackInfo.cancel();
}
} | 6,968 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiOptions.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiOptions.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.minecraft.client.gui.GuiOptions;
import net.minecraft.client.gui.GuiScreen;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(GuiOptions.class)
public class MixinGuiOptions extends GuiScreen {
@Override
public void onGuiClosed() {
mc.gameSettings.saveOptions();
}
}
| 548 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiConnecting.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiConnecting.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import com.mojang.authlib.GameProfile;
import net.ccbluex.liquidbounce.ui.font.Fonts;
import net.ccbluex.liquidbounce.utils.ServerUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.multiplayer.GuiConnecting;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.network.NetHandlerLoginClient;
import net.minecraft.network.EnumConnectionState;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.handshake.client.C00Handshake;
import net.minecraft.network.login.client.C00PacketLoginStart;
import net.minecraft.util.ChatComponentTranslation;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.concurrent.atomic.AtomicInteger;
@Mixin(GuiConnecting.class)
public abstract class MixinGuiConnecting extends GuiScreen {
@Shadow
private NetworkManager networkManager;
@Shadow
@Final
private static Logger logger;
@Shadow
private boolean cancel;
@Shadow
@Final
private GuiScreen previousGuiScreen;
@Shadow
@Final
private static AtomicInteger CONNECTION_ID;
@Inject(method = "connect", at = @At("HEAD"))
private void headConnect(final String ip, final int port, CallbackInfo callbackInfo) {
ServerUtils.serverData = new ServerData("", ip + ":" + port, false);
}
/*
@Inject(method = "connect", at = @At(value = "NEW", target = "net/minecraft/network/login/client/C00PacketLoginStart"), cancellable = true)
private void mcLeaks(CallbackInfo callbackInfo) {
if(MCLeaks.isAltActive()) {
networkManager.sendPacket(new C00PacketLoginStart(new GameProfile(null, MCLeaks.getSession().getUsername())));
callbackInfo.cancel();
}
}
*/
/**
* @author CCBlueX
*/
@Overwrite
private void connect(final String ip, final int port) {
logger.info("Connecting to " + ip + ", " + port);
new Thread(() -> {
InetAddress inetaddress = null;
try {
if(cancel) {
return;
}
inetaddress = InetAddress.getByName(ip);
networkManager = NetworkManager.createNetworkManagerAndConnect(inetaddress, port, mc.gameSettings.isUsingNativeTransport());
networkManager.setNetHandler(new NetHandlerLoginClient(networkManager, mc, previousGuiScreen));
networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN, true));
networkManager.sendPacket(new C00PacketLoginStart(mc.getSession().getProfile()));
}catch(UnknownHostException unknownhostexception) {
if(cancel)
return;
logger.error("Couldn\'t connect to server", unknownhostexception);
mc.displayGuiScreen(new GuiDisconnected(previousGuiScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", "Unknown host")));
}catch(Exception exception) {
if(cancel) {
return;
}
logger.error("Couldn\'t connect to server", exception);
String s = exception.toString();
if(inetaddress != null) {
String s1 = inetaddress.toString() + ":" + port;
s = s.replaceAll(s1, "");
}
mc.displayGuiScreen(new GuiDisconnected(previousGuiScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", s)));
}
}, "Server Connector #" + CONNECTION_ID.incrementAndGet()).start();
}
/**
* @author CCBlueX
*/
@Overwrite
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
this.drawDefaultBackground();
String ip = "Unknown";
final ServerData serverData = mc.getCurrentServerData();
if(serverData != null)
ip = serverData.serverIP;
Fonts.font40.drawCenteredString("Connecting to", scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() / 4 + 110, 0xFFFFFF, true);
Fonts.font35.drawCenteredString(ip, scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() / 4 + 120, 0x5281FB, true);
super.drawScreen(mouseX, mouseY, partialTicks);
}
} | 5,277 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiSlot.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiSlot.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.injection.implementations.IMixinGuiSlot;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(GuiSlot.class)
public abstract class MixinGuiSlot implements IMixinGuiSlot {
private int listWidth = 220;
private boolean enableScissor = false;
@Shadow
protected boolean field_178041_q;
@Shadow
protected int mouseX;
@Shadow
protected int mouseY;
@Shadow
protected abstract void drawBackground();
@Shadow
protected abstract void bindAmountScrolled();
@Shadow
public int left;
@Shadow
public int top;
@Shadow
public int width;
@Shadow
protected float amountScrolled;
@Shadow
protected boolean hasListHeader;
@Shadow
protected abstract void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_);
@Shadow
protected abstract void drawSelectionBox(int p_148120_1_, int p_148120_2_, int mouseXIn, int mouseYIn);
@Shadow
public int right;
@Shadow
public int bottom;
@Shadow
@Final
protected Minecraft mc;
@Shadow
public int height;
@Shadow
protected abstract int getContentHeight();
@Shadow
public abstract int func_148135_f();
@Shadow
protected abstract void func_148142_b(int p_148142_1_, int p_148142_2_);
/**
* @author CCBlueX
*/
@Overwrite
public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) {
if(this.field_178041_q) {
this.mouseX = mouseXIn;
this.mouseY = mouseYIn;
this.drawBackground();
int i = this.getScrollBarX();
int j = i + 6;
this.bindAmountScrolled();
GlStateManager.disableLighting();
GlStateManager.disableFog();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
int l = this.top + 4 - (int) this.amountScrolled;
if (this.hasListHeader) {
this.drawListHeader(k, l, tessellator);
}
RenderUtils.makeScissorBox(left, top, right, bottom);
GL11.glEnable(GL11.GL_SCISSOR_TEST);
this.drawSelectionBox(k, l + 2, mouseXIn, mouseYIn + 2);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GlStateManager.disableDepth();
int i1 = 4;
// ClientCode
ScaledResolution scaledResolution = new ScaledResolution(mc);
Gui.drawRect(0, 0, scaledResolution.getScaledWidth(), this.top, Integer.MIN_VALUE);
Gui.drawRect(0, this.bottom, scaledResolution.getScaledWidth(), this.height, Integer.MIN_VALUE);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1);
GlStateManager.disableAlpha();
GlStateManager.shadeModel(7425);
GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(this.left, this.top + i1, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 0).endVertex();
worldrenderer.pos(this.right, this.top + i1, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 0).endVertex();
worldrenderer.pos(this.right, this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(this.left, this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
tessellator.draw();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(this.left, this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(this.right, this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(this.right, this.bottom - i1, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 0).endVertex();
worldrenderer.pos(this.left, this.bottom - i1, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 0).endVertex();
tessellator.draw();
int j1 = this.func_148135_f();
if (j1 > 0) {
int k1 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight();
k1 = MathHelper.clamp_int(k1, 32, this.bottom - this.top - 8);
int l1 = (int) this.amountScrolled * (this.bottom - this.top - k1) / j1 + this.top;
if (l1 < this.top) {
l1 = this.top;
}
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(i, this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(j, this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(j, this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(i, this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
tessellator.draw();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(i, l1 + k1, 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex();
worldrenderer.pos(j, l1 + k1, 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex();
worldrenderer.pos(j, l1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex();
worldrenderer.pos(i, l1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex();
tessellator.draw();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(i, l1 + k1 - 1, 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex();
worldrenderer.pos(j - 1, l1 + k1 - 1, 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex();
worldrenderer.pos(j - 1, l1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex();
worldrenderer.pos(i, l1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex();
tessellator.draw();
}
this.func_148142_b(mouseXIn, mouseYIn);
GlStateManager.enableTexture2D();
GlStateManager.shadeModel(7424);
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
}
}
/**
* @author CCBlueX
*/
@Overwrite
protected int getScrollBarX() {
return this.width - 5;
}
@Override
public void setEnableScissor(boolean enableScissor) {
this.enableScissor = enableScissor;
}
/**
* @author CCBlueX (superblaubeere27)
*/
@Overwrite
public int getListWidth() {
return this.listWidth;
}
@Override
public void setListWidth(int listWidth) {
this.listWidth = listWidth;
}
} | 7,845 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiMultiplayer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiMultiplayer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import de.enzaxd.viaforge.ViaForge;
//import de.enzaxd.viaforge.gui.GuiProtocolSelector;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.ui.elements.ToolDropdown;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.fml.client.config.GuiSlider;
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;
import java.util.Arrays;
@Mixin(GuiMultiplayer.class)
public abstract class MixinGuiMultiplayer extends MixinGuiScreen {
private GuiButton toolButton;
private GuiSlider viaSlider;
@Inject(method = "initGui", at = @At("RETURN"))
private void initGui(CallbackInfo callbackInfo) {
buttonList.add(toolButton = new GuiButton(997, 5, 8, 138, 20, "Tools"));
buttonList.add(viaSlider = new GuiSlider(1337, width - 104, 8, 98, 20, "Version: ", "", 0, ProtocolCollection.values().length - 1, ProtocolCollection.values().length - 1 - getProtocolIndex(ViaForge.getInstance().getVersion()), false, true,
guiSlider -> {
ViaForge.getInstance().setVersion(ProtocolCollection.values()[ProtocolCollection.values().length - 1 - guiSlider.getValueInt()].getVersion().getVersion());
this.updatePortalText();
}));
this.updatePortalText();
}
private void updatePortalText() {
if (this.viaSlider == null)
return;
this.viaSlider.displayString = "Version: " + ProtocolCollection.getProtocolById(ViaForge.getInstance().getVersion()).getName();
}
private int getProtocolIndex(int id) {
for (int i = 0; i < ProtocolCollection.values().length; i++)
if (ProtocolCollection.values()[i].getVersion().getVersion() == id)
return i;
return -1;
}
@Inject(method = "drawScreen", at = @At("TAIL"))
private void injectToolDraw(int mouseX, int mouseY, float partialTicks, CallbackInfo callbackInfo) {
ToolDropdown.handleDraw(toolButton);
}
@Inject(method = "mouseClicked", at = @At("HEAD"), cancellable = true)
private void injectToolClick(int mouseX, int mouseY, int mouseButton, CallbackInfo callbackInfo) {
if (mouseButton == 0)
if (ToolDropdown.handleClick(mouseX, mouseY, toolButton))
callbackInfo.cancel();
}
@Inject(method = "actionPerformed", at = @At("HEAD"))
private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
if (button.id == 997)
ToolDropdown.toggleState();
}
} | 3,153 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiDownloadTerrain.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiDownloadTerrain.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.utils.SessionUtils;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDownloadTerrain;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.resources.I18n;
import net.minecraft.realms.RealmsBridge;
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(GuiDownloadTerrain.class)
public abstract class MixinGuiDownloadTerrain extends MixinGuiScreen {
@Inject(method = "initGui", at = @At(value = "RETURN"))
private void injectDisconnectButton(CallbackInfo ci) {
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel")));
}
@Override
protected void injectedActionPerformed(GuiButton button) {
if (button.id == 0) {
boolean flag = this.mc.isIntegratedServerRunning();
boolean flag1 = this.mc.isConnectedToRealms();
button.enabled = false;
this.mc.theWorld.sendQuittingDisconnectingPacket();
this.mc.loadWorld(null);
if (flag) {
this.mc.displayGuiScreen(new GuiMainMenu());
} else if (flag1) {
RealmsBridge realmsbridge = new RealmsBridge();
realmsbridge.switchToRealms(new GuiMainMenu());
} else {
this.mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu()));
}
}
}
}
| 1,894 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinGuiButton.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/gui/MixinGuiButton.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer;
import net.ccbluex.liquidbounce.ui.font.Fonts;
import net.ccbluex.liquidbounce.utils.AnimationUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.MathHelper;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.awt.*;
import org.lwjgl.opengl.GL11;
@Mixin(GuiButton.class)
public abstract class MixinGuiButton extends Gui {
@Shadow
public boolean visible;
@Shadow
public int xPosition;
@Shadow
public int yPosition;
@Shadow
public int width;
@Shadow
public int height;
@Shadow
protected boolean hovered;
@Shadow
public boolean enabled;
@Shadow
protected abstract void mouseDragged(Minecraft mc, int mouseX, int mouseY);
@Shadow
protected abstract int getHoverState(boolean mouseOver);
@Shadow
public String displayString;
@Shadow
@Final
protected static ResourceLocation buttonTextures;
private float bright = 0F;
private float moveX = 0F;
private float cut;
private float alpha;
/**
* @author CCBlueX
*/
@Overwrite
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (visible) {
final FontRenderer fontRenderer =
mc.getLanguageManager().isCurrentLocaleUnicode() ? mc.fontRendererObj : Fonts.font40;
hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition &&
mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
final int delta = RenderUtils.deltaTime;
final float speedDelta = 0.01F * delta;
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if (hud == null) return;
if (enabled && hovered) {
// LiquidBounce
cut += 0.05F * delta;
if (cut >= 4) cut = 4;
alpha += 0.3F * delta;
if (alpha >= 210) alpha = 210;
// LiquidBounce+
moveX = AnimationUtils.animate(this.width - 2.4F, moveX, speedDelta);
} else {
// LiquidBounce
cut -= 0.05F * delta;
if (cut <= 0) cut = 0;
alpha -= 0.3F * delta;
if (alpha <= 120) alpha = 120;
// LiquidBounce+
moveX = AnimationUtils.animate(0F, moveX, speedDelta);
}
float roundCorner = (float) Math.max(0F, 2.4F + moveX - (this.width - 2.4F));
switch (hud.getGuiButtonStyle().get().toLowerCase()) {
case "minecraft":
mc.getTextureManager().bindTexture(buttonTextures);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int i = this.getHoverState(this.hovered);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.blendFunc(770, 771);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
if (!this.enabled)
{
j = 10526880;
}
else if (this.hovered)
{
j = 16777120;
}
this.drawCenteredString(mc.fontRendererObj, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j);
break;
case "liquidbounce":
Gui.drawRect(this.xPosition + (int) this.cut, this.yPosition,
this.xPosition + this.width - (int) this.cut, this.yPosition + this.height,
this.enabled ? new Color(0F, 0F, 0F, this.alpha / 255F).getRGB() :
new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB());
break;
case "rounded":
RenderUtils.originalRoundedRect(this.xPosition, this.yPosition,
this.xPosition + this.width, this.yPosition + this.height, 2F,
this.enabled ? new Color(0F, 0F, 0F, this.alpha / 255F).getRGB() :
new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB());
break;
case "liquidbounce+":
RenderUtils.drawRoundedRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 2.4F, new Color(0, 0, 0, 150).getRGB());
RenderUtils.customRounded(this.xPosition, this.yPosition, this.xPosition + 2.4F + moveX, this.yPosition + this.height, 2.4F, roundCorner, roundCorner, 2.4F, (this.enabled ? new Color(0, 111, 255) : new Color(71, 71, 71)).getRGB());
break;
}
if (hud.getGuiButtonStyle().get().equalsIgnoreCase("minecraft")) return;
mc.getTextureManager().bindTexture(buttonTextures);
mouseDragged(mc, mouseX, mouseY);
AWTFontRenderer.Companion.setAssumeNonVolatile(true);
fontRenderer.drawStringWithShadow(displayString,
(float) ((this.xPosition + this.width / 2) -
fontRenderer.getStringWidth(displayString) / 2),
this.yPosition + (this.height - 5) / 2F - 2, 14737632);
AWTFontRenderer.Companion.setAssumeNonVolatile(false);
GlStateManager.resetColor();
}
}
} | 6,441 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntity.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntity.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.StrafeEvent;
import net.ccbluex.liquidbounce.features.module.modules.combat.HitBox;
//import net.ccbluex.liquidbounce.features.module.modules.exploit.NoPitchLimit;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityDispatcher;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Random;
import java.util.UUID;
@Mixin(Entity.class)
public abstract class MixinEntity {
@Shadow
public double posX;
@Shadow
public double posY;
@Shadow
public double posZ;
@Shadow
public abstract boolean isSprinting();
@Shadow
public float rotationPitch;
@Shadow
public float rotationYaw;
@Shadow
public abstract AxisAlignedBB getEntityBoundingBox();
@Shadow
public abstract float getDistanceToEntity(Entity entityIn);
@Shadow
public Entity ridingEntity;
@Shadow
public double motionX;
@Shadow
public double motionY;
@Shadow
public double motionZ;
@Shadow
public boolean onGround;
@Shadow
public boolean isAirBorne;
@Shadow
public boolean noClip;
@Shadow
public World worldObj;
@Shadow
public void moveEntity(double x, double y, double z) {
}
@Shadow
public boolean isInWeb;
@Shadow
public float stepHeight;
@Shadow
public boolean isCollidedHorizontally;
@Shadow
public boolean isCollidedVertically;
@Shadow
public boolean isCollided;
@Shadow
public float distanceWalkedModified;
@Shadow
public float distanceWalkedOnStepModified;
@Shadow
public abstract boolean isInWater();
@Shadow
protected Random rand;
@Shadow
public int fireResistance;
@Shadow
protected boolean inPortal;
@Shadow
public int timeUntilPortal;
@Shadow
public float width;
@Shadow
public abstract boolean isRiding();
@Shadow
public abstract void setFire(int seconds);
@Shadow
protected abstract void dealFireDamage(int amount);
@Shadow
public abstract boolean isWet();
@Shadow
public abstract void addEntityCrashInfo(CrashReportCategory category);
@Shadow
protected abstract void doBlockCollisions();
@Shadow
protected abstract void playStepSound(BlockPos pos, Block blockIn);
@Shadow
public abstract void setEntityBoundingBox(AxisAlignedBB bb);
@Shadow
private int nextStepDistance;
@Shadow
private int fire;
@Shadow
public float prevRotationPitch;
@Shadow
public float prevRotationYaw;
@Shadow
protected abstract Vec3 getVectorForRotation(float pitch, float yaw);
@Shadow
public abstract UUID getUniqueID();
@Shadow
public abstract boolean isSneaking();
@Shadow
public abstract boolean isInsideOfMaterial(Material materialIn);
@Shadow(remap = false) private CapabilityDispatcher capabilities;
public int getNextStepDistance() {
return nextStepDistance;
}
public void setNextStepDistance(int nextStepDistance) {
this.nextStepDistance = nextStepDistance;
}
public int getFire() {
return fire;
}
@Inject(method = "getCollisionBorderSize", at = @At("HEAD"), cancellable = true)
private void getCollisionBorderSize(final CallbackInfoReturnable<Float> callbackInfoReturnable) {
final HitBox hitBox = LiquidBounce.moduleManager.getModule(HitBox.class);
if (hitBox.getState())
callbackInfoReturnable.setReturnValue(0.1F + hitBox.getSizeValue().get());
}
/*
@Inject(method = "setAngles", at = @At("HEAD"), cancellable = true)
private void setAngles(final float yaw, final float pitch, final CallbackInfo callbackInfo) {
if (LiquidBounce.moduleManager.getModule(NoPitchLimit.class).getState()) {
callbackInfo.cancel();
float f = this.rotationPitch;
float f1 = this.rotationYaw;
this.rotationYaw = (float) ((double) this.rotationYaw + (double) yaw * 0.15D);
this.rotationPitch = (float) ((double) this.rotationPitch - (double) pitch * 0.15D);
this.prevRotationPitch += this.rotationPitch - f;
this.prevRotationYaw += this.rotationYaw - f1;
}
}
*/
@Inject(method = "moveFlying", at = @At("HEAD"), cancellable = true)
private void handleRotations(float strafe, float forward, float friction, final CallbackInfo callbackInfo) {
if ((Entity) (Object) this != Minecraft.getMinecraft().thePlayer)
return;
final StrafeEvent strafeEvent = new StrafeEvent(strafe, forward, friction);
LiquidBounce.eventManager.callEvent(strafeEvent);
if (strafeEvent.isCancelled())
callbackInfo.cancel();
}
@Redirect(method = "getBrightnessForRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isBlockLoaded(Lnet/minecraft/util/BlockPos;)Z"))
public boolean alwaysReturnTrue(World world, BlockPos pos) {
return true;
}
@Inject(method = "spawnRunningParticles", at = @At("HEAD"), cancellable = true)
private void checkGroundState(CallbackInfo ci) {
if (!this.onGround) ci.cancel();
}
/**
* @author asbyth
* @reason Faster capability check
*/
@Overwrite(remap = false)
public boolean hasCapability(Capability<?> capability, EnumFacing direction) {
return this.capabilities != null && this.capabilities.hasCapability(capability, direction);
}
} | 6,643 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntityLivingBase.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityLivingBase.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import de.enzaxd.viaforge.ViaForge;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.JumpEvent;
import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura;
import net.ccbluex.liquidbounce.features.module.modules.misc.Patcher;
import net.ccbluex.liquidbounce.features.module.modules.movement.AirJump;
import net.ccbluex.liquidbounce.features.module.modules.movement.LiquidWalk;
import net.ccbluex.liquidbounce.features.module.modules.movement.NoJumpDelay;
import net.ccbluex.liquidbounce.features.module.modules.movement.Sprint;
import net.ccbluex.liquidbounce.features.module.modules.movement.TargetStrafe;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.ccbluex.liquidbounce.features.module.modules.render.AntiBlind;
import net.ccbluex.liquidbounce.utils.MovementUtils;
import net.ccbluex.liquidbounce.utils.RotationUtils;
import net.minecraft.block.Block;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.server.S0BPacketAnimation;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldServer;
import java.util.Iterator;
import java.util.Map;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(EntityLivingBase.class)
public abstract class MixinEntityLivingBase extends MixinEntity {
@Shadow
protected abstract float getJumpUpwardsMotion();
@Shadow
public abstract PotionEffect getActivePotionEffect(Potion potionIn);
@Shadow
public abstract boolean isPotionActive(Potion potionIn);
@Shadow
private int jumpTicks;
@Shadow
protected boolean isJumping;
@Shadow
public void onLivingUpdate() {
}
@Shadow
protected abstract void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos);
@Shadow
public abstract float getHealth();
@Shadow
public abstract ItemStack getHeldItem();
@Shadow
protected abstract void updateAITick();
@Shadow
public int swingProgressInt;
@Shadow
public boolean isSwingInProgress;
@Shadow
public float swingProgress;
@Inject(method = "updatePotionEffects", at = @At(value = "INVOKE", target = "Lnet/minecraft/potion/PotionEffect;onUpdate(Lnet/minecraft/entity/EntityLivingBase;)Z"),
locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true)
private void checkPotionEffect(CallbackInfo ci, Iterator<Integer> iterator, Integer integer, PotionEffect potioneffect) {
if (potioneffect == null)
ci.cancel();
}
/**
* @author CCBlueX
*/
@Overwrite
protected void jump() {
final JumpEvent jumpEvent = new JumpEvent(this.getJumpUpwardsMotion());
LiquidBounce.eventManager.callEvent(jumpEvent);
if (jumpEvent.isCancelled())
return;
this.motionY = jumpEvent.getMotion();
if (this.isPotionActive(Potion.jump))
this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
if (this.isSprinting()) {
final KillAura auraMod = LiquidBounce.moduleManager.getModule(KillAura.class);
final Sprint sprintMod = LiquidBounce.moduleManager.getModule(Sprint.class);
final TargetStrafe tsMod = LiquidBounce.moduleManager.getModule(TargetStrafe.class);
float yaw = this.rotationYaw;
if (tsMod.getCanStrafe())
yaw = tsMod.getMovingYaw();
else if (Patcher.jumpPatch.get())
if (auraMod.getState() && auraMod.getRotationStrafeValue().get().equalsIgnoreCase("strict") && auraMod.getTarget() != null)
yaw = RotationUtils.targetRotation != null ? RotationUtils.targetRotation.getYaw() : (RotationUtils.serverRotation != null ? RotationUtils.serverRotation.getYaw() : yaw);
else if (sprintMod.getState() && sprintMod.getAllDirectionsValue().get() && sprintMod.getMoveDirPatchValue().get())
yaw = MovementUtils.getRawDirection();
float f = yaw * 0.017453292F;
this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
}
this.isAirBorne = true;
}
@Inject(method = "onLivingUpdate", at = @At("HEAD"))
private void headLiving(CallbackInfo callbackInfo) {
if (LiquidBounce.moduleManager.getModule(NoJumpDelay.class).getState())
jumpTicks = 0;
}
@ModifyConstant(method = "onLivingUpdate", constant = @Constant(doubleValue = 0.005D))
private double refactor1_9MovementThreshold(double constant) {
if (ViaForge.getInstance().getVersion() <= 47)
return 0.005D;
return 0.003D;
}
@Inject(method = "onLivingUpdate", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/EntityLivingBase;isJumping:Z", ordinal = 1))
private void onJumpSection(CallbackInfo callbackInfo) {
if (LiquidBounce.moduleManager.getModule(AirJump.class).getState() && isJumping && this.jumpTicks == 0) {
this.jump();
this.jumpTicks = 10;
}
final LiquidWalk liquidWalk = LiquidBounce.moduleManager.getModule(LiquidWalk.class);
if (liquidWalk.getState() && !isJumping && !isSneaking() && isInWater() &&
liquidWalk.modeValue.get().equalsIgnoreCase("Swim")) {
this.updateAITick();
}
}
@Inject(method = "getLook", at = @At("HEAD"), cancellable = true)
private void getLook(CallbackInfoReturnable<Vec3> callbackInfoReturnable) {
if (((EntityLivingBase) (Object) this) instanceof EntityPlayerSP)
callbackInfoReturnable.setReturnValue(getVectorForRotation(this.rotationPitch, this.rotationYaw));
}
@Inject(method = "isPotionActive(Lnet/minecraft/potion/Potion;)Z", at = @At("HEAD"), cancellable = true)
private void isPotionActive(Potion p_isPotionActive_1_, final CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
final AntiBlind antiBlind = LiquidBounce.moduleManager.getModule(AntiBlind.class);
if ((p_isPotionActive_1_ == Potion.confusion || p_isPotionActive_1_ == Potion.blindness) && antiBlind.getState() && antiBlind.getConfusionEffect().get())
callbackInfoReturnable.setReturnValue(false);
}
//visionfx sucks
@Overwrite
private int getArmSwingAnimationEnd() {
int speed = LiquidBounce.moduleManager.getModule(Animations.class).getState() ? 2 + (20 - Animations.SpeedSwing.get()) : 6;
return this.isPotionActive(Potion.digSpeed) ? speed - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? speed + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : speed);
}
}
| 7,866 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinAbstractClientPlayer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinAbstractClientPlayer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.misc.NameProtect;
import net.ccbluex.liquidbounce.features.module.modules.render.NoFOV;
import net.ccbluex.liquidbounce.features.module.modules.render.Cape;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.resources.DefaultPlayerSkin;
import net.minecraft.init.Items;
import net.minecraft.util.ResourceLocation;
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 java.util.Objects;
@Mixin(AbstractClientPlayer.class)
public abstract class MixinAbstractClientPlayer extends MixinEntityPlayer {
//private CapeInfo capeInfo;
@Inject(method = "getLocationCape", at = @At("HEAD"), cancellable = true)
private void getCape(CallbackInfoReturnable<ResourceLocation> callbackInfoReturnable) {
final Cape capeMod = LiquidBounce.moduleManager.getModule(Cape.class);
if (capeMod.getState() && Objects.equals(getGameProfile().getName(), Minecraft.getMinecraft().thePlayer.getGameProfile().getName())) {
callbackInfoReturnable.setReturnValue(capeMod.getCapeLocation(capeMod.getStyleValue().get()));
}
}
@Inject(method = "getFovModifier", at = @At("HEAD"), cancellable = true)
private void getFovModifier(CallbackInfoReturnable<Float> callbackInfoReturnable) {
final NoFOV fovModule = LiquidBounce.moduleManager.getModule(NoFOV.class);
if(fovModule.getState()) {
float newFOV = fovModule.getFovValue().get();
if(!this.isUsingItem()) {
callbackInfoReturnable.setReturnValue(newFOV);
return;
}
if(this.getItemInUse().getItem() != Items.bow) {
callbackInfoReturnable.setReturnValue(newFOV);
return;
}
int i = this.getItemInUseDuration();
float f1 = (float) i / 20.0f;
f1 = f1 > 1.0f ? 1.0f : f1 * f1;
newFOV *= 1.0f - f1 * 0.15f;
callbackInfoReturnable.setReturnValue(newFOV);
}
}
@Inject(method = "getLocationSkin()Lnet/minecraft/util/ResourceLocation;", at = @At("HEAD"), cancellable = true)
private void getSkin(CallbackInfoReturnable<ResourceLocation> callbackInfoReturnable) {
final NameProtect nameProtect = LiquidBounce.moduleManager.getModule(NameProtect.class);
if(nameProtect.getState() && nameProtect.skinProtectValue.get()) {
if (!nameProtect.allPlayersValue.get() && !Objects.equals(getGameProfile().getName(), Minecraft.getMinecraft().thePlayer.getGameProfile().getName()))
return;
callbackInfoReturnable.setReturnValue((nameProtect.customSkinValue.get() && nameProtect.skinImage != null) ? nameProtect.skinImage : DefaultPlayerSkin.getDefaultSkin(getUniqueID()));
}
}
}
| 3,336 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntityXPOrb.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityXPOrb.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(EntityXPOrb.class)
public class MixinEntityXPOrb {
@Redirect(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;getEyeHeight()F"))
private float lowerHeight(EntityPlayer entityPlayer) {
return (float) (entityPlayer.getEyeHeight() / 2.0D);
}
}
| 815 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinPlayerControllerMP.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinPlayerControllerMP.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.AttackEvent;
import net.ccbluex.liquidbounce.event.ClickWindowEvent;
import net.ccbluex.liquidbounce.features.module.modules.exploit.AbortBreaking;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerControllerMP.class)
public class MixinPlayerControllerMP {
@Inject(method = "attackEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/PlayerControllerMP;syncCurrentPlayItem()V"))
private void attackEntity(EntityPlayer entityPlayer, Entity targetEntity, CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new AttackEvent(targetEntity));
}
@Inject(method = "getIsHittingBlock", at = @At("HEAD"), cancellable = true)
private void getIsHittingBlock(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
if (LiquidBounce.moduleManager.getModule(AbortBreaking.class).getState())
callbackInfoReturnable.setReturnValue(false);
}
@Inject(method = "windowClick", at = @At("HEAD"), cancellable = true)
private void windowClick(int windowId, int slotId, int mouseButtonClicked, int mode, EntityPlayer playerIn, CallbackInfoReturnable<ItemStack> callbackInfo) {
final ClickWindowEvent event = new ClickWindowEvent(windowId, slotId, mouseButtonClicked, mode);
LiquidBounce.eventManager.callEvent(event);
if (event.isCancelled())
callbackInfo.cancel();
}
} | 2,164 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntityPlayerSP.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityPlayerSP.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import de.enzaxd.viaforge.ViaForge;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.*;
import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura;
import net.ccbluex.liquidbounce.features.module.modules.exploit.AntiHunger;
import net.ccbluex.liquidbounce.features.module.modules.exploit.PortalMenu;
import net.ccbluex.liquidbounce.features.module.modules.misc.AntiDesync;
import net.ccbluex.liquidbounce.features.module.modules.movement.InvMove;
import net.ccbluex.liquidbounce.features.module.modules.movement.NoSlow;
import net.ccbluex.liquidbounce.features.module.modules.movement.Fly;
import net.ccbluex.liquidbounce.features.module.modules.movement.LongJump;
import net.ccbluex.liquidbounce.features.module.modules.movement.Sneak;
import net.ccbluex.liquidbounce.features.module.modules.movement.Sprint;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.ccbluex.liquidbounce.features.module.modules.world.Scaffold;
//import net.ccbluex.liquidbounce.features.module.modules.world.Tower;
import net.ccbluex.liquidbounce.utils.MovementUtils;
import net.ccbluex.liquidbounce.utils.Rotation;
import net.ccbluex.liquidbounce.utils.RotationUtils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockWall;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemSword;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C0APacketAnimation;
import net.minecraft.network.play.client.C0BPacketEntityAction;
import net.minecraft.potion.Potion;
import net.minecraft.util.*;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.List;
@Mixin(EntityPlayerSP.class)
public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer {
@Shadow
public boolean serverSprintState;
@Shadow
public abstract void playSound(String name, float volume, float pitch);
@Shadow
public int sprintingTicksLeft;
@Shadow
protected int sprintToggleTimer;
@Shadow
public float timeInPortal;
@Shadow
public float prevTimeInPortal;
@Shadow
protected Minecraft mc;
@Shadow
public MovementInput movementInput;
@Shadow
public abstract void setSprinting(boolean sprinting);
@Shadow
protected abstract boolean pushOutOfBlocks(double x, double y, double z);
@Shadow
public abstract void sendPlayerAbilities();
@Shadow
public float horseJumpPower;
@Shadow
public int horseJumpPowerCounter;
@Shadow
protected abstract void sendHorseJump();
@Shadow
public abstract boolean isRidingHorse();
@Shadow
@Final
public NetHandlerPlayClient sendQueue;
@Shadow
private boolean serverSneakState;
@Shadow
public abstract boolean isSneaking();
/**
* @author liuli
*/
@Overwrite
protected boolean isCurrentViewEntity() {
return (mc.getRenderViewEntity()!=null && mc.getRenderViewEntity().equals(this)) || (LiquidBounce.moduleManager != null && LiquidBounce.moduleManager.getModule(Fly.class).getState());
}
@Shadow
private double lastReportedPosX;
@Shadow
private int positionUpdateTicks;
@Shadow
private double lastReportedPosY;
@Shadow
private double lastReportedPosZ;
@Shadow
private float lastReportedYaw;
@Shadow
private float lastReportedPitch;
@Unique
private boolean lastOnGround;
/**
* @author CCBlueX
*/
@Overwrite
public void onUpdateWalkingPlayer() {
try {
MotionEvent event = new MotionEvent(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround);
LiquidBounce.eventManager.callEvent(event);
final InvMove inventoryMove = LiquidBounce.moduleManager.getModule(InvMove.class);
final Sneak sneak = LiquidBounce.moduleManager.getModule(Sneak.class);
final boolean fakeSprint = (inventoryMove.getState() && inventoryMove.isAACAP()) || LiquidBounce.moduleManager.getModule(AntiHunger.class).getState() || (sneak.getState() && (!MovementUtils.isMoving() || !sneak.stopMoveValue.get()) && sneak.modeValue.get().equalsIgnoreCase("MineSecure"));
ActionEvent actionEvent = new ActionEvent(this.isSprinting() && !fakeSprint, this.isSneaking());
boolean sprinting = actionEvent.getSprinting();
boolean sneaking = actionEvent.getSneaking();
if (sprinting != this.serverSprintState) {
if (sprinting)
this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.START_SPRINTING));
else
this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.STOP_SPRINTING));
this.serverSprintState = sprinting;
}
if (sneaking != this.serverSneakState && (!sneak.getState() || sneak.modeValue.get().equalsIgnoreCase("Legit"))) {
if (sneaking)
this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.START_SNEAKING));
else
this.sendQueue.addToSendQueue(new C0BPacketEntityAction((EntityPlayerSP) (Object) this, C0BPacketEntityAction.Action.STOP_SNEAKING));
this.serverSneakState = sneaking;
}
if (this.isCurrentViewEntity()) {
float yaw = event.getYaw();
float pitch = event.getPitch();
float lastReportedYaw = RotationUtils.serverRotation.getYaw();
float lastReportedPitch = RotationUtils.serverRotation.getPitch();
if (RotationUtils.targetRotation != null) {
yaw = RotationUtils.targetRotation.getYaw();
pitch = RotationUtils.targetRotation.getPitch();
}
double xDiff = event.getX() - this.lastReportedPosX;
double yDiff = event.getY() - this.lastReportedPosY;
double zDiff = event.getZ() - this.lastReportedPosZ;
double yawDiff = (double) (yaw - lastReportedYaw);
double pitchDiff = (double) (pitch - lastReportedPitch);
boolean moved = xDiff * xDiff + yDiff * yDiff + zDiff * zDiff > (LiquidBounce.moduleManager.getModule(AntiDesync.class).getState() ? 0D : 9.0E-4D) || this.positionUpdateTicks >= 20;
boolean rotated = yawDiff != 0.0D || pitchDiff != 0.0D;
if (this.ridingEntity == null) {
if (moved && rotated) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(event.getX(), event.getY(), event.getZ(), yaw, pitch, event.getOnGround()));
} else if (moved) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(event.getX(), event.getY(), event.getZ(), event.getOnGround()));
} else if (rotated) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, event.getOnGround()));
} else {
this.sendQueue.addToSendQueue(new C03PacketPlayer(event.getOnGround()));
}
} else {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, yaw, pitch, event.getOnGround()));
moved = false;
}
++this.positionUpdateTicks;
if (moved) {
this.lastReportedPosX = event.getX();
this.lastReportedPosY = event.getY();
this.lastReportedPosZ = event.getZ();
this.positionUpdateTicks = 0;
}
if (rotated) {
this.lastReportedYaw = yaw;
this.lastReportedPitch = pitch;
}
}
if (this.isCurrentViewEntity())
lastOnGround = event.getOnGround();
event.setEventState(EventState.POST);
LiquidBounce.eventManager.callEvent(event);
} catch (final Exception e) {
e.printStackTrace();
}
}
@Inject(method = "pushOutOfBlocks", at = @At("HEAD"), cancellable = true)
private void onPushOutOfBlocks(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
PushOutEvent event = new PushOutEvent();
if (this.noClip) event.cancelEvent();
LiquidBounce.eventManager.callEvent(event);
if (event.isCancelled())
callbackInfoReturnable.setReturnValue(false);
}
/**
* @author CCBlueX
*/
@Overwrite
public void onLivingUpdate() {
LiquidBounce.eventManager.callEvent(new UpdateEvent());
if (this.sprintingTicksLeft > 0) {
--this.sprintingTicksLeft;
if (this.sprintingTicksLeft == 0) {
this.setSprinting(false);
}
}
if (this.sprintToggleTimer > 0) {
--this.sprintToggleTimer;
}
this.prevTimeInPortal = this.timeInPortal;
if (this.inPortal) {
if (this.mc.currentScreen != null && !this.mc.currentScreen.doesGuiPauseGame()
&& !LiquidBounce.moduleManager.getModule(PortalMenu.class).getState()) {
this.mc.displayGuiScreen(null);
}
if (this.timeInPortal == 0.0F) {
this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F));
}
this.timeInPortal += 0.0125F;
if (this.timeInPortal >= 1.0F) {
this.timeInPortal = 1.0F;
}
this.inPortal = false;
} else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) {
this.timeInPortal += 0.006666667F;
if (this.timeInPortal > 1.0F) {
this.timeInPortal = 1.0F;
}
} else {
if (this.timeInPortal > 0.0F) {
this.timeInPortal -= 0.05F;
}
if (this.timeInPortal < 0.0F) {
this.timeInPortal = 0.0F;
}
}
if (this.timeUntilPortal > 0) {
--this.timeUntilPortal;
}
boolean flag = this.movementInput.jump;
boolean flag1 = this.movementInput.sneak;
float f = 0.8F;
boolean flag2 = this.movementInput.moveForward >= f;
this.movementInput.updatePlayerMoveState();
final NoSlow noSlow = LiquidBounce.moduleManager.getModule(NoSlow.class);
final KillAura killAura = LiquidBounce.moduleManager.getModule(KillAura.class);
if (getHeldItem() != null && (this.isUsingItem() || (getHeldItem().getItem() instanceof ItemSword && killAura.getBlockingStatus())) && !this.isRiding()) {
final SlowDownEvent slowDownEvent = new SlowDownEvent(0.2F, 0.2F);
LiquidBounce.eventManager.callEvent(slowDownEvent);
this.movementInput.moveStrafe *= slowDownEvent.getStrafe();
this.movementInput.moveForward *= slowDownEvent.getForward();
this.sprintToggleTimer = 0;
}
this.pushOutOfBlocks(this.posX - (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double) this.width * 0.35D);
this.pushOutOfBlocks(this.posX - (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ - (double) this.width * 0.35D);
this.pushOutOfBlocks(this.posX + (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ - (double) this.width * 0.35D);
this.pushOutOfBlocks(this.posX + (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double) this.width * 0.35D);
final Sprint sprint = LiquidBounce.moduleManager.getModule(Sprint.class);
boolean flag3 = !sprint.getFoodValue().get() || (float) this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying;
if (this.onGround && !flag1 && !flag2 && this.movementInput.moveForward >= f && !this.isSprinting() && flag3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) {
if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.isKeyDown()) {
this.sprintToggleTimer = 7;
} else {
this.setSprinting(true);
}
}
if (!this.isSprinting() && this.movementInput.moveForward >= f && flag3 && (noSlow.getState() || !this.isUsingItem()) && !this.isPotionActive(Potion.blindness) && this.mc.gameSettings.keyBindSprint.isKeyDown()) {
this.setSprinting(true);
}
final Scaffold scaffold = LiquidBounce.moduleManager.getModule(Scaffold.class);
NoSlow noslow = LiquidBounce.moduleManager.getModule(NoSlow.class);
if ((scaffold.getState() && scaffold.towerActivation() && scaffold.sprintModeValue.get().equalsIgnoreCase("Off")) || (scaffold.getState() && scaffold.sprintModeValue.get().equalsIgnoreCase("Off")) || (sprint.getState() && sprint.getCheckServerSide().get() && (onGround || !sprint.getCheckServerSideGround().get()) && !sprint.getAllDirectionsValue().get() && RotationUtils.targetRotation != null && RotationUtils.getRotationDifference(new Rotation(mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch)) > 30))
this.setSprinting(false);
if (this.isSprinting() && ((!(sprint.getState() && sprint.getAllDirectionsValue().get()) && this.movementInput.moveForward < f) || this.isCollidedHorizontally || !flag3)) {
this.setSprinting(false);
}
if (this.capabilities.allowFlying) {
if (this.mc.playerController.isSpectatorMode()) {
if (!this.capabilities.isFlying) {
this.capabilities.isFlying = true;
this.sendPlayerAbilities();
}
} else if (!flag && this.movementInput.jump) {
if (this.flyToggleTimer == 0) {
this.flyToggleTimer = 7;
} else {
this.capabilities.isFlying = !this.capabilities.isFlying;
this.sendPlayerAbilities();
this.flyToggleTimer = 0;
}
}
}
if (this.capabilities.isFlying && this.isCurrentViewEntity()) {
if (this.movementInput.sneak) {
this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F);
}
if (this.movementInput.jump) {
this.motionY += (double) (this.capabilities.getFlySpeed() * 3.0F);
}
}
if (this.isRidingHorse()) {
if (this.horseJumpPowerCounter < 0) {
++this.horseJumpPowerCounter;
if (this.horseJumpPowerCounter == 0) {
this.horseJumpPower = 0.0F;
}
}
if (flag && !this.movementInput.jump) {
this.horseJumpPowerCounter = -10;
this.sendHorseJump();
} else if (!flag && this.movementInput.jump) {
this.horseJumpPowerCounter = 0;
this.horseJumpPower = 0.0F;
} else if (flag) {
++this.horseJumpPowerCounter;
if (this.horseJumpPowerCounter < 10) {
this.horseJumpPower = (float) this.horseJumpPowerCounter * 0.1F;
} else {
this.horseJumpPower = 0.8F + 2.0F / (float) (this.horseJumpPowerCounter - 9) * 0.1F;
}
}
} else {
this.horseJumpPower = 0.0F;
}
super.onLivingUpdate();
if (this.onGround && this.capabilities.isFlying && !this.mc.playerController.isSpectatorMode()) {
this.capabilities.isFlying = false;
this.sendPlayerAbilities();
}
}
@Override
public void moveEntity(double x, double y, double z) {
MoveEvent moveEvent = new MoveEvent(x, y, z);
LiquidBounce.eventManager.callEvent(moveEvent);
if (moveEvent.isCancelled())
return;
x = moveEvent.getX();
y = moveEvent.getY();
z = moveEvent.getZ();
if (this.noClip) {
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, y, z));
this.posX = (this.getEntityBoundingBox().minX + this.getEntityBoundingBox().maxX) / 2.0D;
this.posY = this.getEntityBoundingBox().minY;
this.posZ = (this.getEntityBoundingBox().minZ + this.getEntityBoundingBox().maxZ) / 2.0D;
} else {
this.worldObj.theProfiler.startSection("move");
double d0 = this.posX;
double d1 = this.posY;
double d2 = this.posZ;
if (this.isInWeb) {
this.isInWeb = false;
x *= 0.25D;
y *= 0.05000000074505806D;
z *= 0.25D;
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
}
double d3 = x;
double d4 = y;
double d5 = z;
boolean flag = this.onGround && this.isSneaking();
if (flag || moveEvent.isSafeWalk()) {
double d6;
for (d6 = 0.05D; x != 0.0D && this.worldObj.getCollidingBoundingBoxes((Entity) (Object) this, this.getEntityBoundingBox().offset(x, -1.0D, 0.0D)).isEmpty(); d3 = x) {
if (x < d6 && x >= -d6) {
x = 0.0D;
} else if (x > 0.0D) {
x -= d6;
} else {
x += d6;
}
}
for (; z != 0.0D && this.worldObj.getCollidingBoundingBoxes((Entity) (Object) this, this.getEntityBoundingBox().offset(0.0D, -1.0D, z)).isEmpty(); d5 = z) {
if (z < d6 && z >= -d6) {
z = 0.0D;
} else if (z > 0.0D) {
z -= d6;
} else {
z += d6;
}
}
for (; x != 0.0D && z != 0.0D && this.worldObj.getCollidingBoundingBoxes((Entity) (Object) this, this.getEntityBoundingBox().offset(x, -1.0D, z)).isEmpty(); d5 = z) {
if (x < d6 && x >= -d6) {
x = 0.0D;
} else if (x > 0.0D) {
x -= d6;
} else {
x += d6;
}
d3 = x;
if (z < d6 && z >= -d6) {
z = 0.0D;
} else if (z > 0.0D) {
z -= d6;
} else {
z += d6;
}
}
}
List<AxisAlignedBB> list1 = this.worldObj.getCollidingBoundingBoxes((Entity) (Object) this, this.getEntityBoundingBox().addCoord(x, y, z));
AxisAlignedBB axisalignedbb = this.getEntityBoundingBox();
for (AxisAlignedBB axisalignedbb1 : list1) {
y = axisalignedbb1.calculateYOffset(this.getEntityBoundingBox(), y);
}
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, y, 0.0D));
boolean flag1 = this.onGround || d4 != y && d4 < 0.0D;
for (AxisAlignedBB axisalignedbb2 : list1) {
x = axisalignedbb2.calculateXOffset(this.getEntityBoundingBox(), x);
}
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, 0.0D, 0.0D));
for (AxisAlignedBB axisalignedbb13 : list1) {
z = axisalignedbb13.calculateZOffset(this.getEntityBoundingBox(), z);
}
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, 0.0D, z));
if (this.stepHeight > 0.0F && flag1 && (d3 != x || d5 != z)) {
StepEvent stepEvent = new StepEvent(this.stepHeight);
LiquidBounce.eventManager.callEvent(stepEvent);
double d11 = x;
double d7 = y;
double d8 = z;
AxisAlignedBB axisalignedbb3 = this.getEntityBoundingBox();
this.setEntityBoundingBox(axisalignedbb);
y = stepEvent.getStepHeight();
List<AxisAlignedBB> list = this.worldObj.getCollidingBoundingBoxes((Entity) (Object) this, this.getEntityBoundingBox().addCoord(d3, y, d5));
AxisAlignedBB axisalignedbb4 = this.getEntityBoundingBox();
AxisAlignedBB axisalignedbb5 = axisalignedbb4.addCoord(d3, 0.0D, d5);
double d9 = y;
for (AxisAlignedBB axisalignedbb6 : list) {
d9 = axisalignedbb6.calculateYOffset(axisalignedbb5, d9);
}
axisalignedbb4 = axisalignedbb4.offset(0.0D, d9, 0.0D);
double d15 = d3;
for (AxisAlignedBB axisalignedbb7 : list) {
d15 = axisalignedbb7.calculateXOffset(axisalignedbb4, d15);
}
axisalignedbb4 = axisalignedbb4.offset(d15, 0.0D, 0.0D);
double d16 = d5;
for (AxisAlignedBB axisalignedbb8 : list) {
d16 = axisalignedbb8.calculateZOffset(axisalignedbb4, d16);
}
axisalignedbb4 = axisalignedbb4.offset(0.0D, 0.0D, d16);
AxisAlignedBB axisalignedbb14 = this.getEntityBoundingBox();
double d17 = y;
for (AxisAlignedBB axisalignedbb9 : list) {
d17 = axisalignedbb9.calculateYOffset(axisalignedbb14, d17);
}
axisalignedbb14 = axisalignedbb14.offset(0.0D, d17, 0.0D);
double d18 = d3;
for (AxisAlignedBB axisalignedbb10 : list) {
d18 = axisalignedbb10.calculateXOffset(axisalignedbb14, d18);
}
axisalignedbb14 = axisalignedbb14.offset(d18, 0.0D, 0.0D);
double d19 = d5;
for (AxisAlignedBB axisalignedbb11 : list) {
d19 = axisalignedbb11.calculateZOffset(axisalignedbb14, d19);
}
axisalignedbb14 = axisalignedbb14.offset(0.0D, 0.0D, d19);
double d20 = d15 * d15 + d16 * d16;
double d10 = d18 * d18 + d19 * d19;
if (d20 > d10) {
x = d15;
z = d16;
y = -d9;
this.setEntityBoundingBox(axisalignedbb4);
} else {
x = d18;
z = d19;
y = -d17;
this.setEntityBoundingBox(axisalignedbb14);
}
for (AxisAlignedBB axisalignedbb12 : list) {
y = axisalignedbb12.calculateYOffset(this.getEntityBoundingBox(), y);
}
this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, y, 0.0D));
if (d11 * d11 + d8 * d8 >= x * x + z * z) {
x = d11;
y = d7;
z = d8;
this.setEntityBoundingBox(axisalignedbb3);
} else {
LiquidBounce.eventManager.callEvent(new StepConfirmEvent());
}
}
this.worldObj.theProfiler.endSection();
this.worldObj.theProfiler.startSection("rest");
this.posX = (this.getEntityBoundingBox().minX + this.getEntityBoundingBox().maxX) / 2.0D;
this.posY = this.getEntityBoundingBox().minY;
this.posZ = (this.getEntityBoundingBox().minZ + this.getEntityBoundingBox().maxZ) / 2.0D;
this.isCollidedHorizontally = d3 != x || d5 != z;
this.isCollidedVertically = d4 != y;
this.onGround = this.isCollidedVertically && d4 < 0.0D;
this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically;
int i = MathHelper.floor_double(this.posX);
int j = MathHelper.floor_double(this.posY - 0.20000000298023224D);
int k = MathHelper.floor_double(this.posZ);
BlockPos blockpos = new BlockPos(i, j, k);
Block block1 = this.worldObj.getBlockState(blockpos).getBlock();
if (block1.getMaterial() == Material.air) {
Block block = this.worldObj.getBlockState(blockpos.down()).getBlock();
if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate) {
block1 = block;
blockpos = blockpos.down();
}
}
this.updateFallState(y, this.onGround, block1, blockpos);
if (d3 != x) {
this.motionX = 0.0D;
}
if (d5 != z) {
this.motionZ = 0.0D;
}
if (d4 != y) {
block1.onLanded(this.worldObj, (Entity) (Object) this);
}
if (this.canTriggerWalking() && !flag && this.ridingEntity == null) {
double d12 = this.posX - d0;
double d13 = this.posY - d1;
double d14 = this.posZ - d2;
if (block1 != Blocks.ladder) {
d13 = 0.0D;
}
if (block1 != null && this.onGround) {
block1.onEntityCollidedWithBlock(this.worldObj, blockpos, (Entity) (Object) this);
}
this.distanceWalkedModified = (float) ((double) this.distanceWalkedModified + (double) MathHelper.sqrt_double(d12 * d12 + d14 * d14) * 0.6D);
this.distanceWalkedOnStepModified = (float) ((double) this.distanceWalkedOnStepModified + (double) MathHelper.sqrt_double(d12 * d12 + d13 * d13 + d14 * d14) * 0.6D);
if (this.distanceWalkedOnStepModified > (float) getNextStepDistance() && block1.getMaterial() != Material.air) {
setNextStepDistance((int) this.distanceWalkedOnStepModified + 1);
if (this.isInWater()) {
float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F;
if (f > 1.0F) {
f = 1.0F;
}
this.playSound(this.getSwimSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
}
this.playStepSound(blockpos, block1);
}
}
try {
this.doBlockCollisions();
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Checking entity block collision");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being checked for collision");
this.addEntityCrashInfo(crashreportcategory);
throw new ReportedException(crashreport);
}
boolean flag2 = this.isWet();
if (this.worldObj.isFlammableWithin(this.getEntityBoundingBox().contract(0.001D, 0.001D, 0.001D))) {
this.dealFireDamage(1);
if (!flag2) {
setFire(getFire() + 1);
if (getFire() == 0) {
this.setFire(8);
}
}
} else if (getFire() <= 0) {
setFire(-this.fireResistance);
}
if (flag2 && getFire() > 0) {
this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
setFire(-this.fireResistance);
}
this.worldObj.theProfiler.endSection();
}
}
}
| 29,682 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntityPlayer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityPlayer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import com.mojang.authlib.GameProfile;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.movement.LongJump;
import net.ccbluex.liquidbounce.features.module.modules.world.Scaffold;
import net.ccbluex.liquidbounce.utils.MovementUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.item.ItemStack;
import net.minecraft.util.FoodStats;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(EntityPlayer.class)
public abstract class MixinEntityPlayer extends MixinEntityLivingBase {
@Shadow
public abstract ItemStack getHeldItem();
@Shadow
public abstract GameProfile getGameProfile();
@Shadow
protected abstract boolean canTriggerWalking();
@Shadow
protected abstract String getSwimSound();
@Shadow
public abstract FoodStats getFoodStats();
@Shadow
protected int flyToggleTimer;
@Shadow
public PlayerCapabilities capabilities;
@Shadow
public abstract int getItemInUseDuration();
@Shadow
public abstract ItemStack getItemInUse();
@Shadow
public abstract boolean isUsingItem();
@Shadow
public abstract boolean isPlayerSleeping();
} | 1,925 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntityOtherPlayerMP.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityOtherPlayerMP.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.entity;
import net.minecraft.client.entity.EntityOtherPlayerMP;
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(EntityOtherPlayerMP.class)
public class MixinEntityOtherPlayerMP {
@Inject(method = "onLivingUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityOtherPlayerMP;updateArmSwingProgress()V", shift = At.Shift.AFTER), cancellable = true)
private void removeUselessAnimations(CallbackInfo ci) {
ci.cancel();
}
}
| 884 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinWorldClient.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/world/MixinWorldClient.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.world;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.TrueSight;
import net.minecraft.client.multiplayer.WorldClient;
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.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(WorldClient.class)
public class MixinWorldClient {
@ModifyVariable(method = "doVoidFogParticles", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;randomDisplayTick(Lnet/minecraft/world/World;Lnet/minecraft/util/BlockPos;Lnet/minecraft/block/state/IBlockState;Ljava/util/Random;)V", shift = At.Shift.AFTER), ordinal = 0)
private boolean handleBarriers(final boolean flag) {
final TrueSight trueSight = LiquidBounce.moduleManager.getModule(TrueSight.class);
return flag || trueSight.getState() && trueSight.getBarriersValue().get();
}
/*
@Inject(method = "tick", at = @At("RETURN"))
public void injectWorldTick(CallbackInfo callbackInfo) {
wdl.WDLHooks.onWorldClientTick((WorldClient) (Object) this);
}
@Inject(method = "doPreChunk", at = @At("HEAD"))
public void doPreChunk(int p_73025_1_, int p_73025_2_, boolean p_73025_3_, CallbackInfo callbackInfo) {
wdl.WDLHooks.onWorldClientDoPreChunk((WorldClient) (Object) this, p_73025_1_, p_73025_2_, p_73025_3_);
}
@Inject(method = "removeEntityFromWorld", at = @At("HEAD"))
public void removeEntityFromWorld(int p_73028_1_, CallbackInfoReturnable<Entity> callbackInfo) {
wdl.WDLHooks.onWorldClientRemoveEntityFromWorld((WorldClient) (Object) this, p_73028_1_);
}
*/
}
| 2,141 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinWorld.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/world/MixinWorld.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.world;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityFallingBlock;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Final;
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.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import java.util.List;
@Mixin(World.class)
public abstract class MixinWorld {
@Shadow
public abstract IBlockState getBlockState(BlockPos pos);
@Shadow @Final public boolean isRemote;
@ModifyVariable(method = "updateEntityWithOptionalForce", at = @At("STORE"), ordinal = 1)
private boolean checkIfWorldIsRemoteBeforeForceUpdating(boolean isForced) {
return isForced && !this.isRemote;
}
@Inject(method = "getCollidingBoundingBoxes", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getEntitiesWithinAABBExcludingEntity(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/AxisAlignedBB;)Ljava/util/List;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT)
private void filterEntities(Entity entityIn, AxisAlignedBB bb, CallbackInfoReturnable<List<AxisAlignedBB>> cir, List<AxisAlignedBB> list) {
if (entityIn instanceof EntityTNTPrimed || entityIn instanceof EntityFallingBlock || entityIn instanceof EntityItem || entityIn instanceof EntityFX)
cir.setReturnValue(list);
}
}
| 2,189 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinSkinManager.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/resources/MixinSkinManager.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.resources;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.misc.NameProtect;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.SkinManager;
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 java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Mixin(SkinManager.class)
public class MixinSkinManager {
@Inject(method = "loadSkinFromCache", cancellable = true, at = @At("HEAD"))
private void injectSkinProtect(GameProfile gameProfile, CallbackInfoReturnable<Map<MinecraftProfileTexture.Type, MinecraftProfileTexture>> cir) {
if (gameProfile == null)
return;
NameProtect nameProtect = LiquidBounce.moduleManager.getModule(NameProtect.class);
if (nameProtect.getState() && nameProtect.skinProtectValue.get()) {
if (nameProtect.allPlayersValue.get() || Objects.equals(gameProfile.getId(), Minecraft.getMinecraft().getSession().getProfile().getId())) {
cir.setReturnValue(new HashMap<>());
cir.cancel();
}
}
}
}
| 1,652 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinDefaultResourcePack.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/resources/MixinDefaultResourcePack.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.resources;
import com.google.common.collect.ImmutableSet;
import java.util.Set;
import net.minecraft.client.resources.DefaultResourcePack;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(DefaultResourcePack.class)
public class MixinDefaultResourcePack {
@Shadow
public static final Set<String> defaultResourceDomains = ImmutableSet
.<String> of("minecraft", "realms");
}
| 945 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinItemStack.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/item/MixinItemStack.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.item;
import net.ccbluex.liquidbounce.injection.implementations.IItemStack;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ItemStack.class)
public class MixinItemStack implements IItemStack {
private long itemDelay;
private String cachedDisplayName;
@Inject(method = "<init>(Lnet/minecraft/item/Item;IILnet/minecraft/nbt/NBTTagCompound;)V", at = @At("RETURN"))
private void init(final CallbackInfo callbackInfo) {
this.itemDelay = System.currentTimeMillis();
}
@Override
public long getItemDelay() {
return itemDelay;
}
@Redirect(
method = "getTooltip",
at = @At(value = "INVOKE", target = "Ljava/lang/Integer;toHexString(I)Ljava/lang/String;")
)
private String fixHexColorString(int i) {
return String.format("%06X", i);
}
@Inject(method = "getDisplayName", at = @At("HEAD"), cancellable = true)
private void returnCachedDisplayName(CallbackInfoReturnable<String> cir) {
if (cachedDisplayName != null) {
cir.setReturnValue(cachedDisplayName);
}
}
@Inject(method = "getDisplayName", at = @At("RETURN"))
private void cacheDisplayName(CallbackInfoReturnable<String> cir) {
cachedDisplayName = cir.getReturnValue();
}
@Inject(method = "setStackDisplayName", at = @At("HEAD"))
private void resetCachedDisplayName(String displayName, CallbackInfoReturnable<ItemStack> cir) {
cachedDisplayName = null;
}
} | 2,062 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinItemRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/item/MixinItemRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.item;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.ccbluex.liquidbounce.features.module.modules.render.AntiBlind;
import net.ccbluex.liquidbounce.utils.timer.MSTimer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.*;
import net.minecraft.init.Items;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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(ItemRenderer.class)
public abstract class MixinItemRenderer {
float delay = 0.0F;
MSTimer rotateTimer = new MSTimer();
@Shadow
private float prevEquippedProgress;
@Shadow
private float equippedProgress;
@Shadow
@Final
private Minecraft mc;
@Shadow
protected abstract void rotateArroundXAndY(float angle, float angleY);
@Shadow
protected abstract void setLightMapFromPlayer(AbstractClientPlayer clientPlayer);
@Shadow
protected abstract void rotateWithPlayerRotations(EntityPlayerSP entityplayerspIn, float partialTicks);
@Shadow
private ItemStack itemToRender;
@Shadow
protected abstract void renderItemMap(AbstractClientPlayer clientPlayer, float pitch, float equipmentProgress, float swingProgress);
@Shadow
protected abstract void transformFirstPersonItem(float equipProgress, float swingProgress);
@Shadow
protected abstract void performDrinking(AbstractClientPlayer clientPlayer, float partialTicks);
@Shadow
protected abstract void doBlockTransformations();
@Shadow
protected abstract void doBowTransformations(float partialTicks, AbstractClientPlayer clientPlayer);
@Shadow
protected abstract void doItemUsedTransformations(float swingProgress);
@Shadow
public abstract void renderItem(EntityLivingBase entityIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform);
@Shadow
protected abstract void renderPlayerArm(AbstractClientPlayer clientPlayer, float equipProgress, float swingProgress);
private void genCustom(float p_178096_1_, float p_178096_2_) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, p_178096_1_ * -0.6F, 0.0F);
GlStateManager.rotate(25F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(p_178096_2_ * p_178096_2_ * 3.1415927F);
float var4 = MathHelper.sin(MathHelper.sqrt_float(p_178096_2_) * 3.1415927F);
GlStateManager.rotate(var3 * -15F, 0.0F, 1.0F, 0.2F);
GlStateManager.rotate(var4 * -10F, 0.2F, 0.1F, 1.0F);
GlStateManager.rotate(var4 * -30F, 1.3F, 0.1F, 0.2F);
GlStateManager.scale(0.4F, 0.4F, 0.4F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void func_178103_d(float qq) {
GlStateManager.translate(-0.5F, qq, 0.0F);
GlStateManager.rotate(30.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(60.0F, 0.0F, 1.0F, 0.0F);
}
private void func_178096_b(float p_178096_1_, float p_178096_2_) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, p_178096_1_ * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(p_178096_2_ * p_178096_2_ * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(p_178096_2_) * (float) Math.PI);
GlStateManager.rotate(var3 * -20.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var4 * -20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(var4 * -80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void test(float i, float i2) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, i * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(i2 * i2 * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(i2) * (float) Math.PI);
float var5 = MathHelper.ceiling_float_int(MathHelper.floor_double(i2) * (float) Math.PI);
GlStateManager.rotate(var3 * -20.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var4 * -20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(var5 * -80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void tap2(final float var2, final float swing) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
final float var3 = MathHelper.sin(swing * swing * 3.1415927f);
final float var4 = MathHelper.sin(MathHelper.sqrt_float(swing) * 3.1415927f);
GlStateManager.translate(0.56f, -0.42f, -0.71999997f);
GlStateManager.translate(0.1f * var4, -0.0f, -0.21999997f * var4);
GlStateManager.translate(0.0f, var2 * -0.15f, 0.0f);
GlStateManager.rotate(var3 * 45.0f, 0.0f, 1.0f, 0.0f);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void avatar(final float equipProgress, final float swingProgress) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0f, 0.0f, 0.0f);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
final float f = MathHelper.sin(swingProgress * swingProgress * 3.1415927f);
final float f2 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * 3.1415927f);
GlStateManager.rotate(f * -20.0f, 0.0f, 1.0f, 0.0f);
GlStateManager.rotate(f2 * -20.0f, 0.0f, 0.0f, 1.0f);
GlStateManager.rotate(f2 * -40.0f, 1.0f, 0.0f, 0.0f);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void swong() {
GL11.glTranslatef(-0.5F, 0.2F, 0.0F);
GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F);
}
private void tap(float tap1, float tap2) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, tap1 * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(tap2 * tap2 * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(tap2) * (float) Math.PI);
GlStateManager.rotate(var3 * -40.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var4 * 0.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(var4 * 0.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void stab(float var10, float var9) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
float var11 = MathHelper.sin(var9 * var9 * (float) Math.PI);
float var12 = MathHelper.sin(MathHelper.sqrt_float(var9) * (float) Math.PI);
GlStateManager.rotate(var11 * 20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(var12 * 0.0F, 0.0F, 0.0f, 0.0F);
GlStateManager.rotate(var12 * -10.0F, 1.0F, 0.0F, -4.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void slide(float var10, float var9) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
float var11 = MathHelper.sin(var9 * var9 * (float) Math.PI);
float var12 = MathHelper.sin(MathHelper.sqrt_float(var9) * (float) Math.PI);
GlStateManager.rotate(var11 * 0.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var12 * 0.0F, 0.0F, 0.0f, 1.0F);
GlStateManager.rotate(var12 * -40.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void slide2(float var10, float var9) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
float var11 = MathHelper.sin(var9 * var9 * (float) Math.PI);
float var12 = MathHelper.sin(MathHelper.sqrt_float(var9) * (float) Math.PI);
GlStateManager.rotate(var11 * 0.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var12 * 0.0F, 0.0F, 0.0f, 1.0F);
GlStateManager.rotate(var12 * -80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void jello(float var11, float var12) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.rotate(48.57f, 0f, 0.24f, 0.14f);
float var13 = MathHelper.sin(var12 * var12 * (float) Math.PI);
float var14 = MathHelper.sin(MathHelper.sqrt_float(var12) * (float) Math.PI);
GlStateManager.rotate(var13 * -35.0F, 0.0F, 0.0F, 0.0F);
GlStateManager.rotate(var14 * 0.0F, 0.0F, 0.0f, 0.0F);
GlStateManager.rotate(var14 * 20.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void continuity(float var11, float var10) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
float var12 = -MathHelper.sin(var10 * var10 * (float) Math.PI);
float var13 = MathHelper.cos(MathHelper.sqrt_float(var10) * (float) Math.PI);
float var14 = MathHelper.abs(MathHelper.sqrt_float(var11) * (float) Math.PI);
GlStateManager.rotate(var12 * var14 * 30.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var13 * 0.0F, 0.0F, 0.0f, 1.0F);
GlStateManager.rotate(var13 * 20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void poke(final float var5, final float var6) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
final float var7 = MathHelper.sin(var6 * var6 * 3.1415927f);
final float var8 = MathHelper.sin(MathHelper.sqrt_float(var6) * 3.1415927f);
GlStateManager.translate(0.56f, -0.42f, -0.71999997f);
GlStateManager.translate(0.1f * var8, -0.0f, -0.21999997f * var8);
GlStateManager.translate(0.0f, var5 * -0.15f, 0.0f);
GlStateManager.rotate(var7 * 0.0f, 0.0f, 1.0f, 0.0f);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void Zoom(float p_178096_1_, float p_178096_2_) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, p_178096_1_ * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(p_178096_2_ * p_178096_2_ * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(p_178096_2_) * (float) Math.PI);
GlStateManager.rotate(var3 * -20.0F, 0.0F, 0.0F, 0.0F);
GlStateManager.rotate(var4 * -20.0F, 0.0F, 0.0F, 0.0F);
GlStateManager.rotate(var4 * -20.0F, 0.0F, 0.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void strange(float lul, float lol) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
float var26 = MathHelper.sin(lol * lul * 3.1415927f);
float var27 = MathHelper.cos(MathHelper.sqrt_double(lul) * (float) Math.PI);
float var28 = MathHelper.abs(MathHelper.sqrt_float(lul) * (float) Math.PI);
GlStateManager.rotate(var26 * var27, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var28 * 15.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(var27 * 10.0f, 1.0f, 0.0f, 0.0f);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void move(final float test1, final float test2) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f);
float var30 = MathHelper.sin(test2 * MathHelper.sqrt_float(test1) * 3.1415927f);
float var31 = MathHelper.cos(MathHelper.sqrt_float(test2) * (float) Math.PI);
float var29 = -MathHelper.abs(MathHelper.sqrt_float(test1) * test2 * (float) Math.PI);
GlStateManager.rotate(var30 * var29 * -90.0f, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var29 * var31 * 5.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(var31 * 5.0f, 1.0f, 0.0f, 0.0f);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void ETB(float equipProgress, float swingProgress) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, equipProgress * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(swingProgress * swingProgress * 3.1415927F);
float var4 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * 3.1415927F);
GlStateManager.rotate(var3 * -34.0F, 0.0F, 1.0F, 0.2F);
GlStateManager.rotate(var4 * -20.7F, 0.2F, 0.1F, 1.0F);
GlStateManager.rotate(var4 * -68.6F, 1.3F, 0.1F, 0.2F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void sigmaold(float p_178096_1_, float p_178096_2_) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, p_178096_1_ * -0.6F, 0.0F);
GlStateManager.rotate(25F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(p_178096_2_ * p_178096_2_ * 3.1415927F);
float var4 = MathHelper.sin(MathHelper.sqrt_float(p_178096_2_) * 3.1415927F);
GlStateManager.rotate(var3 * -15F, 0.0F, 1.0F, 0.2F);
GlStateManager.rotate(var4 * -10F, 0.2F, 0.1F, 1.0F);
GlStateManager.rotate(var4 * -30F, 1.3F, 0.1F, 0.2F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void push(float idk, float idc) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, idk * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(idc * idc * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(idc) * (float) Math.PI);
GlStateManager.rotate(var3 * -10.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.rotate(var4 * -10.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.rotate(var4 * -10.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void push2(float idk, float idc) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, idk * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(idc * idc * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(idc) * (float) Math.PI);
GlStateManager.rotate(var3 * -10.0F, 2.0F, 2.0F, 2.0F);
GlStateManager.rotate(var4 * -10.0F, 2.0F, 2.0F, 0.0F);
GlStateManager.rotate(var4 * -10.0F, 2.0F, 2.0F, 0.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void up(float idk, float idc) {
GlStateManager.translate(0.56F, -0.52F, -0.71999997F);
GlStateManager.translate(0.0F, idk * -0.6F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float var3 = MathHelper.sin(idc * idc * (float) Math.PI);
float var4 = MathHelper.sin(MathHelper.sqrt_float(idc) * (float) Math.PI);
GlStateManager.rotate(var3 * -20.0F, 0.0F, 1.0F, 1.0F);
GlStateManager.rotate(var4 * -10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(var3 * -20.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(var4 * -10.0F, 1.0F, 0.0F, 1.0F);
GlStateManager.scale(Animations.Scale.get(), Animations.Scale.get(), Animations.Scale.get());
}
private void func_178103_d() {
GlStateManager.translate(-0.5F, 0.2F, 0.0F);
GlStateManager.rotate(30.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-80.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(60.0F, 0.0F, 1.0F, 0.0F);
}
/**
* @author CCBlueX
*/
@Overwrite
public void renderItemInFirstPerson(float partialTicks) {
float f = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTicks);
AbstractClientPlayer abstractclientplayer = this.mc.thePlayer;
float f1 = abstractclientplayer.getSwingProgress(partialTicks);
float f2 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
float f3 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
if (LiquidBounce.moduleManager.getModule(Animations.class).getState()) {
GL11.glTranslated(Animations.itemPosX.get().doubleValue(), Animations.itemPosY.get().doubleValue(), Animations.itemPosZ.get().doubleValue());
}
this.rotateArroundXAndY(f2, f3);
this.setLightMapFromPlayer(abstractclientplayer);
this.rotateWithPlayerRotations((EntityPlayerSP) abstractclientplayer, partialTicks);
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
if (LiquidBounce.moduleManager.getModule(Animations.class).getState()) {
GL11.glTranslated(Animations.itemPosX.get().doubleValue(), Animations.itemPosY.get().doubleValue(), Animations.itemPosZ.get().doubleValue());
}
if (this.itemToRender != null) {
final KillAura killAura = LiquidBounce.moduleManager.getModule(KillAura.class);
boolean canBlockEverything = LiquidBounce.moduleManager.getModule(Animations.class).getState() && Animations.blockEverything.get() && killAura.getTarget() != null
&& (itemToRender.getItem() instanceof ItemBucketMilk || itemToRender.getItem() instanceof ItemFood
|| itemToRender.getItem() instanceof ItemPotion || itemToRender.getItem() instanceof ItemAxe || itemToRender.getItem().equals(Items.stick));
if (this.itemToRender.getItem() instanceof ItemMap) {
this.renderItemMap(abstractclientplayer, f2, f, f1);
} else if (abstractclientplayer.getItemInUseCount() > 0
|| (itemToRender.getItem() instanceof ItemSword && (killAura.getBlockingStatus() || killAura.getFakeBlock()))
|| (itemToRender.getItem() instanceof ItemSword && LiquidBounce.moduleManager.getModule(Animations.class).getState()
&& Animations.fakeBlock.get() && killAura.getTarget() != null) || canBlockEverything) {
EnumAction enumaction = (killAura.getBlockingStatus() || canBlockEverything) ? EnumAction.BLOCK : this.itemToRender.getItemUseAction();
switch (enumaction) {
case NONE:
this.transformFirstPersonItem(f, 0.0F);
break;
case EAT:
case DRINK:
this.performDrinking(abstractclientplayer, partialTicks);
this.transformFirstPersonItem(f, f1);
if (LiquidBounce.moduleManager.getModule(Animations.class).getState() && Animations.RotateItems.get())
rotateItemAnim();
break;
case BLOCK:
if (LiquidBounce.moduleManager.getModule(Animations.class).getState()) {
GL11.glTranslated(Animations.blockPosX.get().doubleValue(), Animations.blockPosY.get().doubleValue(), Animations.blockPosZ.get().doubleValue());
final String z = Animations.Sword.get();
float var2 = 1.0f - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTicks);
float var4 = this.mc.thePlayer.getSwingProgress(partialTicks);
switch (z) {
case "Normal": {
this.transformFirstPersonItem(f + 0.1F, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.doBlockTransformations();
GlStateManager.translate(-0.5F, 0.2F, 0.0F);
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "1.7": {
this.transformFirstPersonItem(f, f1);
GlStateManager.translate(0, 0.3, 0);
this.doBlockTransformations();
break;
}
case "Flux": {
this.transformFirstPersonItem(f / 2, 0);
GlStateManager.rotate(-MathHelper.sin(f1 * f1 * 3.1415927F) * 40.0F / 2.0F, MathHelper.sin(f1 * f1 * 3.1415927F) / 2.0F, -0.0F, 9.0F);
GlStateManager.rotate(-MathHelper.sin(f1 * f1 * 3.1415927F) * 30.0F, 1.0F, MathHelper.sin(f1 * f1 * 3.1415927F) / 2.0F, -0.0F);
this.doBlockTransformations();
GL11.glTranslatef(-0.05F, this.mc.thePlayer.isSneaking() ? -0.2F : 0.0F, 0.1F);
break;
}
case "Slidedown": {
this.func_178096_b(0.2f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Slidedown2": {
this.slide2(0.1f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Minecraft": {
this.func_178096_b(f, Animations.mcSwordPos.get());
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Remix": {
this.genCustom(f, 0.83f);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
float f4 = MathHelper.sin(MathHelper.sqrt_float(f1) * 3.83f);
GlStateManager.translate(-0.5f, 0.2f, 0.2f);
GlStateManager.rotate(-f4 * 0.0f, 0.0f, 0.0f, 0.0f);
GlStateManager.rotate(-f4 * 43.0f, 58.0f, 23.0f, 45.0f);
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Swank": {
GL11.glTranslated((double) -0.1, (double) 0.15, (double) 0.);
this.transformFirstPersonItem(var2 / 0.15f, var4);
float cnmmm = MathHelper.sin((float) (MathHelper.sqrt_float((float) f1) * 3.1415927f));
GlStateManager.rotate((float) (cnmmm * 30.0f), (float) (2.0f), (float) -cnmmm, (float) 9.0f);
GlStateManager.rotate((float) (cnmmm * 35.0f), (float) 1.0f, (float) (-cnmmm), (float) -0.0f);
this.func_178103_d();
break;
}
case "Exhibition": {
float var9 = MathHelper.sin(MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) * 3.1415927F);
GL11.glTranslated(-0.03D, 0.23D, 0.0D);
this.transformFirstPersonItem(f / 2.5F, 0.0f);
GlStateManager.rotate(-var9 * 25.0F /1.0F, var9 / 2.0F, 1.0F, 4.0F);
GlStateManager.rotate(-var9 * 45.0F, 1.0F, var9 / 3.0F, -0.0F);
this.func_178103_d(-0.05F);
break;
}
case "Exhibition2": {
this.transformFirstPersonItem(f / 2.0F, 0.0F);
GL11.glTranslated(-0.07D, 0.58D, 0.0D);
float var9 = MathHelper.sin(MathHelper.sqrt_float(f1) * 3.1415927F);
GL11.glRotated(-var9 * 60.0F / 2.0F, -var9 / 2.0F, -0.0F, 9.0F);
GL11.glRotated(-var9 * 53.0F, 1.0F, var9 / 2.0F, -0.0F);
this.func_178103_d(-0.05F);
break;
}
case "OldExhibition": {
float var9 = MathHelper.sin(MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) * 3.1415927F);
GL11.glTranslated(-0.04D, 0.13D, 0.0D);
this.transformFirstPersonItem(f / 2.5F, 0.0f);
GlStateManager.rotate(-var9 * 40.0F / 2.0F, var9 / 2.0F, 1.0F, 4.0F);
GlStateManager.rotate(-var9 * 30.0F, 1.0F, var9 / 3.0F, -0.0F);
this.func_178103_d(0.2F);
break;
}
case "Tifality": {
float f8 = MathHelper.sin(MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) * 3.1415927F);
func_178096_b(f, 0.0F);
GL11.glTranslated(0.0D, 0.25D, 0.07D);
GL11.glRotated((-f8 * 40.0F), (f8 / 2.0F), 0.0D, 9.0D);
GL11.glRotated((-f8 * 50.0F), 0.800000011920929D, (f8 / 2.0F), 0.0D);
this.func_178103_d(0.2F);
break;
}
case "Swang": {
transformFirstPersonItem(f / 2.0F, f1);
GL11.glTranslated(0.0D, 0.25D, 0.0D);
float Swang = MathHelper.sin(MathHelper.sqrt_float(f1) * 3.1415927F);
GlStateManager.rotate(Swang * 30.0F / 2.0F, -Swang, -0.0F, 9.0F);
GlStateManager.rotate(Swang * 40.0F, 1.0F, -Swang / 2.0F, -0.0F);
doBlockTransformations();
break;
}
case "Stella": {
this.transformFirstPersonItem(-0.1F, f1);
GlStateManager.translate(-0.5F, 0.4F, -0.2F);
GlStateManager.rotate(32, 0, 1, 0);
GlStateManager.rotate(-70, 1, 0, 0);
GlStateManager.rotate(40, 0, 1, 0);
break;
}
case "Avatar": {
this.avatar(f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Tap2": {
this.tap2(0.0f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
GlStateManager.scale(2f, 2f, 2f);
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Poke": {
this.poke(0.1f, f1);
GlStateManager.scale(2.5f, 2.5f, 2.5f);
GL11.glTranslated(1.2, -0.5, 0.5);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Slide": {
this.slide(0.1f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Push": {
this.push(0.1f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Up": {
this.up(f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Shield": {
this.jello(0.0f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Akrien": {
this.func_178096_b(f1, 0.0F);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "VisionFX": {
this.continuity(0.1f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Strange": {
this.strange(f1 + 0.2f, 0.1f);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Lucky": {
this.move(-0.3f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "ETB": {
this.ETB(f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Swong": {
this.transformFirstPersonItem(f / 2.0F, 0.0F);
GlStateManager.rotate(-MathHelper.sin(MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) * 3.1415927F) * 40.0F / 2.0F, MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) / 2.0F, -0.0F, 9.0F);
GlStateManager.rotate(-MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) * 30.0F, 1.0F, MathHelper.sqrt_float(this.mc.thePlayer.getSwingProgress(partialTicks)) / 2.0F, -0.0F);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "SigmaOld": {
float var15 = MathHelper.sin(MathHelper.sqrt_float(f1) * 3.1415927f);
this.sigmaold(f * 0.5f, 0);
GlStateManager.rotate(-var15 * 55 / 2.0F, -8.0F, -0.0F, 9.0F);
GlStateManager.rotate(-var15 * 45, 1.0F, var15 / 2, -0.0F);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
GL11.glTranslated(1.2, 0.3, 0.5);
GL11.glTranslatef(-1, this.mc.thePlayer.isSneaking() ? -0.1F : -0.2F, 0.2F);
GlStateManager.scale(1.2f, 1.2f, 1.2f);
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "SmoothFloat": {
this.func_178096_b(0.0f, 0.95f);
GlStateManager.rotate(this.delay, 1.0F, 0.0F, 2.0F);
if (this.rotateTimer.hasTimePassed(1)) {
++this.delay;
this.delay = this.delay + Animations.SpeedRotate.get();
this.rotateTimer.reset();
}
if (this.delay > 360.0F) {
this.delay = 0.0F;
}
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
GlStateManager.rotate(this.delay, 0.0F, 1.0F, 0.0F);
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Rotate360": {
this.func_178096_b(0.0f, 0.95f);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
GlStateManager.rotate(this.delay, 1.0F, 0.0F, 2.0F);
if (this.rotateTimer.hasTimePassed(1)) {
++this.delay;
this.delay = this.delay + Animations.SpeedRotate.get();
this.rotateTimer.reset();
}
if (this.delay > 360.0F) {
this.delay = 0.0F;
}
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Reverse": {
this.func_178096_b(f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Zoom": {
this.Zoom(0.0f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Move": {
this.test(f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Tap": {
this.tap(f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Stab": {
this.stab(0.1f, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Push2": {
this.push2(0.1F, f1);
if (Animations.RotateItems.get())
rotateItemAnim();
this.func_178103_d();
if (Animations.RotateItems.get())
rotateItemAnim();
break;
}
case "Jello": {
this.func_178096_b(0, 0.0F);
this.func_178103_d();
int alpha = (int) Math.min(255, ((System.currentTimeMillis() % 255) > 255/2 ? (Math.abs(Math.abs(System.currentTimeMillis()) % 255 - 255)) : System.currentTimeMillis() % 255)*2);
float f5 = (f1 > 0.5 ? 1-f1 : f1);
GlStateManager.translate(0.3f, -0.0f, 0.40f);
GlStateManager.rotate(0.0f, 0.0f, 0.0f, 1.0f);
GlStateManager.translate(0, 0.5f, 0);
GlStateManager.rotate(90, 1.0f, 0.0f, -1.0f);
GlStateManager.translate(0.6f, 0.5f, 0);
GlStateManager.rotate(-90, 1.0f, 0.0f, -1.0f);
GlStateManager.rotate(-10, 1.0f, 0.0f, -1.0f);
GlStateManager.rotate((- f5) * 10.0f, 10.0f, 10.0f, -9.0f);
GlStateManager.rotate(10.0f, -1.0f, 0.0f, 0.0f);
GlStateManager.translate(0, 0, -0.5);
GlStateManager.rotate(mc.thePlayer.isSwingInProgress ? -alpha/5f : 1, 1.0f, -0.0f, 1.0f);
GlStateManager.translate(0, 0, 0.5);
break;
}
}
} else {
this.transformFirstPersonItem(f + 0.1F, f1);
this.doBlockTransformations();
GlStateManager.translate(-0.5F, 0.2F, 0.0F);
}
break;
case BOW:
this.transformFirstPersonItem(f, f1);
if (LiquidBounce.moduleManager.getModule(Animations.class).getState() && Animations.RotateItems.get())
rotateItemAnim();
this.doBowTransformations(partialTicks, abstractclientplayer);
if (LiquidBounce.moduleManager.getModule(Animations.class).getState() && Animations.RotateItems.get())
rotateItemAnim();
}
} else {
this.doItemUsedTransformations(f1);
this.transformFirstPersonItem(f, f1);
if (LiquidBounce.moduleManager.getModule(Animations.class).getState() && Animations.RotateItems.get())
rotateItemAnim();
}
this.renderItem(abstractclientplayer, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON);
} else if (!abstractclientplayer.isInvisible())
this.renderPlayerArm(abstractclientplayer, f, f1);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
RenderHelper.disableStandardItemLighting();
if (LiquidBounce.moduleManager.getModule(Animations.class).getState())
GL11.glTranslated(-Animations.itemPosX.get().doubleValue(), -Animations.itemPosY.get().doubleValue(), -Animations.itemPosZ.get().doubleValue());
}
private void rotateItemAnim() {
if (Animations.transformFirstPersonRotate.get().equalsIgnoreCase("RotateY")) {
GlStateManager.rotate(this.delay, 0.0F, 1.0F, 0.0F);
}
if (Animations.transformFirstPersonRotate.get().equalsIgnoreCase("RotateXY")) {
GlStateManager.rotate(this.delay, 1.0F, 1.0F, 0.0F);
}
if (Animations.transformFirstPersonRotate.get().equalsIgnoreCase("Custom")) {
GlStateManager.rotate(this.delay, Animations.customRotate1.get(), Animations.customRotate2.get(), Animations.customRotate3.get());
}
if (this.rotateTimer.hasTimePassed(1)) {
++this.delay;
this.delay = this.delay + Animations.SpeedRotate.get();
this.rotateTimer.reset();
}
if (this.delay > 360.0F) {
this.delay = 0.0F;
}
}
@Inject(method = "renderFireInFirstPerson", at = @At("HEAD"), cancellable = true)
private void renderFireInFirstPerson(final CallbackInfo callbackInfo) {
final AntiBlind antiBlind = LiquidBounce.moduleManager.getModule(AntiBlind.class);
if (antiBlind.getState() && antiBlind.getFireEffect().get()) {
//vanilla's method
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F);
GlStateManager.depthFunc(519);
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
GlStateManager.depthFunc(515);
callbackInfo.cancel();
}
}
}
| 50,075 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinNBTTagCompound.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/item/MixinNBTTagCompound.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.item;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
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(NBTTagCompound.class)
public class MixinNBTTagCompound {
@Inject(method = "setTag", at = @At("HEAD"))
private void failFast(String key, NBTBase value, CallbackInfo ci) {
if (value == null) throw new IllegalArgumentException("Invalid null NBT value with key " + key);
}
}
| 839 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinModelVillager.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinModelVillager.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.model.ModelVillager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(ModelVillager.class)
public class MixinModelVillager {
@ModifyConstant(method = "<init>(FFII)V", constant = @Constant(intValue = 18))
private int changeTextureHeight(int original) {
return 20;
}
}
| 687 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinRenderItem.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinRenderItem.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.ccbluex.liquidbounce.utils.render.ColorUtils;
import net.ccbluex.liquidbounce.features.module.modules.color.ColorMixer;
import net.ccbluex.liquidbounce.features.module.modules.render.EnchantEffect;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.Final;
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;
import java.awt.*;
@Mixin(RenderItem.class)
public abstract class MixinRenderItem {
@Final
@Shadow
private TextureManager textureManager;
@Final
@Shadow
private static ResourceLocation RES_ITEM_GLINT;
@Shadow
public abstract void renderModel(IBakedModel model, int color);
@Inject(method = "renderEffect", at = @At("HEAD"), cancellable = true)
private void renderEffect(IBakedModel model, CallbackInfo callbackInfo) {
final EnchantEffect enchantEffect = LiquidBounce.moduleManager.getModule(EnchantEffect.class);
if (enchantEffect.getState()) {
int rainbowColour = RenderUtils.getRainbowOpaque(enchantEffect.rainbowSpeedValue.get(), enchantEffect.rainbowSatValue.get(), enchantEffect.rainbowBrgValue.get(), ((int) Minecraft.getSystemTime() % 2) * (enchantEffect.rainbowDelayValue.get() * 10));
int skyColor = RenderUtils.SkyRainbow(0, enchantEffect.rainbowSatValue.get(), enchantEffect.rainbowBrgValue.get());
int mixerColor = ColorMixer.getMixedColor(0, enchantEffect.rainbowSpeedValue.get()).getRGB();
int currentColor = new Color(enchantEffect.redValue.get(), enchantEffect.greenValue.get(), enchantEffect.blueValue.get()).getRGB();
GlStateManager.depthMask(false);
GlStateManager.depthFunc(514);
GlStateManager.disableLighting();
GlStateManager.blendFunc(768, 1);
this.textureManager.bindTexture(RES_ITEM_GLINT);
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.scale(8.0f, 8.0f, 8.0f);
float f = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0f / 8.0f;
GlStateManager.translate(f, 0.0f, 0.0f);
GlStateManager.rotate(-50.0f, 0.0f, 0.0f, 1.0f);
switch (enchantEffect.modeValue.get().toLowerCase()) {
case "custom":
this.renderModel(model, currentColor);
break;
case "rainbow":
this.renderModel(model, rainbowColour);
break;
case "sky":
this.renderModel(model, skyColor);
case "mixer":
this.renderModel(model, mixerColor);
break;
}
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(8.0f, 8.0f, 8.0f);
float f1 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0f / 8.0f;
GlStateManager.translate(-f1, 0.0f, 0.0f);
GlStateManager.rotate(10.0f, 0.0f, 0.0f, 1.0f);
switch (enchantEffect.modeValue.get().toLowerCase()) {
case "custom":
this.renderModel(model, currentColor);
break;
case "rainbow":
this.renderModel(model, rainbowColour);
break;
case "sky":
this.renderModel(model, skyColor);
case "mixer":
this.renderModel(model, mixerColor);
break;
}
GlStateManager.popMatrix();
GlStateManager.matrixMode(5888);
GlStateManager.blendFunc(770, 771);
GlStateManager.enableLighting();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
callbackInfo.cancel();
}
}
}
| 4,812 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinTileEntityRendererDispatcher.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinTileEntityRendererDispatcher.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.XRay;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
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;
import java.util.Objects;
@Mixin(TileEntityRendererDispatcher.class)
public class MixinTileEntityRendererDispatcher {
@Inject(method = "renderTileEntity", at = @At("HEAD"), cancellable = true)
private void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage, final CallbackInfo callbackInfo) {
final XRay xray = LiquidBounce.moduleManager.getModule(XRay.class);
if (xray.getState() && !xray.getXrayBlocks().contains(tileentityIn.getBlockType()))
callbackInfo.cancel();
}
@Inject(method = "renderTileEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getCombinedLight(Lnet/minecraft/util/BlockPos;I)I"))
private void enableLighting(CallbackInfo ci) {
RenderHelper.enableStandardItemLighting();
}
}
| 1,600 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinModelSkeleton.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinModelSkeleton.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelSkeleton;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(ModelSkeleton.class)
public class MixinModelSkeleton extends ModelBiped {
@Override
public void postRenderArm(float scale) {
this.bipedRightArm.rotationPointX++;
this.bipedRightArm.postRender(scale);
this.bipedRightArm.rotationPointX--;
}
}
| 678 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinVisGraph.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinVisGraph.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.XRay;
import net.minecraft.client.renderer.chunk.VisGraph;
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(VisGraph.class)
public class MixinVisGraph {
@Inject(method = "func_178606_a", at = @At("HEAD"), cancellable = true)
private void func_178606_a(final CallbackInfo callbackInfo) {
if (LiquidBounce.moduleManager.getModule(XRay.class).getState())
callbackInfo.cancel();
}
}
| 946 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinTileEntityChestRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinTileEntityChestRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.Chams;
import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer;
import org.lwjgl.opengl.GL11;
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(TileEntityChestRenderer.class)
public class MixinTileEntityChestRenderer {
@Inject(method = "renderTileEntityAt", at = @At("HEAD"))
private void injectChamsPre(CallbackInfo callbackInfo) {
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
if (chams.getState() && chams.getChestsValue().get()) {
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
GL11.glPolygonOffset(1.0F, -1000000F);
}
}
@Inject(method = "renderTileEntityAt", at = @At("RETURN"))
private void injectChamsPost(CallbackInfo callbackInfo) {
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
if (chams.getState() && chams.getChestsValue().get()) {
GL11.glPolygonOffset(1.0F, 1000000F);
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
}
}
}
| 1,553 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinLayerWitherAura.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinLayerWitherAura.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.layers.LayerWitherAura;
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(LayerWitherAura.class)
public class MixinLayerWitherAura {
@Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityWither;FFFFFFF)V", at = @At("TAIL"))
private void fixDepth(CallbackInfo ci) {
GlStateManager.depthMask(true);
}
}
| 853 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinRenderEntityItem.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinRenderEntityItem.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.entity.item.*;
import net.minecraft.client.renderer.entity.*;
import org.spongepowered.asm.mixin.injection.callback.*;
import net.ccbluex.liquidbounce.features.module.modules.render.*;
import net.ccbluex.liquidbounce.*;
import org.lwjgl.opengl.*;
import org.spongepowered.asm.mixin.injection.*;
import net.minecraft.client.resources.model.*;
import net.minecraft.util.*;
import net.minecraft.client.renderer.block.model.*;
import net.minecraft.client.renderer.*;
import net.minecraft.item.*;
import org.spongepowered.asm.mixin.*;
@Mixin(RenderEntityItem.class)
public abstract class MixinRenderEntityItem extends Render<EntityItem> {
protected MixinRenderEntityItem(final RenderManager p_i46179_1_) {
super(p_i46179_1_);
}
@Shadow
protected abstract int func_177078_a(final ItemStack p0);
@Shadow
protected abstract boolean shouldBob();
@Inject(method = "doRender", at = @At("HEAD"))
private void injectChamsPre(CallbackInfo callbackInfo) {
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
if (chams.getState() && chams.getItemsValue().get()) {
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
GL11.glPolygonOffset(1.0F, -1000000F);
}
}
@Inject(method = "doRender", at = @At("RETURN"))
private void injectChamsPost(CallbackInfo callbackInfo) {
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
if (chams.getState() && chams.getItemsValue().get()) {
GL11.glPolygonOffset(1.0F, 1000000F);
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
}
}
@Overwrite
private int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_)
{
final ItemPhysics itemPhysics = LiquidBounce.moduleManager.getModule(ItemPhysics.class);
ItemStack itemstack = itemIn.getEntityItem();
Item item = itemstack.getItem();
if (item == null || itemPhysics == null)
{
return 0;
}
else
{
boolean flag = p_177077_9_.isGui3d();
int i = this.func_177078_a(itemstack);
float f = 0.25F;
float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
if (itemPhysics.getState()) {
f1 = 0.0f;
}
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
if (flag || this.renderManager.options != null)
{
float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
if (itemPhysics.getState()) {
if (itemIn.onGround) {
GL11.glRotatef(itemIn.rotationYaw, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(itemIn.rotationPitch + 90.0f, 1.0f, 0.0f, 0.0f);
} else {
for (int a = 0; a < 10; ++a) {
GL11.glRotatef(f3, itemPhysics.getItemWeight().get(), itemPhysics.getItemWeight().get(), 0.0f);
}
}
} else {
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
}
}
if (!flag)
{
float f6 = -0.0F * (float)(i - 1) * 0.5F;
float f4 = -0.0F * (float)(i - 1) * 0.5F;
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
GlStateManager.translate(f6, f4, f5);
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
return i;
}
}
}
| 4,189 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinLayerSpiderEyes.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinLayerSpiderEyes.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.layers.LayerSpiderEyes;
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(LayerSpiderEyes.class)
public class MixinLayerSpiderEyes {
@Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySpider;FFFFFFF)V", at = @At("TAIL"))
private void fixDepth(CallbackInfo ci) {
GlStateManager.depthMask(true);
}
}
| 856 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEntityRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinEntityRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import com.google.common.base.Predicates;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.Render3DEvent;
import net.ccbluex.liquidbounce.features.module.modules.combat.KillAura;
import net.ccbluex.liquidbounce.features.module.modules.player.Reach;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.ccbluex.liquidbounce.features.module.modules.render.CameraClip;
import net.ccbluex.liquidbounce.features.module.modules.render.NoHurtCam;
import net.ccbluex.liquidbounce.features.module.modules.render.TargetMark;
import net.ccbluex.liquidbounce.features.module.modules.render.Tracers;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.util.*;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
@Mixin(EntityRenderer.class)
public abstract class MixinEntityRenderer {
@Shadow
public abstract void loadShader(ResourceLocation resourceLocationIn);
@Shadow
public abstract void setupCameraTransform(float partialTicks, int pass);
@Shadow
private Entity pointedEntity;
@Shadow
private Minecraft mc;
@Shadow
private float thirdPersonDistanceTemp;
@Shadow
private float thirdPersonDistance;
@Shadow
private boolean cloudFog;
@Inject(method = "renderStreamIndicator", at = @At("HEAD"), cancellable = true)
private void cancelStreamIndicator(CallbackInfo ci) {
ci.cancel();
}
@Inject(
method = "renderWorldPass",
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/util/EnumWorldBlockLayer;TRANSLUCENT:Lnet/minecraft/util/EnumWorldBlockLayer;")),
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/RenderGlobal;renderBlockLayer(Lnet/minecraft/util/EnumWorldBlockLayer;DILnet/minecraft/entity/Entity;)I",
ordinal = 0
)
)
private void enablePolygonOffset(CallbackInfo ci) {
GlStateManager.enablePolygonOffset();
GlStateManager.doPolygonOffset(-0.325F, -0.325F);
}
@Inject(
method = "renderWorldPass",
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/util/EnumWorldBlockLayer;TRANSLUCENT:Lnet/minecraft/util/EnumWorldBlockLayer;")),
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/RenderGlobal;renderBlockLayer(Lnet/minecraft/util/EnumWorldBlockLayer;DILnet/minecraft/entity/Entity;)I",
ordinal = 0,
shift = At.Shift.AFTER
)
)
private void disablePolygonOffset(CallbackInfo ci) {
GlStateManager.disablePolygonOffset();
}
@Inject(method = "renderWorldPass", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/EntityRenderer;renderHand:Z", shift = At.Shift.BEFORE))
private void renderWorldPass(int pass, float partialTicks, long finishTimeNano, CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new Render3DEvent(partialTicks));
}
@Inject(method = "hurtCameraEffect", at = @At("HEAD"), cancellable = true)
private void injectHurtCameraEffect(CallbackInfo callbackInfo) {
if (LiquidBounce.moduleManager.getModule(NoHurtCam.class).getState())
callbackInfo.cancel();
}
@Inject(method = "orientCamera", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Vec3;distanceTo(Lnet/minecraft/util/Vec3;)D"), cancellable = true)
private void cameraClip(float partialTicks, CallbackInfo callbackInfo) {
if (LiquidBounce.moduleManager.getModule(CameraClip.class).getState()) {
callbackInfo.cancel();
Entity entity = this.mc.getRenderViewEntity();
float f = entity.getEyeHeight();
if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPlayerSleeping()) {
f = (float) ((double) f + 1D);
GlStateManager.translate(0F, 0.3F, 0.0F);
if(!this.mc.gameSettings.debugCamEnable) {
BlockPos blockpos = new BlockPos(entity);
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.theWorld, blockpos, iblockstate, entity);
GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F);
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F);
}
}else if(this.mc.gameSettings.thirdPersonView > 0) {
double d3 = (double) (this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * partialTicks);
if(this.mc.gameSettings.debugCamEnable) {
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
}else{
float f1 = entity.rotationYaw;
float f2 = entity.rotationPitch;
if(this.mc.gameSettings.thirdPersonView == 2)
f2 += 180.0F;
if(this.mc.gameSettings.thirdPersonView == 2)
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, (float) (-d3));
GlStateManager.rotate(f1 - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F);
}
}else
GlStateManager.translate(0.0F, 0.0F, -0.1F);
if(!this.mc.gameSettings.debugCamEnable) {
float yaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F;
float pitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
float roll = 0.0F;
if(entity instanceof EntityAnimal) {
EntityAnimal entityanimal = (EntityAnimal) entity;
yaw = entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * partialTicks + 180.0F;
}
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks);
net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup((EntityRenderer) (Object) this, entity, block, partialTicks, yaw, pitch, roll);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
GlStateManager.rotate(event.roll, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(event.pitch, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(event.yaw, 0.0F, 1.0F, 0.0F);
}
GlStateManager.translate(0.0F, -f, 0.0F);
double d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double) partialTicks;
double d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double) partialTicks + (double) f;
double d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double) partialTicks;
this.cloudFog = this.mc.renderGlobal.hasCloudFog(d0, d1, d2, partialTicks);
}
}
@Inject(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/EntityRenderer;setupViewBobbing(F)V", shift = At.Shift.BEFORE))
private void setupCameraViewBobbingBefore(final CallbackInfo callbackInfo) {
final TargetMark targetMark = LiquidBounce.moduleManager.getModule(TargetMark.class);
final KillAura aura = LiquidBounce.moduleManager.getModule(KillAura.class);
if ((targetMark != null && aura != null && targetMark.modeValue.get().equalsIgnoreCase("tracers") && !aura.getTargetModeValue().get().equalsIgnoreCase("multi") && aura.getTarget() != null) || LiquidBounce.moduleManager.getModule(Tracers.class).getState()) GL11.glPushMatrix();
}
@Inject(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/EntityRenderer;setupViewBobbing(F)V", shift = At.Shift.AFTER))
private void setupCameraViewBobbingAfter(final CallbackInfo callbackInfo) {
final TargetMark targetMark = LiquidBounce.moduleManager.getModule(TargetMark.class);
final KillAura aura = LiquidBounce.moduleManager.getModule(KillAura.class);
if ((targetMark != null && aura != null && targetMark.modeValue.get().equalsIgnoreCase("tracers") && !aura.getTargetModeValue().get().equalsIgnoreCase("multi") && aura.getTarget() != null) || LiquidBounce.moduleManager.getModule(Tracers.class).getState()) GL11.glPopMatrix();
}
/**
* @author CCBlueX
*/
@Inject(method = "getMouseOver", at = @At("HEAD"), cancellable = true)
private void getMouseOver(float p_getMouseOver_1_, CallbackInfo ci) {
Entity entity = this.mc.getRenderViewEntity();
if (entity != null && this.mc.theWorld != null) {
this.mc.mcProfiler.startSection("pick");
this.mc.pointedEntity = null;
final Reach reach = (Reach) LiquidBounce.moduleManager.getModule(Reach.class);
double d0 = reach.getState() ? reach.getMaxRange() : (double) this.mc.playerController.getBlockReachDistance();
this.mc.objectMouseOver = entity.rayTrace(reach.getState() ? reach.getBuildReachValue().get() : d0, p_getMouseOver_1_);
double d1 = d0;
Vec3 vec3 = entity.getPositionEyes(p_getMouseOver_1_);
boolean flag = false;
if (this.mc.playerController.extendedReach()) {
d0 = 6.0D;
d1 = 6.0D;
} else if (d0 > 3.0D) {
flag = true;
}
if (this.mc.objectMouseOver != null) {
d1 = this.mc.objectMouseOver.hitVec.distanceTo(vec3);
}
if (reach.getState()) {
d1 = reach.getCombatReachValue().get();
final MovingObjectPosition movingObjectPosition = entity.rayTrace(d1, p_getMouseOver_1_);
if (movingObjectPosition != null) d1 = movingObjectPosition.hitVec.distanceTo(vec3);
}
Vec3 vec31 = entity.getLook(p_getMouseOver_1_);
Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0);
this.pointedEntity = null;
Vec3 vec33 = null;
float f = 1.0F;
List<Entity> list = this.mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand((double) f, (double) f, (double) f), Predicates.and(EntitySelectors.NOT_SPECTATING, p_apply_1_ -> p_apply_1_.canBeCollidedWith()));
double d2 = d1;
for (int j = 0; j < list.size(); ++j) {
Entity entity1 = (Entity) list.get(j);
float f1 = entity1.getCollisionBorderSize();
AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double) f1, (double) f1, (double) f1);
MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32);
if (axisalignedbb.isVecInside(vec3)) {
if (d2 >= 0.0D) {
this.pointedEntity = entity1;
vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec;
d2 = 0.0D;
}
} else if (movingobjectposition != null) {
double d3 = vec3.distanceTo(movingobjectposition.hitVec);
if (d3 < d2 || d2 == 0.0D) {
if (entity1 == entity.ridingEntity && !entity.canRiderInteract()) {
if (d2 == 0.0D) {
this.pointedEntity = entity1;
vec33 = movingobjectposition.hitVec;
}
} else {
this.pointedEntity = entity1;
vec33 = movingobjectposition.hitVec;
d2 = d3;
}
}
}
}
if (this.pointedEntity != null && flag && vec3.distanceTo(vec33) > (reach.getState() ? reach.getCombatReachValue().get() : 3.0D)) {
this.pointedEntity = null;
this.mc.objectMouseOver = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, vec33, (EnumFacing) null, new BlockPos(vec33));
}
if (this.pointedEntity != null && (d2 < d1 || this.mc.objectMouseOver == null)) {
this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity, vec33);
if (this.pointedEntity instanceof EntityLivingBase || this.pointedEntity instanceof EntityItemFrame) {
this.mc.pointedEntity = this.pointedEntity;
}
}
this.mc.mcProfiler.endSection();
}
ci.cancel();
}
} | 14,536 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinModelBiped.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinModelBiped.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.misc.SpinBot;
import net.ccbluex.liquidbounce.features.module.modules.render.Rotations;
import net.ccbluex.liquidbounce.utils.RotationUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
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(ModelBiped.class)
public class MixinModelBiped {
@Shadow
public ModelRenderer bipedRightArm;
@Shadow
public int heldItemRight;
@Shadow
public ModelRenderer bipedHead;
@Inject(method = "setRotationAngles", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelBiped;swingProgress:F"))
private void revertSwordAnimation(float p_setRotationAngles_1_, float p_setRotationAngles_2_, float p_setRotationAngles_3_, float p_setRotationAngles_4_, float p_setRotationAngles_5_, float p_setRotationAngles_6_, Entity p_setRotationAngles_7_, CallbackInfo callbackInfo) {
if(heldItemRight == 3)
this.bipedRightArm.rotateAngleY = 0F;
final Rotations rotationModule = LiquidBounce.moduleManager.getModule(Rotations.class);
if (p_setRotationAngles_7_ instanceof EntityPlayer && p_setRotationAngles_7_.equals(Minecraft.getMinecraft().thePlayer)) {
final SpinBot spinBot = LiquidBounce.moduleManager.getModule(SpinBot.class);
if (spinBot.getState() && !spinBot.getPitchMode().get().equalsIgnoreCase("none"))
this.bipedHead.rotateAngleX = spinBot.getPitch() / (180F / (float) Math.PI);
else if (rotationModule.getState() && RotationUtils.serverRotation != null)
this.bipedHead.rotateAngleX = RotationUtils.serverRotation.getPitch() / (180F / (float) Math.PI);
}
}
} | 2,392 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinFontRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinFontRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.TextEvent;
import net.ccbluex.liquidbounce.ui.font.GameFontRenderer;
import net.minecraft.client.gui.FontRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(FontRenderer.class)
public abstract class MixinFontRenderer {
@Shadow protected abstract void resetStyles();
@Inject(method = "drawString(Ljava/lang/String;FFIZ)I",
at = @At(
value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;renderString(Ljava/lang/String;FFIZ)I",
ordinal = 0, shift = At.Shift.AFTER
)
)
private void resetStyle(CallbackInfoReturnable<Integer> ci) {
this.resetStyles();
}
@ModifyVariable(method = "renderString", at = @At("HEAD"), require = 1, ordinal = 0)
private String renderString(final String string) {
if (string == null)
return null;
if (LiquidBounce.eventManager == null)
return string;
final TextEvent textEvent = new TextEvent(string);
LiquidBounce.eventManager.callEvent(textEvent);
return textEvent.getText();
}
@ModifyVariable(method = "getStringWidth", at = @At("HEAD"), require = 1, ordinal = 0)
private String getStringWidth(final String string) {
if (string == null)
return null;
if (LiquidBounce.eventManager == null)
return string;
final TextEvent textEvent = new TextEvent(string);
LiquidBounce.eventManager.callEvent(textEvent);
return textEvent.getText();
}
}
| 2,287 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinRender.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinRender.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.RenderEntityEvent;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
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(Render.class)
public abstract class MixinRender {
@Shadow
protected abstract <T extends Entity> boolean bindEntityTexture(T entity);
@Inject(method = "doRender", at = @At("HEAD"))
private void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new RenderEntityEvent(entity, x, y, z, entityYaw, partialTicks));
}
}
| 1,158 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinTileEntityMobSpawnerRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinTileEntityMobSpawnerRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityPainting;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
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(net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer.class)
public class MixinTileEntityMobSpawnerRenderer {
@Inject(method = "renderMob", cancellable = true, at = @At("HEAD"))
private static void injectPaintingSpawnerFix(MobSpawnerBaseLogic mobSpawnerLogic, double posX, double posY, double posZ, float partialTicks, CallbackInfo ci) {
Entity entity = mobSpawnerLogic.func_180612_a(mobSpawnerLogic.getSpawnerWorld());
if (entity == null || entity instanceof EntityPainting)
ci.cancel();
}
}
| 1,164 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinLayerArrow.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinLayerArrow.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.renderer.entity.layers.LayerArrow;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(LayerArrow.class)
public class MixinLayerArrow {
@Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderHelper;disableStandardItemLighting()V"))
private void removeDisable() {
// no-op
}
@Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderHelper;enableStandardItemLighting()V"))
private void removeEnable() {
// no-op
}
}
| 948 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinRenderPlayer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinRenderPlayer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.renderer.entity.RenderPlayer;
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;
@Mixin(RenderPlayer.class)
public class MixinRenderPlayer {
@Redirect(method = "renderRightArm", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelPlayer;isSneak:Z", ordinal = 0))
private void resetArmState(ModelPlayer modelPlayer, boolean value) {
modelPlayer.isRiding = modelPlayer.isSneak = false;
}
}
| 903 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinTileEntityBannerRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinTileEntityBannerRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.LayeredColorMaskTexture;
import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.tileentity.TileEntityBanner;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Mixin(TileEntityBannerRenderer.class)
public class MixinTileEntityBannerRenderer {
@Shadow @Final private static Map<String, TileEntityBannerRenderer.TimedBannerTexture> DESIGNS;
@Shadow @Final private static ResourceLocation BANNERTEXTURES;
/**
* @author asbyth
* @reason Resolve banners in chests not displaying once cache is full
*/
@Overwrite
private ResourceLocation func_178463_a(TileEntityBanner banner) {
String texture = banner.getPatternResourceLocation();
if (texture.isEmpty()) {
return null;
} else {
TileEntityBannerRenderer.TimedBannerTexture timedTexture = DESIGNS.get(texture);
if (timedTexture == null) {
if (DESIGNS.size() >= 256 && !this.freeCacheSlot()) {
return BANNERTEXTURES;
}
List<TileEntityBanner.EnumBannerPattern> patternList = banner.getPatternList();
List<EnumDyeColor> colorList = banner.getColorList();
List<String> patternPath = Lists.newArrayList();
for (TileEntityBanner.EnumBannerPattern pattern : patternList) {
patternPath.add("textures/entity/banner/" + pattern.getPatternName() + ".png");
}
timedTexture = new TileEntityBannerRenderer.TimedBannerTexture();
timedTexture.bannerTexture = new ResourceLocation(texture);
Minecraft.getMinecraft().getTextureManager().loadTexture(timedTexture.bannerTexture, new LayeredColorMaskTexture(BANNERTEXTURES, patternPath, colorList));
DESIGNS.put(texture, timedTexture);
}
timedTexture.systemTime = System.currentTimeMillis();
return timedTexture.bannerTexture;
}
}
@Unique
private boolean freeCacheSlot() {
long start = System.currentTimeMillis();
Iterator<String> iterator = DESIGNS.keySet().iterator();
while (iterator.hasNext()) {
String next = iterator.next();
TileEntityBannerRenderer.TimedBannerTexture timedTexture = DESIGNS.get(next);
if ((start - timedTexture.systemTime) > 5000L) {
Minecraft.getMinecraft().getTextureManager().deleteTexture(timedTexture.bannerTexture);
iterator.remove();
return true;
}
}
return DESIGNS.size() < 256;
}
@Redirect(method = "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntityBanner;DDDFI)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getTotalWorldTime()J"))
private long resolveOverflow(World world) {
return world.getTotalWorldTime() % 100L;
}
}
| 3,596 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinTileEntitySkullRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinTileEntitySkullRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
import org.lwjgl.opengl.GL11;
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(TileEntitySkullRenderer.class)
public class MixinTileEntitySkullRenderer {
@Inject(method = "renderSkull", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V"))
private void enableBlending(CallbackInfo ci) {
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
}
}
| 1,087 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinInventoryEffectRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinInventoryEffectRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.injection.forge.mixins.gui.MixinGuiContainer;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.minecraft.client.renderer.InventoryEffectRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(InventoryEffectRenderer.class)
public abstract class MixinInventoryEffectRenderer extends MixinGuiContainer {
@Shadow
private boolean hasActivePotionEffects;
@Overwrite
public void updateActivePotionEffects()
{
final HUD hud = LiquidBounce.moduleManager.getModule(HUD.class);
if (!hud.getInvEffectOffset().get())
{
this.guiLeft = (this.width - this.xSize) / 2;
this.hasActivePotionEffects = !this.mc.thePlayer.getActivePotionEffects().isEmpty();
}
else if (!this.mc.thePlayer.getActivePotionEffects().isEmpty())
{
this.guiLeft = 160 + (this.width - this.xSize - 200) / 2;
this.hasActivePotionEffects = true;
}
else
{
this.guiLeft = (this.width - this.xSize) / 2;
this.hasActivePotionEffects = false;
}
}
} | 1,537 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinLayerHeldItem.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinLayerHeldItem.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.RendererLivingEntity;
import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.util.UUID;
@Mixin(LayerHeldItem.class)
public class MixinLayerHeldItem {
@Shadow
@Final
private RendererLivingEntity<?> livingEntityRenderer;
/**
* @author CCBlueX
*/
@Overwrite
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {
ItemStack itemstack = entitylivingbaseIn.getHeldItem();
if(itemstack != null) {
GlStateManager.pushMatrix();
if(this.livingEntityRenderer.getMainModel().isChild) {
float f = 0.5F;
GlStateManager.translate(0.0F, 0.625F, 0.0F);
GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
GlStateManager.scale(f, f, f);
}
final UUID uuid = entitylivingbaseIn.getUniqueID();
final EntityPlayer entityplayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(uuid);
if(entityplayer != null && entityplayer.isBlocking()) {
if(entitylivingbaseIn.isSneaking()) {
((ModelBiped) this.livingEntityRenderer.getMainModel()).postRenderArm(0.0325F);
GlStateManager.translate(-0.58F, 0.3F, -0.2F);
GlStateManager.rotate(-24390.0F, 137290.0F, -2009900.0F, -2054900.0F);
}else{
((ModelBiped) this.livingEntityRenderer.getMainModel()).postRenderArm(0.0325F);
GlStateManager.translate(-0.48F, 0.2F, -0.2F);
GlStateManager.rotate(-24390.0F, 137290.0F, -2009900.0F, -2054900.0F);
}
}else{
((ModelBiped) this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F);
}
GlStateManager.translate(-0.0625F, 0.4375F, 0.0625F);
if(entitylivingbaseIn instanceof EntityPlayer && ((EntityPlayer) entitylivingbaseIn).fishEntity != null) {
itemstack = new ItemStack(Items.fishing_rod, 0);
}
Item item = itemstack.getItem();
Minecraft minecraft = Minecraft.getMinecraft();
if(item instanceof ItemBlock && Block.getBlockFromItem(item).getRenderType() == 2) {
GlStateManager.translate(0.0F, 0.1875F, -0.3125F);
GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
float f1 = 0.375F;
GlStateManager.scale(-f1, -f1, f1);
}
if(entitylivingbaseIn.isSneaking()) {
GlStateManager.translate(0.0F, 0.203125F, 0.0F);
}
minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON);
GlStateManager.popMatrix();
}
}
}
| 3,954 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinModelPlayer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinModelPlayer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.UpdateModelEvent;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ModelPlayer.class)
public class MixinModelPlayer extends ModelBiped {
@Shadow
private boolean smallArms;
@ModifyConstant(method = "<init>", constant = @Constant(floatValue = 2.5F))
private float fixAlexArmHeight(float original) {
return 2.0F;
}
/**
* @author asbyth
* @reason Resolve item positions being incorrect on Alex models (MC-72397)
*/
@Overwrite
public void postRenderArm(float scale) {
if (this.smallArms) {
this.bipedRightArm.rotationPointX += 0.5F;
this.bipedRightArm.postRender(scale);
this.bipedRightArm.rotationPointZ -= 0.5F;
} else {
this.bipedRightArm.postRender(scale);
}
}
@Inject(method = "setRotationAngles", at = @At("RETURN"))
private void revertSwordAnimation(float p_setRotationAngles_1_, float p_setRotationAngles_2_, float p_setRotationAngles_3_, float p_setRotationAngles_4_, float p_setRotationAngles_5_, float p_setRotationAngles_6_, Entity p_setRotationAngles_7_, CallbackInfo callbackInfo) {
LiquidBounce.eventManager.callEvent(new UpdateModelEvent((EntityPlayer) p_setRotationAngles_7_,(ModelPlayer)(Object)this));
}
}
| 2,166 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinLayerCreeperCharge.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinLayerCreeperCharge.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.Slice;
@Mixin(LayerCreeperCharge.class)
public class MixinLayerCreeperCharge {
@ModifyArg(
method = "doRenderLayer(Lnet/minecraft/entity/monster/EntityCreeper;FFFFFFF)V",
slice = @Slice(
from = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/model/ModelCreeper;render(Lnet/minecraft/entity/Entity;FFFFFF)V"
)
),
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/GlStateManager;depthMask(Z)V"
)
)
private boolean fixDepth(boolean original) {
return true;
}
}
| 1,146 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinTileEntityItemStackRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinTileEntityItemStackRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import com.mojang.authlib.GameProfile;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.tileentity.TileEntityBanner;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityEnderChest;
import net.minecraft.tileentity.TileEntitySkull;
import net.minecraft.util.EnumFacing;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(TileEntityItemStackRenderer.class)
public class MixinTileEntityItemStackRenderer {
@Shadow
private TileEntityBanner banner;
@Shadow
private TileEntityEnderChest enderChest;
@Shadow
private TileEntityChest field_147718_c;
@Shadow
private TileEntityChest field_147717_b;
/**
* @author CCBlueX
*/
@Overwrite
public void renderByItem(ItemStack itemStackIn) {
if(itemStackIn.getItem() == Items.banner) {
this.banner.setItemValues(itemStackIn);
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F);
}else if(itemStackIn.getItem() == Items.skull) {
GameProfile gameprofile = null;
if(itemStackIn.hasTagCompound()) {
NBTTagCompound nbttagcompound = itemStackIn.getTagCompound();
try {
if(nbttagcompound.hasKey("SkullOwner", 10)) {
gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
}else if(nbttagcompound.hasKey("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) {
GameProfile lvt_2_2_ = new GameProfile(null, nbttagcompound.getString("SkullOwner"));
gameprofile = TileEntitySkull.updateGameprofile(lvt_2_2_);
nbttagcompound.removeTag("SkullOwner");
nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
}
}catch(Exception ignored) {
}
}
if(TileEntitySkullRenderer.instance != null) {
GlStateManager.pushMatrix();
GlStateManager.translate(-0.5F, 0.0F, -0.5F);
GlStateManager.scale(2.0F, 2.0F, 2.0F);
GlStateManager.disableCull();
TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, EnumFacing.UP, 0.0F, itemStackIn.getMetadata(), gameprofile, -1);
GlStateManager.enableCull();
GlStateManager.popMatrix();
}
}else{
Block block = Block.getBlockFromItem(itemStackIn.getItem());
if(block == Blocks.ender_chest) {
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.enderChest, 0.0D, 0.0D, 0.0D, 0.0F);
}else if(block == Blocks.trapped_chest) {
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F);
}else if(block != Blocks.chest)
net.minecraftforge.client.ForgeHooksClient.renderTileItem(itemStackIn.getItem(), itemStackIn.getMetadata());
else{
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F);
}
}
}
} | 4,102 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinRendererLivingEntity.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinRendererLivingEntity.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import co.uk.hexeption.utils.OutlineUtils;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.color.ColorMixer;
import net.ccbluex.liquidbounce.features.module.modules.render.Chams;
import net.ccbluex.liquidbounce.features.module.modules.render.ESP;
import net.ccbluex.liquidbounce.features.module.modules.render.ESP2D;
import net.ccbluex.liquidbounce.features.module.modules.render.NameTags;
import net.ccbluex.liquidbounce.features.module.modules.render.NoRender;
import net.ccbluex.liquidbounce.features.module.modules.render.TrueSight;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.ccbluex.liquidbounce.utils.EntityUtils;
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
import net.ccbluex.liquidbounce.utils.render.ColorUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RendererLivingEntity;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.awt.*;
@Mixin(RendererLivingEntity.class)
public abstract class MixinRendererLivingEntity extends MixinRender {
@Shadow
protected ModelBase mainModel;
@Inject(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At("HEAD"), cancellable = true)
private <T extends EntityLivingBase> void injectChamsPre(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
final NoRender noRender = LiquidBounce.moduleManager.getModule(NoRender.class);
if (noRender.getState() && noRender.shouldStopRender(entity)) {
callbackInfo.cancel();
return;
}
if (chams.getState() && chams.getTargetsValue().get() && chams.getLegacyMode().get() && ((chams.getLocalPlayerValue().get() && entity == Minecraft.getMinecraft().thePlayer) || EntityUtils.isSelected(entity, false))) {
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
GL11.glPolygonOffset(1.0F, -1000000F);
}
}
@Inject(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At("RETURN"))
private <T extends EntityLivingBase> void injectChamsPost(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
final NoRender noRender = LiquidBounce.moduleManager.getModule(NoRender.class);
if (chams.getState() && chams.getTargetsValue().get() && chams.getLegacyMode().get() && ((chams.getLocalPlayerValue().get() && entity == Minecraft.getMinecraft().thePlayer) || EntityUtils.isSelected(entity, false))
&& !(noRender.getState() && noRender.shouldStopRender(entity))) {
GL11.glPolygonOffset(1.0F, 1000000F);
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
}
}
@Inject(method = "canRenderName(Lnet/minecraft/entity/EntityLivingBase;)Z", at = @At("HEAD"), cancellable = true)
private <T extends EntityLivingBase> void canRenderName(T entity, CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
final NoRender noRender = LiquidBounce.moduleManager.getModule(NoRender.class);
if (!ESP.renderNameTags
|| (LiquidBounce.moduleManager.getModule(NameTags.class).getState() && ((LiquidBounce.moduleManager.getModule(NameTags.class).getLocalValue().get() && entity == Minecraft.getMinecraft().thePlayer && (!LiquidBounce.moduleManager.getModule(NameTags.class).getNfpValue().get() || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0)) || EntityUtils.isSelected(entity, false)))
|| ESP2D.shouldCancelNameTag(entity)
|| (noRender.getState() && noRender.getNameTagsValue().get()))
callbackInfoReturnable.setReturnValue(false);
}
/**
* @author CCBlueX
*/
@Inject(method = "renderModel", at = @At("HEAD"), cancellable = true)
protected <T extends EntityLivingBase> void renderModel(T p_renderModel_1_, float p_renderModel_2_, float p_renderModel_3_, float p_renderModel_4_, float p_renderModel_5_, float p_renderModel_6_, float p_renderModel_7_, CallbackInfo ci) {
boolean visible = !p_renderModel_1_.isInvisible();
final TrueSight trueSight = LiquidBounce.moduleManager.getModule(TrueSight.class);
final Chams chams = LiquidBounce.moduleManager.getModule(Chams.class);
boolean chamsFlag = (chams.getState() && chams.getTargetsValue().get() && !chams.getLegacyMode().get() && ((chams.getLocalPlayerValue().get() && p_renderModel_1_ == Minecraft.getMinecraft().thePlayer) || EntityUtils.isSelected(p_renderModel_1_, false)));
boolean semiVisible = !visible && (!p_renderModel_1_.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) || (trueSight.getState() && trueSight.getEntitiesValue().get()));
if(visible || semiVisible) {
if(!this.bindEntityTexture(p_renderModel_1_))
return;
if(semiVisible) {
GlStateManager.pushMatrix();
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.15F);
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 771);
GlStateManager.alphaFunc(516, 0.003921569F);
}
final ESP esp = LiquidBounce.moduleManager.getModule(ESP.class);
if(esp.getState() && EntityUtils.isSelected(p_renderModel_1_, false)) {
Minecraft mc = Minecraft.getMinecraft();
boolean fancyGraphics = mc.gameSettings.fancyGraphics;
mc.gameSettings.fancyGraphics = false;
float gamma = mc.gameSettings.gammaSetting;
mc.gameSettings.gammaSetting = 100000F;
switch(esp.modeValue.get().toLowerCase()) {
case "wireframe":
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderUtils.glColor(esp.getColor(p_renderModel_1_));
GL11.glLineWidth(esp.wireframeWidth.get());
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
GL11.glPopAttrib();
GL11.glPopMatrix();
break;
case "outline":
ClientUtils.disableFastRender();
GlStateManager.resetColor();
final Color color = esp.getColor(p_renderModel_1_);
OutlineUtils.setColor(color);
OutlineUtils.renderOne(esp.outlineWidth.get());
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
OutlineUtils.setColor(color);
OutlineUtils.renderTwo();
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
OutlineUtils.setColor(color);
OutlineUtils.renderThree();
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
OutlineUtils.setColor(color);
OutlineUtils.renderFour(color);
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
OutlineUtils.setColor(color);
OutlineUtils.renderFive();
OutlineUtils.setColor(Color.WHITE);
}
mc.gameSettings.fancyGraphics = fancyGraphics;
mc.gameSettings.gammaSetting = gamma;
}
final int blend = 3042;
final int depth = 2929;
final int srcAlpha = 770;
final int srcAlphaPlus1 = srcAlpha + 1;
final int polygonOffsetLine = 10754;
final int texture2D = 3553;
final int lighting = 2896;
boolean textured = chams.getTexturedValue().get();
Color chamsColor = new Color(0x00000000);
switch (chams.getColorModeValue().get()) {
case "Custom":
chamsColor = new Color(chams.getRedValue().get(), chams.getGreenValue().get(), chams.getBlueValue().get());
break;
case "Rainbow":
chamsColor = new Color(RenderUtils.getRainbowOpaque(chams.getMixerSecondsValue().get(), chams.getSaturationValue().get(), chams.getBrightnessValue().get(), 0));
break;
case "Sky":
chamsColor = RenderUtils.skyRainbow(0, chams.getSaturationValue().get(), chams.getBrightnessValue().get());
break;
case "LiquidSlowly":
chamsColor = ColorUtils.LiquidSlowly(System.nanoTime(), 0, chams.getSaturationValue().get(), chams.getBrightnessValue().get());
break;
case "Mixer":
chamsColor = ColorMixer.getMixedColor(0, chams.getMixerSecondsValue().get());
break;
case "Fade":
chamsColor = ColorUtils.fade(new Color(chams.getRedValue().get(), chams.getGreenValue().get(), chams.getBlueValue().get(), chams.getAlphaValue().get()), 0, 100);
break;
}
chamsColor = ColorUtils.reAlpha(chamsColor, chams.getAlphaValue().get());
if (chamsFlag) {
Color chamsColor2 = new Color(0x00000000);
switch (chams.getBehindColorModeValue().get()) {
case "Same":
chamsColor2 = chamsColor;
break;
case "Opposite":
chamsColor2 = ColorUtils.getOppositeColor(chamsColor);
break;
case "Red":
chamsColor2 = new Color(0xffEF2626);
break;
}
GL11.glPushMatrix();
GL11.glEnable(polygonOffsetLine);
GL11.glPolygonOffset(1.0F, 1000000.0F);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
if (!textured) {
GL11.glEnable(blend);
GL11.glDisable(texture2D);
GL11.glDisable(lighting);
GL11.glBlendFunc(srcAlpha, srcAlphaPlus1);
GL11.glColor4f(chamsColor2.getRed() / 255.0F, chamsColor2.getGreen() / 255.0F, chamsColor2.getBlue() / 255.0F, chamsColor2.getAlpha() / 255.0F);
}
GL11.glDisable(depth);
GL11.glDepthMask(false);
}
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
if (chamsFlag) {
GL11.glEnable(depth);
GL11.glDepthMask(true);
if (!textured) {
GL11.glColor4f(chamsColor.getRed() / 255.0F, chamsColor.getGreen() / 255.0F, chamsColor.getBlue() / 255.0F, chamsColor.getAlpha() / 255.0F);
}
this.mainModel.render(p_renderModel_1_, p_renderModel_2_, p_renderModel_3_, p_renderModel_4_, p_renderModel_5_, p_renderModel_6_, p_renderModel_7_);
if (!textured) {
GL11.glEnable(texture2D);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(blend);
GL11.glEnable(lighting);
}
GL11.glPolygonOffset(1.0f, -1000000.0f);
GL11.glDisable(polygonOffsetLine);
GL11.glPopMatrix();
}
if (semiVisible) {
GlStateManager.disableBlend();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.popMatrix();
GlStateManager.depthMask(true);
}
}
ci.cancel();
}
} | 13,817 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinEffectRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/render/MixinEffectRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.render;
import net.ccbluex.liquidbounce.features.module.modules.render.Animations;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.particle.EntityParticleEmitter;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
@Mixin(EffectRenderer.class)
public abstract class MixinEffectRenderer {
@Shadow
protected abstract void updateEffectLayer(int layer);
@Shadow
private List<EntityParticleEmitter> particleEmitters;
/**
* @author Mojang
* @author Marco
*/
@Overwrite
public void updateEffects() {
try {
for(int i = 0; i < 4; ++i)
this.updateEffectLayer(i);
for(final Iterator<EntityParticleEmitter> it = this.particleEmitters.iterator(); it.hasNext(); ) {
final EntityParticleEmitter entityParticleEmitter = it.next();
entityParticleEmitter.onUpdate();
if(entityParticleEmitter.isDead)
it.remove();
}
} catch (final ConcurrentModificationException ignored) {
}
}
@Inject(
method = {
"addBlockDestroyEffects",
"addBlockHitEffects(Lnet/minecraft/util/BlockPos;Lnet/minecraft/util/EnumFacing;)V"
}, at = @At("HEAD"), cancellable = true
)
private void removeBlockBreakingParticles(CallbackInfo ci) {
if (Animations.noBlockParticles.get())
ci.cancel();
}
// this is added by forge, so this shouldn't be remapped (and causes a compile error if it is)
@Inject(
method = "addBlockHitEffects(Lnet/minecraft/util/BlockPos;Lnet/minecraft/util/MovingObjectPosition;)V",
at = @At("HEAD"), cancellable = true, remap = false
)
private void removeBlockBreakingParticles_Forge(CallbackInfo ci) {
if (Animations.noBlockParticles.get())
ci.cancel();
}
} | 2,491 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlockSoulSand.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlockSoulSand.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.movement.NoSlow;
import net.minecraft.block.BlockSoulSand;
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(BlockSoulSand.class)
public class MixinBlockSoulSand {
@Inject(method = "onEntityCollidedWithBlock", at = @At("HEAD"), cancellable = true)
private void onEntityCollidedWithBlock(CallbackInfo callbackInfo) {
final NoSlow noSlow = LiquidBounce.moduleManager.getModule(NoSlow.class);
if(noSlow.getState() && noSlow.getSoulsandValue().get())
callbackInfo.cancel();
}
} | 1,040 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlockModelRenderer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlockModelRenderer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.render.XRay;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.BlockModelRenderer;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
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 java.util.Objects;
@Mixin(BlockModelRenderer.class)
public class MixinBlockModelRenderer {
@Inject(method = "renderModelAmbientOcclusion", at = @At("HEAD"), cancellable = true)
private void renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSide, final CallbackInfoReturnable<Boolean> booleanCallbackInfoReturnable) {
final XRay xray = LiquidBounce.moduleManager.getModule(XRay.class);
if (xray.getState() && xray.getXrayBlocks().contains(this))
booleanCallbackInfoReturnable.setReturnValue(false);
}
@Inject(method = "renderModelStandard", at = @At("HEAD"), cancellable = true)
private void renderModelStandard(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides, final CallbackInfoReturnable<Boolean> booleanCallbackInfoReturnable) {
final XRay xray = LiquidBounce.moduleManager.getModule(XRay.class);
if (xray.getState() && !xray.getXrayBlocks().contains(this))
booleanCallbackInfoReturnable.setReturnValue(false);
}
}
| 2,105 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlock.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlock.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.BlockBBEvent;
import net.ccbluex.liquidbounce.features.module.modules.combat.Criticals;
import net.ccbluex.liquidbounce.features.module.modules.exploit.GhostHand;
import net.ccbluex.liquidbounce.features.module.modules.player.NoFall;
import net.ccbluex.liquidbounce.features.module.modules.render.XRay;
import net.ccbluex.liquidbounce.features.module.modules.world.NoSlowBreak;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
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.CallbackInfoReturnable;
import java.util.List;
import java.util.Objects;
@Mixin(Block.class)
public abstract class MixinBlock {
@Shadow
public abstract AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state);
@Shadow
@Final
protected BlockState blockState;
@Shadow
public abstract void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ);
// Has to be implemented since a non-virtual call on an abstract method is illegal
@Shadow
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
return null;
}
/**
* @author CCBlueX
*/
@Overwrite
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity) {
AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(worldIn, pos, state);
BlockBBEvent blockBBEvent = new BlockBBEvent(pos, blockState.getBlock(), axisalignedbb);
LiquidBounce.eventManager.callEvent(blockBBEvent);
axisalignedbb = blockBBEvent.getBoundingBox();
if(axisalignedbb != null && mask.intersectsWith(axisalignedbb))
list.add(axisalignedbb);
}
@Inject(method = "shouldSideBeRendered", at = @At("HEAD"), cancellable = true)
private void shouldSideBeRendered(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
final XRay xray = LiquidBounce.moduleManager.getModule(XRay.class);
if(xray.getState())
callbackInfoReturnable.setReturnValue(xray.getXrayBlocks().contains(this));
}
@Inject(method = "isCollidable", at = @At("HEAD"), cancellable = true)
private void isCollidable(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
final GhostHand ghostHand = LiquidBounce.moduleManager.getModule(GhostHand.class);
if (ghostHand.getState() && !(ghostHand.getBlockValue().get() == Block.getIdFromBlock((Block) (Object) this)))
callbackInfoReturnable.setReturnValue(false);
}
@Inject(method = "getAmbientOcclusionLightValue", at = @At("HEAD"), cancellable = true)
private void getAmbientOcclusionLightValue(final CallbackInfoReturnable<Float> floatCallbackInfoReturnable) {
if (LiquidBounce.moduleManager.getModule(XRay.class).getState())
floatCallbackInfoReturnable.setReturnValue(1F);
}
@Inject(method = "getPlayerRelativeBlockHardness", at = @At("RETURN"), cancellable = true)
public void modifyBreakSpeed(EntityPlayer playerIn, World worldIn, BlockPos pos, final CallbackInfoReturnable<Float> callbackInfo) {
float f = callbackInfo.getReturnValue();
// NoSlowBreak
final NoSlowBreak noSlowBreak = LiquidBounce.moduleManager.getModule(NoSlowBreak.class);
if (noSlowBreak.getState()) {
if (noSlowBreak.getWaterValue().get() && playerIn.isInsideOfMaterial(Material.water) &&
!EnchantmentHelper.getAquaAffinityModifier(playerIn)) {
f *= 5.0F;
}
if (noSlowBreak.getAirValue().get() && !playerIn.onGround) {
f *= 5.0F;
}
} else if (playerIn.onGround) { // NoGround
final NoFall noFall = LiquidBounce.moduleManager.getModule(NoFall.class);
final Criticals criticals = LiquidBounce.moduleManager.getModule(Criticals.class);
if (noFall.getState() && noFall.getTypeValue().get().equalsIgnoreCase("edit") && noFall.getEditMode().get().equalsIgnoreCase("noground") ||
criticals.getState() && criticals.getModeValue().get().equalsIgnoreCase("NoGround")) {
f /= 5F;
}
}
callbackInfo.setReturnValue(f);
}
} | 5,460 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlockLadder.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlockLadder.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.movement.FastClimb;
import net.minecraft.block.BlockLadder;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(BlockLadder.class)
public abstract class MixinBlockLadder extends MixinBlock {
@Shadow
@Final
public static PropertyDirection FACING;
/**
* /@author CCBlueX
*/
@Overwrite
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) {
final IBlockState iblockstate = worldIn.getBlockState(pos);
if(iblockstate.getBlock() instanceof BlockLadder) {
final FastClimb fastClimb = LiquidBounce.moduleManager.getModule(FastClimb.class);
final float f = fastClimb.getState() && fastClimb.getModeValue().get().equalsIgnoreCase("AAC3.0.0") ? 0.99f : 0.125f;
switch(iblockstate.getValue(FACING)) {
case NORTH:
this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
break;
case SOUTH:
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
break;
case WEST:
this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
break;
case EAST:
default:
this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
}
}
}
}
| 2,029 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlockAnvil.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlockAnvil.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.minecraft.block.BlockAnvil;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
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(BlockAnvil.class)
public abstract class MixinBlockAnvil extends MixinBlock {
@Inject(method = "onBlockPlaced", cancellable = true, at = @At("HEAD"))
private void injectAnvilCrashFix(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, CallbackInfoReturnable<IBlockState> cir) {
if (((meta >> 2) & ~0x3) != 0) {
cir.setReturnValue(super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(BlockAnvil.FACING, placer.getHorizontalFacing().rotateY()).withProperty(BlockAnvil.DAMAGE, 2));
cir.cancel();
}
}
}
| 1,374 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlockLiquid.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlockLiquid.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.features.module.modules.movement.NoSlow;
import net.ccbluex.liquidbounce.features.module.modules.world.Liquids;
import net.minecraft.block.BlockLiquid;
import net.minecraft.util.Vec3;
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(BlockLiquid.class)
public class MixinBlockLiquid {
@Inject(method = "canCollideCheck", at = @At("HEAD"), cancellable = true)
private void onCollideCheck(CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
if (LiquidBounce.moduleManager.getModule(Liquids.class).getState())
callbackInfoReturnable.setReturnValue(true);
}
@Inject(method = "modifyAcceleration", at = @At("HEAD"), cancellable = true)
private void onModifyAcceleration(CallbackInfoReturnable<Vec3> callbackInfoReturnable) {
final NoSlow noSlow = LiquidBounce.moduleManager.getModule(NoSlow.class);
if (noSlow.getState() && noSlow.getLiquidPushValue().get()) {
callbackInfoReturnable.setReturnValue(new Vec3(0.0D, 0.0D, 0.0D));
}
}
} | 1,528 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
MixinBlockRedstoneTorch.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/block/MixinBlockRedstoneTorch.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.block;
import net.minecraft.block.BlockRedstoneTorch;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
@Mixin(BlockRedstoneTorch.class)
public class MixinBlockRedstoneTorch {
@Shadow private static Map<World, List<BlockRedstoneTorch.Toggle>> toggles = new WeakHashMap<>();
}
| 672 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
StaticStorage.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/access/StaticStorage.java | /*
* LiquidBounce+ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/WYSI-Foundation/LiquidBouncePlus/
*
* This code was taken from UnlegitMC/FDPClient. Please credit them when using this code in your repository.
*/
package net.ccbluex.liquidbounce.injection.access;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.EnumWorldBlockLayer;
/**
* values() will cause performance issues, so we store them in a static array.
* We use ASM to replace values() with our own array. [net.ccbluex.liquidbounce.injection.transformers.OptimizeTransformer]
* https://stackoverflow.com/questions/2446135/is-there-a-performance-hit-when-using-enum-values-vs-string-arrays
*
* in my tests, this is 10 times faster than using values()
* I access them 1145141919 times and save EnumFacing.name into a local variable in my test
* EnumFacings.values() cost 122 ms
* StaticStorage.facings() cost 15 ms
*
* @author liulihaocai
*/
public class StaticStorage {
private static final EnumFacing[] facings = EnumFacing.values();
private static final EnumChatFormatting[] chatFormatting = EnumChatFormatting.values();
private static final EnumParticleTypes[] particleTypes = EnumParticleTypes.values();
private static final EnumWorldBlockLayer[] worldBlockLayers = EnumWorldBlockLayer.values();
public static EnumFacing[] facings() {
return facings;
}
public static EnumChatFormatting[] chatFormatting() {
return chatFormatting;
}
public static EnumParticleTypes[] particleTypes() {
return particleTypes;
}
public static EnumWorldBlockLayer[] worldBlockLayers() {
return worldBlockLayers;
}
}
| 1,852 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
IItemStack.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/access/IItemStack.java | /*
* LiquidBounce+ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/WYSI-Foundation/LiquidBouncePlus/
*
* This code was taken from UnlegitMC/FDPClient. Please credit them when using this code in your repository.
*/
package net.ccbluex.liquidbounce.injection.access;
public interface IItemStack {
long getItemDelay();
} | 409 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
OptimizeTransformer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/transformers/OptimizeTransformer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.transformers;
import net.ccbluex.liquidbounce.utils.ASMUtils;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodInsnNode;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean;
public class OptimizeTransformer implements IClassTransformer {
private static final HashMap<String, String> transformMap = new HashMap<>();
static {
addTransform("net.minecraft.util.EnumFacing", "cq", "facings");
addTransform("net.minecraft.util.EnumChatFormatting", "a", "chatFormatting");
addTransform("net.minecraft.util.EnumParticleTypes", "cy", "particleTypes");
addTransform("net.minecraft.util.EnumWorldBlockLayer", "adf", "worldBlockLayers");
}
/**
* Add transform to transformMap
* @param mcpName the normal name look like in developing env
* @param notchName the obfuscated name in player env
* @param targetName the target method in [StaticStorage]
*/
private static void addTransform(final String mcpName, final String notchName, final String targetName) {
transformMap.put(mcpName, targetName);
transformMap.put(notchName, targetName);
}
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if(!(name.startsWith("net.ccbluex") || name.startsWith("kotlin")) && basicClass != null && !transformMap.containsKey(transformedName)) {
try {
final ClassNode classNode = ASMUtils.INSTANCE.toClassNode(basicClass);
AtomicBoolean changed = new AtomicBoolean(false);
classNode.methods.forEach(methodNode -> {
for (int i = 0; i < methodNode.instructions.size(); ++i) {
final AbstractInsnNode abstractInsnNode = methodNode.instructions.get(i);
if (abstractInsnNode instanceof MethodInsnNode) {
MethodInsnNode min = (MethodInsnNode) abstractInsnNode;
if(min.getOpcode() == Opcodes.INVOKESTATIC && min.name.equals("values")) {
final String owner = min.owner.replaceAll("/", ".");
if (transformMap.containsKey(owner)) {
changed.set(true);
min.owner = "net/ccbluex/liquidbounce/injection/access/StaticStorage";
min.name = transformMap.get(owner);
}
}
}
}
});
if (changed.get()) {
return ASMUtils.INSTANCE.toBytes(classNode);
}
}catch(final Throwable throwable) {
throwable.printStackTrace();
}
}
return basicClass;
}
}
| 3,258 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
ForgeNetworkTransformer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/transformers/ForgeNetworkTransformer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.transformers;
import net.ccbluex.liquidbounce.features.special.AntiForge;
import net.ccbluex.liquidbounce.script.remapper.injection.utils.ClassUtils;
import net.ccbluex.liquidbounce.script.remapper.injection.utils.NodeUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.tree.*;
import static org.objectweb.asm.Opcodes.*;
/**
* Transform bytecode of classes
*/
public class ForgeNetworkTransformer implements IClassTransformer {
/**
* Transform a class
*
* @param name of target class
* @param transformedName of target class
* @param basicClass bytecode of target class
* @return new bytecode
*/
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if(name.equals("net.minecraftforge.fml.common.network.handshake.NetworkDispatcher")) {
try {
final ClassNode classNode = ClassUtils.INSTANCE.toClassNode(basicClass);
classNode.methods.stream().filter(methodNode -> methodNode.name.equals("handleVanilla")).forEach(methodNode -> {
final LabelNode labelNode = new LabelNode();
methodNode.instructions.insertBefore(methodNode.instructions.getFirst(), NodeUtils.INSTANCE.toNodes(
new MethodInsnNode(INVOKESTATIC, "net/ccbluex/liquidbounce/injection/transformers/ForgeNetworkTransformer", "returnMethod", "()Z", false),
new JumpInsnNode(IFEQ, labelNode),
new InsnNode(ICONST_0),
new InsnNode(IRETURN),
labelNode
));
});
return ClassUtils.INSTANCE.toBytes(classNode);
}catch(final Throwable throwable) {
throwable.printStackTrace();
}
}
if(name.equals("net.minecraftforge.fml.common.network.handshake.HandshakeMessageHandler")) {
try {
final ClassNode classNode = ClassUtils.INSTANCE.toClassNode(basicClass);
classNode.methods.stream().filter(method -> method.name.equals("channelRead0")).forEach(methodNode -> {
final LabelNode labelNode = new LabelNode();
methodNode.instructions.insertBefore(methodNode.instructions.getFirst(), NodeUtils.INSTANCE.toNodes(
new MethodInsnNode(INVOKESTATIC,
"net/ccbluex/liquidbounce/injection/transformers/ForgeNetworkTransformer",
"returnMethod", "()Z", false
),
new JumpInsnNode(IFEQ, labelNode),
new InsnNode(RETURN),
labelNode
));
});
return ClassUtils.INSTANCE.toBytes(classNode);
}catch(final Throwable throwable) {
throwable.printStackTrace();
}
}
return basicClass;
}
public static boolean returnMethod() {
return AntiForge.enabled && AntiForge.blockFML && !Minecraft.getMinecraft().isIntegratedServerRunning();
}
}
| 3,537 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
NetworkManagerTransformer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/net/ccbluex/liquidbounce/injection/transformers/NetworkManagerTransformer.java | /*
* LiquidBounce++ Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/PlusPlusMC/LiquidBouncePlusPlus/
*/
package net.ccbluex.liquidbounce.injection.transformers;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.TypeInsnNode;
public class NetworkManagerTransformer implements IClassTransformer {
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if(name.equals("net.ccbluex.liquidbounce.injection.forge.mixins.network.MixinNetworkManagerProxy")) {
try {
final ClassReader reader = new ClassReader(basicClass);
final ClassNode classNode = new ClassNode();
reader.accept(classNode, 0);
classNode.methods.stream().filter(methodNode -> methodNode.name.equals("createNetworkManagerAndConnect")).forEach(methodNode -> {
for(int i = 0; i < methodNode.instructions.size(); ++i) {
final AbstractInsnNode abstractInsnNode = methodNode.instructions.get(i);
if(abstractInsnNode instanceof TypeInsnNode) {
TypeInsnNode tin = (TypeInsnNode) abstractInsnNode;
if(tin.desc.equals("net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetworkManagerProxy$1")) {
((TypeInsnNode) abstractInsnNode).desc = "net/minecraft/network/NetworkManager$5";
}
} else if(abstractInsnNode instanceof MethodInsnNode) {
MethodInsnNode min = (MethodInsnNode) abstractInsnNode;
if(min.owner.equals("net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetworkManagerProxy$1") && min.name.equals("<init>")) {
min.owner = "net/minecraft/network/NetworkManager$5";
}
}
}
});
final ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
classNode.accept(writer);
return writer.toByteArray();
}catch(final Throwable throwable) {
throwable.printStackTrace();
}
}
return basicClass;
}
}
| 2,630 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
ViaForge.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/ViaForge.java | package de.enzaxd.viaforge;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import de.enzaxd.viaforge.loader.BackwardsLoader;
import de.enzaxd.viaforge.loader.RewindLoader;
import de.enzaxd.viaforge.platform.Injector;
import de.enzaxd.viaforge.platform.Platform;
import de.enzaxd.viaforge.platform.ProviderLoader;
import de.enzaxd.viaforge.util.JLoggerToLog4j;
import io.netty.channel.EventLoop;
import io.netty.channel.local.LocalEventLoopGroup;
import org.apache.logging.log4j.LogManager;
import java.io.File;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.logging.Logger;
public class ViaForge {
public final static int SHARED_VERSION = 47;
private static final ViaForge instance = new ViaForge();
public static ViaForge getInstance() {
return instance;
}
private final Logger jLogger = new JLoggerToLog4j(LogManager.getLogger("ViaForge"));
private final CompletableFuture<Void> initFuture = new CompletableFuture<>();
private ExecutorService asyncExecutor;
private EventLoop eventLoop;
private File file;
private int version;
private String lastServer;
public void start() {
ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("ViaForge-%d").build();
asyncExecutor = Executors.newFixedThreadPool(8, factory);
eventLoop = new LocalEventLoopGroup(1, factory).next();
eventLoop.submit(initFuture::join);
setVersion(SHARED_VERSION);
this.file = new File("ViaForge");
if (this.file.mkdir())
this.getjLogger().info("Creating ViaForge Folder");
Via.init(
ViaManagerImpl.builder()
.injector(new Injector())
.loader(new ProviderLoader())
.platform(new Platform(file))
.build()
);
MappingDataLoader.enableMappingsCache();
((ViaManagerImpl) Via.getManager()).init();
new BackwardsLoader(file);
new RewindLoader(file);
initFuture.complete(null);
}
public Logger getjLogger() {
return jLogger;
}
public CompletableFuture<Void> getInitFuture() {
return initFuture;
}
public ExecutorService getAsyncExecutor() {
return asyncExecutor;
}
public EventLoop getEventLoop() {
return eventLoop;
}
public File getFile() {
return file;
}
public String getLastServer() {
return lastServer;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public void setFile(File file) {
this.file = file;
}
public void setLastServer(String lastServer) {
this.lastServer = lastServer;
}
}
| 3,103 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
RewindLoader.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/loader/RewindLoader.java | package de.enzaxd.viaforge.loader;
import com.viaversion.viaversion.api.Via;
import de.gerrygames.viarewind.api.ViaRewindConfigImpl;
import de.gerrygames.viarewind.api.ViaRewindPlatform;
import java.io.File;
import java.util.logging.Logger;
public class RewindLoader implements ViaRewindPlatform {
public RewindLoader(final File file) {
final ViaRewindConfigImpl conf = new ViaRewindConfigImpl(file.toPath().resolve("ViaRewind").resolve("config.yml").toFile());
conf.reloadConfig();
this.init(conf);
}
@Override
public Logger getLogger() {
return Via.getPlatform().getLogger();
}
}
| 643 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
BackwardsLoader.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/loader/BackwardsLoader.java | package de.enzaxd.viaforge.loader;
import com.viaversion.viabackwards.api.ViaBackwardsPlatform;
import de.enzaxd.viaforge.ViaForge;
import java.io.File;
import java.util.logging.Logger;
public class BackwardsLoader implements ViaBackwardsPlatform {
private final File file;
public BackwardsLoader(final File file) {
this.init(this.file = new File(file, "ViaBackwards"));
}
@Override
public Logger getLogger() {
return ViaForge.getInstance().getjLogger();
}
@Override
public void disable() {
}
@Override
public boolean isOutdated() {
return false;
}
@Override
public File getDataFolder() {
return new File(this.file, "config.yml");
}
}
| 735 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
CommonTransformer.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/handler/CommonTransformer.java | package de.enzaxd.viaforge.handler;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.handler.codec.MessageToMessageDecoder;
import java.lang.reflect.InvocationTargetException;
public class CommonTransformer {
public static final String HANDLER_DECODER_NAME = "via-decoder";
public static final String HANDLER_ENCODER_NAME = "via-encoder";
public static void decompress(ChannelHandlerContext ctx, ByteBuf buf) throws InvocationTargetException {
ChannelHandler handler = ctx.pipeline().get("decompress");
ByteBuf decompressed = handler instanceof MessageToMessageDecoder
? (ByteBuf) PipelineUtil.callDecode((MessageToMessageDecoder<?>) handler, ctx, buf).get(0)
: (ByteBuf) PipelineUtil.callDecode((ByteToMessageDecoder) handler, ctx, buf).get(0);
try {
buf.clear().writeBytes(decompressed);
} finally {
decompressed.release();
}
}
public static void compress(ChannelHandlerContext ctx, ByteBuf buf) throws Exception {
ByteBuf compressed = ctx.alloc().buffer();
try {
PipelineUtil.callEncode((MessageToByteEncoder<?>) ctx.pipeline().get("compress"), ctx, buf, compressed);
buf.clear().writeBytes(compressed);
} finally {
compressed.release();
}
}
} | 1,581 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
EncodeHandler.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/handler/EncodeHandler.java | package de.enzaxd.viaforge.handler;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.exception.CancelCodecException;
import com.viaversion.viaversion.exception.CancelEncoderException;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
@ChannelHandler.Sharable
public class EncodeHandler extends MessageToMessageEncoder<ByteBuf> {
private final UserConnection info;
private boolean handledCompression;
public EncodeHandler(UserConnection info) {
this.info = info;
}
@Override
protected void encode(final ChannelHandlerContext ctx, ByteBuf bytebuf, List<Object> out) throws Exception {
if (!info.checkOutgoingPacket()) throw CancelEncoderException.generate(null);
if (!info.shouldTransformPacket()) {
out.add(bytebuf.retain());
return;
}
ByteBuf transformedBuf = ctx.alloc().buffer().writeBytes(bytebuf);
try {
boolean needsCompress = handleCompressionOrder(ctx, transformedBuf);
info.transformOutgoing(transformedBuf, CancelEncoderException::generate);
if (needsCompress) {
CommonTransformer.compress(ctx, transformedBuf);
}
out.add(transformedBuf.retain());
} finally {
transformedBuf.release();
}
}
private boolean handleCompressionOrder(ChannelHandlerContext ctx, ByteBuf buf) throws InvocationTargetException {
if (handledCompression) return false;
int encoderIndex = ctx.pipeline().names().indexOf("compress");
if (encoderIndex == -1) return false;
handledCompression = true;
if (encoderIndex > ctx.pipeline().names().indexOf("via-encoder")) {
// Need to decompress this packet due to bad order
CommonTransformer.decompress(ctx, buf);
ChannelHandler encoder = ctx.pipeline().get("via-encoder");
ChannelHandler decoder = ctx.pipeline().get("via-decoder");
ctx.pipeline().remove(encoder);
ctx.pipeline().remove(decoder);
ctx.pipeline().addAfter("compress", "via-encoder", encoder);
ctx.pipeline().addAfter("decompress", "via-decoder", decoder);
return true;
}
return false;
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return;
super.exceptionCaught(ctx, cause);
}
}
| 2,806 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
DecodeHandler.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/handler/DecodeHandler.java | package de.enzaxd.viaforge.handler;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.exception.CancelCodecException;
import com.viaversion.viaversion.exception.CancelDecoderException;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
@ChannelHandler.Sharable
public class DecodeHandler extends MessageToMessageDecoder<ByteBuf> {
private final UserConnection info;
private boolean handledCompression;
private boolean skipDoubleTransform;
public DecodeHandler(UserConnection info) {
this.info = info;
}
public UserConnection getInfo() {
return info;
}
// https://github.com/ViaVersion/ViaVersion/blob/master/velocity/src/main/java/us/myles/ViaVersion/velocity/handlers/VelocityDecodeHandler.java
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf bytebuf, List<Object> out) throws Exception {
if (skipDoubleTransform) {
skipDoubleTransform = false;
out.add(bytebuf.retain());
return;
}
if (!info.checkIncomingPacket()) throw CancelDecoderException.generate(null);
if (!info.shouldTransformPacket()) {
out.add(bytebuf.retain());
return;
}
ByteBuf transformedBuf = ctx.alloc().buffer().writeBytes(bytebuf);
try {
boolean needsCompress = handleCompressionOrder(ctx, transformedBuf);
info.transformIncoming(transformedBuf, CancelDecoderException::generate);
if (needsCompress) {
CommonTransformer.compress(ctx, transformedBuf);
skipDoubleTransform = true;
}
out.add(transformedBuf.retain());
} finally {
transformedBuf.release();
}
}
private boolean handleCompressionOrder(ChannelHandlerContext ctx, ByteBuf buf) throws InvocationTargetException {
if (handledCompression) return false;
int decoderIndex = ctx.pipeline().names().indexOf("decompress");
if (decoderIndex == -1) return false;
handledCompression = true;
if (decoderIndex > ctx.pipeline().names().indexOf("via-decoder")) {
// Need to decompress this packet due to bad order
CommonTransformer.decompress(ctx, buf);
ChannelHandler encoder = ctx.pipeline().get("via-encoder");
ChannelHandler decoder = ctx.pipeline().get("via-decoder");
ctx.pipeline().remove(encoder);
ctx.pipeline().remove(decoder);
ctx.pipeline().addAfter("compress", "via-encoder", encoder);
ctx.pipeline().addAfter("decompress", "via-decoder", decoder);
return true;
}
return false;
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return;
super.exceptionCaught(ctx, cause);
}
} | 3,246 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
ProviderLoader.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/platform/ProviderLoader.java | package de.enzaxd.viaforge.platform;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.bungee.providers.BungeeMovementTransmitter;
import com.viaversion.viaversion.protocols.base.BaseVersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
import de.enzaxd.viaforge.ViaForge;
public class ProviderLoader implements ViaPlatformLoader {
@Override
public void load() {
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BungeeMovementTransmitter());
Via.getManager().getProviders().use(VersionProvider.class, new BaseVersionProvider() {
@Override
public int getClosestServerProtocol(UserConnection connection) throws Exception {
if (connection.isClientSide())
return ViaForge.getInstance().getVersion();
return super.getClosestServerProtocol(connection);
}
});
}
@Override
public void unload() {
}
}
| 1,245 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
ViaAPI.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/platform/ViaAPI.java | package de.enzaxd.viaforge.platform;
import com.viaversion.viaversion.ViaAPIBase;
import java.util.UUID;
public class ViaAPI extends ViaAPIBase<UUID> {
}
| 157 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
Platform.java | /FileExtraction/Java_unseen/MokkowDev_LiquidBouncePlusPlus/src/main/java/de/enzaxd/viaforge/platform/Platform.java | package de.enzaxd.viaforge.platform;
import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.platform.PlatformTask;
import com.viaversion.viaversion.api.platform.UnsupportedSoftware;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.libs.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import com.viaversion.viaversion.libs.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.util.FutureTaskId;
import de.enzaxd.viaforge.util.JLoggerToLog4j;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import org.apache.logging.log4j.LogManager;
import java.util.Collection;
import java.io.File;
import java.nio.file.Path;
import java.util.UUID;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
public class Platform implements ViaPlatform<UUID> {
private final Logger logger = new JLoggerToLog4j(LogManager.getLogger("ViaVersion"));
private final ViaConfig config;
private final File dataFolder;
private final com.viaversion.viaversion.api.ViaAPI api;
public Platform(File dataFolder) {
Path configDir = dataFolder.toPath().resolve("ViaVersion");
config = new ViaConfig(configDir.resolve("viaversion.yml").toFile());
this.dataFolder = configDir.toFile();
api = new ViaAPI();
}
public static String legacyToJson(String legacy) {
return GsonComponentSerializer.gson().serialize(LegacyComponentSerializer.legacySection().deserialize(legacy));
}
@Override
public Logger getLogger() {
return logger;
}
@Override
public String getPlatformName() {
return "ViaForge";
}
@Override
public String getPlatformVersion() {
return ViaForge.SHARED_VERSION+"";
}
@Override
public boolean isProxy() {
return ViaPlatform.super.isProxy();
}
@Override
public String getPluginVersion() {
return "4.5.1";
}
@Override
public FutureTaskId runAsync(Runnable runnable) {
return new FutureTaskId(CompletableFuture
.runAsync(runnable, ViaForge.getInstance().getAsyncExecutor())
.exceptionally(throwable -> {
if (!(throwable instanceof CancellationException)) {
throwable.printStackTrace();
}
return null;
})
);
}
@Override
public FutureTaskId runSync(Runnable runnable) {
return new FutureTaskId(ViaForge.getInstance().getEventLoop().submit(runnable).addListener(errorLogger()));
}
@Override
public PlatformTask runSync(Runnable runnable, long ticks) {
return new FutureTaskId(ViaForge.getInstance().getEventLoop().schedule(() -> runSync(runnable), ticks *
50, TimeUnit.MILLISECONDS).addListener(errorLogger()));
}
@Override
public PlatformTask runRepeatingSync(Runnable runnable, long ticks) {
return new FutureTaskId(ViaForge.getInstance().getEventLoop().scheduleAtFixedRate(() -> runSync(runnable),
0, ticks * 50, TimeUnit.MILLISECONDS).addListener(errorLogger()));
}
@Override
public PlatformTask runRepeatingAsync(Runnable runnable, long ticks) {
return new FutureTaskId(ViaForge.getInstance().getEventLoop().scheduleAtFixedRate(() -> runSync(runnable),
0, ticks * 50, TimeUnit.MILLISECONDS).addListener(errorLogger()));
}
private <T extends Future<?>> GenericFutureListener<T> errorLogger() {
return future -> {
if (!future.isCancelled() && future.cause() != null) {
future.cause().printStackTrace();
}
};
}
@Override
public ViaCommandSender[] getOnlinePlayers() {
return new ViaCommandSender[1337];
}
private ViaCommandSender[] getServerPlayers() {
return new ViaCommandSender[1337];
}
@Override
public void sendMessage(UUID uuid, String s) {
}
@Override
public boolean kickPlayer(UUID uuid, String s) {
return false;
}
@Override
public boolean disconnect(UserConnection connection, String message) {
return ViaPlatform.super.disconnect(connection, message);
}
@Override
public boolean isPluginEnabled() {
return true;
}
@Override
public com.viaversion.viaversion.api.ViaAPI getApi() {
return api;
}
@Override
public ViaVersionConfig getConf() {
return config;
}
@Override
public ConfigurationProvider getConfigurationProvider() {
return config;
}
@Override
public File getDataFolder() {
return dataFolder;
}
@Override
public void onReload() {
}
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();
return platformSpecific;
}
@Override
public boolean isOldClientsAllowed() {
return true;
}
@Override
public Collection<UnsupportedSoftware> getUnsupportedSoftwareClasses() {
return ViaPlatform.super.getUnsupportedSoftwareClasses();
}
@Override
public boolean hasPlugin(String name) {
return false;
}
}
| 5,759 | Java | .java | MokkowDev/LiquidBouncePlusPlus | 82 | 28 | 3 | 2022-07-27T12:21:34Z | 2023-12-31T08:57:34Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.