Jump to content

Busti

Forge Modder
  • Posts

    624
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Busti

  1. That means that java can't create a new Instance of the class because its abstract... My bad use EntitySmallFireball
  2. I started a bit like you... My goal was to put XP Orbs in pipes. So i created a Block that pushed every xp orb into the air... When I wanted to know how something works I looked how Minecraft did it or i asked here. Follow you ideas and If something doesn't work just ask why. Starting can be a bit hard but its totally worth it
  3. You have to use findEntitysWithinAABB(); in 1.6
  4. Create the entity like so: public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { Vec3 v3 = player.getLook(); EntityFireball fireball = new EntityFireball(world, player, v3.xCoord, v3.yCoord, v3.zCoord); world.spawnEntityInWorld(fireball); } EDIT: You might need to mess around with the vars a bit... (EntityGhast is a good learning source.)
  5. Use this to detect the player(s) and put them in the list. worldObj.selectEntitiesWithinAABB(); Then use an Iterator to run through the list. Once you have a player entity use player.inventory to access the players Inventory. Then check the inventory slots for your item and transfer a copy of that item into the chest. When that's done delete the Itemstack in the players inventory. I hope that helps Busti
  6. Why don't you create a TileEntity?
  7. This will go into your item class... public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { world.spawnEntityInWorld(new YourEntityClass()); } EDIT: Have a look at EntityEgg or ItemEgg if you want to know how they solve the block detection. (raytrace)
  8. This tutorial by Ichun (the creator of the portalgun mod) shows how to create custom rendered Items. He also shows how to edit the players arm rotation. Its a bit old but most of the code is still working. Good luck Busti
  9. You have to use the Install.cmd script in the forge folder. It will set up you mcp folder. Or just use 1.7 its much easier now
  10. Thanks... That worked
  11. Hello, is there a way to damage an (tool)item when its used in a recipe but not consume it and let it remain in the crafting grid? Any help would be greatly appreciated... Busti
  12. The tutorial is fine but somebody should add the *16...
  13. You might want to have a look at: package net.minecraft.item.crafting.ShapedRecepies.class . You have to create a custom crafting hander (implementing IRecepie) which parses the NBT data to the result. Even though this is for crafting it will also apply to crafting.
  14. You have to multiply the chunkX and chunkZ by 16. Or just use my class: Then just use the addOre method in your Registry... EDIT: I forgot the package
  15. When I do it with my blocks each chunk takes about 10 seconds more to generate but when I do it with a Vanilla block it doesn't. Even though nothing is really generating
  16. Its now called Block.blockRegistry but you need to get the blocks by using a mapping key since it is using maps instead of an array now.
  17. Yes I am. The generate method gets called but nothing generates. It also takes a very long time but i cant imagine where the delay comes from.
  18. Hello, I tried to add an ore to the world gen and I followed the common tutorials. I tried to add some structure to it to make it easier, but somehow it isn't working: Registration: public static void Init() { //Generators OreGen oreGen = new OreGen(); oreGen.addOre(block_CopperOre, 10); GameRegistry.registerWorldGenerator(oreGen, 500); } Gen Class: /* * Copyright (c) 2013-2014 Busti2000. * * Technica is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ package mlb.technica.core.world; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.terraingen.TerrainGen; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; public class OreGen implements IWorldGenerator{ private final List<WorldGenMinable> oreGenList = new ArrayList<WorldGenMinable>(); public void addOre(Block block, int number) { oreGenList.add(new WorldGenMinable(block, number)); } public void genStandardOre(int count, World world, WorldGenerator worldGen, Random random, int chunkX, int chunkZ, int min, int max) { for (int i = 0; i < count; i++) { int x = chunkX + random.nextInt(16); int y = random.nextInt(max - min) + min; int z = chunkZ + random.nextInt(16); worldGen.generate(world, random, x, y, z); } } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { Iterator<WorldGenMinable> iter = oreGenList.iterator(); while(iter.hasNext()) { WorldGenMinable ore = iter.next(); if (TerrainGen.generateOre(world, random, ore, chunkX, chunkZ, OreGenEvent.GenerateMinable.EventType.CUSTOM)) genStandardOre(20, world, ore, random, chunkX, chunkZ, 0, 96); } } }
  19. He did not but you can use his repos with some fixing...
  20. Item and Block mappings are stored in the GameData class. You can get a block mapping by using the GameData.blockRegistry.get("NAME"); command but there is no real method to easily remove that entry. You could try using the itreator of the map but I have not tried that.
  21. Hello, is it possible do Hot-Swap Code while Minecraft is running in Debug Mode? I tried it but it says the VM does not support it. Busti
  22. Use world.getEntitiesWithinAABB(yourEntityClass, AxisAlignedBB); it will return a list wit all entities found inside the given box.
  23. I had this once... Is your JDK up to date?
  24. Is it possible to store a tag directly in a tag List or do I have to create a TagCompound? Busti
×
×
  • Create New...

Important Information

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