Everything posted by Black
-
[1.7.10] Blocks and items textures not loading[HELP PLEASE]
He's setting icons in his block class so he doesn't need that. And I don't know what other people prefer but I think this way is generally better. - It provides cleaner code, such as that mess everyone always makes in their main class with the blocks. - It provides more information about itself in its own block class. E.g. no matter the programming language you should always strive to keep information about an object to itself instead of spreading it everywhere. - More Flexibility, the method is more flexible than the setter. - More maintainability, because of the above mentioned it allows the code to be far more maintainable. And you are welcome, Redfoxhint.
-
SOLVED - Machine model wont face player [1.7.10]
You have to methods in your block class: public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); this.setDefaultDirection(world, x, y, z); } & public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer, ItemStack itemstack) { int l = MathHelper.floor_double((double)(entityplayer.rotationYaw * 4.0F / 360.F) + 0.5D) & 3; if(l == 0) { world.setBlockMetadataWithNotify(x, y, z, 2, 2); } if(l == 1) { world.setBlockMetadataWithNotify(x, y, z, 5, 2); } if(l == 2) { world.setBlockMetadataWithNotify(x, y, z, 3, 2); } if(l == 3) { world.setBlockMetadataWithNotify(x, y, z, 4, 2); } if(itemstack.hasDisplayName()) { ((TileEntityEnditeReactor)world.getTileEntity(x, y, z)).setGuiDisplayName(itemstack.getDisplayName()); } } Both are called at the same time, namely when the block is placed. In one you're setting the direction towards the player and the other method is happily overriding that metadata with the default direction. I know it is sometimes tempting to add several functions, certainly when minecraft has about 101 methods for the things you don't really need and zero for the ones you do but here you're just fine with deleting the 'OnBlockAdded' method.
-
[1.7.10] Blocks and items textures not loading[HELP PLEASE]
Such clean code. You deserve some applause. But I can't see anything wrong really. Check if, when booting minecraft, the log says it can't find the textures. Otherwise it might just be a known bug in the current forge versions that sometimes desyncs minecraft and forge. I don't know if they have fixed that yet but the solution is equipping and deequipping a custom texturepack.
-
Tessellator animations [1.7.10]
No need for an event because there are ample other solutions for that. Simple example: Boolean CanRotate in tileentity with getter and setter. In render class simply check that it is true and if you don't want to rotate it anymore just set it to false. The same goes for a timer.
-
[1.7.10] Achievement Page Crashing
Please put error logs in code tags. And it tells us the achievement it tries to get from the achievementlist is null. So your achievements aren't registered correctly. I can't see anything immediately wrong with the piece of code provided(though I can overlook something). These are similar threads: http://www.minecraftforge.net/forum/index.php/topic,16909.0.html http://www.minecraftforge.net/forum/index.php?topic=20831.0
-
Ore Dictionary Question
It's actually very simple. OreDictionary.registerOre("toolShovel", new ItemStack(Items.diamond_shovel, 1, OreDictionary.WILDCARD_VALUE)); This registers any 'ore' of this type with any itemdamage to the common denominator "toolshovel". you can use it simply by calling "toolShovel" for a particular slot. Example: GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Pruner, 1), "I I", " F ", "P P", 'P', new ItemStack(BasePlank, 1), 'I', "ingotIron", 'F', "gemDiamond" )); Once you load up minecraft and, for instance, use NEI to look at the recipes you'll see one with the iron and diamond changing with other items registered to the same denominator. Technically you could use your planks with any itemdamage to create this item then but if they don't exist, you can't use them. I hope this helps.
-
Tessellator animations [1.7.10]
I see no reason not to use it. It's meant for axis movement, has no negative sideeffects and there's little alternative. If you want an alternative you can do: - Override basefunctions of opengl itself(not that I have ever tried it, nor do I recommend it). - Move your x, y, z coordinates yourself before you draw the block. Both are utterly stupid and impractical. So just use glTranslate.
-
[1.7.10] Latest build not starting from eclipse
Questions such as those are very common in any programming board(or any board handling any topic for which you have to learn things for that matter). Any such action would not really help. For one the foruminfo says this isn't a java tutorial yet how many people ask questions that would be easily solved if they knew more than 'first week OOP introduction' level java. So I believe that, in the end, if you want to help people by answering questions on forums you will, and have to be always confronted with questions of very low level. That's simply how it works and unless beginners suddenly realise that they should read the errorlogs, use google optimally and use their brain they'll keep coming(and everyone knows that won't happen). I guess you could say it is part of 'the job'. Disclaimer: Reading the above can be harmful for your health if you are a budding programmer.
-
Tessellator animations [1.7.10]
Googled 'tessellator animation tutorial minecraft forge'. first hit: http://www.minecraftforge.net/wiki/TileEntitySpecialRenderers_and_Animation Answer: The same as any other animation, e.g. use opengls glRotate(), glTranslate(), glScale() Have fun.
-
[1.7.10] Latest build not starting from eclipse
The same thing as for every other person not being able to start minecraft forge. Use Java 7. Not 8.
-
[1.7.10] Custom GL rendered armor model
I said it's just like that, not that you have to use it. Just make a new instance of the tessellator class.
-
Selecting a hotbar slot
I take it you want to destroy the current item as you're trying to set it to null? Isn't it more efficient to call the following instead of messing around with changeCurrentItem? YourcurrentEntityPlayerObject.destroyCurrentEquippedItem(); or YourcurrentEntityPlayerObject.inventory.getCurrentItem() it returns an itemstack. Otherwise you have to append '.getItem()' behind it. Furthermore you can swap items with YourcurrentEntityPlayerObject.inventory.setInventorySlotContents(current item, new itemstack of item you want to place there);
-
[1.7.10] Custom GL rendered armor model
Any render class makes its own thing so its not that suprising. Besides, if you use a wavefront you're also not extending some obj.class but rather just importing the things you need.
-
[1.7.10] Custom GL rendered armor model
Forge adds a pleasant hook for custom armors: https://github.com/MinecraftForge/MinecraftForge/commit/ace8c29085d275c830ab97c1779fc1426533b897 And most likely you will have to extend ModelBiped but don't quote me on that.
-
Error
Java 8 is the most common problem beginner modders can't set up their environment. (that and incompetence) Use Java 7
-
[1.7.10] [Unsolved] How to add Wavefront Armor?
http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571595-1-7-2-how-to-code-custom-3d-armor-models-3d Well, I did find this though. It's written horribly but should help you find where to put things. It uses techne but simply swap out the techne stuff with an obj loader and position it.
-
[1.7.10] Custom GL rendered armor model
Good, the amount of times I have posted that link is getting ridiculous. I can't really find an immediate tutorial for that for 1.7 but in any case, it doesn't really matter what kind of 3D object you are using for the armor. It's simply a case of swapping them out in the render class. I haven't got experience with the tessellator because I don't like hardcoded objects but what I'd do is set all the code for a armor(just follow any tutorial for 1.6 or later, I highly doubt something changed there) and once you are done start filling in the 3D render as you want. In which case, all you need to know is how to use the tessellator of which there are ample tutorials such as this http://www.minecraftforge.net/wiki/Tessellator I hope this helps you.
-
[1.7.10] Metadata Blocks all use same texture?
If you use a custom model you need to have a custom itemBlock class to render that model in your inventory. And since you have a tileentity you might want to give us your tileentity, clientproxy and tileentityspecialrenderer class. It's mere guesswork if we only have 1/4th of the code that makes up the block.
-
[1.7.10] Custom GL rendered armor model
GL? You mean opengl? I know lots of 3D programs but none have the acronym gl. That or I am overlooking one. Opengl doesn't have a specific 3D preference, everything in minecraft renders through opengl. But I believe an obj.file or a wavefront, in which case you can find a tutorial here: http://www.minecraftforge.net/wiki/Using_wavefront_model
-
Custom Leaves not Working
You seem to completely misunderstand me and think I am not helping you with my statements. Contrary to a lot of opinions have I no problem with people trying to learn OOP through modding. However, albeit more fun than most, it is far from the easiest way. Pasting blindly means that you have little understand of what the code does. This is important because, the more you understand what the code does, the more you will be able to write code yourself. If you keep paste/copying you won't really progress and for every little problem that is easy to fix you will have to run to forums, halting yourself, halting the people there and in the end get totally nowhere but a easy tutorial level problem, if you even get there. Don't get me wrong, copy/paste is good, but only on the premise that you understand what that function does, why it is there and how it can be used. e.g. the copy doesn't happen blind anymore. Now, variable names, let me adress those. These are, without a doubt, blind copy paste. Why? Well, who would name them a number? They are extremely unclear to anyone, yes newbies and pros alike, who looks at them. It is even more paramount for new coders to name their variables properly. Let me give you an example: protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) { if ((p_150124_5_ & 3) == 1 && p_150124_1_.rand.nextInt(p_150124_6_) == 0) { this.dropBlockAsItem(p_150124_1_, p_150124_2_, p_150124_3_, p_150124_4_, new ItemStack(Items.apple, 1, 0)); } } This was grabbed from your supplied code. Please tell me what the variable "p_150124_3_" is used for. I for one can immediately tell that that will most likely be a Y coordinate from a block passed through. Why? Well, minecraft has the habit of having the first few parameters be 'the worldobj, the Xvariable, the Yvariable, the Zvariable. But please tell me what 'p_150124_6_' means. I for one cannot tell and if I wanted to know I would have go look through your extended class and try to find a method that resembles yours. And that in the case this method isn't one you wrote yourself, in which case that would be totally fruitless. You cannot expect anyone to help you with this and if they do, they're most likely wrong as well. We cannot understand your code, you cannot understand your code and nobody benefits from using deobfuscated variable names. The only creature that could possibly do so is the cat sleeping on your lap because you will be longer on your computer struggling with the same damn problem. To sum it up, there are three things a person new to coding should never ever do. Use unclear variable names, blind copy paste and learning very bad habits. You violated all three of them. It doesn't matter if you write stupid things, it doesn't matter if you program crashes, you're learning. That's good. But don't do things like that, then you won't learn and in the end you'll give up because you'll find coding too dificult. Which it isn't by the way. And as a last epigraph, you call me rude, which, well I always sound rude so I'm not blaming you, but there are so many new people asking stupid beginner questions that in the end the people that can help them care very little. And if people see stuff like you posted they are even more reluctant to help. So please do me a favor, clean up your code and do it properly. Now solutions: set isOpaqueCube to false, getRenderType to 0 but render as normal block. That will get rid of the world holes. And the itemdamage missing is most likely the case because you haven't set a unlocalizedname for each leave. Although really, this is just a guess since I don't want to bother much with your code. And no you don't need a custom ItemBlock. You're not doing anything fancy and you don't need custom Itemclass for a leaveblock with subtypes.
-
[Solved] [1.7.10] Tick an item every step
Halfway the itemclass there is this handy method: /** * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and * update it's contents. */ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {}
-
[1.7.10] How could I see the damage dealt by an item on a entity?
Well...this utterly from the top of my head since I can't look at the code but something like this should do the job. in constructor call yourentity.getHealth() to a variable. And there should be method that gets called when it is attacked, simple output the old health - the new health and set the new health to the variable. There should be better methods out there, as I said, this is from the top of my head.
-
[1.7.10] How do I load textures for a modeled block? [SOLVED]
Is that techne or wavefront? Seems Techne-like. Wavefront is a simple matter of creating a new resourcelocation and binding the texture before rendering the model. You can find an tutorial here: http://www.minecraftforge.net/wiki/Using_wavefront_model If it is techne: In techne: http://www.minecraftforge.net/wiki/Modelling_in_Techne http://pixelmon.wikia.com/wiki/Using_Texture_Maps_In_Techne And code: http://www.minecraftforge.net/wiki/Using_Your_Techne_Model
-
[1.7.10] [Unsolved] How to add Wavefront Armor?
Wait? What? Unclear? I used that one myself to see how wavefronts were loaded in minecraft and I found it extremely clear. What can you not understand about a tutorial that says: load model & texture in constructor open the matrix, place the model correctly, bind the texture, render it, close the matrix It's 7 lines of code...
-
Custom Leaves not Working
Please 1. Do not blindly copy and paste. It is clear you have no idea what you are doing and thus we cannot and will not help you. 2. Learn proper java because once again, if you just copy and paste it is clear you have no idea what you are doing. 3. If you cannot resist, and then I mean that you will die if you don't, copying code blindly at least try to make an effort and change those deobfuscated variablesnames.
IPS spam blocked by CleanTalk.