Jump to content

Manslaughter777

Members
  • Posts

    99
  • Joined

  • Last visited

Everything posted by Manslaughter777

  1. Nevermind, found it. Part of the constructor for BlockBreakable
  2. I have a custom portal block which extends BlockPortal and I have overrode some methods to make it my own. But in the BlockPortal class I can't find a method that sets the texture. Is it located somewhere else? Can someone plz tell me how to find it thnx
  3. SOLVED! After looking at the error code i needed to remove this line: this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); in the Entity class
  4. Crap! i forgot to post it! , i do have an error: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedConstructorAccessor29.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at net.minecraft.world.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:164) at net.minecraft.world.WorldServer.tick(WorldServer.java:169) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:692) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) Caused by: java.lang.IllegalArgumentException: Attribute is already registered! at net.minecraft.entity.ai.attributes.ServersideAttributeMap.registerAttribute(ServersideAttributeMap.java:41) at com.manslaughter777.crystaldimension.entity.EntityCrystopian.applyEntityAttributes(EntityCrystopian.java:100) at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:156) at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:78) at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:36) at net.minecraft.entity.monster.EntityMob.<init>(EntityMob.java:21) at com.manslaughter777.crystaldimension.entity.EntityCrystopian.<init>(EntityCrystopian.java:24) ... 10 more
  5. For some reason my entity doesnt want to spawn (doesnt spawn in world or using its own mob egg). ive looked through the code but cant seem to find whats wrong. Im guessing its something to do with the actual entity cause when i use the mob egg, the hitbox on the ground doesnt go away so its not a texture issue. Any help is appreciated! Entity class Model Class RenderEntity class ClientProxy entity handler Phew, and finnaly in my main class there is: (postInit) I also get an error when using the mob egg:
  6. I have a log block with metadata, and what Im trying to do is make the block with the meta "1" to give of light. I just can't seem to do this. I have tried: (which probably is totally wrong) In my log class: if(new ItemStack(Item.getItemFromBlock(this).getItemDamage() == 1) { setLightLevel(3.0F); } I don't know if that's wrong or something but it keeps crashing on startup
  7. I am trying to get a blocks metadata when I call the Item.getItemFromBlock method. Does anyone know how to add a blocks metadata to this? Eg: Item.getItemFromBlock(BLOCK with metadata)
  8. Ah that's easy to fix! In the items code you will see there is a lot of lines of code than determine the x, y, and z pos. read them carefully and change the y pos of all the blocks to where u want it
  9. Lighting a portal with vannila blocks can be hard as u can't edit the BlockFire class. But anyway, what u need to do is in the block class ur trying to light it with u need to add a method onBlockAdded (I think that's what it's called) and copy the code in it from BlockFire. Then change Blocks.portal into (BlockPortal)MainModClass.yourPortalBlock. I will provide some code in a bit cause I'm not on my computer.
  10. A) an int still works and you need it for the random generating part B) he is using a block so the getItemDropped works. If u think this is wrong post ur own code
  11. Well for the random items you should do something like: int[] itemList = new int[20]; //amount of random items itemList[0] = MainModClass.randomItem1; itemList[1] = MainModClass.randomItem2; itemList[2] = MainModClass.randomItem3; etc..: Then you would want a random thingy. Random rand = new Random(); int randomInt = rand.nextInt(20); //amount of random items Then in the getItemDropped() method you return: itemList[randomInt]; So it would be: public void getItemDropped(PARAMS HERE) { return itemList[randomInt]; } This SHOULD work, not 100% cause I didn't test it
  12. Yes, I typically do. I just threw this "basic" set of classes together to get it to work, as the actual version in my mod does the same thing. Good question. I don't see the hitbox (black wireframe) even highlight when I hover over the painting. The block's behind the painting will show their hitbox as if the painting wasn't there. Sorry that was my mistake, pretty sure entities don't have hit boxes
  13. Firstly, u should rename your params, it will make everything a lot easier. And secondly, when u hover over the painting is the hitbox around the painting or is the hitbox half a block down? (Like the stone)
  14. You could also do if(player.isSneaking()) { //stuff here }
  15. That's cause u need to make a string, for example: @Mod(modid = MODID, ...) public String MODID = "yourmodid";
  16. Don't worry! I found it, this.setHarvestLevel
  17. Can someone quickly tell me how to add a harvest level for an ore? I remember it used to be MinecraftForge.setBlockHarvestLevel(.....) But It seems it doesn't work anymore. Thnx
  18. Hey , my custom leaves are green for some reason and when placed in my custom dimension they are slightly darker. But my leave texture is all blue so idk why they r green. is there a way to make em blue? Leaves class package com.manslaughter777.crystaldimension.block; import java.util.List; import java.util.Random; import com.manslaughter777.crystaldimension.Main; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockLeaves; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class Leaves extends BlockLeaves { public static final String[][] leafDifference = new String[][] {{"crystowoodLeaves"}, {"crystowoodLeavesOpaque"}}; public static final String[] leafTypes = new String[] {"crystowood"}; public Leaves() { super(); this.setLightOpacity(1); this.setBlockName("leaves"); this.setCreativeTab(CreativeTabs.tabBlock); } protected void func_150124_c(World world, int x, int y, int z, int side, int meta) { if((side & 3) == 1 && world.rand.nextInt(meta) == 0) { this.dropBlockAsItem(world, x, y, z, new ItemStack(Items.apple, 1, 0)); } } /** * Determines the damage on the item the block drops. Used in cloth and wood. */ public int damageDropped(int i) { return super.damageDropped(i) + 4; } /** * Get the blocks damage value (for use with pick block) */ public int getDamageValue(World world, int x, int y, int z) { return world.getBlockMetadata(x, y, z) & 3; } /** * Returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) */ @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list) { for(int i = 0; i < leafTypes.length; i++) { list.add(new ItemStack(item, 1, i)); } } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { for (int i = 0; i < leafDifference.length; i++) { this.field_150129_M[i] = new IIcon[leafDifference[i].length]; for(int j = 0; j < leafDifference[i].length; j++) { this.field_150129_M[i][j] = iconRegister.registerIcon(Main.MODID + ":" + leafDifference[i][j]); } } } @Override public IIcon getIcon(int side, int meta) { return (meta & 3) == 1 ? this.field_150129_M[this.field_150127_b][1] : this.field_150129_M[this.field_150127_b][0]; } @Override public String[] func_150125_e() { return leafTypes; } @Override public boolean renderAsNormalBlock() { return false; } @Override public boolean isOpaqueCube() { return false; } @Override public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) { return true; } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return random.nextInt(20) == 0 ? 1 : 0; } public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Item.getItemFromBlock(Main.sapling); } /** * Drops the block items with a specified chance of dropping the specified items */ @Override public void dropBlockAsItemWithChance(World world, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { super.dropBlockAsItemWithChance(world, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_); } protected int func_150123_b(int par1) { return 20; } }
  19. I am trying to make a biome for my dimension and I'm having lots of trouble adding the biome to the default world type. But then I realised something... I knew that WorldType.DEFAULT.addNewBiome() doesn't work so I looked in WorldType class, and the addNewBiome() method was all "Greened Out". The code was there but it was all in green like a comment. Why is this? Has forge done this on purpose? Is there any other way to add biomes to default? Plz help, thnx.
  20. The title pretty much explains it. I am having problems with my custom sugar cane plants. It doesnt grow and i cant place them on eachother. I have spent a good 8 hours trying to fix it but nothing. Plz help me cause im really close to finishing this mod and this stupid plant is letting me down. I am guessing its something to d with the canPlaceBlockAt part but i dont know what. Any help is appreciated The MarijuanaPlant mod class (custom sugar cane)
×
×
  • Create New...

Important Information

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