Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

joaopms

Members
  • Content Count

    36
  • Joined

  • Last visited

Everything posted by joaopms

  1. Try something like this (didn't tested it): @Override public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { if (entity instanceof EntityPlayer) { ((EntityPlayer) entity).addPotionEffect(new PotionEffect(yourArgumentsHere)); } }
  2. I have a block and I need to color it based on the biome he is in, like a block of grass. I'm currently using the grass' methods, but it colors all sides.
  3. I have a block that set's it's textures when someone right clicks it with a block on theur wand. I'm saving it's ID and metadata to the block's tile entity's NBT data. Now I need a way to get a block's metadata and sided textures. I'm already doing it using "getBlockTexture" and "Block.blocksList[tile.blockCamouflageID].getBlockTexture(block, x, y, z, side);", but now, how can I do it with metadata? Thank you!
  4. I have a block that let's you change it's texture by right clicking it with a block in your wand. I'm saving a boolean called "isPersonalized" (if the block was a custom texture, then is true) and an integer called "blockCamouflageID" (if the block was a custum texture, then is the block's ID you chosed) on the block's tile entity's NBT data. Everything is getting saved, but when I call the tile entity and get the data from it, on my "getBlockTexture()" method, it returns "false" for the "isPersonalized" variable and "0" for the "blockCamouflageID" variable (I'm invoking the entity using "Ti
  5. First of all, what are you trying to do? Second, what is at the line 68 at BetterMinecraftMod.java?
  6. Wow, I'm so stupid! -.- Thank you very much, you just saved me from a huge rage.
  7. Eval() is evil. Do not use. So, do you have any idea on what I can do?
  8. Yes I know, it returns an Icon. And I want to like build a string and the run the string like it was an argument.
  9. Yes, but I want to use the "tile.blockName" like I'm building a string, so it should be like this (I know this isn't going to work): Block. + tile.blockName + .getBlockTextureFromSide(0); I don't know if it is possible, but still.
  10. Look at GuiSelectWorld.java, it may help you
  11. On my onBlockActivated I have this method to have access to my tile entity: TileEntityIluminator tile = (TileEntityIluminator) world.getBlockTileEntity(x, y, z); Then I have a string variable on my tile entity called blockName. I can read/write to it by doing "tile.blockName = "[blockName]". Now I want to replace the "stone" part with my variable, "tile.blockName".
  12. I'm trying to get a texture from a block when you right click my block with a block in your wand. That works and it is writing the block name to my block's Tile Entity's NBT Data. Now I want to get the texture from the block from the NBT Data, and for that I'm using this piece of code: Block.blocksList[stone.itemID].getBlockTextureFromSide(0); Now I want to replace the "stone" with the block name from my NBT Data. Is that possible? Is there a easiest way to do it? Thanks!
  13. Since Mac OS is based on Linux, it should be "bash install.sh" or "sh install.sh"
  14. Yes, you just need to modify the hex color. For example, red is 0xFF0000, blue is 0x0000FF, green is 0x006400, purple is 0x6A5ACD and black is 0x000000. Source: http://www.minecraftforum.net/topic/1412300-147forgeblaueseichoerns-gui-tutorial/
  15. Argh, packets are so complicated! I will do Vswe's Courses before I continue to code.
  16. Yes, I've changed the static value. Do something to the tile entity? I think I already have that: the identificationName string is used to read the packet and then send save it to NBT.
  17. Yeah, I will need to do that. Checking it when I need it isn't enought. Thanks!
  18. Hmm... didn't know about that. But I've changed it and it persists: public class TileEntityIdentification extends TileEntity { public String name; public TileEntityIdentification() { } public void setName(String s) { name = s; //called from the packethandler via the gui System.out.println("setName: " + name); // this works } public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); name = nbt.getString("name"); // returns null - should return the name on the block (get) PacketHandler.setIdentificationName(name); // returns null - should return the name on the b
  19. Go to %appdata%/.minecraft and search for the mods folder. I'm not sure how is the folder structure for Forge 1.6, but it should be on the .minecraft
  20. I have another problem: my variables aren't working as they should (check the code): public class TileEntityIdentification extends TileEntity { public String setName; public String getName; public TileEntityIdentification() { } public void setName(String s) { setName = s; //called from the packethandler via the gui System.out.println("setName: " + setName); // this works } public String getName() { //System.out.println("getName: " + getName); return getName; // returns null - should return the name on the block (get) } public void readFromNBT(NBTTagCompound nbt) { super.readFr
  21. Okay, I've done the packet thing, but it stays the same because the string is static and if I try to change it, it throws me a couple of errors, like "Cannot make a static reference to the non-static method getIdentificationName() from the type PacketHandler" and it only allows me to change it back to static. Nevermind, I was forgetting how to do it properly.
  22. Man, Packets are confusing and complicated and took me almost 4 hours to figure that out, but I did it - I think - but when I set the name and close and then open the GUI it doesn't get the new name (unless I log out). Also, every Block was the same name and every block should have their own name. Here's my code if you need it: BlockIdentification.java public class BlockIdentification extends BlockContainer { public BlockIdentification(int id, Material material) { super(id, material); setHardness(2.0F); setStepSound(Block.soundStoneFootstep); setUnlocalizedName("identificationBl
  23. I have a GuiScreen and you can access it by right clicking a block. There, you can set the name of the player you want to detect when it is touching the block (I'm still working on it). If the block already was a name set, it will get it from the TileEntity NBT Data, and when you set the name on the GUI it will write it to the TileEntity NBT Data. I've read that I will need to send and get packets to update the GUI and write to the TileEntity NBT Data, but I'm not sure if I need to do it using packets and how to do it.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.