Jump to content

Skkkitzo

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Skkkitzo

  1. When I run ./gradlew runClient it loads up the game, and all seems well. However, when I attack any block, it crashes giving: [13:03:05] [Client thread/FATAL] [minecraft/Minecraft]: Unreported exception thrown! java.lang.NoSuchFieldError: drill at net.skkkitzo.konstant.EventHandlerCommon.onBlockBreak(EventHandlerCommon.java:29) ~[EventHandlerCommon.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_EventHandlerCommon_onBlockBreak_BreakSpeed.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) ~[EventBus.class:?] at net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(ForgeEventFactory.java:199) ~[ForgeEventFactory.class:?] at net.minecraft.entity.player.EntityPlayer.getDigSpeed(EntityPlayer.java:916) ~[EntityPlayer.class:?] at net.minecraftforge.common.ForgeHooks.blockStrength(ForgeHooks.java:264) ~[ForgeHooks.class:?] at net.minecraft.block.Block.getPlayerRelativeBlockHardness(Block.java:702) ~[Block.class:?] at net.minecraft.block.state.BlockStateContainer$StateImplementation.getPlayerRelativeBlockHardness(BlockStateContainer.java:420) ~[BlockStateContainer$StateImplementation.class:?] at net.minecraft.client.multiplayer.PlayerControllerMP.clickBlock(PlayerControllerMP.java:269) ~[PlayerControllerMP.class:?] at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1630) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2376) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2147) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1935) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1188) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:442) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_251] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_251] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_251] 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_251] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_251] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_251] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_251] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Now forgive me if I'm wrong, but I'm a bit confused about this. Because according to this line at net.skkkitzo.konstant.EventHandlerCommon.onBlockBreak(EventHandlerCommon.java:29) ~[EventHandlerCommon.class:?] I have a class called EventHandlerCommon in the package net.skkkitzo.konstant, which I do not. The class is actually located in the package net.skkkitzo.konstant.handlers. And even more confusing, it says line #29 is the culprit.... but that is the line of my class. Is gradle using the wrong code or something? I am completely baffled. Any help is much appreciated. Using the latest version
  2. Then my question is, why are almost all the large mods (TE5, Applied Energistics, Industrial Foregoing, etc.) made for 1.12.2 and nothing above?
  3. I am using 1.12.2, as this is the version that most mods are currently updated to. I tried that, nothing. I would assume it's the version I'm using.
  4. I know this question has been asked a few times on these forums before, but the answers were inconclusive and sometimes confusing. I have been searching for quite some hours now, to no avail. I want to use VScode for forge modding, and I know I can use eclipse or intelliJ, I just prefer VScode; and at this point I've spent so much effort trying to get it working that I don't want to just give up. Downloading the mdk from Forge's official downloads page, and then opening that folder in VScode, I would assume you would immediately be able to start debugging but no. I noticed that you must have a launch.json file, but I am unsure what needs to be put in this. I tried copying this file from FabricMC, and editing the classes, but that didn't work. I tried to auto-generate the file as well, but to no avail. What am I missing? What is staring me in the face and I cannot see it? I apologise for asking this question the millionth time on these forums probably, but I cannot find any answers. I greatly appreciate any help
  5. And one final thing, why is redstone ore not an instance of BlockOre?
  6. And regarding other mod support, I'll do some research on how to implement general mod supportivity, but specifically regarding checking if the block that I mine is an instance of their mod, would it be similar to block_mined instanceof BlockOre or is it something entirely different? I would assume because other mod's ores would still be extensions of the BlockOre class that this code would work.
  7. When you say, "just check if the block is an instance of OreBlock", do you mean something like this? if (event.getState().getBlock() instanceof BlockOre) { System.out.println("Yes"); }
  8. Forgive me if this is a duplicate answer, I haven't been able to find anything relating to this. How can I test if a block at position x,y,z is a type of ore? Something like this MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); World world = server.getWorld(0); IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); if (block.type == Type.ORE) { // do smthing } I cannot just manually check for every ore type, because depending on how many other mods are installed, there could be a lot of different ores. I'm not really sure how to proceed from here, as I can't find anything regarding the type of a block. Thanks in advance
  9. Found a solution, will update OP.
  10. Yeah I saw that earlier as well, but my question is what's: Direction.getFacingDirections Because when I type this in, Eclipse has no suggestions for me. Wondering what library this is from?
  11. How can I get the block face that the player was facing when they broke the block? I am using the BreakEvent event, and I can't seem to find anything related to side or faces. Solution: Using ray casting from the player's head I can find out which side of the block I am looking at. double a = player.posX; double b = player.posY + (double)player.getEyeHeight(); double c = player.posZ; Vec3d vec3start = new Vec3d(a, b, c); float f = player.rotationPitch; float f1 = player.rotationYaw; float f2 = MathHelper.cos(-f1 * 0.017453292F - (float)Math.PI); float f3 = MathHelper.sin(-f1 * 0.017453292F - (float)Math.PI); float f4 = -MathHelper.cos(-f * 0.017453292F); float f5 = MathHelper.sin(-f * 0.017453292F); float f6 = f3 * f4; float f7 = f2 * f4; double d3 = 5.0D; Vec3d vec3end = vec3start.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); RayTraceResult face = world.rayTraceBlocks(vec3start, vec3end); The maths behind this is completely overwhelming for me. But if you just copy and paste this, it works. If you want to then get the string value of which side you are looking at, use: face.sideHit.toString();
×
×
  • Create New...

Important Information

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