Everything posted by Draco18s
-
How can my entity search for a certain type of block (an easy way)
You could do a three dimensional loop worth of getBlockID(x,y,z).
-
Adding different redstone colors
Take a look at the onNeighborBlockChanged functions inside the redstone blocks.
-
Adding different redstone colors
Redstone visually connecting is a bug you wouldn't be able to fix without editing the redstone wire class. It sees bluestone as a redstone-capbable block and attempts a connection.
-
[1.4.7] How to correctly check redstone power on sides of my block?
I think these functions return properties of block types, not state of specific block. If a block can provide power, then you can determine if it's powered based on its metadata, no?
-
Multi textured blocks
Open up BlockTNT. TNT has three textures it uses in exactly the manner in which you want to use it. Peruse that class.
-
[1.4.7] How to correctly check redstone power on sides of my block?
There's a function called isPowerProvider or isProvidingPower that I believe returns true for all redstone blocks. Edit: canProvidePower() Whereas isProvidingWeakPower and isProvidingStrongPower may also be useful.
-
Custom models as blocks
This might help. I haven't used it though.
-
Block that damage the player when in the inventory
You can't do it as a Block. You'll need to have the ore block itself drop an Item version, which can damage the player. The Item class has a function called...onUpdate that will let you do what you need to. Here's an example: public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { double r = new Random().nextDouble(); if(r < 0.005 * par1ItemStack.stackSize) { EntityPlayer p = (EntityPlayer)par3Entity; p.attackEntityFrom(DamageSource.generic, 1); } } I used a custom damage source ("cold") but I've replaced it above with Generic damage. This code is great for stacking items, as the stack will only hurt you once. What this does is increase the frequency that the player takes damage (rather than the amount) based on stack size. Figure that that function is called 40 times a second when calculating how often you want the player to take damage (and there's a 1-2 second damage immunity effect after taking damage). Which is why the random chance is so small (half a percent per item in the stack). This code also means that roughly speaking, having 10 items in a stack is as bad for your health as 10 single items.
-
Item/Block meta/damage data maxinum value
IC2 needs it for their powered items, like the quantum armor, which has something like a million hp. But yeah. 32,000 is sufficient for most modders.
-
Item/Block meta/damage data maxinum value
You can always use the NBTTagCompound associated with each ItemStack. That allows you to store a basically infinite amount of data into your Item. It's a possibility. Depends on the "hack" (either they made items use a long int, or they made their own item damage renderer, or...)
-
Item/Block meta/damage data maxinum value
*short Touche. Still allows for a maximum value of +/-32,767, which is sufficient for most needs. Though I suspect IC2 hacked things so that their items can use a long int (+/-9,223,372,036,854,775,807, yes, that's 9 pentillion)
-
Bounding Boxes: What are they?
Which is why it's taken them four years to implement dynamic deobfuscation.
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
Not really no. :\ I've barely touched rendering. I've made a cube. :V
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
Ah, I see, you're trying to do something more complicated than I expected. I thought you were trying to get a TEXTURE upside down.
-
Need help understanding Dimesions,Biomes,etc
I did opened it and i noticed it handles biome related things. If i understood it right, it decides where biomes are put. Did not understood where are biomes defined and where is actual terrain generation made? I know that biomes are handled by their own classes. See WorldGenForest (etc). How they're defined, I don't know.
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
You might want to build the renderer yourself, rather than relying on the prebuilt functions. It's not that difficult, really. At least, for cubes. I'll dig up some code I have for a custom renderer I have when I get home. It is basically what you need, just you have to swap some variables around.
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
Ah, I see, you're using the built in render[direction]Face fucntions. Yeah. You're going to need to duplicate those and change them. You're looking for this: tessellator.addVertexWithUV(var28, var34, var36, var20, var24); Note five variables are passed. They are, in order: X, Y, Z, U, V. XYZ should be fairly obvious. It's the coordinate in space the vertex is located at. Typically they vary from block.posX to block.posX+1 (same for Y and Z, modified by bounds). U and V relate to the texture. U is a horizontal (x axis) position on the texture, V is the vertical (y axis) position. You need to duplicate the renderFace functions for the sides you want flipped, then swap the variables passed to the V parameter with each other (eg. if the four verts use var23 and var24 you'd change them to be the other).
-
Need help understanding Dimesions,Biomes,etc
The WorldChunkManager, if you opened it, handles things like biomes and weather.
-
[UNSOLVED] Nighttime check
His sig is actually a pretty standard browser data detector. It's just customized a little in terms of its output.
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
...Simpler? Simpler than swapping two variables?
-
Item/Block meta/damage data maxinum value
Blocks yes, items no. Items have a full integer worth of "damage" whereas blocks have a single nybble.
-
WorldGeneration not generating..
Do this: System.out.println("RandPosX: " + randPosX); (or use whatever printing statement you like) and run it. Check the outputted values and insure that they're within the expected range.
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
Draw the points in a different order. Specifically, you might want to look at the last value passed....the texture V (as in, swap it).
-
Beacon's Beam?
No idea, honestly. I haven't messed with it.
-
[1.5.1]Request for updated directional blocks tutorial
What is Block.opaqueCubeLookup? ...and what it has to do with find the direction? It's a static class level function that lets you lookup if a given block (by ID) is opaque or not. In Eclipse you can mouse-over and function, variable, or class name and see the relevant information about it (if any) and there's a little red/green icon next to the definition in the yellow popup box, that if clicked on, will take you to where that function, class, or variable is declared. As for what it has to do with direction: It's a dispenser. It's figuring out which direction it can face without facing a solid block.
IPS spam blocked by CleanTalk.