Jump to content

Mecblader

Members
  • Posts

    225
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mecblader

  1. Hello, In my mod I need to test for an event, breaking a block. I then need to set a block after the block is broken. It calls the set wool method, but it won't place the block. Any suggestions? BWT these blocks are just testing block, how would go about testing for a block with metadata and placing a block with the same metadata, but different id's. Here is my code: package mod.xtronius.rc_mod.util.event; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.player.BonemealEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent.BreakEvent; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import net.minecraftforge.event.Event.Result; public class EventWoodReplace { public int x, y, z; @ForgeSubscribe public void onWoodBreak(HarvestDropsEvent event) { if (event.block == Block.dirt) { x = event.x; y = event.y; z = event.z; System.out.println(x + " " + y + " " + z); System.out.println("Setting Block!!!"); setWool(event.world); } } public void setWool(World world) { System.out.println("Setting Block 2"); world.setBlock(Block.fire.blockID, this.x, this.y+1, this.z); world.setBlock(Block.blockGold.blockID, this.x, this.y+5, this.z, 1, 2); } }
  2. Is there some sort of method that I can tap into to detect when the player breaks a certain type of block. From the link that was provided I saw that there are special events that forge provides. Could you please explain what they are and how I can uses them and any other way I can go about making the mod without editing base classes and using advanced java to change code while the game is running, thats what the ASM thing does right?
  3. Hello, I want to create a game changing mod and I know that changing MC Source is a big no-no, but would you think it is acceptable if it is a game changing mod. Also, would i be allowed to distribute my mod with edited src code in the zip. it wouldn't be the whole game, but some parts of it. I would appreciate any help I can get, I just don't want to get into trouble with mojang. Also my mod does not need to be compatible with other mods, my mod would change the way or purpose of Minecraft.
  4. Do you mean animation for a 2d texture because I'm working with 3d models. I'm sorry I should have mentioned that. My bad
  5. This works if your modding 1.6.4. No garentees for 1.7, also This will only work if you have your mod in a separate project. ---------------------------------------------------------------------------------------------------------------------------------------------------------------- Did you add forge or minecraft as a required project for your mod. If not then right-click on your project. Hover over build path and then click configure build path. Click on the project tab and click add and select minecraft. Good Luck!
  6. Hello, Everyone. I'm making a mod with an animated item. I don't know if there is a way that you are supposed to to do it, but I basically messing with the rotation angles and other stuff from my model to animate my items. What I would like to know is if there is a way I can make a timed sequence of events without making my own timer because it may cause lag on some computers. Or is there a way in minecraft or forge that enables me to be able to animate items and blocks more easily. Just a random question, does anyone know how bulidcraft animates it's engines. I tried looking my self, but amount of code to look through is mind-boggling I would really appreciate any help that anyone can give.
  7. Hello, my sound in my dev environment is not working. I have my volume turned to max in game and through the sound panel. I would appreciate it if someone can help because my mod uses sounds and I cant test them if it won't play. I get this error when I start the game: 2014-01-14 18:57:25 [iNFO] [sTDOUT] Starting up SoundSystem... 2014-01-14 18:57:25 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2014-01-14 18:57:25 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2014-01-14 18:57:25 [iNFO] [sTDERR] Exception in thread "Thread-38" java.lang.IllegalStateException: Only one OpenAL context may be instantiated at any one time. 2014-01-14 18:57:25 [iNFO] [sTDERR] at org.lwjgl.openal.AL.create(AL.java:113) 2014-01-14 18:57:25 [iNFO] [sTDERR] at org.lwjgl.openal.AL.create(AL.java:102) 2014-01-14 18:57:25 [iNFO] [sTDERR] at org.lwjgl.openal.AL.create(AL.java:201) 2014-01-14 18:57:25 [iNFO] [sTDERR] at paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164) 2014-01-14 18:57:25 [iNFO] [sTDERR] at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576) 2014-01-14 18:57:25 [iNFO] [sTDERR] at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) 2014-01-14 18:57:25 [iNFO] [sTDERR] at paulscode.sound.CommandThread.run(CommandThread.java:121)
  8. Even though you might not understand the code, you can decompile the code. You should at least get an idea on how to do something like that. You could also try to look at Minecrafts achievement page classes. Good Luck!
  9. I sorry, I meant to say that I want to update the item's texture. Does anyone know how to remove an item and add another item with a different meta data into a players inventory.
  10. Hello, I am making a mod and I have an item that places down 16 different blocks with the same block id, but a different metadata. I have the block placement down, you basically [shift-Right-Click] and it changes a nbt value and that determines the metadata of the block placed. My problem is that I want the item's texture to update to a different texture every time I [shift-Right-Click]. I have tried this before, but the texture does not seem to update. Does any one have any ideas an how I could update the texture, is there some sort of method that updates the texture or can you "tick an item like you can a block". I would appreciate any help anyone can give me. Thanks in advance!!!
  11. Sorry, but could you go a bit more into details. I know java but, I don't really understand nbt tags. If I wanted to call this method would I just call this in the onItemUse method and how do I get the current number for this tag and would I just put: nbt.setInteger("currentColorInt",0); if I wanted to change the value. Sorry for asking so many questions, but I have been having trouble understanding the nbt data system because some of the tutorials that I have looked at do not explain it well enough and they are all for tileEntities.
  12. Hello I'm making a mod and I have an item that will eventually place a block according to the NBT data of the item. Basically by default the tag currentColor should be 0 at default and every time the player shift right clicks it should place the correct block. The issue that I'm having is that I can't seem to figure out how to add a tag to an item and increase it every time. I would appreciate it if someone could tell be how to add a tag to an item, set the default value, and how to make it increase, or possibly a tutorial giving the basic lines of code needed to do this. I am not asking for anyone to write it for me, I am just asking how to do this. Any help is appreciated.
  13. Thank you for your help that fixed it
  14. Hello, I am making a mod and I made 16 lamps that are the colors 16 colors of minecraft and I used the minecraft lamp as a template and I have everything working, but I can't seem to get the block to drop as the Idle form. The lamp has two forms the idle form and the active for, they are two different block ids. I need the block to figure out the metadata of the block that is going to be destroyed and return the other block id with the same meta-data. I would really appreciate any help because everything I have tried has not worked so for. (I don't know if this matters, but I got the pick block to work)
  15. I am making a mod were I have a copy of vanilla cocoa beans and thanks to a person called "VivaDaylight3" I have it working, but I have an issue with the render types method. When I put this into my block class: public int getRenderType() { return 28; } (28 being the render cocoa render type) I get this error: Is there a way to fix this or will I have to make this into a tile entity and then custom render the block like that. Sorry if I sound stupid or am making this more complicated than it needs to be because I am not the best at modding yet. I would really appreciate any help anyone can give.
  16. Hello, I am making a mod and I want to add grapes to it and I though adding them by way of the way that cocoa beans work might be neat, but I have tried many times, but I can't even figure out how to make them work. Me rambling about what happened: I have an intermediate knowledge about Java, but I'm no professional modder. I would really appreciate it if someone could help me figure out how to make pretty much a simple copy of the cocoa beans in minecraft because I obviously can't do this myself.
  17. Hello I am making a mod and it has a custom furnace in it and I keep getting an error when the game is running. Error: I would really apriciate it if someone can help me! Here is my code for my stuff: Block Code: Tile Entity Code: Container Code: Gui Code: I don't think that most of the code is necessary, but I'll put it in just in case. please explain because I am a relatively new modder and I don't know much about minecraft code yet, but before the hateres start hating, they sould know that I am at an Intermediate level of JAVA, so don't say that I am someone who doesn't know anything about JAVA.
  18. add: @NetworkMod(clientSideRequired = true, serverSideRequired = false) after the initialization of your mod.
  19. The bug fixed its self, some how, but thx for your help. PS:I'm going to sleep right after I fix a few other bugs!
  20. Hello I have a bug with my custom furnace, when I put something like a stick in the fuel slot and something like raw beef in the item slot, as you would expect the stick doesn't completely cook the beef, you need 2 sticks, but if I put more than one in the fuel slot, it just eats them all up right after the first one runs out and doesn't set the Item burn time to 100, and the fuel bar doesn't tick down, it just is full when the furnace is on and empty when the furnace runs out of fuel. How would I fix this? Code: Block Class : Hint: TestGui = the block TileEntity Class: Hint: TileEntityTestGui = the tile entity Container Class: Hint: TestGuiContainer = the container Gui Class: Hint: GuiTestGui = the Gui
  21. What is your material set as because if it is rock or iron you need a pick to mine it, but if it is something like sand or wood, you can break it with your fists. Try changing this part: public SmallRock(int par1, Material par2Material) { super(par1, par2Material); this.setBlockBounds(1f/16f*6.5f, 0f, 1f/16f*6.5f, 1f-1f/16f*6.5f, 1f-1f/16f*14f, 1f-1f/16f*6.5f); this.setUnlocalizedName("smallrock"); this.setCreativeTab(ThroughTheAges.throughTheAges); } Into this: public SmallRock(int par1) { super(par1, Material.sand); this.setBlockBounds(1f/16f*6.5f, 0f, 1f/16f*6.5f, 1f-1f/16f*6.5f, 1f-1f/16f*14f, 1f-1f/16f*6.5f); this.setUnlocalizedName("smallrock"); this.setCreativeTab(ThroughTheAges.throughTheAges); } PS: Something I like to do is to give the Unlocalized name when you initialize the block in your main class, so you can use the class for more than one item and have it have the block back and display the Texture according to the Unlocalized name.
  22. Yeah I understand that it may be difficult to learn all of this code and the way minecraft does stuff, but it is really worth it in the end. I remember when i learned ho to make the block rotate, the only issue I had was that I did not have the help of other people because I did not know of this section in the forge website. Tip for the future: Despite it being very tempting to copy and paste, a good way to learn how to do stuff yourself is to use source code from professional mods, but not too professional like BuildCraft because that mod is confusing to understand how it works. Few mods I use as reference material: BuildCraft(Despite it being confusing, some parts are useful to the average modder) EquivilantExchange3 IronChests Any other open source forge mods [*]
  23. Sorry about posting the wrong code, but I'm really confused now. I created a new world and checked if the bug was still occurring, but surprisingly it did not occur in the 20 min i spent moving around the world and then I went back to my original test world and I moved away from the area where the bug was occurring and the bug stopped occurring there too. Is it just a minecraft glitch, that it is only rendering wrong in that specific are or is it because I have a multi block placed there that has this Block in it. I don't know, I won't bother posting the render code because the OpenGL part is pretty much the same as the Item Renderer, but thanks for the help anyway.
  24. I'll post my render code, but you should know that when I have the item render as a 3D object I have separate rendering code, it is essentially the same, but I was getting an error when i referenced the render code in my RenderBlock Class. I'll post all of the relevant code in case you need to look at it. Block Model: http://pastebin.com/SGGficvJ Render Block: http://pastebin.com/xpUVHba8 Render Item: http://pastebin.com/XdJ1cFPd If you need any other code, just ask.
×
×
  • Create New...

Important Information

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