Jump to content

jordsta95

Members
  • Posts

    169
  • Joined

  • Last visited

Everything posted by jordsta95

  1. Hey there, I was wondering what I would be looking at so that I can make it so that when an entity stands on top of a block, they get a potion effect. E.g. When player stands on <block> give entity at Y+1 poison 1
  2. THAT WOULD BE WHY! I always do that and never notice why v_v Thanks I tried registering ores before registering items... Sometimes I feel like a complete idiot
  3. Hey, I am getting this crash after registering ores: http://pastebin.com/SnFrfL3N I understand that it's an issue with damage values, but I don't get why it is doing it... Here's the code registering the oreDict stuff: OreDictionary.registerOre("ingotCopper", new ItemStack(itemRegist.ingots)); OreDictionary.registerOre("ingotLead", new ItemStack(itemRegist.ingots, 1, 3)); OreDictionary.registerOre("ingotTin", new ItemStack(itemRegist.ingots, 2, 3)); OreDictionary.registerOre("ingotNickel", new ItemStack(itemRegist.ingots,3, 3)); OreDictionary.registerOre("ingotAluminum", new ItemStack(itemRegist.ingots, 4, 3)); OreDictionary.registerOre("ingotSilver", new ItemStack(itemRegist.ingots, 5, 3)); And if I comment that out, everything runs just fine. And I have tried that code like that and like OreDictionary.registerOre("ingotCopper", new ItemStack(itemRegist.ingots)); OreDictionary.registerOre("ingotLead", new ItemStack(itemRegist.ingots, 1)); OreDictionary.registerOre("ingotTin", new ItemStack(itemRegist.ingots, 2)); OreDictionary.registerOre("ingotNickel", new ItemStack(itemRegist.ingots,3)); OreDictionary.registerOre("ingotAluminum", new ItemStack(itemRegist.ingots, 4)); OreDictionary.registerOre("ingotSilver", new ItemStack(itemRegist.ingots, 5)); both of which had the same outcome... Sorry for sounding like a noob on something that is probably really obvious, but I just don't know what is wrong, as that looks fine to me, and using it (this code) without the metadata item(s) works just fine...
  4. 1) Yeah, that was just a test 2) I have always tried to avoid meta-blocks, so I don't know how to use them, or do this (I sorta expected it defaults to :0 because when you set block to <metablock> it defaults to :0 3) Oh, I didn't know that.
  5. Hey there, I am trying to do this public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if(world.getBlock(posX, posY - 1, posZ) == blockRegist.cable && world.getBlockMetadata(posX, posY - 1, posZ) == 1){ world.setBlock(posX, posY, posZ+1, blockRegist.cable, 1, 1); } } in a block class for metadata, but it doesn't work. I know it's a metadata block, so I didn't expect it to work. But how would I make it so that it works? I am trying to make it so when cable:0 detects cable:1 below it, it will set itself as cable:1 (if that makes sense)
  6. Hey there, I am looking into using meta-blocks for something I am trying to do with a few different functional blocks, however I am at a loss for how to use metadata blocks: public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if (world.getBlock(posX, posY + 1, posZ) == Blocks.iron_ore){ world.setBlock(posX, posY + 1, posZ, blockRegist.doubled); } } Right now, this works how I want it, as doubled:1 is what should come from iron, however when I want it to be the next block along: public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if (world.getBlock(posX, posY + 1, posZ) == Blocks.gold_ore){ world.setBlock(posX, posY + 1, posZ, blockRegist.doubled); } } Will still do the first metadata (obviously) but I need it to do doubled:2 How would one go about doing this?
  7. If you don't know what this means then you need to go do some tutorials about basic Java. I know what it means. But I don't understand why, I was told to do that, but then find out it doesn't work...
  8. I dropped it because this didn't work: public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if (world.getBlock(posX, posY + 1, posZ) == contains(OreDictionary.getOreIDs((neighbourBlock),OreDictionary.getOreID("oreIron")))){ And I thought you meant use the other... the issue is "getOreIDs" it says it's not applicable for Block, int
  9. OreDictionary.getOreID(...) I thought that was pretty obvious. public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if (world.getBlock(posX, posY + 1, posZ) == Ints.contains(OreDictionary.getOreID("oreIron"){ Still getting issues though... Ints is erroring, but I don't know what to do with it, as importing the only option doesn't fix anything
  10. And "oreIron" is still not an integer. You need getOreID(String name) Yes, call me an idiot all you like, but I don't know what that means! Getting somewhere though through my idiocy and I apologize for this: public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if (world.getBlock(posX, posY + 1, posZ) == Ints.contains(OreDictionary.getOreIDs((neighbourBlock),getOreID("oreIron")) now the only issue is the getOreID... well... it doesn't work?
  11. From ore dictionary class... do I just need to do oreIron? registerOre("oreIron", Blocks.iron_ore); So this? Ints.contains(OreDictionary.getOreIDs(null), "oreIron") Which still shows errors, I don't know what that Ints is supposed to be, and the null? I don't understand what it should be...
  12. My bad, I saw stack as a "how many you would want" (I was replying while on my way home from work, so I didn't know what it needed... So let me correct that now... So I have: if (world.getBlock(posX, posY + 1, posZ) == OreDictionary.getOreIDs(, "ore:oreIron") [code] But I don't actually understand what it wants in the brackets, it suggests null (when you add unimplemented methods) but that breaks everything... I really don't know what to put in there (Sorry for the newbie questions, but I have never used oreDict, and the code [code] public static int[] getOreIDs(ItemStack stack) { if (stack == null || stack.getItem() == null) return new int[0]; Set<Integer> set = new HashSet<Integer>(); int id = Item.getIdFromItem(stack.getItem()); List<Integer> ids = stackToId.get(id); if (ids != null) set.addAll(ids); ids = stackToId.get(id | ((stack.getItemDamage() + 1) << 16)); if (ids != null) set.addAll(ids); Integer[] tmp = set.toArray(new Integer[set.size()]); int[] ret = new int[tmp.length]; for (int x = 0; x < tmp.length; x++) ret[x] = tmp[x]; return ret; } doesn't really make sense And i didn't do Ints.containts(OreDicitionary.getOreIDs(<stack>), <ironOreID>) because the Ints.containts didn't exist (dunno if that is needed or not)
  13. When you say stack? Do you mean it'd be something like: Ints.containts(OreDicitionary.getOreIDs(1), ore:oreIron) to do 1 iron ore?
  14. Hey there, I was wondering if it is possible for onNeighbourBlock to detect the oreDict of whatever is next to it? For example: public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if (world.getBlock(posX, posY + 1, posZ) == Blocks.iron_ore){ but I wanted it to be the ore dictionary for iron ore, because that would make some amount of sense for what this does would it be possible to do that?
  15. I'm trying to update an old mod's code to work in a new 1.7 mod... but I have no idea what the new code is package assests.jordsta95; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntitySafePearl extends EntityThrowable { public EntitySafePearl(World par1World) { super(par1World); } public EntitySafePearl(World par1World, EntityLiving par2EntityLiving) { super(par1World, par2EntityLiving); } @SideOnly(Side.CLIENT) public EntitySafePearl(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0); } for (int var2 = 0; var2 < 32; ++var2) { this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian()); } if (!this.worldObj.isRemote) { if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { EntityPlayerMP var3 = (EntityPlayerMP)this.getThrower(); if (!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) { this.getThrower().setPositionAndUpdate(this.posX, this.posY, this.posZ); this.getThrower().fallDistance = 0.0F; } } this.setDead(); } } } The line which is giving me issues is: if (!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) more specifically the .connectionClosed. I tried replacing it with everything that was recommended (in Eclipse) and none of them worked. Any ideas?
  16. Hey there, I want to try making some custom models, but techne's layout (using numbers and not sliders, etc.) is horrible IMO. Is there anything better than it? Something that can do rotations, and maybe sliders (drag to move things)?
  17. Hey there, people are complaining that what I have at the minute is slightly over powered, so the simple solution is make it so that when the item is used, it uses durability... but how do I do that? public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (world.getBlock(x, y + 1, z) == Blocks.air) { world.setBlock(x, y + 1, z, Blocks.cake); return true; } return false; } It extends item sword, so there's no issue about it having durability, it's just I have no idea how to make it do this
  18. Call me blind and/or stupid, but I don't actually know what to do with this information. Do I do public void onBreakEvent... @ForgeSubscribe BlockEvent.BreakEvent What? I have never used forge events before, or any event to be more precise, so I have no idea what I am doing. I can't find anything in the events folder (forge reference folder) that has anything to do with this, so I am really stuck
  19. Hey, I don't know if this would be possible, but I am looking for a nicer "crafting" recipe than just combining two items. I was wondering if it is possible to make it so that if a diamond sword breaks a cake it makes a "itemRegist.cakeSword" (that's the item I am crafting as it is called - don't know the correct term, like Items.coal)
  20. OMG! You are a saviour. The names are still messed up, but you fixed the issue Thanks dude
  21. Alright? And this will get all items to show too, or...?
  22. Hey there, I am having issues with something I never really liked - meta-data. I am trying to do items, and the only 1.7 tutorial I found on it was for blocks, so I tried to substitute in what I could to get it to work. I have no errors in the code, but with what I have, only 1 item spawns. and it shows as item.null.name, not anything which I would have expected. Here's the code: https://github.com/jordsta95/JordnElecsUtils/blob/master/src/main/java/com/jordsta/stuff/integration/tinkers/UberiumToolParts.java And here's how it's registered: https://github.com/jordsta95/JordnElecsUtils/blob/master/src/main/java/com/jordsta/stuff/integration/tinkers/ticonRegist.java Any pointers on what I am doing wrong. Sorry if this is something really obvious, but I have never used meta-data before, but I felt when adding ~100 items, meta-data would be best (especially when they are all crafting components)
  23. THANK YOU! I didn't know that numbers too big would be that much of a hassle, I never had issues with 200 (as a test figure) in the end... but I guess other ores genning in the same area can cause issues
  24. @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; case Main.dimensionID: generateDim(world, random, chunkX * 16, chunkZ * 16); break; } } Added in the breaks, and can now load the world, but when travelling to the dimension there is still the same crash: http://pastebin.com/k5enStDG
×
×
  • Create New...

Important Information

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