Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. get the vector you need to look (blockvector-playervector) after that you need to get pitch and yaw from that. https://bukkit.org/threads/tutorial-how-to-calculate-vectors.138849/
  2. Ah im sorry I thought you had trouble with the setting player head part. What you need to do is calculate the vector from your eyes to the block and get the angles from it. player.getPositionEyes gets you the position of the players eyes as Vec3, getting the Vec3 from a BlockPos should be new Vec3(pos). After that its vector math
  3. private float epicVariableOne, epicVariableTwo; @SubscribeEvent public void clientTick(ClientTickEvent event) { if(event.phase==Phase.END) return; epicVariableOne+=0.3f; epicVariableTwo+=0.3f; if(Minecraft.getMinecraft().thePlayer!=null)Minecraft.getMinecraft().thePlayer.setAngles(epicVariableOne, epicVariableTwo); } (This is part of an MinecraftForge EventBus)
  4. I already told you how to find them. They are in the minecraft class. If you are inside the class u can use Strg+F to search
  5. You need to add it to the build path..
  6. Take a look at the Minecraft class. Check the method rightClickMouse you will find everything you need there
  7. This will only work for blocks. Do you want to do that on client or server side?
  8. I think what he means is that the method gets called twice (server/client) if he clicks once and the method gets called twice and the second run causes the weapon to shoot, because his variable is global. By the way if the server is on your local machine, do server and client share the same class for the items or are there two instances?
  9. First of all dont put variables inside the item class, because they are singletons and shared for all instances of your object. Use the itemStacks tagcompound Second why are you checking if your itemStack has the stacksize 0 ?
  10. If you are working on a client side mod the Minecraft class is your way to go. It has two methods "rightClickMouse" , and "clickMouse". You are free to guess what they do. The methods are private, so you need to use reflection to call them
  11. Have you tried the google? What is this kind of sorcery?
  12. I tracked some call hierachy, and it seems like the Packet C08PacketPlayerBlockPlacement might be the thing you are looking for, even if if might be complicated using it correctly
  13. Failender and jsons, a never ending lovestory x) thank you for help sir! I was searching the error in the wrong file all the time
  14. Hey everyone, I started doing my own crops and having trouble with the jsons. I get the following exception (8 times, for age from 0 to 7) Im a bit confused because I am quite certain that the jsons are correct. The models/block json (8 times from 0 to 7 blockstates Any help would be appreciated. Greetz Fail
  15. Add your mod to your workspace http://www.minecraftforge.net/forum/index.php?topic=19177.0 After that you can either just straight up import your stuff or use GameRegistry functions to get already registered items (GameRegistry.getRegisteredItem?)
  16. UUID's use 128 bit. long use 64 bit. That means u can represent a UUID with 2 long, most significant and least significant. If you are a bit into computer science u will already know those two terms
  17. and im pretty sure that 1.7 will have a reference of the block that got broken.. aaaaaaaand I found it. its HarvestDropsEvent#block
  18. if(stack.getItem()==Items.iron) itsIron();
  19. thats 1.8 code, (1.8 introduced IBlockState) but it should be easy to rewrite it for 1.7
  20. setHarvestLevel on vanilla stuff will not do what you are expecting. you will need to use events for that. (in case I missed a patch that changed that please correct me) https://github.com/Failender/AdvancedTools/blob/master/main/java/de/failender/advancedtools/utils/ToolHandler.java
  21. yes. WorldSavedData OP!
  22. So when is writeToNBT getting called? I would expect it to be when the game gets safed to disk, but I got a sysout that is never shown sadly
  23. @SubscribeEvent public void onPlantGrowth(GrowthTick event) { if(event.world.isRemote) return; if(event.block instanceof IGrowable) { IGrowable growable = (IGrowable) event.block; if(!growable.canGrow(event.world, event.pos, event.currentState, false)) { addDecayer(new PlantDecayer(event.currentState, event.pos, event.world, TIME_TO_DECAY_MIN+event.world.rand.nextInt(TIME_TO_DECAY_RND))); } } } This is what I am doing right now. The add decayer is registering the position to a watcher that is a tick handler that checks after x seconds if the plant is still there. There you could just go ahead and get the blockstate with metadata 0, because thats normally the seed stage. Even if thats not what im triing to accomplish :b
  24. Alright. I am at the point where I feel totally retarded. The mod wants me to get 1.8.9 . But I cant find forge for 1.8.9, only for 1.8 which seems to get me 1.8.0
×
×
  • Create New...

Important Information

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