Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. no idea to be honest, i started with 1.8 . try it out i guess..
  2. To make it simple. if(Player.getCurrentEquippedItem() !=null && Player.getCurrentEquippedItem().itemID == this.itemID NO if(Player.getCurrentEquippedItem()==MyItem) YES if you dont understand this go back, learn some java and come backj then
  3. Im not gonna spoon feed you. If you got some specific questions I might help you but im not gonna throw a bunch of code on you
  4. also you dont need to compare the items, the boolean should tell u if the item is equipped or not
  5. dont use ids to compare, use the instance of the item u create to register the item. so use equippedItem==myItem
  6. for gods sake learn java. NEW BlockPos
  7. use new BlockPos(x,y,z). blockpos is the new wrapper class for posuitiohns
  8. should be event.state.getBlock()
  9. how about you tell us which version you are in? if its 1.8 , 1.8 ios working wit hblocksates
  10. if you know what static means then you know where ur issues come from.
  11. use an IWorldGenerator, to check which chunk u are in use World#getBiomeGenForCoods Also if u have a question add which version u are in please.
  12. Your tradehandler code is never getting called. the FMLInit events are only called in the Mainmod class. So you need to call the villager stuff from your main mod class
  13. ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); ModItem.mainRegistry(); what the f.....?
  14. Sorry that I answered on your first problem.
  15. for your handler implement IMessageHandler and your message needs to implement IMessage. that will fix the problem with not applicable args
  16. never ever copy paste cody. it wont help you
  17. the thread is month old why are u responsing here?^^ i had it in preinit
  18. Was already using that, just dont realized that I need to use the relative path, seen from the jar. Thank you anyway. (So we were talking about learning java.. :'D )
  19. I was so confused with the exception with the handler that i dont thought about the thrown ioexception Actually I dont care, because I want to crash the game anyway if there is something wrong in that part, because then my mod will be useless as fk. But yeah it is a FileNotFound exception. java.lang.RuntimeException: java.io.FileNotFoundException: F:\Server\mods\minigames-1.8-1.0.jar\assets\minigames\maps\archer.fail (Das System kann den angegebenen Pfad nicht finden) I just realized that my problem is, that my file inside a jar, so its technically not a file. So I need to read the file inside the jar. The way to do that was getClassCloader and getResourceAsStream (right?) so my problem is.. im inside a static method i cant use this.class. Whats the correct way to do that?
  20. Hey guys, to describe my situation. I got additional data saved in the assets under assets.minigames.maps , that I need to access on server side. So i save the path of my data in the preInit Event using path = event.getSourceFile().getAbsolutePath(); The files are storing an int[][][] , saved with an ObjectOutputStream into the file. So I try to read that using the following method, where key is the name of the map (e.g. archerwars) private static int[][][] readFile(String key) { File file = new File(MiniGames.path+"/assets/minigames/maps/"+key+".fail"); try { ObjectInputStream in = new ObjectInputStream(new FileInputStream(file)); int[][][] ret = (int[][][]) in.readObject(); in.close(); return ret; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(file.getAbsolutePath()); } } In eclipse this is working just fine. But once I compile the mod it crashes the server with the following crash log Any ideas? Greetz Fail
  21. hint of the day: learn java x)
  22. it might be better to create ur SNW by using the constructor SimpleNetworkWrapper(String channelname) but i am not sure with that
  23. public void setMimicBlock(IBlockState state, boolean isClient) { this.state = state; if (isClient){ PacketDispatcher.sendToAll(new SyncCurrentMimicBlockState((EntityPlayer) this.player)); PacketDispatcher.sendToServer(new SyncCurrentMimicBlockState((EntityPlayer) this.player)); } else PacketDispatcher.sendTo(new SyncCurrentMimicBlockState((EntityPlayer) this.player), ((EntityPlayerMP) this.player)); } sendToAll should also send to server nevermind
  24. show the PacketDispatcher. I feel like theres sth wrong. You should be creating ur own SimpleNetworkWrapper
  25. are u registrating the generator? also there is really no need to create a new worldgenminable all the time.. create it in the constructor and just call generate instead of (new WorldGenMinable(dgr2Blocks.dark_ore.getDefaultState(), 2)).generate(world, rand, quisquePos);
×
×
  • Create New...

Important Information

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