Jump to content

Abastro

Forge Modder
  • Posts

    1075
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Abastro

  1. Then please show your code..
  2. Then, you have to use: if (par6ItemStack.hasDisplayName()) { ((TileXX)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); } when TileXX is the class which has setGuiDisplayName.
  3. It is setting the displayed name in the gui of the tile entity. (This code is from my mod, which contains Heat Furnace.) If your gui-displayed name is constant, you can simply ignore that.
  4. Oh, sorry. I used improper word. By the way, then you can use the method for your dimension, too. It is far from any bugs, and I think this way is standard for those uses.
  5. first, override onBlockPlacedBy: /** * 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()) { ((TileHeatFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); } } The metadata is the direction of the furnace. You can see Direction class to see the name of each direction
  6. Did you call init() before registerRecipes()?
  7. I think it is has to do with GL11.glRotatef(par1EntityBolt.prevRotationYaw + (par1EntityBolt.rotationYaw - par1EntityBolt.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); Maybe GL11.glRotatef(par1EntityBolt.prevRotationYaw + (par1EntityBolt.rotationYaw - par1EntityBolt.prevRotationYaw) * par9, 0.0F, 1.0F, 0.0F); is correct.
  8. Yes, it DOES keep them constant. Since the Brightness in the minecraft day is from the SUN, the light level is Highly Dependent to the position of the SUN. If someone has the SUN stop, then the day-light cycle would gone in most world, even in minecraft. Please do not neglect the Sky and the SUN, and do not use the unreliable way.
  9. How did you initialize the stackTagCompound? I think this problem is related with the problem...
  10. Override the calculateCelestialAngle method of your WorldProvider class, and just return 0.75F every time. So, It would look like this: public float calculateCelestialAngle(long par1, float par3) { return 0.75F; }
  11. No, It will return a list of the entities in 11*11*11 Box surrounding the block. If you want to get the lists of the entities in 10 block-distance, You have to check for each entity if the squared distance is smaller than 10*10.
  12. You can also make a crossover mod for your mod and the another mod. you can have several mods in your mod.jar, so you can pack them in a jar.
  13. For second question, you can implement IFluidHandler. You can use the FluidTank to support it. Let the tileentity implement it, and when a bucket is interacting with the tileentity, let the block handle the state. For first question, I think it would be related with slot, so please post your container...
  14. Hmm.. maybe you are confused with capital letters. Do not make and use a static variable: tileentitykeypad. Just change all of them to: tileEntityKeyPad. It was already declared in the GuiKeyPad class, but not used.
  15. I'll change name of some parameters so you can easily understand them. //This method is called when right-clicked with an item. //I think it was for placing block from the items, so the block position would be where a block would appear. //bx, by, bz is the coordinate of the clicked region. //side is the placing side. Bottom = 0, Top = 1, East = 2, West = 3, North = 4, South = 5. //px, py, pz is the coordinate of the player relative to the clicked block. public boolean onItemUse(ItemStack used, EntityPlayer player, World world, int bx, int by, int bz, int side, float px, float py, float pz) { //clicked bottom of the block if (side == 0) { //decreases the y position to get the actual clicked block --by; } //clicked top of the block if (side == 1) { //increases the y position to get the actual clicked block ++by; } //and so on... if (side == 2) { --bz; } if (side == 3) { ++bz; } if (side == 4) { --bx; } if (side == 5) { ++bx; } //check if player can edit the block. if (!player.canPlayerEdit(bx, by, bz, side, used)) { //Item didnt used. return false; } else { //When the block is air, if (world.isAirBlock(bx, by, bz)) { //play Sound at the center of the block. world.playSoundEffect((double)x+ 0.5D, (double)y+ 0.5D, (double)z+ 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); //Sets the Block! world.setBlock(par4, par5, par6, Block.fire.blockID); } //Damages the Item. used.damageItem(1, player); //Item used. return true; }
  16. Then please post your code now. I think it would be changed a lot..
  17. You already have the tileEntityKeyPad in GuiKeyPad class, So you can use it. Also, if the variable is not static, it will be always an initialized variable when you calls "new TileEntityKeyPad().pass". So you should not use new TileEntityKeyPad(). Just use the tileEntityKeyPad in GuiKeyPad class for those use, I think it is the solution.
  18. I think the problem is, that you moves the position of the player BEFORE transferring dimension. It would probably cause some issues, like on the case that teleport to the position is invalid.
  19. why do you use "new TileEntityKeyPad()" every time? It would be a new instance, and using the component of the instance would be no use. instead, you can use GuiKeyPad#tileEntityKeyPad. Replace new TileEntityKeyPad() to tileEntityKeyPad.
  20. So, you have to deal with each of them. It seems that there are no other ways to do that.
  21. Try again till the "gradlew setupDecompWorkspace --reresh-dependencies" builds successful. (<-I had mistaken too;) It might have some random errors, I also frustrated with them. But it finally built successful when I tried 4~5 times.
  22. They are another type of recipe, so you have to check each of them. It might be hard to deal with all of them, but it is necessary if you want to deal with every recipe.
  23. What were the red exclamation marks? please show us them.
  24. Of course most recipes would be saved to the IRecipes, but there are an exceptional case. Tool Damage adding Recipes is the case. They are processed externally, not related with the IRecipes. You can see the code in the net.minecraft.item.crafting.CraftingManager. However, It is simple case so you would easily be able to deal with the case.
  25. http://www.minecraftforge.net/forum/index.php?topic=17281.25 I think the topic above would be help.
×
×
  • Create New...

Important Information

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