Jump to content

Matler

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    Poland
  • Personal Text
    Gravel falling on my face!!!

Matler's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi, I'm writing little mod for simple physics in minecraft. I need to check blocks on their update so I might need to somehow override the onBlockAdded and onNeighborBlockChange methods for all blocks, even added by other mods. But I don't know how to accomplish that. I tried to handle events, but I couldn't find any "onBlockPlaced" event or something like this. The PlayerInteractEvent isn't sufficient too, because what I need to know is what block is being placed and where is it. And forgive me my poor English
  2. I've tried to make it like this: TileEntityVoltage Voltage = (TileEntityVoltage) world.getBlockTileEntity(i, j, k); but it's still doesn't work :'(....
  3. Yes your offer is very good but I have a lot of ideas like ... (no, I can't tell you what I want to add, cause you may steal my ideas ) and your API isn't good to do what I want. Don't think that your mod is poor(it's really cool) but I want to make my own code with my own troubles. And yes I've got trouble. My Tile Entity is null (I have no idea how to write my problem cause I'm not English) I have never wrote any Tile Entity, so maybe I did it wrong. Please, could you help me with TileEntity and how to add it to block and how to get from it a variable. Here is my code: TileEntityVoltage: package net.minecraft.src; import java.util.Random; public class TileEntityVoltage extends TileEntity { private float Voltage; public TileEntityVoltage() { Voltage = 0.0F; } public void setVoltage(float f) { Voltage = f; } public float getVoltage() { return this.Voltage; } } and in blockCabble: public TileEntity getBlockEntity() { return new TileEntityVoltage(); } public void setBlockVoltage(World world, int i, int j, int k) { TileEntity Voltage = world.getBlockTileEntity(i, j, k); if(world.getBlockId(i, j, k + 1) == mod_Electricity.blockBattery.blockID && world.getBlockMetadata(i, j, k + 1) == 2) { TileEntity Voltage2 = world.getBlockTileEntity(i, j, k + 1); Voltage.setVoltage(Voltage2.getVoltage()); } } And when I place if (Voltage == null) ModLoader.getMinecraftInstance().thePlayer.addChatMessage("NULL!!!!!"); On chat i hav NULL!!!!!! And of course i put into my mod_ ModLoader.registerTileEntity(net.minecraft.src.TileEntityVoltage.class, "TileEntityVoltage");
  4. Uh that's looks great but since I've started playing Minecraft I wanted to make my own mod that adds electricity. And it's my first mod which I going to publish (probably). Well so far I won't use your API but it's looks pretty awesome!
  5. Oh, ok. I haven't thought about it. Thanks a lot!
  6. Hi, I've got a trouble with mods. I need to get my own variable from my own block. I've tried to do this like this: mod_Electricity.blockBattery.getVoltage but it's gets variable from whole class not one block. Is there any way to do this like: world.getBlockMetadata(i, j, k) but like this: world.getBlockVoltage(i, j, k) Could i do it without changing an original Minecraft code?
×
×
  • Create New...

Important Information

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