Jump to content

SanAndreaP

Forge Modder
  • Posts

    1689
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SanAndreaP

  1. There is the FOVUpdateEvent you can use. For how vanilla does it, look at the getFOVMultiplier method within the EntityPlayerSP class (dunno if it's still named like that in 1.7.x or if it's a func_xxxx name) For an example, look at this: https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/client/event/FOVManipulator.java Note that this zooms in more than the regular bow, so if you don't want that, follow the vanilla values (20.0F instead of 10.0F, 0.15F instead of 0.3F).
  2. This is a better approach to the original bow rendering (since isFull3D wasn't quite right) https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/client/render/ItemRendererNiobBow.java
  3. You need to send packets.
  4. Can you show your main class (where you initialize / register your block)?
  5. Also if all else fails, you really need to edit base classes and you know what you're doing, use a coremod and utilize ASM.
  6. Also in 1.7.x aren't they called IIcon and IIconRegister? You even imported the right classes, just missed the I in front of the names in your methods.
  7. It is, but the OP got the wrong method signature! @OP: the two EntityLiving parameters should be EntityLivingBase parameters. hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) And as coolboy4531 suggested, always add @Override above methods you intend to override to avoid errors.
  8. Like this: https://github.com/SanAndreasP/SAPManagerPack/blob/master/java/sanandreasp/core/manpack/helpers/client/RenderBlockGlowOverlay.java#L106-L126 Basically I render the block (which is not glowing), set the brightness to 240 (max brightness), then rendered the glowing texture and last but not least reset the brightness. In your case it's vice versa (set brightness, render glowy texture, reset brightness, render standard block)
  9. Your mod class? An example block class?
  10. You should learn Java before you start modding... Just because you put that now at the bottom doesn't mean it gets called after all methods in the class. Aside: static initializers actually do get called in the order they appear in the code, according to Java docs: "The runtime system guarantees that static initialization blocks are called in the order that they appear in the source code." While that refers specifically to static blocks, it's true for all static initializations. More info. Indeed, you could look at all static initialization stuff in your class as a huge classload-initialization method.
  11. You actually know what glPushMatrix does? It surely doesn't "init OpenGL". Yes I know it doesn't actually "init" openGL, it saves current matrix right? I just thought it's easier to understand that way... It pushes the current matrix up the stack. It should always be paired with glPopMatrix, which takes the topmost matrix away and the matrix below becomes the topmost one. Example: glTranslatef(...); // translates the current matrix (#1) glPushMatrix(); // pushes current matrix up, previous translation still in effect glTranslatef(...); // translates the current matrix (#2) renderStuff(); // renders stuff with translation #1 and #2 glPopMatrix(); // pops the current matrix, translation #2 is not in effect anymore, #1 still is renderMoreStuff(); // renders stuff with translation #1 http://www.opengl.org/sdk/docs/man2/xhtml/glPushMatrix.xml
  12. You should learn Java before you start modding... Just because you put that now at the bottom doesn't mean it gets called after all methods in the class.
  13. You actually know what glPushMatrix does? It surely doesn't "init OpenGL".
  14. updateTick only gets called if you use true as parameter in setTickRandomly.
  15. [15:39:48] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! You can ignore this error. For the rest, follow Robosphinx' suggestion And no, you don't need Java EE, The only thing you need is the JDK and JRE, and your preferred IDE (you could also use Notepad, but meh)
  16. IMO, creating a (ticking) EntityItem just to render some item seems like a waste of resources.
  17. http://java-performance.info/primitive-types-collections-trove-library/
  18. If you want to look at some example code, here's how I've done it: https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/client/render/RenderTileEntityWeatherAltar.java#L29-L54
  19. Only if you want to let the user enchant the item further upon your added effect (on the enchantment table of course). If you don't want that, or you want the user to be able to "disenchant" your item (possible by repairing the item on the workbench rather than on the anvil), use The_SlayerMC's suggestion.
  20. It clearly states that you're missing a mod (hence the name "MissingModsException"). In order to see which one, we need the full log.
  21. use the LivingDeathEvent. use event.source.getEntity() and check if it's an instance of EntityPlayer.
  22. Here is where I've got the code from: http://stackoverflow.com/questions/13848333/accessing-files-in-specific-folder-in-classpath-using-java And as I said, it seems to work, at least for me. EDIT: If you want to know if a path is a file or a directory, convert the path into an URL, which then is converted into a File (for some reason if I suppy the path string directly, it always thinks it's a file): File file = new File(this.getClass().getClassLoader().getResource("assets/enderstuffp/" + name).toURI()); System.out.println(file.isDirectory());
  23. I tried it and it seems to work, even if I compile it and load it up as a jar.
  24. You actually can list files from your classpath using the code below: InputStream stream = this.getClass().getClassLoader().getResourceAsStream("assets/enderstuffp"); BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); try { while( reader.ready() ) { System.out.println(reader.readLine()); } } catch( IOException e ) { e.printStackTrace(); } where this represents your mod class and "assets/enderstuffp" is your assets folder It prints a list into your console of all files and folders within the assets folder. Please note that it doesn't do a "deep-search", so you need to write your own method for that if you desire to do a deep search.
×
×
  • Create New...

Important Information

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