Jump to content

MikaXD

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by MikaXD

  1. Thanks for your answers! I think I found the place where the world is rendered.
  2. I know this is not an easy question: How can I render the game a second time from bird's-eye view as a minimap and then display the rendered scene on the screen as a minimap? You don't have to tell me how to render it, but it would be really helpful if you could tell me where I can find the place where the game is drawn in the code. Thanks in advance!
  3. World-Generator: package com.youtube.util; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class OreGenerator implements IWorldGenerator { private Block block; public OreGenerator(Block block) { this.block = block; } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if(world.provider.getDimensionId() == 0) { for(int i = 0; i < 50; i++) { int posX = chunkX + random.nextInt(16); int posY = random.nextInt(64); int posZ = chunkZ + random.nextInt(16); WorldGenMinable wgm = new WorldGenMinable(block.getDefaultState(), 10); wgm.generate(world, random, new BlockPos(posX, posY, posZ)); } } } } I register the world generator in the initialization part of my main class: GameRegistry.registerWorldGenerator(new OreGenerator(myBlock), 0);
  4. Hey, I created a new class implementing the world generator which randomly generates my custom block in the world. The Problem is, I cannot find the block anywhere in the world. I also used System.out.println("Generated") when the generate(...)-Method of the WorldGenMinable-Instance returned true. Resulting is a console full of "Generated"-messages. But nevertheless nothing is generated. What am I doing wrong? PS: I used 0 as the second parameter of the addWorldGenerator(...)-Method of the GameRegistry. Is this ok?
  5. Thanks!
  6. Oh, no, I've almost expected. Ok, but currently I cannot find any new tutorials, which are not outdated. Is there any open source?
  7. Hey, I created a GUI which can be open through pressing a key (I'm using the KeyInputEvent). I have already registered a gui handler and actually everything works perfect. Now I added a button to my gui which gives the player an apple (only an example). This works, but if you right click the apple it disappears. If I open my GUI in the KeyInputEvent, it only calls the getClientServerSide()-Method of my GUI-Handler. But what I need is the server side, too. If I open the gui in the onItemRightClick()-Method of any item, it works. Can anyone help me? PS: I don't have much idea of sending packets...
  8. Ok... My .json file is located in assets/MODID/models/item In the initialization event of my main class i wrote this: GameRegistry.registerItem(item, "item"); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("MODID:item", "inventory")); Does this help?
  9. I don't think there is a mistake because I followed the instructions of Eternaldoom's post: http://www.minecraftforge.net/forum/index.php/topic,24263.0.html And as I already said, with FML it still worked.
  10. First I used FML 1.8. The texture of the item was rendering correctly. Now I'm using Forge 1.8 -using the same code and the result is a blocky item with the default "missing texture" - texture. What has happened?
  11. I want to create a new block, let's say an amethyst block. This line is what I already have (in the init): Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block_amethyst), 0, new ModelResourceLocation("mymodid:block_amethyst", "inventory")); Is that correct? Ok, if yes, which files do I need to create? And in which package(s)?
  12. Hmmm, any other ideas?
  13. In 1.8 I can't find any method to load a texture for a item/block. Are there any tutorials on that? If not, how would I do this? Thanks in advance!
  14. Will there be changes in the code between FML 1.8 (http://files.minecraftforge.net/fml/1. and Minecraft Forge? And can somebody explain the difference?
  15. Hi, I already asked how to create a custom inventory. It worked. Then, I wanted to add 5 slots to it - no problem, too. I created a new IInventory with a size of 5 (can save 5 ItemStacks). Now if you put a stack in the fifth slot, the background of it turns to a fish. Also the background of all the other slots of my inventory changes to a fish IF they are NOT empty. I don't have any idea about why this happens. I nowhere used a fish as a background icon for a slot...
  16. Thanks! My biggest problem was to get the entity into the guihandler, but now it works fine!
  17. Hi, What should I do if I want to create entities which each have an own inventory where you can save items (like a chest but an entity stores the things). The entity was no problem but I don't get ahead with the inventory part. What do I need to implement this idea? I don't want you to show me code... just give me some hints (what classes I need; is there a similar mod?; ...) Thanks in advance!
  18. I think this class doesn't really help me because I don't have an EntityTameable. Isn't there an other method in the world class? I found this in the World.class: getPathEntityToEntity I have no idea HOW and IF this works at all. EDIT: Works fine for me this method! First parameter: EntityPlayer, Second parameter: the entity
  19. How would I do that? I want the entity following all the time (until it dies).
  20. I did this already. The constructor is never called... But in the FMLInitalization event I wrote RenderingRegistry.registerEntityEventHandler(...);
  21. It doesn't seem to work... I think it has something to do with the renderer because the entity does EXIST in the world and it's exploding after a few seconds BUT it's not rendering. Did I forget anything? I already used a proxy but the result is always the same...
  22. Hey, I have a little rendering problem... What I want: A new explosive with my own texture. I copied the most of the code from the minecraft sources but it doesn't seem to work... When I'm activating my block (witz flint and steel OR redstone) the block disappears (OK!) but the entity is not rendering! A few seconds later there's an explosion and that's it! I know that the entity is created in the world because of some outputs but the renderer is never called... The classes: - main class - block class - Entity class (for the primed version of my block) - Render class In the main class i registered the block and rendering handler in the FMLInitalization event: GameRegistry.registerBlock(blockMyExplosive, "blockMyExplosive"); RenderingRegistry.registerEntityRenderingHandler(EntityMyExplosivePrimed.class, new RenderMyExplosive); So, what's wrong? Did i forget anything?
  23. Biomes O' Plenty does also add panoramas to the main menu background.
  24. How to add (and remove!?) them? AND: Can I determine WHICH background should be shown?
×
×
  • Create New...

Important Information

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