Everything posted by Mazetar
-
[SOLVED]Block not rendering correctly in inventory
Ah great, did that include the last line: renderer.clearOverrideBlockTexture(); Wondering since I will get into minecraft's rendering soon after I'm done learning more of the openGL basics Hehe, well I'm trying to work on my mod but got stuck on a logic problem so I'm procrastinating by answering posts on the forum when I see a chance to help or to learn something =)
-
delete
Seriously! I can't read this shit. Trying to spot any errors, missing ; or other stuff inn code and logs which is just dumped into the forum post is quite a lot harder! Not only does it make our job much harder, it makes less people willing to even attempt reading your post. So for your own sake, use pastebin.com to post code(Enable Syntax Highlightning: Java inn the options below the paste). This will give you a link to a easly readable sheet of code For logs, just use pastebin.com without any syntax higlightning and it's fine Thank you. PS: Most mods will update to 1.5.1 as soon as they can get their code updated and working.
-
Changing a method
You know methods are functions and not variables inn Java? I'm pretty sure you can't assign the a method to another one... However you could replace a function with another one, or make the first function call the second function etc. I guess that's what you actually want to do. Again as replied earlier if you want your mod to be compatible with other mods, don't edit base classes use reflection or other ways to achieve what you want to And as stated earlier, depending on what you are trying to do by wanting to edit base classes, there might be easier workaround for whatever you want to do
-
Bonemeal
If you have and Item, then override the OnUse method. By using that you get the location(world, x,y,z) of the block targeted along with infromation about the player etc. From that you can find out the type of block targeted by the xyz. And then you can do whatever you want to happen with it If you look at ItemDye you see the Bonemeal code inside the OnUse method, it's kinda hard to see what is for the bonemeal and not when it's 15 items inn one, but if you look here: http://www.minecraftwiki.net/wiki/Data_values#Dyes You can see that the damage value for Bonemeal is 15. So then you know that everything within this if statment's block is for the bonemeal: if (par1ItemStack.getItemDamage() == 15)
-
Changing a method
You want to do this stynax? classA.someMethod() = classB.AnotherMethod();
-
OnRightClick
If you check what methods you have access to on ItemStack objects you should find some for dealing damage to the item. Just use them and then return the damaged item as the return value of the function
-
[SOLVED]Block not rendering correctly in inventory
EDIT: Problem solved inn the post below this. I'm not familiar with rendering so I'm not going to try at this code, but It made me wonder about this odd thing: On Line 63, 69 and below you have these calls to render each face. But the parameters are the same for all of them and zero, is that meant to be so? renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, 0));
-
How to make a custom Arrow ?
Inside the Item.java it's located on Line 46, as you see it's not much to the arrow inn it self Which is fine since it's only an item and has no special code. Since you have the bow I assumed you had looked at the original bow's code. There you will find all the logic of shooting including the creation of the entity for the arrow
-
Block missing issue
for the script, I think it will be easier to do it out of Minecraft, just run it on the world folder and make it sort out the ID's But then again, you have to be sure to know the basics of programming and you should be able to do it inn whatever language you are most familiar with PS: Before you start testing your scripts etc. do a backup of the worlds or else you can end up losing your world over a simple logic mistake
-
Achievement Error
Hi! Well I guess that means your code is somehow duplicating a stat somehow. So I guess that means that you're code is not doing what you think it would. Maybe the number 5242907 is not defined, not valid which is the reason for the place holder or it's the wrong number? You could of course go looking after the 5242907 inn your code or you could set a break point and do some debugging to see what happens at the seconds before it crashes and how it crashes. But all of this you already knew, so why am I saying this? Because with NO CODE and NO LOGS then we can give NO HELP.
-
Block missing issue
Well why did you change the blockID then if you didn't want to corrupt old worlds? Anyways I guess one could apply some script to the world file and then swap the old BlockID out for the new one which would solve the issues.
-
How to make custom trees?
You should go check out this page! It should give you some better understanding of the @Init and @Mod annotations as well as help you get your textures and blocks working. For information on Textures and Icons as of 1.5.X read AtomicStryker's post about it As for Bonemeal to work, I believe that one is quite easy to fix but did you try something from a tutorial which didn't work or did I misunderstand your post? If the tutorial code didn't work for you then share your code for the sappling and whatever you modified to get the bonemeal to work. (like your mainMod file).
-
Check if chat is open ?
how would you use that to set a keybinding? And more importantly, when do you want to check if it's open? Do you want to be able to do like this: if (Chat.isOpen) { // Do stuff } Or do you want to know when it gets opened? You are quite vague inn your request, so I need some clarification
-
How to make a custom Arrow ?
Have you started at all? I assume not, so first try to create a new item and get it into the game. Then check the ItemArrow code and the original bow's code. Try to see if you can understand how it works. Then write some code trying out things and come back here with it, if it's not working out and we will help you further
-
OnRightClick
Just wanted to add some lines to the isRemote thing world.isRemote - This is true if it's the client side reading the code. while it's false if it's the server. Minecraft has a built inn server, even inn SSP, therefore you need to be aware of this fact even on SSP This is at least very important to do when working with Entity's, so you don't spawn one on client side(ghost/fake entity which will only be visible to the client) and another one on the server.
-
TileEntity not working properly
For most things tutorials from 1.3.X of Minecraft and newer works for 1.5.1 The exception being the things that changed during the patches, like now the code for Icons and textures etc. But mainly it should work with only minor differences inn your code. But you found them now, using the link above? Also take a look into the code which is used inn TileEntityFurnace and BlockFurnace as I said, and then look at the other TE's and their blocks. That should help you out inn understanding how they work and how to use them
-
TileEntity not working properly
[lmgtfy=forge furnace tutorial]Where did you look?[/lmgtfy] There's a lot of them
-
[SOLVED]Texture Help
You have the textures inn the wrong place, take a look here: http://www.minecraftforum.net/topic/1722368-15-icons-and-block-textures/ Should tell you everything you need.
-
TileEntity not working properly
Thats how they are supposed to be used yeah.. But that's not how you are using it now. Your block classis only called once, inn the whole game your Block is only stored once. The only thing stored at a gi en x,y,z location inn the world is a blockId, metadata and sometimes a TileEntity. You need to readup some more on TilEntity's, I suggest following a tutorial for a custom furnace to start learning about TE's What you are doing now is saying that Everytime the game looks for your block's TileEntityit will get the same single TilEntity everytime regardless of the world positions it looks at.
-
Getting the block directly in front of my custom block
No a TileEntity is a whole different file. A TileEntity can hold huge ammounts of data and execute internal logic every update. I suggest you go do some searcing on TilEntitys aswell as opening some to see how they work. I.e: TileEntityFurnace and BlockFurnace -see how they work A block can't hold more than it's metadata of information, most of the time a block can't even reffer to it's location inn the world. TileEntitys is what makes chests, furnaces and workbenches work So start reading up on them
-
Getting the block directly in front of my custom block
That depends... When do you need this information? It's possible but depending on when you need the info and what you want to based upon it, you probably need a TileEntity to store, check and update the information
-
How to make custom trees?
The fact that the code ain't giving an error means that the code's syntax is valid. Not that it will do as you intended. When it get's errors before you run it, the errors are with the syntax or grammar of your code if you will. When it crashes at runtime it encounters something it didn't know how to handle, like nothing where it expected something(Null pointer exception). But when it does neither and does not produce the wanted result, the code is still wrong. It's just allowed to type it out that way you did so you get no pre-compile errors If you want help tough, post your mainmod file at pastbin.com (USE JAVA SYNTAX HIGHLIGHTNING!!!) and give us the link. Also include code for blocks and the generation files etc. Then we can help you figure out where your problem is located so you can fix it.
-
[Solved] Saving data about a player
Take a look at the IExtendedEntityProperties file which can be found inside the "minecraftforge.common" package or by pressing CTRL+SHIFT+T(in eclipse) and use the "Open Type" window to find it by entering IExtendedEntityProperties into the box. Then take a look at the bottom of Entity.java inside "net.minecraft.entity" package. The two last methods there are dealing with the extended properties. I haven't seen it before now but it seems quite awesome, Thanks diesieben07!
-
Blocks textured fine in-world but missing texture on HUD/Inventory
Hi again! I'm still playing around with my blocks inn 1.5.1 and I encounter the following problem: The blocks are shown with "Texture missing" upon them when they are rendered inn the hand or HUD/inventory. Why is this? Heres the block code: http://pastebin.com/vtczsXSi And here's the main file: http://pastebin.com/4XizgaQ1 The other blocks is essentially the same code as the one above.
-
[Solved] All blocks getting the same name (forgot set.UnlocalizedName)
I guess I just have to use setUnlocalizedName() methods inside my blocks now, hopefully that will work Edit: Well just by using the set on one of them the problem got solved and they all got names as they where named inn .addName() I guess I just have to start using setUnlocalizedName() from now on
IPS spam blocked by CleanTalk.