Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

general3214

Forge Modder
  • Joined

  • Last visited

  1. Since Forge 1.5.2 wouldn't work, I had to use MCP. The code in BlockFurnace that relates to your problem is pretty much the same in 1.6.4, but try putting this code in your block class: /** * Called whenever the block is added into the world. Args: world, x, y, z */ public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); this.setDefaultDirection(par1World, par2, par3, par4); } /** * set a blocks direction */ private void setDefaultDirection(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { int var5 = par1World.getBlockId(par2, par3, par4 - 1); int var6 = par1World.getBlockId(par2, par3, par4 + 1); int var7 = par1World.getBlockId(par2 - 1, par3, par4); int var8 = par1World.getBlockId(par2 + 1, par3, par4); byte var9 = 3; if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { var9 = 3; } if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { var9 = 2; } if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { var9 = 5; } if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { var9 = 4; } par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); } } /** * Called when the block is placed in the world. */ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) { int var7 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (var7 == 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); } if (var7 == 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); } if (var7 == 2) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); } if (var7 == 3) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); } }
  2. In the model class, take out the following code: this.bipedHead.addChild(Base); this.bipedHead.addChild(Base2); this.bipedHead.addChild(Shape1); this.bipedHead.addChild(Shape1b); this.bipedHead.addChild(Shape2); this.bipedHead.addChild(Shape3); this.bipedHead.addChild(Shape3b); this.bipedHead.addChild(Shape4); this.bipedHead.addChild(Shape5); this.bipedHead.addChild(Shape5b); this.bipedHead.addChild(Shape6); this.bipedHead.addChild(Shape6b); this.bipedHead.addChild(Shape7); this.bipedHead.addChild(Shape7b); this.bipedHead.addChild(Shape8); this.bipedHead.addChild(Shape9); this.bipedHead.addChild(Shape10); this.bipedHead.addChild(Shape11); this.bipedHead.addChild(Shape12); this.bipedHead.addChild(Shape12b); this.bipedHead.addChild(Shape13); this.bipedHead.addChild(Shape13b); If that doesn't work, take out this: this.bipedHeadwear.addChild(Base); this.bipedHeadwear.addChild(Base2); this.bipedHeadwear.addChild(Shape1); this.bipedHeadwear.addChild(Shape1b); this.bipedHeadwear.addChild(Shape2); this.bipedHeadwear.addChild(Shape3); this.bipedHeadwear.addChild(Shape3b); this.bipedHeadwear.addChild(Shape4); this.bipedHeadwear.addChild(Shape5); this.bipedHeadwear.addChild(Shape5b); this.bipedHeadwear.addChild(Shape6); this.bipedHeadwear.addChild(Shape6b); this.bipedHeadwear.addChild(Shape7); this.bipedHeadwear.addChild(Shape7b); this.bipedHeadwear.addChild(Shape8); this.bipedHeadwear.addChild(Shape9); this.bipedHeadwear.addChild(Shape10); this.bipedHeadwear.addChild(Shape11); this.bipedHeadwear.addChild(Shape12); this.bipedHeadwear.addChild(Shape12b); this.bipedHeadwear.addChild(Shape13); this.bipedHeadwear.addChild(Shape13b); If neither work, tell us what happens when you take out the code.
  3. Try using LivingHurtEvent or LivingAttackEvent .
  4. Take out getArmorTexture or getArmorModel ; you only need one.
  5. Code from BlockFurnace that should be of interest for you: /** * Called whenever the block is added into the world. Args: world, x, y, z */ public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); this.setDefaultDirection(par1World, par2, par3, par4); } /** * set a blocks direction */ private void setDefaultDirection(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { int l = par1World.getBlockId(par2, par3, par4 - 1); int i1 = par1World.getBlockId(par2, par3, par4 + 1); int j1 = par1World.getBlockId(par2 - 1, par3, par4); int k1 = par1World.getBlockId(par2 + 1, par3, par4); byte b0 = 3; if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1]) { b0 = 3; } if (Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l]) { b0 = 2; } if (Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1]) { b0 = 5; } if (Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1]) { b0 = 4; } par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); } } /** * Called when the block is placed in the world. */ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); } if (l == 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); } if (l == 2) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); } if (l == 3) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); } if (par6ItemStack.hasDisplayName()) { ((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); } } EDIT: I noticed that you're asking about 1.5.2; I'll look into it ASAP. EDIT 2: 1.5.2 won't decompile for me...
  6. More efficient code: this.currentPower += power;
  7. Looking over my own code, I'm pretty sure I know what's the problem. But before we get fixing, change your render IDs: int uraniumRenderID = SeroCraft.proxy.registerArmorRenderID(ARMOR_URANIUM.name()); int copperRenderID = SeroCraft.proxy.registerArmorRenderID(ARMOR_COPPER.name()); int unobtaniumRenderID = SeroCraft.proxy.registerArmorRenderID(UNOBTANIUM.name()); You have to change them again because RenderingRegistry.addNewArmourRendererPrefix (which is in your client proxy) adds an armor prefix to the string array RenderBiped.bipedArmorFilenamePrefix . bipedArmorFilenamePrefix is defined as an array of armor type strings ( new String[] {"leather", "chainmail", "iron", "diamond", "gold"} ), so your code should register armor type strings, rather than texture paths, when using SeroCraft.proxy.registerArmorRenderID . Now getting to the actual fixing, change public String getArmorTextureFile(ItemStack itemstack, Entity entity, int slot, int layer) to public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, int layer) . This is in the armor class (e.g. ItemSCUnobtaniumArmor).
  8. Try this: int uraniumRenderID = SeroCraft.proxy.registerArmorRenderID("serocraft:textures/armor/UraniumArmor"); int copperRenderID = SeroCraft.proxy.registerArmorRenderID("serocraft:textures/armor/CopperArmor"); int unobtaniumRenderID = SeroCraft.proxy.registerArmorRenderID("serocraft:textures/armor/UnobtaniumArmor"); The problem is that "_layer_#.png" is already added, so "serocraft/Armor_" makes Minecraft look for textures in "minecraft:textures/models/armor/serocraft/Armor__layer_#.png" (two underscores after "Armor"). Also, put your armor textures in "serocraft:textures/models/armor" rather than "serocraft:textures/armor". You might need to change some code here and there, but it helps with compatibility.
  9. You're missing a curly brace.
  10. No. GameRegistry.registerBlock registers a block into the code. LanguageRegistry.addName adds a name to be displayed in-game. For example: Block testBlock = new Block(1000, Material.air).setUnlocalizedName("testBlock").setTextureName("test_block"); GameRegistry.registerBlock(testBlock, "testBlock"); LanguageRegistry.addName(testBlock, "Test Block"); I personally like to register blocks with their unlocalized names like so: GameRegistry.registerBlock(testBlock, testBlock.getUnlocalizedName.substring(5));
  11. There are lots of them: https://github.com/MinecraftForge/MinecraftForge/tree/master/src/main/java/net/minecraftforge/event Explore Forge source code more often.
  12. I believe the method you are looking for is swingItem() , which is located in EntityLivingBase , a class extended by EntityPlayer .
  13. Kuuu, please learn basic Java.
  14. Dude, look at the source code (tested with Forge 10.12.0.996, may not work with other versions): Item.class public Item setTextureName(String par1Str) { this.iconString = par1Str; return this; } /** * Returns the string associated with this Item's Icon. */ @SideOnly(Side.CLIENT) protected String getIconString() { return this.iconString == null ? "MISSING_ICON_ITEM_" + field_150901_e.func_148757_b(this) + "_" + this.unlocalizedName : this.iconString; } Block.class public Block func_149658_d(String p_149658_1_) { this.field_149768_d = p_149658_1_; return this; } @SideOnly(Side.CLIENT) protected String func_149641_N() { return this.field_149768_d == null ? "MISSING_ICON_BLOCK_" + func_149682_b(this) + "_" + this.field_149770_b : this.field_149768_d; }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.