• 0

    posted a message on playing ambient sounds
    Quote from TechGuy543

    mc.sndManager.playSoundFX("sound.name.here", 1.0F, 1.0F); 

    mc is the Minecraft instance. Put it in any method that is called when you want your sound to be played.
    ok, looks like there isn't a way to tell (yet) if an instance of that sound is already playing and to wait, so will have to find out how to do that. Thanks for the tip!


    You can also find documentation upon Paulscode by Googling it, it's not just Minecraft only, you see.
    aah, nice. duh, of course. is there a way to take the javadoc from say http://www.paulscode.com/docs/SoundSystem/ and put it into eclipse?
    Posted in: Modification Development
  • 0

    posted a message on One-Way-Windows
    Quote from Bryguy

    Why not create a block which uses glass texture on one side and a regular block texture on all others? With the glass side being oriented by your location when placing the block, similar to furnaces.
    hmm, because it only draws blocks one sided, the glass would be see through on the "front" facing block but some other on the other faces.. would look strange when placed by itself of course but as a "pane" instead of a "block" of glass it would work. I'll remember this trick :)
    Posted in: Modification Development
  • 0

    posted a message on Google SketchUp
    I'm pretty sure http://www.minecraftdl.com/turbo-model-thingy/ has support for loading external objects (with simple bones for making animations easier). It also adds support for non-square blocks just to **** off the fanbois. The planes mod uses this to draw all its stuff. Search the forums for "turbo model thingy"
    Posted in: Mods Discussion
  • 0

    posted a message on already tessellating
    The only thing I can think of then is that because I've put this inside block.java that when the RenderItem.doRenderItem() which renders a block object that it's starting to spawn the particle effects again for the block which in turn cause the tesselator to start drawing particles for the block... or something like that. I'm evidently confused because I was following the pattern of the existing particles-for-block-type except that I am doing it from block class directly whereas other particle effects are being called from within a block that extends block.java.

    I could move all the spawnParticles out into the randomDisplayTick() inside each of the block types I'm testing to see if that works. Not as "neat" but I'm finding that neatness isn't a big part of mc code (or following the same design pattern in different parts of the game...)

    I'm not sure that block is the best class to draw particles from for world particles like this, player or world might be better anyway. Trial and error.

    Cheers, I think you have helped me stumble along some more :-)
    Posted in: Modification Development
  • 0

    posted a message on playing ambient sounds
    I want to have a long ambient soundtrack that accompanies particular conditions (e.g. inside a house, in a cave, in a particular biome, etc). I don't want these as background music, and their position is not relative to the player (e.g. they don't play at a block). The soundPoolSounds.getRandomSoundFromSoundPool seems to pull a known random sound which is not what I want.

    a) What class is the best place to play sounds from? I could perform a test of the current biome in Block.java but calculating the current biome per block is crazy (there doesn't seem to be a global that stores the current player biome)
    B) is there a way to determine if a sound is already playing, or queue the sound to loop? E.g. stacking multiple sounds on top of each other a-la "is raining" sound is not working for me.
    c) when transitioning sounds (e.g. moving from one biome to another) is it possible to fade out one playing sound and fade in another?

    Paulscode doesn't appear to be documented in the mpc javadoc so I don't know how it works except for the 3 or so methods used by mc.
    Posted in: Modification Development
  • 0

    posted a message on already tessellating
    Quote from RANKSHANK

    is there an instance of the tesselator drawing in entityFx.renderParticle?

    if the crash is anything to go by then yes the probably is.

    The problem is that I don't know what it is. It *seems* to be related to when EntityPickupFX is drawing something, which appears to be seperate from the normal entityfx renderer.

    Is there a programatic way to determine if the tesselator is currently drawing something and determining the stack at that point? So I can try to work out why the sudden new behaviour / crash.
    Posted in: Modification Development
  • 0

    posted a message on already tessellating
    I've added some new particle effects which are added to blocks using randomDisplayTick() but this has had the effect that when I pick up a dropped item, I get this crash.


    java.lang.IllegalStateException: Already tesselating!
    at net.minecraft.src.Tessellator.startDrawing(Tessellator.java:314)
    at net.minecraft.src.Tessellator.startDrawingQuads(Tessellator.java:304)
    at net.minecraft.src.RenderItem.func_40267_a(RenderItem.java:166)
    at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:135)
    at net.minecraft.src.RenderItem.doRender(RenderItem.java:407)
    at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:184)
    at net.minecraft.src.EntityPickupFX.renderParticle(EntityPickupFX.java:50)
    at net.minecraft.src.EffectRenderer.renderParticles(EffectRenderer.java:143)
    at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1136)
    at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
    at net.minecraft.client.Minecraft.run(Minecraft.java:801)


    My new particles are being added (in Block.java) like this:


    	public void randomDisplayTick(World world, int i, int j, int k, Random random)
    	{
    	 BiomeGenBase biome = world.getBiomeGenForCoords(i, k); // TODO: calculate and cache
    		if ((random.nextInt(50) == 0) && (!world.isRaining() && ( biome.equals(BiomeGenBase.icePlains) || biome.equals(BiomeGenBase.iceMountains) )))
    		{
    		 if ((world.worldInfo.getWorldTime() % 1000 == 0) || ((int)world.worldInfo.getWindDirection()==-1)) {
    		 world.worldInfo.setWindDirection(random.nextInt(360));
    		 world.worldInfo.setWindSpeed(random.nextFloat());
    		 }
    		
    		 float velocity = random.nextFloat() + 1;
    			double dirX = (world.worldInfo.getWindSpeed() * velocity) * Math.cos(world.worldInfo.getWindDirection());
    			double dirZ = (world.worldInfo.getWindSpeed() * velocity) * Math.sin(world.worldInfo.getWindDirection());
    			
    		world.spawnParticle("icewind", (float)i, (float)j + 2.6F, (float)k, dirX, 0.0D, dirZ);
    		if (this.blockMaterial.isGroundCover() && random.nextBoolean()) { // chance at spawning ice cloud effect
    			world.spawnParticle("blizzard", (float)i, (float)j, (float)k, dirX, 0.0D, dirZ);
    		}
      
    	  }
    	}


    Particles are spawned pretty much the same way as any other EntityFX particle; though there's a new effect renderer which doesn't seem to be related (if I unhook it it still crashes). It's renderer is just a proper alpha blender rather than the clamped/solid standard renderer; it looks like this:


    				Tessellator tessellator = Tessellator.instance;
    				//GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.0F);
    				GL11.glEnable(GL11.GL_BLEND);
    				GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // debug with GL11.GL_DST_ALPHA);
    				GL11.glBindTexture(GL11.GL_TEXTURE_2D, j); // i.e. j = renderer.getTexture("/environment/blizzard4x4.png");
    				GL11.glDepthMask(false);
    				tessellator.startDrawingQuads();
    				for (int k = 0; k < fxLayers[i].size(); k++)
    				{
    					EntityFX entityfx = (EntityFX)fxLayers[i].get(k);
    					// debug with tessellator.setBrightness(15728640);
    					tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
    					entityfx.renderParticle(tessellator, par2, f, f4, f1, f2, f3);
    				}
    				tessellator.draw();
    				GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    				GL11.glDisable(GL11.GL_BLEND);
    				GL11.glDepthMask(true);


    I can't work it out. TryCatching over the error doesn't seem like a good solution...
    Posted in: Modification Development
  • 1

    posted a message on Snapshot 12w17a is Ready to Test!
    censored? what is that, a naked herobrine running around or something?
    Posted in: Minecraft News
  • 0

    posted a message on lighting question
    hey, i'm happy to tinker and fail. I mean, this is a sidetrack anyway - I had been adding dust storms to the deserts and got sidetracked in the implementation of the particle system, then started tinkering with other ideas like lighting from particles and non-block items... tinker tinker

    the mod you liked to (and all by that author) handily have source code so people like myself can learn from them. It's great that you pointed me at this one as the code is realtively easy to follow, just trying to work out the strangely convoluted rendering system that mc has in it. I had also thought that particles in particular would benefit from a shader based light alteration implementation and forget the mc renderers - but that's a bit beyond my current skill level (though I guess it's just a matter of learning glsl I guess, maybe one day).
    Posted in: Modification Development
  • 0

    posted a message on lighting question
    Quote from RANKSHANK

    its called dynamic lights
    http://www.minecraft...dynamic-lights/
    although it also serves as an api... so maybe try to just use that?
    Yeah, I'd seen the Handheld Torchlights some time ago and hear that this is based on that. Again, it's still block based (toch is still a block and renders as a block, and blocks have the brightness code in their renderer, so unsure how to affect block lighting with an item (say a flaming arrow) or particle system (e.g. radioactive dust cloud, fireflies, billboarded projectile, etc)
    Posted in: Modification Development
  • 0

    posted a message on lighting question
    hmm, suppose I'll have to grab one of those and decompile it to see how they do it then. I think I see it for items, but particles are a bit different and don't seem to render the same way.
    Posted in: Modification Development
  • 0

    posted a message on lighting question
    Can a mob, item, particle or other non-block item perform block-like lighting during rendering? If so, how?
    Posted in: Modification Development
  • 0

    posted a message on Sky Dimension Ideas
    Quote from ShadowKreach

    Minecraft isn't about realism, it's about what's entertaining and enjoyable, and I personally don't think giant Black, Brown or Grey things flying in the sky is very entertaining, especially in the colourful Minecraft world (This is part of the reason I dislike the Enderdragon). I think a randomized choice for a Dragons colour would be cool, but they could be the same stat wise.


    I think that if physics worked differently in the sky realm that might help.. e.g. blocks fall only so far then slow down and float. Ditto with the player or mobs falling - the sky is like a gelatin that you can smack into with enough velocity, but move through with low velocity. Having islands the size of one biome in and around each other that do not project as much shadow downwards (because "all" is sky) and allowing the player or mobs to fall off them to navigate between without dying on impact would make this sort of thing much more fun! (yay fun to jump off the world, oops landed in lava in the biome underneath)
    Posted in: Suggestions
  • 0

    posted a message on Minecraft's Map size is bigger than a star!
    Quote from kaas94

    Also not that Sirius B is a white dwarf star. White dwarf stars are dieng stars. In there young ages they where very big starts but didn't have enough mass to become a neutron star. The star wasnt hot enough or did not get enough pressure in the core the fuse helium to carbon so the star shrinks to a white dwarf.


    Also, Sirius B probably doesn't exist anymore, except as old light.
    Posted in: Discussion
  • 0

    posted a message on getting "already decorating" errors randomly
    I guess maybe a trycatch instead of throwing the exception will be the only way around it then.. when in doubt, ignore and move on etc
    Posted in: Modification Development
  • To post a comment, please .