Jump to content

gline9

Members
  • Posts

    17
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    United States
  • Personal Text
    I am new!!

gline9's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. here is the code that worked for me... @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack item){ int yaw = ((int) player.rotationYaw)%360; if (yaw<0) yaw+=360; if (315<yaw || yaw<=45) world.setBlockMetadataWithNotify(x, y, z, 2, 3); if (45<yaw && yaw<=135) world.setBlockMetadataWithNotify(x, y, z, 5, 3); if (135<yaw && yaw<=225) world.setBlockMetadataWithNotify(x, y, z, 3, 3); if (225<yaw && yaw<=315) world.setBlockMetadataWithNotify(x, y, z, 4, 3); player.rotationYaw = 90; } the other code you see there just rotates the block depending on which direction you are facing which is unimportant in this case. What is important is the last line player.rotationYaw = 90; when run and I place the block my character is rotated to the position of 90 degrees so it is working for me.
  2. I just left the house for the day when I arrive back I can post the source code. If I forget pm me and I'll remember
  3. you can use this image to help you with the general texture for slots. http://img3.wikia.nocookie.net/__cb20130218210446/thetekkit/images/a/a1/Gold_Chest_gui.png
  4. The setAngles() method isn't doing what you think it is. Here is the text that the forge gives for what that method does. Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both arguments in degrees. try removing that method and see if your entity rotates how you think it should. I tried a test using myself as the entity and when I changed the rotationYaw variable by itself it did work without any added code so try only changing that variable. Also try david's suggestion.
  5. There should be a variable in your entity called rotationYaw try setting that to the value of fYaw and it should work.
  6. We need to see more of your code. I see that you set the rotation yaw to fyaw but I don't know what fyaw is set to elsewhere in your code...
  7. instead of sending the meta data using nbt.setInteger("meta", this.blockMetadata); you can use the write nbt and read nbt code you already have to retrieve the tile entity data. i.e. this.readFromNBT(nbt); and this.writeToNBT(nbt)
  8. Thank you guys so much for your help. My tileentity saves the data now to the server using a combination of the two ideas Unfortunately whenever I change the redstone state of the block, the tile entity data for the block disappears. I am using the same methods for using redstone as the redstone lamp uses. Does anyone know of a way of keeping the same tile entity data with that block when replacing the block? Here are the classes that I changed for anyone interested in how I solved the previous problem. Tile Entity Class: IMessage Class: Gui Class:
  9. There is a really good tutorial at this link http://www.minecraftforge.net/forum/index.php?topic=14048.0
  10. For some reason the rest of the message didn't add Gui class: my common proxy class finally the main class: and here is the error log that I am getting. If you need any additional info please let me know.
  11. I have created a gui for a block I made that only needs to transfer 1 integer worth of information over to the server and client tile entities. I thought that using IMessage and IMessageHandler would be useful in syncing the two tile entities but when I send the message it calls and index of -1 and won't send... Here is my code: Block class: TileEntity class: IMessage class: IMessageHandler class:
  12. You are right diesieben using a tile entity isn't the best way of saving the data you should use the metadata like you are. While looking at the code I did notice that you aren't using the metadata when assigning block textures to the sides though so the block would always use the same texture for each side whether the metadata says the block is rotated or not. This could be your problem.
  13. If you want the furnace to face you you need to create a variable in your tile entity class that saves the direction of the furnace then change that variable in the on block placed method depending on the direction of the player. You then need to access the variable when retreiving the icons for the block.
  14. Your ItemWand class needs to extend the item class
  15. I don't know if this is your error the code is giving but you don't have the type of variable before ItemWand. This code may give you better results. ItemWand itemWand = new ItemWand().setUnlocalizedName("ItemWand"); Also make sure you are importing the item class for ItemWand.
×
×
  • Create New...

Important Information

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