Jump to content

EducationalPurposes

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by EducationalPurposes

  1. The more advanced way of doing that is adding this method to your block class. It allows more control for all the sides and stuff, just for later purpose. package first.mod.block; // imports public class RedOre extends Block{ public RedOre(int par1, Material par2Material) { super(par1, par2Material); this.setCreativeTab(Base.TabRed); this.setHardness(10); this.setResistance(5); } @SideOnly( Side.CLIENT ) public void RegisterIcons(IconRegister iconRegister){ blockIcon = iconRegister.registerIcon("FirstMod:RedOre"); } @SideOnly( Side.CLIENT ) public Icont getIcon(int side, int meta ) { return this.blockIcon; } public int idDropped(int par1, Random par2Random, int par3) { return Base.RedThing.itemID; } } this.setTextureName does this automatically, but I still wanted to point that out. And for the not generating part.. just check this really nice tutorial for that, I mean you need IWorldGenerator and you need to register it with GameRegistry.registerWorldGenerator( x.class ); in your FMLInitializationEvent. Anyway, just check this tutorial out for that.
  2. Actually it could be every tileentity object. That line just checks if it the other tileentities are the same as itself. Because your tileentity which gets rendered als must be an instance of your cable block object. Look up instanceof on Google, you will find out.
  3. At this point I figured out on how to solve my problem that I had. Thank you all for your help! (I used a player tick handler, and from there you can just get the input via the lwjgl library. )
  4. Providing some of your own code really is necessary, especially in a case like this. What is not working? Did you even created an Item? Did you even look up how you craft?
  5. That helped quite a bit, thank you for that. But I dont get how you can the actual key input of the client. I have my tick handler implement ITickHandler, but Im very unsure how to do custom stuff to the actual client. If I understand that, I think I get a big part of minecraft modding, since I never use those sided Proxies and stuff.
  6. That is a really good tutorial about keybinding, thanks for that. But what Im looking for is for every key on your keyboard, and then keybinding isnt a real good idea. Thanks for the effort though!
  7. Hi, As the title says I need to know if a player presses a key or not. Luckily, we got lwjgl, so that is not really a problem for me. But I dont know how to follow a player's keystrokes. For example, currently I have setup a system, that adds the players to a list who do a certain thing, but I am really unsure how to follow that specific player's key stuff. I know you must follow the keystrokes client side, but I dont know how I can get on someone's client side or anything. So a recap:how can I get into a player's client? Im not expecting the practical work-out, but I do really like to see some theory what steps I should follow. Not in great detail or anything, but just something that you guys point me in the right direction. Thanks, EducationalPurposes
  8. Hi, I have a problem that I cant solve myself. It isnt a problem with code, but I just cannot find 'the perfect method'. Sure, you need to know those get-arounds, for example getting the world via an entity, but I just cant figure it out. The problem is that I need an event, or method for the Block class, that gives you the coords of the block (for the TileEntity I added to it) and the player (to get the username and world). I got around the BreakSpeed event but this doesnt give me the information that I need. What Im trying to do is make a block that only can be broken by one player, I know how to save the player and all that with the NBT of the TileEntity, not a problem at all. But I just cant get the TileEntity via events that is along the line of "breaking a block". Thanks for the help!
  9. http://www.minecraftforge.net/wiki/Crafting_and_Smelting Scroll down a little bit and you see that you need to add your recipes in the FMLInitializationEvent method of your base class.
  10. Hello community! First of all I want to tell you why Im trying to make this mod: Im a very beginner, and got pretty much the basics done, kinda. So I needed a target to get better at modding, so I asked a friend what he really is missing in minecraft. He knows Im just a beginner, so he said: chocolate. So I thought, why the h*** not? So I started with writing chocolatemilk, because I love it! Soon when I wanted to add the recipe for it, I got a bit of a problem. The recipe was a bucket of milk, and 8 cocao beans. I started up the dev-mc and crafted it, but I got an empty bucket from the bucket of milk and my own bucket of chocolatemilk. I thought I would have to write my own CraftingHandler of some sorts and while looking through vanilla code I decided I was going to use the IRecipe interface. I want to say I change my initiate recipe, because I was writing a custom one anyway. The file: engineer.chocolate.crafting.RecipeChocoBucket is the one which really is important here. When I want to remove items from the ItemStack, it gives me lots of errors I honestly dont understand. But those method calls are the crashers of that file (dont worry, I commented it ). I hope you guys can hopefully figure the code out on your own, but if you want me to explain my target for the handler, dont be shy to ask! Here is the external link to the mod because I couldnt find a way to do it with this editor: http://puu.sh/58QxO.zip Thank you guys in advance, - EducationalPurposes
  11. You would want to use this event: AttackEntityEvent (net.minecraftforge.event.entity.player.AttackEntityEvent)
  12. Another option would be: for( int i = 0; i < 120; i++ ) { LanguageRegistry.addName(new ItemStack(ironCell, 1, i), "Iron Cell"); }
  13. Well, first take a look at the method, how it should look in your code: @Override public void onEntityCollidedWithBlock( World world, int x, int y, int z, Entity entity ) {} Now, we have an Entity. What can we do with an Entity? Yeah, add the potion effect: public void onEntityCollidedWithBlock( World world, int x, int y, int z, Entity entity ) { // Dont know if you need to check if the world is remote entity.addPotionEffect( new MyPotionEffect() ) // The argument obviously must be instanceof PotionEffect } From here you are on you're own!
×
×
  • Create New...

Important Information

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