-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
If A B Ergo !A Huh?
-
Changing the TileEntity from inside the block it's attacht to
Draco18s replied to Abascus's topic in Modder Support
No, the OP said how, the first reply asked when, the functions I refer to are WHERE in the code that WHEN happens and HOW to do it. So stop being pedantic. -
Use either metadata (so that a block's metadata corresponds to it's Y coord) or TileEntity data (so you can have more than 16 possibilities).
-
How can my entity search for a certain type of block (an easy way)
Draco18s replied to kauan99's topic in Modder Support
No idea. :\ -
Changing the TileEntity from inside the block it's attacht to
Draco18s replied to Abascus's topic in Modder Support
world.getBlockTileEntity(x, y, z); Where x, y, z is the location of the block (block update/interaction/tick functions pass these as values). -
How can my entity search for a certain type of block (an easy way)
Draco18s replied to kauan99's topic in Modder Support
You could do a three dimensional loop worth of getBlockID(x,y,z). -
Take a look at the onNeighborBlockChanged functions inside the redstone blocks.
-
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?
Draco18s replied to Nyandoma's topic in Modder Support
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? -
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?
Draco18s replied to Nyandoma's topic in Modder Support
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. -
This might help. I haven't used it though.
-
Block that damage the player when in the inventory
Draco18s replied to Golitan11's topic in Modder Support
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. -
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.
-
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...)
-
*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)
-
Which is why it's taken them four years to implement dynamic deobfuscation.
-
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
Draco18s replied to sci4me's topic in Modder Support
Not really no. :\ I've barely touched rendering. I've made a cube. :V -
Flipping an ISimpleBlockRenderingHandler 180 degress (upside down)
Draco18s replied to sci4me's topic in Modder Support
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. -
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)
Draco18s replied to sci4me's topic in Modder Support
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)
Draco18s replied to sci4me's topic in Modder Support
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). -
The WorldChunkManager, if you opened it, handles things like biomes and weather.
-
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)
Draco18s replied to sci4me's topic in Modder Support
...Simpler? Simpler than swapping two variables?