
bl4ckscor3
Members-
Posts
86 -
Joined
-
Last visited
Everything posted by bl4ckscor3
-
[Unsolved] How to make an armor using Forge for SMP?
bl4ckscor3 replied to Soviet's topic in Modder Support
I used the tutorial by TheGrovesyProject101. It uses a deprecated class, but it works. -
Try this in your custom block class: @Override public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("filename of the texture from the block you want"); } For the textures go to mcp/temp/bin/minecraft/textures/blocks Press CRTL+SHIFT+O to import everything necessary.
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Sorry, what? -
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
My code (still doesn't work): package MoreDimensions.blocks; import static net.minecraftforge.common.EnumPlantType.Plains; import net.minecraft.block.BlockFlower; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import MoreDimensions.MoreDimensions; public class SlimeFlower extends BlockFlower { public SlimeFlower(int id) { super(id); this.setCreativeTab(MoreDimensions.moreDimensions); } @Override protected boolean canThisPlantGrowOnThisBlockID(int par1) { return false; } @Override public EnumPlantType getPlantType(World world, int x, int y, int z) { if (blockID == MoreDimensions.slimeFlower.blockID) return Plains; return Plains; } @Override public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("MoreDimensions:slimeFlower"); } @Override public boolean canPlaceBlockAt(World world, int x, int y, int z) { if(world.getBlockId(x, y-1, z) == MoreDimensions.slimeGrass.blockID) { } else if(world.getBlockId(x, y-1, z) == MoreDimensions.slimeDirt.blockID) { } else { world.setBlockToAir(x, y, z);{return true;} } return true; } } -
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Anyone got a solution on how the flower can only be placed on my custom grass/dirt? At the moment it can be placed on them, but it can be placed on normal grass/dirt, too. -
You're welcome. No problem
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Ok now I rewrote the class, it now extends BlockFlower. I know have all unnecessary methods removed, and I added the @Override protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == MoreDimensions.slimeGrass.blockID || par1 == MoreDimensions.slimeDirt.blockID; } and it worked. However, I can still place the flower on normal grass and dirt... Any workaround? Whole class: package MoreDimensions.blocks; import static net.minecraftforge.common.EnumPlantType.Cave; import static net.minecraftforge.common.EnumPlantType.Crop; import static net.minecraftforge.common.EnumPlantType.Desert; import static net.minecraftforge.common.EnumPlantType.Nether; import static net.minecraftforge.common.EnumPlantType.Plains; import static net.minecraftforge.common.EnumPlantType.Water; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import MoreDimensions.MoreDimensions; public class SlimeFlower extends BlockFlower { public SlimeFlower(int id) { super(id); this.setCreativeTab(MoreDimensions.moreDimensions); } @Override protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == MoreDimensions.slimeGrass.blockID || par1 == MoreDimensions.slimeDirt.blockID; } @Override public EnumPlantType getPlantType(World world, int x, int y, int z) { if (blockID == MoreDimensions.slimeFlower.blockID) return Plains; return Plains; } @Override public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("MoreDimensions:slimeFlower"); } } Removing the @Override annotion @ canThisPlantGrowOnThisBlockID doesn't do anything. -
Maybe try this: (new WorldGenMinable(Alloycraft.oreCopper.blockID, 6)).generate(world, random, randomPosX , randomPosY , randomPosZ );//6 = the number of maximum ore blocks per vein instead of (new WorldGenMinable(Alloycraft.oreCopper.blockID, 0, 6, Block.stone.blockID)).generate(world, random, randomPosX , randomPosY , randomPosZ );//6 = the number of maximum ore blocks per vein
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Still doesn't work -
Ok Answer sent, too.
-
Hm.... can you send me your main class, please? It might help solving the problem.
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Now the question: How can I create a TileEntity for the flower? -
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
I replaced it with a & (don't know if this is the AND operator, but I assume it is) and it doesn't work. Is there a TileEntity or Renderer for plants? -
Which Forge source? 7.8.1.737? It's the latest recommended.
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
How can I rewrite it as a custom rendered block? I tried what you said and it did nothing. My code: package MoreDimensions.blocks; import static net.minecraftforge.common.EnumPlantType.Plains; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.IPlantable; import MoreDimensions.MoreDimensions; public class SlimeFlower extends Block implements IPlantable { public SlimeFlower(int par1, Material par2Material) { super(par1, par2Material); this.setTickRandomly(true); float f = 0.2F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f); } public SlimeFlower(int id) { this(id, Material.plants); } public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4); } public boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == MoreDimensions.slimeGrass.blockID || par1 == MoreDimensions.slimeDirt.blockID; } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { super.onNeighborBlockChange(par1World, par2, par3, par4, par5); this.checkFlowerChange(par1World, par2, par3, par4); } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { this.checkFlowerChange(par1World, par2, par3, par4); } public final void checkFlowerChange(World par1World, int par2, int par3, int par4) { if (!this.canBlockStay(par1World, par2, par3, par4)) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); } } public boolean canBlockStay(World par1World, int par2, int par3, int par4) { Block soil = blocksList[par1World.getBlockId(par2, par3 - 1, par4)]; return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) && (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this)); } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return 1; } @Override public EnumPlantType getPlantType(World world, int x, int y, int z) { if (blockID == MoreDimensions.slimeFlower.blockID) return Plains; return Plains; } @Override public int getPlantID(World world, int x, int y, int z) { return blockID; } @Override public int getPlantMetadata(World world, int x, int y, int z) { return world.getBlockMetadata(x, y, z); } @Override public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("MoreDimensions:slimeFlower"); } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving, ItemStack itemstack, EntityPlayer player) { if(world.getBlockId(x, y - 1, z) == MoreDimensions.slimeGrass.blockID) { } else if(world.getBlockId(x, y - 1, z) == MoreDimensions.slimeDirt.blockID) { } else { world.setBlockToAir(x, y, z); player.inventory.addItemStackToInventory(itemstack); } } } -
What Forge version do you use? Try to use a quick fix. Click on the one which says remove arguments bla bla bla. If it isn't there, can I have your WorldGen class?
-
I think you wrote this: (new WorldGenMinable(oreCopper, 0, 6, Block.stone.blockID)).generate(world, random, randomPosX , randomPosY , randomPosZ ); As you are in another class, you have to import your Main class and write it in front of the variable from your main class. In this case the above line would be the following: (new WorldGenMinable(yourMainClass.oreCopper, 0, 6, Block.stone.blockID)).generate(world, random, randomPosX , randomPosY , randomPosZ ); And another thing: As you will come across many things where you need your block/item variable in other classes, change private final static to public final static The private says that this variable is only available for the class it's in. The public makes it, well, publically available.
-
You could try out this tutorial http://www.youtube.com/watch?v=nEuTvNts9x4 But I don't know if it works in 1.5.2. Just try it out.
-
In your @Init Method, write the following: GameRegistry.registerWorldGenerator(new WorldGenCustomOres()); (You can change the name of WorldGenCustomOres if you want) This is your WorldGenCustomOres: package your.package; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class WorldGenCustomOres implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; } } private void generateSurface(World world, Random random, int i, int j) { for(int k = 0; k < 5; k++)//5 = maximum veins per chunk { int randomPosX = i + random.nextInt(16); int randomPosY = random.nextInt(29);//29 = spawns up to height int randomPosZ = j + random.nextInt(16); (new WorldGenMinable(yourOre, 0, 6, Block.stone.blockID)).generate(world, random, randomPosX , randomPosY , randomPosZ );//6 = the number of maximum ore blocks per vein } } private void generateNether(World world, Random random, int i, int j) { } private void generateEnd(World world, Random random, int i, int j) { } } The Block.stone.blockID says that the ore can only replace stone blocks in the world. This gets rid of the little chance to override diamonds and other ores. If you want to add another ore, just place another for(int k = 0; k < 5; k++)//5 = maximum veins per chunk { int randomPosX = i + random.nextInt(16); int randomPosY = random.nextInt(29);//29 = spawns up to height int randomPosZ = j + random.nextInt(16); (new WorldGenMinable(yourOre, 0, 6, Block.stone.blockID)).generate(world, random, randomPosX , randomPosY , randomPosZ );//6 = the number of maximum ore blocks per vein under your existing one. Hope that helped.
-
[1.5.1] FurnaceRecipes.getSmeltingResult always null
bl4ckscor3 replied to epicsquare's topic in Modder Support
I'm not that familiar with java, but have you tried a for loop? -
[1.5.1] FurnaceRecipes.getSmeltingResult always null
bl4ckscor3 replied to epicsquare's topic in Modder Support
Do you need the if (!dropModified) super.onBlockDestroyed(par1ItemStack, par2World, par3, x, y, z, par7EntityLiving); else par2World.destroyBlock(x, y, z, false); ? If not, try deleting it. -
Try something like this: GameRegistry.addRecipe(new ItemStack(Item.diamond), "X", 'X', new ItemStack(Item.skull, 1, 3); If you put a diamond in the crafting table you will get a Player Head. The data values you have to change for the second number in the second ItemStack are: 0 = Skeleton Head 1 = Wither Head 2 = Zombie Head 3 = Player Head 4 = Creeper Head Hope I helped.
-
[UNSOLVED]Adding texture overly to a specific custom Block?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Sorry, I wrote something in there. t disapperead What I wrote was that I'm stuck at the moment and that the link didn't help me either... -
[UNSOLVED]Adding texture overly to a specific custom Block?
bl4ckscor3 replied to bl4ckscor3's topic in Modder Support
Should do, but if they want it to sort of have a mixed texture... look up the randomite mod he mentioned and look at how that texture blends into the stone background. That has to use alphas to work. It is a little bit more complex, but not too bad. It won't work for me. Can you please tell me how you did it? I'm kinda stuck at the moment. Above method does allow alpha. I'm using it. Image from a thread where I was having an issue, but you can clearly see that I have an overlay on top of stone bricks that is alpha'd.