-
Posts
1689 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SanAndreaP
-
Also, if you happen to use Eclipse, I suggest the "Bytecode Overlay" plugin. Anyway, why not use a TickHandler, check if a GUI is open and if yes, which one, then "override" the GUI with opening your own GUI?
-
There was a similar thread: Assuming you have at least Forge 7.8.0.700, I've made an ItemRenderer which can be used for every bow: https://gist.github.com/SanAndreasP/5608824 You need to bind the renderer to your item. You can bind the renderer to multiple items. Note that this does not support multiple render passes. You have to figure this out for yourself if you need those. Please don't return true in isFull3d() if you happen to have that method. Also counts for the shouldRotateWhenRendering()
-
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
The rotation didn't work, because you have isFull3d(), and it's returning true (since I tested it and I got the same result with that). My code is directly from the bow rendering code (RenderBiped). So I suggest you use my code, and remove the isFull3d() method from your item (or at least let it return false). -
Different hosting for the Scala-library.jar
SanAndreaP replied to tabshank's topic in Support & Bug Reports
Maybe people would stop telling you to read the EAQ if you actually would READ the EAQ: -
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
hm, there probably has been something changed in .701-703. I have to update Forge and see if I can fix this. I'll post here if I fixed it. EDIT: Did you remove the code you put into the getIcon method: if(Minecraft.getMinecraft().gameSettings.thirdPersonView != 0){ GL11.glTranslatef(0.0F, -0.6F, -0.025F); GL11.glRotatef(-17.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(14.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(4.5F, 0.0F, 1.0F, 0.0F); } -
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
Can I get a screenshot? Which forge version are you using? -
Cant create item stack in Event Hook Container Class, please help
SanAndreaP replied to M1kep's topic in Modder Support
Yup, if it's intended to be used only client-sided then it's fine. Check if getCurrentEquippedItem() is not null, then execute your code. -
When loading a world FML becomes corrupted
SanAndreaP replied to Jonathan1999's topic in Support & Bug Reports
hm, there are a bunch of jar mods you have. Try without them and see if it works. Most likely a conflicting jar mod. -
Calling function on game start OUTSIDE the main mod class
SanAndreaP replied to Dawars's topic in Modder Support
You mean like calling a function from an other class in your main mod file? -
Cant create item stack in Event Hook Container Class, please help
SanAndreaP replied to M1kep's topic in Modder Support
okay, since I have time now, I'll go into detail: You have this: if ((Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem() == new ItemStack(DebugItem1))) { Minecraft.getMinecraft().thePlayer.setHealth(-1); } The very first problem I see is that you use Minecraft.getMinecraft().thePlayer to get the player. That is wrong, because with this your mod won't be multiplayer compatible. The event you use ships the player instance already, so you can use event.entityPlayer. The second thing is that you try to compare two (completely different) instances with the == operator, which is only true if you compare two variables which have the same primitive datatype (e.g. int) and the same value associated with, or if the variables contain the exact same instance of an object. So getCurrentEquippedItem() == getCurrentEquippedItem() would be true, getCurrentEquippedItem() == new ItemStack(...) would be false (since new indicates a new instance). For ItemStacks I suggest you use the isItemEqual method provided by the ItemStack in order to compare those two: getCurrentEquippedItem().isItemEqual(new ItemStack(...)). For any other object, use either the method provided by the objects class or use the globally applicable .equals(...) method. The third issue is the DebugItem1. It shows you the error, because this variable is not declared in the class where the code is. It would be declared if you would do public <type> DebugItem1; somewhere in your class body. But that would be wrong, since you want to get your item instance (whose field is declared as static by you) inside your main mod class. To get this static field you have to reference the class where it lies: FoolsCraftMain.DebugItem1. Ah yeah, in order to access the field, make it public, not private nor protected. Now you should be able to fix this piece of code you have there with the information I gave you above, since that's the most detailed info I can give you unless I fix your code, and this isn't my interest, since you should learn what you've done wrong -
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
Im having the same problem. When I use your code, I get an error on all of the EQUIPPED_FIRST_PERSONs. Also, I know this sounds noobish, but how do you bind the renderer to the bow? As I said, in order to use that code, you need Forge 7.8.0.700, since the EQUIPPED_FIRST_PERSON field is introduced there. You bind the item to the ItemRenderer with MinecraftForgeClient.registerItemRenderer -
Cant create item stack in Event Hook Container Class, please help
SanAndreaP replied to M1kep's topic in Modder Support
You don't specify which class holds this variable (since you don't specify it in the class where you call it). ExampleClass.ExampleStaticVariable exampleClassInstance.ExampleNonStaticVariable I dont really understand what you are trying to say http://www.javatutorialhub.com/java-static-variable-methods.html You should learn some basics... -
Cant create item stack in Event Hook Container Class, please help
SanAndreaP replied to M1kep's topic in Modder Support
You don't specify which class holds this variable (since you don't specify it in the class where you call it). ExampleClass.ExampleStaticVariable exampleClassInstance.ExampleNonStaticVariable -
[Solved]Making bows held properly by other players.
SanAndreaP replied to Noah_Beech's topic in Modder Support
Assuming you have at least Forge 7.8.0.700, I've made an ItemRenderer which can be used for every bow: https://gist.github.com/SanAndreasP/5608824 You need to bind the renderer to your item. You can bind the renderer to multiple items. Note that this does not support multiple render passes. You have to figure this out for yourself if you need those. -
The parameter for the PermGen size is -XX:PermSize=128m If your PC can handle it, you can also use 256m instead of 128m.
-
Do your TileEntities extend TileEntityChest? If not you need to change the references / casts there first.
-
Yes, install scala.
-
Your RenderBlastBold class has to extend Render. Also in the doRender method, you have to call your renderArrow method.
-
If you meant the code here it is: -snip- No, he meant YOUR render class: RenderBlasterBolt And don't post Mojang / Minecraft classes! Sorry...My bad. That's still not the right code. Wee need the code from your class named "RenderBlasterBolt".
-
If you meant the code here it is: -snip- No, he meant YOUR render class: RenderBlasterBolt And don't post Mojang / Minecraft classes!
-
[SOLVED] Get Texture of Block in World
SanAndreaP replied to Bedrock_Miner's topic in Modder Support
No, that code doesn't go to the texture method! Use the previous code you did there. The code I've provided goes into the getColorMultiplier method, which you should override in your block class. -
[SOLVED] Get Texture of Block in World
SanAndreaP replied to Bedrock_Miner's topic in Modder Support
Have some pseudocode: Block block = Block.blocksList[iBlockAccess.getBlockID(x, y-1, z)]; if(block != null) return block.getColorMultiplier(iBlockAccess, x, y-1, z) else return super.getColorMultiplier(...) -
Those are not there anymore, not even in an other form / name. Just delete those lines.
-
[SOLVED] Get Texture of Block in World
SanAndreaP replied to Bedrock_Miner's topic in Modder Support
I tried this code, it works fine. But if I place the mine on grass, it takes a stone texture... How can I avoid this? (And how can I spawn the explosion if somebody walkes on the mine?) It's probably not the stone texture, but the un-colorized grass texture. You would need to get the color from the block below, too. There's a method called colorMultiplier. Don't worry about the first parameter, it's basically a world instance (but don't cast it!). Get the block instance below your block and return the same method with the instance (instance.getColorMultiplier), while giving the method the same parameters. To trigger something on impact, look at the pressure plate code or at the Cactus code. To create an explosion, look at the TNT entity or at the Creeper. Hint: it's one line of code. -
Well, my future coremod will inject a new method in the Item class, which gets called by injected code in the EntityPlayerSP class. Also it creates some public getters and setters for stuff. But it's more worth it if you actually want to inject or edit a code snippet / a (new) method / interface / etc.