Jump to content

Zedicus

Members
  • Posts

    63
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    England
  • Personal Text
    I am... fairly new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Zedicus's Achievements

Stone Miner

Stone Miner (3/8)

7

Reputation

  1. But then it will become an addon, so it would require IC2 to work at all, wouldn't it? I don't want it to do that Yeah, that's a hard dependency, as Chibill said just use 'after' rather than 'required-after' for a soft depend.
  2. Dependencies are: @Mod(modid = "modid" name = "modname", version = "v0.123", dependencies = "required-after:IC2") That'll require any version of IC2 to run and it'll always run after the dependency's loaded. EDIT: And for 'specific' version: dependencies = "required-after:IC2@[1.1.7,)") Would require the minimum version of IC2 to be 1.1.7
  3. I'll be honest, I'd be impressed if you could find me another mod that overrode chicken, haha.
  4. Had to use: ItemStack.getItemDamage(); to get the damage, then add 0-3 dependant on therotation within the block class, rather than getting the block meta data.
  5. It's fairly silly, whilst I was making this post it was 0, 4, etc and in my sleep-deprived state I thought it was a mistake, haha, changed it back - I'll have a look into the onBlockPlacedBy method, one second. EDIT: It would appear the recipes aren't doing much, the base metadata (changed the code a little for ease) //Set it to base meta then I have a separate variables with + 1, +2, etc. if (l == 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, meta1, 2); System.out.println("Meta " + meta + " : " + "Meta1 " + meta1); } The 'recipe' based metadata's always 0.
  6. Currently I have my block (It has a tile entity) using a custom renderer, basically it should be able to face the 'four cardinal points' so to speak, it also has 4 different textures (one for each wood type). However the meta data only varies between 0 and 3 which is the 'birch + direction' section. Here's the code: The recipes: GameRegistry.addShapedRecipe(new ItemStack(BlockLoader.blockWriter, 1, 0), "xyx", "y y", "xyx", 'x', dirtStack, 'y', gravelStack); GameRegistry.addShapedRecipe(new ItemStack(BlockLoader.blockWriter, 1, 3), "yxy", "y y", "xyx", 'x', dirtStack, 'y', gravelStack); GameRegistry.addShapedRecipe(new ItemStack(BlockLoader.blockWriter, 1, 7), "yyy", "y y", "xyx", 'x', dirtStack, 'y', gravelStack); GameRegistry.addShapedRecipe(new ItemStack(BlockLoader.blockWriter, 1, 11), "xxx", "y y", "xyx", 'x', dirtStack, 'y', gravelStack); The block: public class BlockWriter extends BlockContainer { public BlockWriter(int par1) { super(par1, Material.wood); setCreativeTab(WriterLoader.creativetab); } @Override public TileEntity createNewTileEntity(World world) { return new TileEntityWriter(); } public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { return false; } public boolean isOpaqueCube() { return false; } public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) { int l = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int meta = par1World.getBlockMetadata(par2, par3, par4); if (l == 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, meta + 0, 2); } if (l == 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, meta + 1, 2); } if (l == 2) { par1World.setBlockMetadataWithNotify(par2, par3, par4, meta + 2, 2); } if (l == 3) { par1World.setBlockMetadataWithNotify(par2, par3, par4, meta + 3, 2); } } } The renderer: public class RendererWriter extends TileEntitySpecialRenderer { ModelWriter model = new ModelWriter(); public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)d, (float)d1, (float)d2); TileEntityWriter tileEntityWriter = (TileEntityWriter)tileEntity; renderBlockWriter(tileEntityWriter, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, BlockLoader.blockWriter); GL11.glPopMatrix(); } public void renderBlockWriter(TileEntityWriter tl, World world, int i, int j, int k, Block block) { Tessellator tessellator = Tessellator.instance; float f = block.getBlockBrightness(world, i, j, k); int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int l1 = l % 65536; int l2 = l / 65536; tessellator.setColorOpaque_F(f, f, f); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2); int meta = world.getBlockMetadata(i, j, k); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 1.5f, 0.5F); GL11.glRotatef(180f, 1f, 0f, 0f); //Where the texture's chosen. if(meta >= 0 && meta < 4) { bindTextureByName("/mods/writer/textures/blocks/ModelWriterBirch.png"); } if(meta >= 4 && meta < { bindTextureByName("/mods/writer/textures/blocks/ModelWriterPine.png"); } if(meta >= 8 && meta < 12) { bindTextureByName("/mods/writer/textures/blocks/ModelWriterOak.png"); } if(meta >= 12 && meta < 16) { bindTextureByName("/mods/writer/textures/blocks/ModelWriterJungle.png"); } //This is where the rotation dependent on direction will most likely end up happening. (Obviously not ready) if(meta == 0 || meta == 4 || meta == 9 || meta == 13) {} if(meta == 0 || meta == 4 || meta == 9 || meta == 13) { } if(meta == 0 || meta == 4 || meta == 9 || meta == 13) { } if(meta == 0 || meta == 4 || meta == 9 || meta == 13) { } this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } } Thanks
  7. Different options for my custom block renderer, how do I go about getting the metadata for the specific block so I can change the rotation, texture etc. tl;dr: How do I find the metadata for a specific block? Thanks!
  8. To save yourself from having to edit base classes, couldn't you just make your cork craft into vanilla leather? It might not be perfect but it prevents base edits.
  9. Well then, I guess you could try: OreDictionary.registerOre("leather", new ItemStack(Item.leather)); Then add your cork leather under the same name and attempt to make leather armor or something?
  10. Why can't you just use 'Item.leather', rather than adding it to the ore dictionary?
  11. The max value for a byte's 255, I believe. You're trying to cast 500 into a byte, see the issue? (It has to be between 0-255)
  12. So... there's already a large 'editable' list of oredictionary entries (http://www.minecraftforge.net/wiki/Common_Oredict_names)... and you make another list on the wiki under the pretense that yours will also be editable (http://www.minecraftforge.net/wiki/Ore_And_Liquid_Dictionary)? I see...
  13. There's a 'program' called BON, it'll deobfuscate the classes for you to decompile. https://github.com/immibis/bearded-octo-nemesis
  14. Made a stupid mistake in a block initialization. So I shifted through Pahimar's modding tutorials, the dev environment seemed pretty good in episode 4, easier than the norm, updating MCP/Forge's similar etc. Everything works fine... except when I've added my mod to the classpath and attempt to generate a world I get a lovely error: So it's running out of memory, but only when my mod's added, I stripped my main mod class down to naught the @Mod interface and the other 'required' components and it still fails on world generation. I've attempted a few ways, well, the ways I know of for adding more memory to eclipse/ the run process: Though I don't seem to be able to assign more than 1gb of ram, but in any case I ran things like FTB/tekkit with around 500mb so it should be fine just generating a 'vanilla world', for all intent and purpose. Thanks, Zed [Edit] Should be noted I'm using the latest forge build as of last night, though I only updated due to the 'java.lang.OutOfMemoryError' I was already having. '1.5.1-7.7.1.674'
×
×
  • Create New...

Important Information

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