Jump to content

Recommended Posts

Posted

I need help. For the 1000th time today. I don't know where to go for help and NO I WILL NOT ADD YOU ON DISCORD.

This time... actual java code. yay finally

 

i fixed a decent amount of it but some of this... helppppppppppppppppppppppppppppppppppppppp

package de.stylextv.hycheat.module;

import de.stylextv.hycheat.util.ScoreboardUtil;
import de.stylextv.hycheat.world.GlowManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.*;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.EntityRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.*;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.event.InputEvent;
import net.minecraftforge.client.event.sound.PlaySoundEvent;

import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;

public class PartyPooperModule extends Module {

    private static String[] MUSIC_SOUNDS=new String[] {
            "block.note_block.snare",
            "block.note_block.bass",
            "block.note_block.xylophone",
            "block.note_block.basedrum"
    };
    private static int SCORE_MAX=170;
    private static int SCORE_GLOW=150;
    private static int AFK_GLOW=20*50;

    private boolean hasRole;
    private boolean isSeeker;
    private String feedbackString;
    private int feedbackColor=0;

    private HashMap<AbstractClientPlayerEntity,Double> npcScores=new HashMap<>();
    private HashMap<AbstractClientPlayerEntity,Integer> npcAfkScores=new HashMap<>();
    private HashMap<AbstractClientPlayerEntity,Integer> glowTimers=new HashMap<>();

    private HashMap<AbstractClientPlayerEntity,String> npcSkinTypes=new HashMap<>();
    private HashMap<AbstractClientPlayerEntity,ResourceLocation> npcSkins=new HashMap<>();

    private ModuleSetting showHiders;
    private ModuleSetting showSeekers;
    private ModuleSetting showObjectives;
    private ModuleSetting disableNoteblockMusic;
    private ModuleSetting disableNpcAttack;
    private ModuleSetting fixHeartBug;

    public PartyPooperModule() {
        super(
                "party_pooper", "Party Pooper", Items.MUSIC_DISC_BLOCKS,
                "This module helps you by marking players and objectives in the party pooper gamemode."
        );
        setSettings(new ModuleSetting[] {
                showHiders=new ModuleSetting("show_hiders","Show Hiders",Items.COMPASS,"Shows the current position of hiders as seeker."),
                showSeekers=new ModuleSetting("show_seekers","Show Seekers",Items.IRON_SWORD,"Shows the positions of seekers as hider."),
                showObjectives=new ModuleSetting("show_obj","Show Objectives",Items.FIREWORK_ROCKET,"Shows the positions of objectives as hider."),
                new ModuleSetting("use_ai","Use NPC-AI",Items.REDSTONE_TORCH,"Uses an ai to control your npc as hider.", false, true),
                disableNoteblockMusic=new ModuleSetting("disable_music","Disable Noteblock-Music",Items.JUKEBOX,"Disables the custom noteblock music in this gamemode."),
                disableNpcAttack=new ModuleSetting("disable_npc_atk","Disable NPC-Attacks",Items.SKELETON_SKULL,"Prevents you from hitting non-player NPCs as seeker."),
                fixHeartBug=new ModuleSetting("fix_hrtbug","Fix Heart-Bug",Items.APPLE,"Resolves the issue that reduced hearts will not reset in 1.15 (Hypixel Bug).")
        });
    }

    @Override
    public void onEnable() {
        npcScores.clear();
        npcAfkScores.clear();
        glowTimers.clear();

        npcSkinTypes.clear();
        npcSkins.clear();

        feedbackString="";
        feedbackColor=0;
    }
    @Override
    public void onDisable() {
        if(fixHeartBug.isEnabled()) {
            Minecraft.getInstance().player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(20);
        }
        GlowManager.removeAllGlow();
        isSeeker=false;
        hasRole=false;
    }
    @Override
    public boolean shouldBeActive(String sidebarTitle, String[] sidebar, String title) {
        if(sidebar.length==15&&sidebar[sidebar.length-3].endsWith(" Party Pooper")) {
            NonNullList<ItemStack> inv=Minecraft.getInstance().player.inventory.mainInventory;
            if(!inv.get(8).getItem().equals(Items.RED_BED)) {
                if(!hasRole) {
                    hasRole=true;
                    isSeeker=inv.get(0).getItem().equals(Items.IRON_SWORD);
                }
                return true;
            }
        }
        return false;
    }
    @Override
    public void onTick() {
        if(!isSeeker) {

            for(Entity e:Minecraft.getInstance().world.getAllEntities()) {
                if(!GlowManager.isGlowing(e)) {

                    if(showSeekers.isEnabled()&&e instanceof AbstractClientPlayerEntity&&!e.isInvisible()&&!e.isInvisibleToPlayer(Minecraft.getInstance().player)) {
                        if(e.getTeam()!=null&&e.getTeam().getColor()==TextFormatting.RED) GlowManager.addGlow(e,GlowManager.RED);
                        else if(GlowManager.isGlowing(e)) GlowManager.removeGlow(e);
                    } else if(showObjectives.isEnabled()&&e instanceof ArmorStandEntity) {
                        ArmorStandEntity stand=(ArmorStandEntity)e;
                        if(stand.getCustomName()!=null&&stand.getCustomName().getSiblings().size()!=0&&stand.getCustomName().getSiblings().get(0).getStyle().getColor()==TextFormatting.GREEN) {
                            GlowManager.addGlow(e,GlowManager.GREEN);
                        }
                    }

                }
            }

        } else if(showHiders.isEnabled()) {

            ArrayList<String> names=ScoreboardUtil.getTablist();
            for(AbstractClientPlayerEntity playerEntity:Minecraft.getInstance().world.getPlayers()) {
                if(playerEntity!=Minecraft.getInstance().player&&!playerEntity.isInvisible()&&!playerEntity.isInvisibleToPlayer(Minecraft.getInstance().player)&&!names.contains(playerEntity.getName().getString())) {

                    if(skinHasChanged(playerEntity)) {
                        GlowManager.removeGlow(playerEntity);
                        playerEntity.setGlowing(false);
                    } else {
                        if(updateNpcScore(playerEntity)) {
                            glowTimers.put(playerEntity, 20*40);
                            if(!GlowManager.isGlowing(playerEntity)) {
                                GlowManager.addGlow(playerEntity,GlowManager.RED);

                                Vector3d playerPos=Minecraft.getInstance().player.getPositionVec();
                                Vector3d targetPos = playerEntity.getPositionVec();
                                Vector3d loc=playerPos.add(targetPos.subtract(playerPos).normalize().mul(3,3,3));
                                Minecraft.getInstance().world.playSound(loc.getX(),loc.getY(),loc.getZ(), SoundEvents.ENTITY_EVOKER_CAST_SPELL, SoundCategory.PLAYERS,1,1,false);
                            }
                        } else {
                            Integer got=glowTimers.get(playerEntity);
                            if(got!=null) {
                                got--;
                                if(got<=0) glowTimers.remove(playerEntity);
                                else glowTimers.put(playerEntity,got);
                            } else if(GlowManager.isGlowing(playerEntity)) GlowManager.removeGlow(playerEntity);
                        }
                    }
                }
            }
            refreshFeedback();

        }
    }
    private void refreshFeedback() {
        double max=0;
        for(AbstractClientPlayerEntity playerEntity:npcScores.keySet()) {
            if(!GlowManager.isGlowing(playerEntity)) {
                double score=npcScores.get(playerEntity)/SCORE_GLOW;
                if(score<=1&&score>max) max=score;
            }
        }
        for(AbstractClientPlayerEntity playerEntity:npcAfkScores.keySet()) {
            if(!GlowManager.isGlowing(playerEntity)) {
                double score=(double)npcAfkScores.get(playerEntity)/AFK_GLOW;
                if(score<=1&&score>max) max=score;
            }
        }
        if(max>1) max=1;

        setFeedback(max);
    }
    private void setFeedback(double progress) {
        int bars=(int)(progress*20);
        String bar;
        if(bars!=0) bar=""+TextFormatting.RESET+TextFormatting.BOLD;
        else bar=""+TextFormatting.DARK_GRAY+TextFormatting.BOLD;
        for(int i=0; i<20; i++) {
            bar=bar+"|";
            if(i==bars-1) bar=bar+TextFormatting.DARK_GRAY+TextFormatting.BOLD;
        }
        feedbackString=TextFormatting.GRAY+"Analyzing player movement... ["+bar+TextFormatting.GRAY+"] "+TextFormatting.RESET+(int)(progress*100)+TextFormatting.GRAY+"%";
        feedbackColor=Color.HSBtoRGB((float)progress/3f,1,1);
    }
    private boolean updateNpcScore(AbstractClientPlayerEntity playerEntity) {
        double score=0;
        Double got=npcScores.get(playerEntity);
        if(got!=null) score=got;

        if(playerEntity.rotationYaw!=playerEntity.prevRotationYaw||playerEntity.rotationPitch!=playerEntity.prevRotationPitch) {
            Integer afkScore=npcAfkScores.get(playerEntity);
            if(afkScore!=null) npcAfkScores.remove(playerEntity);

            if(playerEntity.rotationYaw!=playerEntity.prevRotationYaw&&playerEntity.rotationPitch!=playerEntity.prevRotationPitch) {
                score+=0.85;
            } else {
                score-=0.5;
                if(score<0) score=0;
            }
        } else {
            score-=0.14;
            if(score<0) score=0;
            Integer afkScore=npcAfkScores.get(playerEntity);
            if(afkScore==null) npcAfkScores.put(playerEntity,1);
            else {
                afkScore++;
                if(afkScore>AFK_GLOW+10) {
                    afkScore=AFK_GLOW+10;
                }
                npcAfkScores.put(playerEntity,afkScore);
                if(afkScore>AFK_GLOW) score=SCORE_MAX;
            }
        }
        if(playerEntity.getHeldItemMainhand().getItem()!=Items.AIR) score=SCORE_MAX;

        if(score>SCORE_MAX) score=SCORE_MAX;

        npcScores.put(playerEntity,score);
        return score>SCORE_GLOW;
    }
    private boolean skinHasChanged(AbstractClientPlayerEntity playerEntity) {
        String type=playerEntity.getSkinType();
        ResourceLocation skin=playerEntity.getLocationSkin();
        String typeGot=npcSkinTypes.get(playerEntity);
        ResourceLocation skinGot=npcSkins.get(playerEntity);
        npcSkinTypes.put(playerEntity,type);
        npcSkins.put(playerEntity,skin);
        if(typeGot!=null&&skinGot!=null) {
            return !typeGot.equals(type) || !skinGot.equals(skin);
        }
        return false;
    }

    @Override
    public void onPlaySound(PlaySoundEvent event) {
        if(disableNoteblockMusic.isEnabled()&&isMusicSound(event.getName())) {
            event.setResultSound(null);
        }
    }
    @Override
    public void onUserClick(InputEvent.ClickInputEvent event) {
        if(disableNpcAttack.isEnabled()&&isSeeker&&event.isAttack()&&Minecraft.getInstance().objectMouseOver.getType()== RayTraceResult.Type.ENTITY) {
            EntityRayTraceResult result=(EntityRayTraceResult) Minecraft.getInstance().objectMouseOver;
            if(!GlowManager.isGlowing(result.getEntity())) {
                event.setCanceled(true);
                Minecraft.getInstance().player.playSound(SoundEvents.UI_BUTTON_CLICK,1,2);
            }
        }
    }
    @Override
    public void onOverlayRender() {
        if(isSeeker&&showHiders.isEnabled()) {
            Minecraft.getInstance().fontRenderer.drawStringWithShadow(feedbackString, 10, 10, feedbackColor);
        }
    }

    private static boolean isMusicSound(String name) {
        for(String check:MUSIC_SOUNDS) {
            if(check.equals(name)) return true;
        }
        return false;
    }

}

and that's just PartyPooperModule.java

theres like 10000000000000 things more

no i dont own this code
being an experimentor

also

Please no hate about me being a begginer

even if you could tell me how to fix it for 1.16.1 would be great.

CommandHandler.javaFetching info... PartyPooperModule.javaFetching info... PropHuntModule.javaFetching info... ItemUtil.javaFetching info... ScoreboardUtil.javaFetching info... TextUtil.javaFetching info...

Posted (edited)

As far as I can tell this is code from a non-forge based hacked client made specifically for a Hypixel minigame.

Even if this forum was designed to ask other people to write code for you (which it isn't) and your code was for a Forge mod (which I'm pretty sure it isn't), no one here is going to be willing to help with that.

Don't cheat at games.

Edited by jdawg3636
  • Like 1

Website: jdawg3636.com
Discord: discord.gg/EKeM7Jz

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • Cracked Launchers are not supported
    • Hi, I have a problem in minecraft java (only in forge 1.20.1), When I start the game after a moment the game crashed with code 1 this only in forge 1.20.1 , I tried to reinstall java, Upgrade java to 17, update the drivers to the latest version, downgrade the drivers to the pervious version, deleting .minecraft and reinstall it , but none of these ways working.   here is the log:   [Launcher] Launching Minecraft... I'm hiding! mods after C:\Users\Windows\AppData\Roaming\.minecraft\mods\tl_skin_cape_forge_1.20_1.20.1-1.32.jar [InnerMinecraftServersImpl]  search changers of the servers read servers from servers.dat [] [InnerMinecraftServersImpl]  prepare inner servers save servers to servers.dat [Launcher] Game skin type: TLAUNCHER [Launcher] Starting Minecraft Forge 1.20.1... [Launcher] Launching in: C:\Users\Windows\AppData\Roaming\.minecraft Starting garbage collector: 96 / 227 MB Garbage collector completed: 60 / 214 MB [Launcher] Processing post-launch actions. Assist launch: true =============================================================================================== [05:29:03] [main/INFO]: ModLauncher running: args [--username, *********, --version, Forge 1.20.1, --gameDir, C:\Users\Windows\AppData\Roaming\.minecraft, --assetsDir, C:\Users\Windows\AppData\Roaming\.minecraft\assets, --assetIndex, 5, --uuid, *************************************, --accessToken, вќ„вќ„вќ„вќ„вќ„вќ„вќ„вќ„, --clientId, null, --xuid, null, --userType, mojang, --versionType, modified, --width, 925, --height, 530, --launchTarget, forgeclient, --fml.forgeVersion, 47.3.22, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [05:29:04] [main/INFO]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.12 by Oracle Corporation; OS Windows 10 arch amd64 version 10.0 [05:29:15] [main/INFO]: Loading ImmediateWindowProvider fmlearlywindow [05:29:24] [main/INFO]: Trying GL version 4.6 [05:29:60] [main/INFO]: Requested GL version 4.6 got version 4.6 [05:29:67] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/Windows/AppData/Roaming/.minecraft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%23100!/ Service=ModLauncher Env=CLIENT FATAL ERROR in native method: Thread[pool-2-thread-1,5,main]: No context is current or a function that is not available in the current context was called. The JVM will abort execution.     at org.lwjgl.opengl.GL11C.nglGetString(org.lwjgl.opengl@3.3.1+7/Native Method)     at org.lwjgl.opengl.GL11C.glGetString(org.lwjgl.opengl@3.3.1+7/GL11C.java:978)     at net.minecraftforge.fml.earlydisplay.DisplayWindow.initRender(fmlearlydisplay@1.20.1-47.3.22/DisplayWindow.java:209)     at net.minecraftforge.fml.earlydisplay.DisplayWindow.lambda$start$5(fmlearlydisplay@1.20.1-47.3.22/DisplayWindow.java:292)     at net.minecraftforge.fml.earlydisplay.DisplayWindow$$Lambda$437/0x000001fab120a618.run(fmlearlydisplay@1.20.1-47.3.22/Unknown Source)     at java.util.concurrent.Executors$RunnableAdapter.call(java.base@17.0.12/Executors.java:539)     at java.util.concurrent.FutureTask.run(java.base@17.0.12/FutureTask.java:264)     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(java.base@17.0.12/ScheduledThreadPoolExecutor.java:304)     at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.12/ThreadPoolExecutor.java:1136)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.12/ThreadPoolExecutor.java:635)     at java.lang.Thread.run(java.base@17.0.12/Thread.java:842) Here I am! [VersionManager] Refreshing versions locally... [VersionManager] Versions has been refreshed (6 ms) [Launcher] Launcher exited. [Launcher] Minecraft closed with exit code: 1 flush now [Launcher] [Crash] Signature "Bad video drivers" matches! [Crash] Signature "Bad video drivers" matches! [Launcher] [Crash] Crash has been recognized! [Crash] Crash has been recognized! flush now
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.