• 0

    posted a message on Get/SetBlockMetadata help please
    Hello!

    I've been banging my head on some code I'm trying to get to work in 'onNeighborBlockChange', and I found out the below code doesn't work either...

    	int b;
    
    	// Fetch metadata and 'or' 32 to it, then save it...
    	b = par1World.getBlockMetadata(par2, par3, par4);
    	b |= 32;
    	par1World.setBlockMetadata(par2, par3, par4, B);
    
    	// Fetch metadata again and see if 32 is in it...
    	b = par1World.getBlockMetadata(par2, par3, par4);
    	if ((b&32) == 32)
    		// do something


    What I was expecting was the 'if' statement to be true; however, the statement remained false and I didn't get anything to happen when I got the metadata, or'd 32 to it, set it into the block's metadata, then immediately called that data and looked to see if the 32 had indeed been or'd into the metadata. I even tried making the metadata equal 32, then fetch it again to see if it still equalled 32 and it didn't. Is there something I'm overlooking, and if so, what do I need to do to make this work?

    Thanks in advance for the help!
    Posted in: Modification Development
  • 0

    posted a message on Change in one custom block propagates to all custom blocks?
    I thought about using metaData, but I couldn't figure out how rotational data is stored in it (I didn't want to mess up the data that was already there), and I didn't know how to load up the metaData with the equivalent of four boolean variables. It was pretty easy in C and CPP; I'd just use something like the following to determine if conditions have been met from a single variable:

    if (something happened)
        myVar |= 4;
    else
        myVar &= ~4;
    if (another thing happened)
        myVar |= 8;
    else
        myVar &= ~8;
    ...
    if (myVar & 4)
        <do something>
    else if (myVar & 8)
        <do something else>
    else
        <myVar hasn't had '4' or '8' anded into the myVar variable so do nothing>


    You can see from the above that I can load up 'myVar' by using bitwise operators, and then later use similar operators to view whether the previous operations had been used to make the conditional statements 'true' or 'false'. How would you recommend taking advantage of metaData or tile entities to do something similar to the above? I'm definitely open to suggestions!

    Thanks in advance for the info!
    Posted in: Modification Development
  • 0

    posted a message on Change in one custom block propagates to all custom blocks?
    Here's one that is really confusing me, see the code below...

    public class BlockFlatBlock extends BlockDirectional
    {
    
    boolean myVariable = false;
    if (something for this block == true)
      myVariable = true;
    }


    This is a very simplified version of what I'm trying to do. What's happening is, if I do something in game to change the value of 'myVariable' in any instance of the block BlockFlatBlock in the game world, the variable 'myVariable' changes for ALL of the instances of BlockFlatBlock! How do I make it so 'myVariable' changes only for the single block in which it has changed?

    Thanks for the info!
    Posted in: Modification Development
  • 0

    posted a message on Getting my block's X Y Z coordinates
    Thanks for the replies! I think I'm figuring it out, but I'm definitely still getting the hang of it.
    Posted in: Modification Development
  • 0

    posted a message on Getting my block's X Y Z coordinates
    I want to know my block's x/y/z coordinates so I can check to see if one side of it is receiving power from a powered redstone wire, and then transfer that power to another side of it based on whether conditions have been met. Sort of like a Deluxe Repeater.
    Posted in: Modification Development
  • 0

    posted a message on Getting my block's X Y Z coordinates
    I created a block in Minecraft, but I don't know how to get its X Y Z coordinates. I was hoping it would be something simple, like 'this.x', 'this.y', 'this.z', but it doesn't appear to be like that... I'm still extremely new to modding Minecraft, so feel free to point out the painfully obvious. ;)

    Thanks in advance for the info!
    Posted in: Modification Development
  • 0

    posted a message on Rotate Block like a Redstone Repeater
    Hey all, I'm pretty new to modding Minecraft... I'm using ModLoader and Eclipse and currently have a block in the game that is flat like a redstone repeater. What I can't do is orient the block based on how the player drops it on the ground... How do I do that? Here's my block code, it places a block on the ground and faces it in one direction no matter which way you're facing when you place it.

    package net.minecraft.src;
    import java.util.Random;
    public class BlockFlat extends BlockDirectional
    {
    public BlockFlat(int par1, int par2)
    	{
    		super(par1, par2, Material.circuits);
    		setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
    	}
    	public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
    	{
    		int i = ((MathHelper.floor_double((double)((par5EntityLiving.rotationYaw * 4F) / 360F) + 0.5D) & 3) + 2) % 4;
    		par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
    	}
    	public int quantityDropped(Random random)
    {
      return 1;
    }
    
    public int idDropped(int i, Random random, int j)
    {
      // return Item.diamond.shiftedIndex;
      return 196;  // Returns same index as block, appears as small floating block.
    }
    }


    Here's the code for my mod...

    package net.minecraft.src;
    public class mod_Flat extends BaseMod
    {
    public static final Block FlatBlock;
    public static Item FlatItem;
    
    static
    {
      FlatBlock = (new BlockFlat(196, ModLoader.addOverride("/terrain.png", "/mods/Flat01.png"))).setHardness(2F).setResistance(10F).setStepSound(Block.soundStoneFootstep).setBlockName("Flat");
      // FlatItem = (new Item(452)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/mods/Flat02.png")).setItemName("FlatItem");
    }
    
    public mod_Flat()
    {
      // ModLoader.addName(FlatItem, "Flat Block");
      ModLoader.addName(FlatBlock, "Flat Block");
      ModLoader.registerBlock(FlatBlock);
    
      ModLoader.addRecipe(new ItemStack(mod_Flat.FlatBlock, 16), new Object[]
    	{
    	 " X ", " X ", " X ", Character.valueOf('X'), Item.reed
    	});
    }
    
    public void load()
    {
    }
    
    public String getVersion()
    {
      return "Flat Block Mod";
    }
    }


    Right now I'm just trying to figure out how to get the texture on the top of this block to point in a direction based on what direction the player is facing when he or she puts the block on the ground. I'll figure what to make it do after that, but one step at a time... Thanks in advance for the help!
    Posted in: Modification Development
  • 0

    posted a message on [1.5.2] Ironclad49er's Mods
    First of all, I'd like to say your elevator mod is absolutely awesome. I've been playing vanilla Minecraft since the alpha days and this is the first 'item' mod I've installed (the other mods were just for visuals), and it really changed the dynamic of the game for me. Keep up the good work!

    As awesome as your elevator mod is in itself, I'd still like to offer a couple of suggestions...

    - Make the 'snap player to elevator block' an option. It's probably not necessary if the elevator is a big one or if the elevator is completely enclosed in an elevator shaft. Unless you've been having collision problems while the player is riding up the elevator (falling through elevator, snapping off to the side of the elevator, etc)... I've only played with v.1.3.1, so I'm not sure what bugs you were fighting before you decided to use the 'snap to elevator' idea, but if it's possible to make 'snap player to elevator block' an option then that would be really cool.

    - Make the recall switch behave the same as when you right-click (use) the elevator block if you are already standing on an elevator block. That way you can put a recall switch in an elevator shaft and then interact with it instead of having to use the elevator block directly.

    That's all I have for ideas, everything else about it is frickin' awesome. Thanks for the elevator mod!
    Posted in: Minecraft Mods
  • 1

    posted a message on Minecraft runs horrible after OS Reinstall
    I just noticed that you said 'java.exe' is to be run by the Nvidia vid card... Shouldn't that be 'javaw.exe'? If you open task manager while you're playing Minecraft, you'll see that it's running on javaw.exe, not java.exe. Try making javaw.exe run with the Nvidia card and then see how Minecraft plays.

    Hope that works!
    Posted in: Legacy Support
  • 1

    posted a message on Minecraft runs horrible after OS Reinstall
    Usually when I do an OS reinstall, it's because I had just replaced the harddrive... Going on that mindset, if you tore your computer apart and reassembled it, make sure you have your monitor plugged into the GeForce 9600 vid card and not the onboard motherboard video. It may seems pretty obvious, but it's still easy to jack into the wrong port.
    Posted in: Legacy Support
  • 0

    posted a message on A fatal error has been detected by the Java Runtime Environment
    Here's what I found from AMD's website (they own ATI)...

    AMD ATI Drivers

    Follow the prompts and see if you can download and install the latest drivers. Looks like that's an older card, so it's possible that the latest drivers still won't support the version of OpenGL on which Minecraft has been coded. But I have a NVidia card that's about as old as your vid card and it runs Minecraft just fine... Either way, it shouldn't hurt to try. Good luck!
    Posted in: Legacy Support
  • 0

    posted a message on A fatal error has been detected by the Java Runtime Environment
    Quote from Axaler

    Your logic amuses me.


    I'm not Vulcan, nor am I a Trekkie (or at least, a hardcore one) :tongue.gif:

    We need to find out what video card is in your computer... If you're running Windows, click 'Start' and 'Run', then type in 'dxdiag' and click OK. When DirectX Diags run, click on the 'Display' tab and look at the Name of your vid card; on my work PC, it's an "Intel 4 Series Express Chipset Family" (don't tell work I'm playing around on the Minecraft forum). Tell me what DXDiag says and I'll try to find a link for you.
    Posted in: Legacy Support
  • 1

    posted a message on A fatal error has been detected by the Java Runtime Environment
    Couple of things hint at 'need to update video drivers'...

    # The crash happened outside the Java Virtual Machine in native code.
    Java install is OK, but something else is crashing the application?

    # Problematic frame:
    # C [atioglx1.dll+0x3fb4c7]

    atioglx1.dll = ATI OpenGL library, maybe it's out of date?

    Try to scout down an updated video driver for your vid card and install it. If that doesn't work, reinstall Java Runtime Environment too. If THAT doesn't work, spill soda on this computer too and use that excuse to buy another computer :wink.gif:
    Posted in: Legacy Support
  • 0

    posted a message on My note block song loop (Clocks)
    Hey Verge_sV, here's a 'quick and dirty' tutorial on how to make looping songs. Sorry I didn't post this yesterday, it took a long time for the video to process/upload and I crashed for the night before it got done.

    Nevermind the chicken... Everyone's a critic.

    You'll notice how the note blocks are put in the redstone loop on every other torch (instead of every torch). This is because the note blocks are triggered when the torch is switched 'on'. You can experiment by putting a note block on every torch and listening to what happens, you might be able to put that effect into your own song!

    You'll also notice how the note block's redstone dust trail is directed at the torch itself, rather than sharing the dust that switches on the next redstone torch; If you try to share the redstone dust with the next torch, the redstone dust trail will go directly to the note block instead of also switching the next torch. If that happens, the loop will end there and your song will stop. You can get it to work by sharing redstone dust with the next torch, but I wanted to make this tutorial as simple and straightforward as possible.

    Play around and experiment with what you see in the video and you'll be making music in no time. Make a giant loop, or zig-zag back and forth to make use of as small of a space as possible. My music tower uses this exact same loop, and I use up to four note blocks together to make chords and percussion (melody blocks are placed on top of dirt, bass blocks are placed on top of wood blocks, and percussion blocks are placed on top of soul sand).

    Hope that helps!
    Posted in: Survival Mode
  • 0

    posted a message on My note block song loop (Clocks)
    Quote from Verge_sV »
    Could you make a tutorial of how to make looping sound blocks? One that we could work off of the tutorial design? :biggrin.gif:
    By the way. This is amazing, I loved Coldplay when they weren't so mainstream.


    I'd make a tutorial map if I knew how... Whenever I look at my savegame folder it consists of a bazillion subfolders, and I'm not sure how to share that.

    But making looping songs is pretty easy, just string together a bunch of repeaters and tap off the 'normally off' torches in the repeater to trigger note blocks. Bring the repeater around back to the first to loop the whole thing. Start the loop by triggering the first bit of redstone dust with a redstone torch, then stop it by breaking the redstone dust path (or use a redstone torch to keep the dust in an 'on' state and break the loop).
    Posted in: Survival Mode
  • To post a comment, please .