Jump to content

NqwSqw

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by NqwSqw

  1. Any help please ?
  2. The main problem is motionblur disappear on toggling perspective but it's buggy like it works with Third Person View but Third Person Rear View and First Person View doesn't work.
  3. So what I have to do with my code ? I'm a newbie in forge coding
  4. public void execute(final MinecraftServer server, final ICommandSender sender, final String[] args) { if (args.length == 0) { sender.addChatMessage((ITextComponent)new TextComponentString("Usage: /motionblur <0 - 10>.")); } else { final int amount = NumberUtils.toInt(args[0], -1); if (amount >= 0 && amount <= 10) { if (MotionBlurMod.isFastRenderEnabled()) { sender.addChatMessage((ITextComponent)new TextComponentString("Motion blur does not work if Fast Render is enabled, please disable it in Options > Video Settings > Performance.")); } else { if (this.mc.entityRenderer.getShaderGroup() != null) { this.mc.entityRenderer.getShaderGroup().deleteShaderGroup(); } if (amount != 0) { MotionBlurMod.isEnabled = true; MotionBlurMod.blurAmount = amount; try { final Method method = ReflectionHelper.findMethod((Class)EntityRenderer.class, (Object)this.mc.entityRenderer, new String[] { "loadShader", "loadShader" }, new Class[] { ResourceLocation.class }); method.invoke(this.mc.entityRenderer, new ResourceLocation("motionblur", "motionblur")); this.mc.entityRenderer.getShaderGroup().createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); sender.addChatMessage((ITextComponent)new TextComponentString("Motion blur enabled.")); } catch (Throwable ex) { sender.addChatMessage((ITextComponent)new TextComponentString("Failed to enable Motion blur.")); ex.printStackTrace(); } } else { MotionBlurMod.isEnabled = false; sender.addChatMessage((ITextComponent)new TextComponentString("Motion blur disabled.")); } } } else { sender.addChatMessage((ITextComponent)new TextComponentString("Invalid amount.")); } } } Here is MotionBlurCommand class @Mod(name = "MotionBlurMod", modid = "motionblurmod", version = "1.0", acceptedMinecraftVersions = "*") public class MotionBlurMod { private Minecraft mc; private Map domainResourceManagers; public static double blurAmount; public static boolean isEnabled; public MotionBlurMod() { this.mc = Minecraft.getMinecraft(); } @Mod.EventHandler public void init(final FMLInitializationEvent event) { ClientCommandHandler.instance.registerCommand((ICommand)new MotionBlurCommand()); MinecraftForge.EVENT_BUS.register((Object)this); } @SubscribeEvent public void onClientTick(final TickEvent.ClientTickEvent event) { if (this.domainResourceManagers == null) { try { for (final Field field : SimpleReloadableResourceManager.class.getDeclaredFields()) { if (field.getType() == Map.class) { field.setAccessible(true); this.domainResourceManagers = (Map)field.get(Minecraft.getMinecraft().getResourceManager()); break; } } } catch (Exception e) { throw new RuntimeException(e); } } if (!this.domainResourceManagers.containsKey("motionblur")) { this.domainResourceManagers.put("motionblur", new MotionBlurResourceManager()); } } @SubscribeEvent public void onKey(final InputEvent.KeyInputEvent event) { if (this.mc.thePlayer != null && MotionBlurMod.isEnabled && Keyboard.isKeyDown(this.mc.gameSettings.keyBindTogglePerspective.getKeyCode())) { try { final Method method = ReflectionHelper.findMethod((Class)EntityRenderer.class, (Object)this.mc.entityRenderer, new String[] { "loadShader", "loadShader" }, new Class[] { ResourceLocation.class }); method.invoke(this.mc.entityRenderer, new ResourceLocation("motionblur", "motionblur")); this.mc.entityRenderer.getShaderGroup().createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); } catch (Exception ex) {} } } public static boolean isFastRenderEnabled() { try { final Field fastRender = GameSettings.class.getDeclaredField("ofFastRender"); return fastRender.getBoolean(Minecraft.getMinecraft().gameSettings); } catch (Exception var1) { return false; } } static { MotionBlurMod.blurAmount = 0.75; MotionBlurMod.isEnabled = false; } } Here MotionBlurMod main class public class MotionBlurResource implements IResource { private static final String JSON = "{\"targets\":[\"swap\",\"previous\"],\"passes\":[{\"name\":\"phosphor\",\"intarget\":\"minecraft:main\",\"outtarget\":\"swap\",\"auxtargets\":[{\"name\":\"PrevSampler\",\"id\":\"previous\"}],\"uniforms\":[{\"name\":\"Phosphor\",\"values\":[%.2f, %.2f, %.2f]}]},{\"name\":\"blit\",\"intarget\":\"swap\",\"outtarget\":\"previous\"},{\"name\":\"blit\",\"intarget\":\"swap\",\"outtarget\":\"minecraft:main\"}]}"; public InputStream getInputStream() { final double amount = 0.7 + MotionBlurMod.blurAmount / 100.0 * 3.0 - 0.01; return IOUtils.toInputStream(String.format(Locale.ENGLISH, "{\"targets\":[\"swap\",\"previous\"],\"passes\":[{\"name\":\"phosphor\",\"intarget\":\"minecraft:main\",\"outtarget\":\"swap\",\"auxtargets\":[{\"name\":\"PrevSampler\",\"id\":\"previous\"}],\"uniforms\":[{\"name\":\"Phosphor\",\"values\":[%.2f, %.2f, %.2f]}]},{\"name\":\"blit\",\"intarget\":\"swap\",\"outtarget\":\"previous\"},{\"name\":\"blit\",\"intarget\":\"swap\",\"outtarget\":\"minecraft:main\"}]}", amount, amount, amount)); } public boolean hasMetadata() { return false; } public IMetadataSection getMetadata(final String metadata) { return null; } public ResourceLocation getResourceLocation() { return null; } public String getResourcePackName() { return null; } public void close() throws IOException { } } Here MotionBlurRessource class public class MotionBlurResourceManager implements IResourceManager { public Set<String> getResourceDomains() { return null; } public IResource getResource(final ResourceLocation location) throws IOException { return (IResource)new MotionBlurResource(); } public List<IResource> getAllResources(final ResourceLocation location) throws IOException { return null; } } Then MotionBlurRessourceManager class Anyways, what does it mean "don't have a uniform with the InSize name" ? Thank you for replying
  5. Any help please ?
  6. You can use a tool named BON2 to replace field, function and parameters that do an important job in the updating course of your mod
  7. Hi I want to solve an error of a mod called MotionBlur that give player a blur effect but while toggling perspective, the blur disappear. So, i created a method to when player toggle perspective, it give blur but it's buggy like it works with Third Person View but Third Person Rear View and First Person View doesn't work. Here is the code: @SubscribeEvent public void onKey(final InputEvent.KeyInputEvent event) { if (this.mc.thePlayer != null && MotionBlurMod.isEnabled && Keyboard.isKeyDown(this.mc.gameSettings.keyBindTogglePerspective.getKeyCode())) { try { //final Method method = ReflectionHelper.findMethod((Class)EntityRenderer.class, (Object)this.mc.entityRenderer, new String[] { "loadShader", "func_175069_a" }, new Class[] { ResourceLocation.class }); this.mc.entityRenderer.loadShader(new ResourceLocation("motionblur", "motionblur")); this.mc.entityRenderer.getShaderGroup().createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); } catch (Exception ex) {} } }
  8. public void handleEntityTeleport(SPacketEntityTeleport packetIn) { final Entity e = Minecraft.getMinecraft().theWorld.getEntityByID(packetIn.getEntityId()); if (e instanceof EntityPlayer) { double x = packetIn.getX(); double z = packetIn.getX(); double f = 1.0D; if (f == 0.0) { this.parent.handleEntityTeleport(packetIn); return; } final double c = Math.hypot(Minecraft.getMinecraft().thePlayer.posX - x, Minecraft.getMinecraft().thePlayer.posZ - z); if (f > c) { f -= c; } final float r = this.a(x, z); if (this.a(Minecraft.getMinecraft().thePlayer.rotationYaw, r) > 180.0) { this.parent.handleEntityTeleport(packetIn); return; } final double a = Math.cos(Math.toRadians(r + 90.0f)); final double b = Math.sin(Math.toRadians(r + 90.0f)); x -= a * f; z -= b * f; final Class<?> k = packetIn.getClass(); try { Field fi = k.getDeclaredField("field_149456_b"); fi.setAccessible(true); fi.set(packetIn, (x)); fi = k.getDeclaredField("field_149454_d"); fi.setAccessible(true); fi.set(packetIn, (z)); } catch (Exception ex) {} } this.parent.handleEntityTeleport(packetIn); } Hi, I want to make a misplace for being testing but while I hit a player , the player dissapear from my vision.
  9. Hi, I make a mod but some packet doesn't work in 1.9.4 Can anyone fix them ?
  10. Hi, I have made a NameSpoof mod but I want to use setLocationofCape but i can't use while I add Optifine as library Any fix ?
  11. Hi, I want to make that when a player was hurt by other player, it check where player was hurt like the back of the player Thank you to spend time to read this
  12. Yes I try make a hack with selfdestruct to hide the hack and injection into javaw.exe process.
  13. To bypass Process Hacker String detection
  14. a.b.c.Module.Category.Combat a.b.c is the package name
  15. I use forge xd
  16. hi, I have made a code to change the knockback of the player but when I set to like 86.1 % in 1.11 version it made like 10% knockback but in 1.9.4 it work well public class VL extends MDL { private NumberValue HM; private NumberValue VM; private BooleanValue LE; private Random random; public VL() { super("VL", 0, a.b.c.MDL.Category.C); this.HM = new NumberValue("X", 100.0, 0.0, 100.0); this.VM = new NumberValue("Y", 100.0, 0.0, 100.0); this.LE = new BooleanValue("Target Only", false); addValue(this.HM); addValue(this.VM); addBoolean(this.LE); } @SubscribeEvent public void onTick(final TickEvent event) { if (Wrapper.getPlayer() == null) { return; } if (Wrapper.getWorld() == null) { return; } final double vM = this.VM.getValue() / 100.0; final double hM = this.HM.getValue() / 100.0; if (Wrapper.getPlayer().hurtTime == Wrapper.getPlayer().maxHurtTime && Wrapper.getPlayer().maxHurtTime > 0) { final EntityPlayerSP player4; final EntityPlayerSP player = player4 = Wrapper.getPlayer(); player4.motionX *= hM; final EntityPlayerSP player5; final EntityPlayerSP player2 = player5 = Wrapper.getPlayer(); player5.motionZ *= hM; final EntityPlayerSP player6; final EntityPlayerSP player3 = player6 = Wrapper.getPlayer(); player6.motionY *= vM; } } private boolean canTarget(final EntityLivingBase entity) { if (!(entity instanceof EntityPlayer) || !(entity instanceof EntityMob) || !(entity instanceof EntityAnimal)) { return false; } if (entity.getHealth() <= 0.0f) { return false; } if (Wrapper.getPlayer().isSneaking()) { return false; } if (MovementUtils.isMoving()) { return false; } if (Wrapper.getPlayer().jumpMovementFactor != 0.0F) { return false; } final float yaw = AngleUtil.getAngle((Entity)entity)[1]; final double yawDistance = MathUtil.getAngleDifference(yaw, this.mc.thePlayer.rotationYaw); if (yawDistance > 40.0) { return false; } if (entity.isInvisible() && entity instanceof EntityPlayer) { final EntityPlayer entityPlayer = (EntityPlayer)entity; for (final ItemStack item : entityPlayer.inventory.armorInventory.clone()) { if (item != null) { return true; } } return entityPlayer.getHeldItemMainhand() != null; } return true; } private Entity getTargetEntity() { double maxDistance = 360.0; Entity target = null; for (final Object object : this.mc.theWorld.loadedEntityList) { if (!(object instanceof EntityLivingBase)) { continue; } final EntityLivingBase entity = (EntityLivingBase)object; if (!this.canTarget(entity)) { continue; } final float yaw = AngleUtil.getAngle((Entity)entity)[1]; final double yawDistance = MathUtil.getAngleDifference(yaw, this.mc.thePlayer.rotationYaw); if (maxDistance <= yawDistance) { continue; } target = (Entity)entity; maxDistance = yawDistance; } return target; } @Override public void onDisable() { final EntityPlayerSP player4; final EntityPlayerSP player = player4 = Wrapper.getPlayer(); player4.motionX *= 1.0f; final EntityPlayerSP player5; final EntityPlayerSP player2 = player5 = Wrapper.getPlayer(); player5.motionZ *= 1.0f; final EntityPlayerSP player6; final EntityPlayerSP player3 = player6 = Wrapper.getPlayer(); player6.motionY *= 1.0f; } }
  17. Okey
  18. There is a way to fly without permission ?
  19. Hi, I have a problem with my code, when I set fly on it make a little effect of sprint and I can't fly. Can anyone help me ? public class FL extends a.b.c.MDL /* */ { /* */ private NumberValue speed; /* */ /* */ public FL() /* */ { /* 29 */ super("Air", 0, a.b.c.MDL.Category.B); this.speed = new NumberValue("Speed", 2.0D, 1.0D, 3.0D); //addValue(this.speed); } @Override public void onEnable() { Wrapper.getPlayer().capabilities.isFlying = true; //MovementUtils.setSpeed(speed.getValue() / 10); } @Override public void onDisable() { Wrapper.getPlayer().capabilities.isFlying = false; } }
  20. No I just want to enable a module in my GUI of the mod and when I enable it, it give the mobeffects to the player
  21. No I just want to enable a module in my GUI of the mod.
  22. Hi, I want to give player effects when i enable my modules but it's doesn't works package xyz.fusked.m0dules.mods.render; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import xyz.fusked.values.BooleanValue; import xyz.fusked.values.IntegerValue; public class NightVision extends xyz.fusked.m0dules.Module{ public NightVision() { super("Night Vision", 0, xyz.fusked.m0dules.Module.Category.RENDER); } public void onEnable(EntityPlayer player) { player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, -1, 0)); } public void onDisable(EntityPlayer player) { player.removePotionEffect(MobEffects.NIGHT_VISION); } } this is my file where is onEnable : /* */ package xyz.fusked.m0dules; /* */ /* */ import java.util.ArrayList; /* */ import net.minecraft.client.Minecraft; /* */ import net.minecraftforge.common.MinecraftForge; /* */ import net.minecraftforge.fml.common.FMLCommonHandler; /* */ import net.minecraftforge.fml.common.eventhandler.EventBus; /* */ import xyz.fusked.utils.Wrapper; /* */ import xyz.fusked.values.BooleanValue; /* */ import xyz.fusked.values.DoubleValue; import xyz.fusked.values.IntegerValue; /* */ /* */ public abstract class Module /* */ { /* */ protected Minecraft mc; /* */ private String name; /* */ private int key; /* */ private boolean state; /* */ private Category category; /* */ private ArrayList<BooleanValue> booleans; /* */ private ArrayList<DoubleValue> doubles; private ArrayList<IntegerValue> integers; /* */ /* */ public Module(String name, int key, Category category) /* */ { /* 24 */ this.mc = Wrapper.getMinecraft(); /* 25 */ this.booleans = new ArrayList(); /* 26 */ this.doubles = new ArrayList(); this.integers = new ArrayList(); /* 27 */ this.name = name; /* 28 */ this.key = key; /* 29 */ this.state = false; /* 30 */ this.category = category; /* */ } /* */ /* */ public String getName() { /* 34 */ return this.name; /* */ } /* */ /* */ public void setName(String name) { /* 38 */ this.name = name; /* */ } /* */ /* */ public void setKey(int key) { /* 42 */ this.key = key; /* */ } /* */ /* */ public boolean setToggled(boolean toggled) { /* 46 */ return this.state = toggled; /* */ } /* */ /* */ public boolean getState() { /* 50 */ return this.state; /* */ } /* */ /* */ public int getKey() { /* 54 */ return this.key; /* */ } /* */ /* */ public Category getCategory() { /* 58 */ return this.category; /* */ } /* */ /* */ public ArrayList<BooleanValue> getBooleans() { /* 62 */ return this.booleans; /* */ } /* */ /* */ public ArrayList<DoubleValue> getDoubles() { /* 66 */ return this.doubles; /* */ } public ArrayList<IntegerValue> getIntegers(){ return this.integers; } /* */ /* */ public void toggle() { /* 70 */ setState(!this.state); /* */ } /* */ /* */ public void addBoolean(BooleanValue booleans) { /* 74 */ this.booleans.add(booleans); /* */ } /* */ /* */ public void addDouble(DoubleValue doubles) { /* 78 */ this.doubles.add(doubles); /* */ } public void addInteger(IntegerValue integers) { this.integers.add(integers); } /* */ /* */ public static ArrayList<Module> getCategoryModules(Category cat) { /* 82 */ ArrayList<Module> modsInCategory = new ArrayList(); /* 83 */ for (Module mod : ModuleManager.getModules()) { /* 84 */ if (mod.getCategory() == cat) { /* 85 */ modsInCategory.add(mod); /* */ } /* */ } /* 88 */ return modsInCategory; /* */ } /* */ /* */ public static Module getModule(Class<? extends Module> clazz) { /* 92 */ for (Module mod : ModuleManager.getModules()) { /* 93 */ if (mod.getClass() == clazz) { /* 94 */ return mod; /* */ } /* */ } /* 97 */ return null; /* */ } /* */ /* */ public void setState(boolean enabled) { /* 101 */ if (this.state == enabled) { /* 102 */ return; /* */ } /* 104 */ this.state = enabled; /* 105 */ if (enabled) { /* 106 */ MinecraftForge.EVENT_BUS.register(this); /* 107 */ FMLCommonHandler.instance().bus().register(this); /* 108 */ onEnable(); /* */ } /* */ else { /* 111 */ MinecraftForge.EVENT_BUS.unregister(this); /* 112 */ FMLCommonHandler.instance().bus().unregister(this); /* 113 */ onDisable(); /* */ } } /* */ /* */ public void onEnable() {} /* */ /* 118 */ public static enum Modules { Hitbox ; /* */ /* */ private Modules() {} } /* */ /* 134 */ public static enum Category { COMBAT, /* 135 */ RENDER, /* 136 */ OTHER, PLAYER, BLATANT, /* 137 */ UTILITY; /* */ /* */ private Category() {} /* */ } /* */ /* */ public void onDisable() {} /* */ }
  23. Thanks for your help but I just solve the problem !
  24. To inject mod into Minecraft Forge
  25. Making injection mod
×
×
  • Create New...

Important Information

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