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.

Alix_The_Alicorn

Members
  • Joined

  • Last visited

Everything posted by Alix_The_Alicorn

  1. BTW, the source for my mod is at https://github.com/alix-the-alicorn/Pickle-Craft
  2. Might my problem lye in here? i've tried a lot of things. package com.jmanpenilla.picklecraft.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import com.jmanpenilla.picklecraft.PickleCraft; import com.jmanpenilla.picklecraft.items.ModItems; import cpw.mods.fml.common.registry.GameRegistry; public class ModBlocks { public static Block cucumberVine; public static String cucumberVine_unloc_name = "cucumberVine"; public static Block cucumberVineGrown; public static String cucumberVineGrown_unloc_name = "cucumberVineGrown"; public static void initializeBlocks() { cucumberVine = new ModBlockVine(Material.vine, cucumberVine, cucumberVineGrown, ModItems.cucumber) .setHardness(0.3F) .setStepSound(Block.soundTypeWood) .setBlockName(cucumberVine_unloc_name) .setBlockTextureName(PickleCraft.modid + ":" + cucumberVine_unloc_name) .setCreativeTab(PickleCraft.tabPickle); GameRegistry.registerBlock(cucumberVine, cucumberVine_unloc_name); cucumberVineGrown = new ModBlockVine(Material.vine, cucumberVine, cucumberVineGrown, ModItems.cucumber) .setHardness(0.8F) .setStepSound(Block.soundTypeWood) .setBlockName(cucumberVineGrown_unloc_name) .setBlockTextureName(PickleCraft.modid + ":" + cucumberVineGrown_unloc_name) .setCreativeTab(PickleCraft.tabPickle); GameRegistry.registerBlock(cucumberVineGrown, cucumberVineGrown_unloc_name); } }
  3. Should I do if world.getBlock(x, y, z) == this.grownBlock instead?
  4. Scroll through the code, I am using both methods. neither are working
  5. If your running the latest version of forge, most of the fields you need are renamed. For example, the parameters in, lets say sugarcane's update tick method, are all jumbled. But you can see what they do, based on how they are used. For example, if I have private void foobar(int foo, int bar, int foobar, world barfoo) { barfoo.setBlock(foo, bar, foobar, Blocks.dirt); } You can see what foo, bar, foobar, and barfoo are by looking at how they are used. If you are overriding a method and it has unknown parameters, click on the green arrow in eclipse next to the method, and see what you are overriding, and try your best to figure it out using the method I specified above. The reason I say most methods are usable, is because Tinkers' Construct, a complicated mod, is almost 100% updated and working.
  6. A, this is not legal, as RedPower is not open source and elorram has not given anyone permission to continue her mod. B, items being called uv will be the least of your problems.
  7. Also, the spawnItemAtPlayer is basically a almost-clone of Tinkers' Construct.
  8. Hello, I have a crop that is supposed to harvest when you punch or right click it. I have these two methods in my block class. /* Left-click harvest */ @Override public void onBlockClicked (World world, int x, int y, int z, EntityPlayer player) { if (!world.isRemote) { int meta = world.getBlockMetadata(x, y, z); if (this == this.grownBlock) { world.setBlockToAir(x, y, z); world.setBlock(x, y, z, this.unGrownBlock, meta, 3); RandomUtils.spawnItemAtPlayer(player, new ItemStack(this.produceItem, 1, 0)); } } } /* Right-click harvest */ @Override public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { int meta = world.getBlockMetadata(x, y, z); if (this == this.grownBlock) { if (world.isRemote) return true; world.setBlockToAir(x, y, z); world.setBlock(x, y, z, this, meta, 3); RandomUtils.spawnItemAtPlayer(player, new ItemStack(this.produceItem, 1, 0)); return true; } return false; } and the spawnItemAtPlayer method is public static void spawnItemAtPlayer (EntityPlayer player, ItemStack stack) { EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack); World world = player.worldObj; world.spawnEntityInWorld(entityitem); if (!(player instanceof FakePlayer)) entityitem.onCollideWithPlayer(player); } . It's doing nothing when I right click it. What am I doing wrong?
  9. Should be fairly similar in 1.7 to 1.4.
  10. First, wrong section of the forums. Second, your configs are registering oil as Block ID #4093, but it is already registered somewhere else in your configs as #1530. Probably says something like oil fluid id and your saying 1530, but it also says oil block ID and your saying 4093, which does not = the fluid ID.
  11. I need a way of accessing the position of the block being destroyed in Block.idDropped(). I am coding in 1.6. I need this to execute some code if a certain bool is true when the block is destroyed by any means.
  12. Provide more info, how is your dev environment set up, what have you done to resolve the issue
  13. Thanks so much to both of you!
  14. I'm trying to make a new version of the lever, and like the lever it doesn't need a tile entity. So I need a way to custom render (like the lever) without making a TileEntity. I figured out that the lever is rendered by this code public boolean renderBlockLever(Block p_147790_1_, int p_147790_2_, int p_147790_3_, int p_147790_4_) { int var5 = this.blockAccess.getBlockMetadata(p_147790_2_, p_147790_3_, p_147790_4_); int var6 = var5 & 7; boolean var7 = (var5 & > 0; Tessellator var8 = Tessellator.instance; boolean var9 = this.hasOverrideBlockTexture(); if (!var9) { this.setOverrideBlockTexture(this.getBlockIcon(Blocks.cobblestone)); } float var10 = 0.25F; float var11 = 0.1875F; float var12 = 0.1875F; if (var6 == 5) { this.setRenderBounds((double)(0.5F - var11), 0.0D, (double)(0.5F - var10), (double)(0.5F + var11), (double)var12, (double)(0.5F + var10)); } else if (var6 == 6) { this.setRenderBounds((double)(0.5F - var10), 0.0D, (double)(0.5F - var11), (double)(0.5F + var10), (double)var12, (double)(0.5F + var11)); } else if (var6 == 4) { this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F + var11), (double)(0.5F + var10), 1.0D); } else if (var6 == 3) { this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), 0.0D, (double)(0.5F + var11), (double)(0.5F + var10), (double)var12); } else if (var6 == 2) { this.setRenderBounds((double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F - var11), 1.0D, (double)(0.5F + var10), (double)(0.5F + var11)); } else if (var6 == 1) { this.setRenderBounds(0.0D, (double)(0.5F - var10), (double)(0.5F - var11), (double)var12, (double)(0.5F + var10), (double)(0.5F + var11)); } else if (var6 == 0) { this.setRenderBounds((double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F - var11), (double)(0.5F + var10), 1.0D, (double)(0.5F + var11)); } else if (var6 == 7) { this.setRenderBounds((double)(0.5F - var11), (double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F + var11), 1.0D, (double)(0.5F + var10)); } this.renderStandardBlock(p_147790_1_, p_147790_2_, p_147790_3_, p_147790_4_); if (!var9) { this.clearOverrideBlockTexture(); } var8.setBrightness(p_147790_1_.getBlockBrightness(this.blockAccess, p_147790_2_, p_147790_3_, p_147790_4_)); var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); IIcon var13 = this.getBlockIconFromSide(p_147790_1_, 0); if (this.hasOverrideBlockTexture()) { var13 = this.overrideBlockTexture; } double var14 = (double)var13.getMinU(); double var16 = (double)var13.getMinV(); double var18 = (double)var13.getMaxU(); double var20 = (double)var13.getMaxV(); Vec3[] var22 = new Vec3[8]; float var23 = 0.0625F; float var24 = 0.0625F; float var25 = 0.625F; var22[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var23), 0.0D, (double)(-var24)); var22[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var23, 0.0D, (double)(-var24)); var22[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var23, 0.0D, (double)var24); var22[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var23), 0.0D, (double)var24); var22[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var23), (double)var25, (double)(-var24)); var22[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var23, (double)var25, (double)(-var24)); var22[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var23, (double)var25, (double)var24); var22[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var23), (double)var25, (double)var24); for (int var26 = 0; var26 < 8; ++var26) { if (var7) { var22[var26].zCoord -= 0.0625D; var22[var26].rotateAroundX(((float)Math.PI * 2F / 9F)); } else { var22[var26].zCoord += 0.0625D; var22[var26].rotateAroundX(-((float)Math.PI * 2F / 9F)); } if (var6 == 0 || var6 == 7) { var22[var26].rotateAroundZ((float)Math.PI); } if (var6 == 6 || var6 == 0) { var22[var26].rotateAroundY(((float)Math.PI / 2F)); } if (var6 > 0 && var6 < 5) { var22[var26].yCoord -= 0.375D; var22[var26].rotateAroundX(((float)Math.PI / 2F)); if (var6 == 4) { var22[var26].rotateAroundY(0.0F); } if (var6 == 3) { var22[var26].rotateAroundY((float)Math.PI); } if (var6 == 2) { var22[var26].rotateAroundY(((float)Math.PI / 2F)); } if (var6 == 1) { var22[var26].rotateAroundY(-((float)Math.PI / 2F)); } var22[var26].xCoord += (double)p_147790_2_ + 0.5D; var22[var26].yCoord += (double)((float)p_147790_3_ + 0.5F); var22[var26].zCoord += (double)p_147790_4_ + 0.5D; } else if (var6 != 0 && var6 != 7) { var22[var26].xCoord += (double)p_147790_2_ + 0.5D; var22[var26].yCoord += (double)((float)p_147790_3_ + 0.125F); var22[var26].zCoord += (double)p_147790_4_ + 0.5D; } else { var22[var26].xCoord += (double)p_147790_2_ + 0.5D; var22[var26].yCoord += (double)((float)p_147790_3_ + 0.875F); var22[var26].zCoord += (double)p_147790_4_ + 0.5D; } } Vec3 var31 = null; Vec3 var27 = null; Vec3 var28 = null; Vec3 var29 = null; for (int var30 = 0; var30 < 6; ++var30) { if (var30 == 0) { var14 = (double)var13.getInterpolatedU(7.0D); var16 = (double)var13.getInterpolatedV(6.0D); var18 = (double)var13.getInterpolatedU(9.0D); var20 = (double)var13.getInterpolatedV(8.0D); } else if (var30 == 2) { var14 = (double)var13.getInterpolatedU(7.0D); var16 = (double)var13.getInterpolatedV(6.0D); var18 = (double)var13.getInterpolatedU(9.0D); var20 = (double)var13.getMaxV(); } if (var30 == 0) { var31 = var22[0]; var27 = var22[1]; var28 = var22[2]; var29 = var22[3]; } else if (var30 == 1) { var31 = var22[7]; var27 = var22[6]; var28 = var22[5]; var29 = var22[4]; } else if (var30 == 2) { var31 = var22[1]; var27 = var22[0]; var28 = var22[4]; var29 = var22[5]; } else if (var30 == 3) { var31 = var22[2]; var27 = var22[1]; var28 = var22[5]; var29 = var22[6]; } else if (var30 == 4) { var31 = var22[3]; var27 = var22[2]; var28 = var22[6]; var29 = var22[7]; } else if (var30 == 5) { var31 = var22[0]; var27 = var22[3]; var28 = var22[7]; var29 = var22[4]; } var8.addVertexWithUV(var31.xCoord, var31.yCoord, var31.zCoord, var14, var20); var8.addVertexWithUV(var27.xCoord, var27.yCoord, var27.zCoord, var18, var20); var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var18, var16); var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var14, var16); } return true; } in RenderBlocks.java, because render type 12 is specified in BlockLever.java. I have not been able to figure out how to add a new RenderBlocks type dealio and I also have not been able to figure out where it says returning 12 in func_149645_b (I'm in 1.7.2) makes it render the lever as that code up there. Any help with understanding how this works would help, but if anyone with experience doing something like I am trying to do, that would be even more helpful.
  15. I'm going to refer you to my github. Look in the 1.7 branch of Carbon-Mod. https://github.com/alix-the-alicorn Also, My stuff isn't localized yet, use the assets method to localize in 1.7.
  16. Personally, I would just make it render really close to the player, but whatever. Use ASM.
  17. It seems ICraftingHandler no longer exists. Please tell me how I would make one in 1.7. If you want to talk in irc, I'm hanging out in the forge and mcp channels, ping me if I don't respond. (IRC name = jmanpenilla)
  18. replace all id things with their newer counterpart, do code digging to find out obfuscated names
  19. I fixed it. Thanks guys. ( I just had to change load order )
  20. What order should it be in?

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.