Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

NqwSqw

Members
  • Posts

    43
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NqwSqw's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. 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.
  2. So what I have to do with my code ? I'm a newbie in forge coding
  3. 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
  4. 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
  5. 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) {} } }
  6. 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.
  7. Hi, I make a mod but some packet doesn't work in 1.9.4 Can anyone fix them ?
  8. 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 ?
  9. 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
  10. Yes I try make a hack with selfdestruct to hide the hack and injection into javaw.exe process.
  11. To bypass Process Hacker String detection
  12. a.b.c.Module.Category.Combat a.b.c is the package name
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.