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

hiotewdew

Members
  • Posts

    101
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by hiotewdew

  1. Quote from StackOverflow. " There are three cases where a FileNotFoundException may be thrown. The named file does not exist. The named file is actually a directory. The named file cannot be opened for reading for some reason. The first two cases are unlikely based on your description. I would test against the third case using file.canRead() . "
  2. So you have to convert the method to some sort of format that excludes partial ticks so it can run serverside.
  3. @Nullable @SideOnly(Side.CLIENT) public RayTraceResult rayTrace(double blockReachDistance, float partialTicks) { Vec3d vec3d = this.getPositionEyes(partialTicks); Vec3d vec3d1 = this.getLook(partialTicks); Vec3d vec3d2 = vec3d.addVector(vec3d1.x * blockReachDistance, vec3d1.y * blockReachDistance, vec3d1.z * blockReachDistance); return this.world.rayTraceBlocks(vec3d, vec3d2, false, false, true); } This is the method...
  4. While you do attempt to do the above it is not correct. static { FluidRegistry.enableUniversalBucket(); } public static final String MODID = "mff"; public static final String NAME = "My Food Factory"; public static final String VERSION = "1.0.0"; public static Logger LOGGER; @Mod.Instance(MyFoodFactory.MODID) public static MyFoodFactory instance; Should be changed to this: public static final String MODID = "mff"; public static final String NAME = "My Food Factory"; public static final String VERSION = "1.0.0"; public static Logger LOGGER; @Mod.Instance(MyFoodFactory.MODID) public static MyFoodFactory instance = createInstance(); static MyFoodFactory createInstance() { FluidRegistry.enableUniversalBucket(); }
  5. You have to call enableUniversalBucket before the pre-initialization stage. Here's a solved thread with an explanation.
  6. I feel like there's a different problem because I am NOT calling any functions to play sounds except in some cases, but in the cases that I don't, there is literally no time I call getAmbientSound(). This is all vanilla handling it. I have a mob with functioning sound, a villager, using default villager sounds. Yet my other mobs all extend a base class, which extends EntityAnimal, which is exactly what I have my villager extending. It makes no sense. The SoundEvents seem to be correct. I read the Forge docs several times already and nothing there has worked.
  7. If you can get the GuiButton variable possibly event.buttonList.get(number) or something like that You can set the visible variable to true/false
  8. A Vector is a list of three numbers. It has an X value, a Y value, and a Z value. In Minecraft, X, Y, and Z refer to the position a block/tile/entity is located at. So if you have a Vector and desire a BlockPos, you can create a BlockPos with a vector via new BlockPos(Vector) Draco referenced the rayTrace function. You can use the EntityPlayer rayTrace to find the Vector (Block Position) that the play is currently looking at. So you can use RayTraceResult rayResult = playerIn.rayTrace(howFarThePlayerCanReachinBlocks, partialTicksnotSurewhatthisIs); BlockPos lookingPosition = new BlockPos(rayResult.hitVec); // Summon your lightning at lookingPosition I haven't tested but if that doesn't work try adding the hitVec to the player position like this: BlockPos lookingPosition = rayResult.hitVec.add(player.getPositionVector()); Pursue your modding course and make sure you understand Java and not just Minecraft code. Java is a useful skill and a powerful tool.
  9. Can I have more context than this? Or are you good and used a universal bucket?
  10. EntityPlayer player = (EntityPlayer) sender.getCommandSenderEntity(); player.sendMessage(new TextComponentString("Current FPS Spoof: " + this.mod.getSpoofType().toString() )); This forum isn't a Java tutorial. Make sure you have basic Java knowledge. and Matryoshika is correct, the calling of Minecraft.getMinecraft().getPlayer() would be bad especially when execute gives you the player executing in the form of ICommandSender.
  11. If you're trying to fix the chat, you send chat with (an instance of EntityPlayer).sendMessage(new TextComponentString(a String));
  12. Error Log? Well, if you are passing a packet from client to server but it is on a singleplayer world, there's a server, but not a dedicated server. I'm not sure, but maybe that could be the problem. Try a manual check for a server and if it isn't a server, just do it all clientside. The problem could be that EntityPlayerSP extends an abstract class, AbstractClientPlayer, which extends EntityPlayer. EntityPlayerSP isn't referenced in these kinds of situations. You run most things on EntityPlayer. In what situation must this be applied to EntityPlayerSP? If you're using Minecraft.getMinecraft().player, you shouldn't. Use the reference from the command as your player. I know nothing about ASM. This is literally all speculation.
  13. If you want to drain it just add a check to see if the item held is your full bucket and run eventWorld.setBlockState to set the block at hitVec to your liquid.
  14. Use Event hooks from Forge. So create an EventHandler, make sure it's registered and subscribe an event like so: public static void onBucketUsed(FillBucketEvent event) { World eventWorld = event.getWorld(); BlockPos hitPos = new BlockPos(event.getTarget().hitVec); if(eventWorld.getBlockState(hitPos) == yourBlockRegistry.theliquidVariable) { event.setFilledBucket(new ItemStack(yourItemRegistry.theBucketVariable, 1)); } }
  15. I have no idea. Some sort of system error. Maybe someone more experienced than me can help you.
  16. It should be in C:\Users\Josh\AppData\Roaming\.minecraft\.minecraft\
  17. There is no error in this crash report (See "Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR". Is this the log or the report from the crash-reports folder? If it's the log can you add the crash-report file if there is one?
  18. So basically if you're on a server the sound doesn't work and the client gives you this error: [main/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1161) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:45) ~[PositionedSoundRecord.class:?] at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:40) ~[PositionedSoundRecord.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:509) ~[WorldClient.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:497) ~[WorldClient.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSoundEffect(NetHandlerPlayClient.java:1828) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:78) ~[SPacketSoundEffect.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:13) ~[SPacketSoundEffect.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [17:48:46] [main/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1161) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:45) ~[PositionedSoundRecord.class:?] at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:40) ~[PositionedSoundRecord.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:509) ~[WorldClient.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:497) ~[WorldClient.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSoundEffect(NetHandlerPlayClient.java:1828) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:78) ~[SPacketSoundEffect.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:13) ~[SPacketSoundEffect.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [17:48:46] [main/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1161) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:45) ~[PositionedSoundRecord.class:?] at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:40) ~[PositionedSoundRecord.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:509) ~[WorldClient.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:497) ~[WorldClient.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSoundEffect(NetHandlerPlayClient.java:1828) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:78) ~[SPacketSoundEffect.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:13) ~[SPacketSoundEffect.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more [17:48:47] [main/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1161) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:45) ~[PositionedSoundRecord.class:?] at net.minecraft.client.audio.PositionedSoundRecord.<init>(PositionedSoundRecord.java:40) ~[PositionedSoundRecord.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:509) ~[WorldClient.class:?] at net.minecraft.client.multiplayer.WorldClient.playSound(WorldClient.java:497) ~[WorldClient.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSoundEffect(NetHandlerPlayClient.java:1828) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:78) ~[SPacketSoundEffect.class:?] at net.minecraft.network.play.server.SPacketSoundEffect.processPacket(SPacketSoundEffect.java:13) ~[SPacketSoundEffect.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_121] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 15 more The server gives no errors whatsoever and my code is not referenced in the stacktrace. Any ideas? This is my sound code on my mob: @Override protected SoundEvent getAmbientSound() { return SoundRegistry.grump; } grump being a regular SoundEvent. EDIT: PositionedSoundRecord contains this as line 43-46: 43 private PositionedSoundRecord(SoundEvent soundIn, SoundCategory categoryIn, float volumeIn, float pitchIn, boolean repeatIn, int repeatDelayIn, ISound.AttenuationType attenuationTypeIn, float xIn, float yIn, float zIn) 44 { 45 this(soundIn.getSoundName(), categoryIn, volumeIn, pitchIn, repeatIn, repeatDelayIn, attenuationTypeIn, xIn, yIn, zIn); 46 } Line 40 is a constructor pointing to this one. From my understand one of the constructing values are null creating this error. I just cannot understand this. Sound should work normally!!! This is a sound in my sounds.json(pointed to by the SoundEvent via ResourceLocation, but I know that works, don't worry about it) "grump": { "replace": false, "category": "entity", "sounds": [ "derpcats:grump" ] },
  19. I can't figure out how Minecraft does this. I know I CAN do it since Minecraft itself does it. Anyone know? EDIT: I have a GUI with buttons, just need the method to call. Sorry for being vague.
  20. I've registered my Event Handler and it does print "#!#" as expected but the button just isn't there. Here's my event class: public class EventHandler { @SubscribeEvent public void onGuiInit(InitGuiEvent.Pre event) { if(event.getGui() instanceof GuiIngameMenu) { // Make sure GUI is Escape menu System.out.println("#!#"); GuiButton button = new GuiButton(43, Minecraft.getMinecraft().displayWidth / 4, Minecraft.getMinecraft().displayHeight / 4, "Music"); event.getButtonList().add(button); } } @SubscribeEvent public void onGuiActionPerformed(ActionPerformedEvent event) { if(event.getGui() instanceof GuiIngameMenu && event.getButton().id == 43) { //Confirm my button was pressed //Open new GUI here } } } Yet when I open it up and hit esc, it prints #!# but fails to show any button in existence.
  21. Is there any reason I was banned from my old account? I don't understand how posting this thread and reporting some spam results in a ban. Anyone?
×
×
  • Create New...

Important Information

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