
Bandayd
Members-
Posts
35 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
Having trouble getting stuff done :-(
Bandayd's Achievements

Tree Puncher (2/8)
3
Reputation
-
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
I was already using bindTextureByName... buuuut... it didn't occur to me that I could load one texture.... render it, then load another texture! :-P Thanks N1xx1! Not only do I think that will work, but now I feel kinda dumb for not thinking of that! :-P lol I'll give that a shot tonight after I get home from work, and I'll report back here how it worked :-) Thanks again!!! :-D -
You're saying that you're both "installing" forge, AND "compiling". Are you sure you're doing everything right, because if you're installing forge, all you should be doing is going to the forge folder and hit install.cmd. Doing this will actually decompile and deobfuscate minecraft. I'm assuming you meant to say you were installing and decompiling? If so, then Lexmanos is right, but if you're hitting "compile.bat" in your mcp folder, then you're not installing it properly, you should go hit install.cmd in your forge folder. :-) Good luck! :-D
-
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Thank you DarkGuardsman, that helped a ton! I did dig around a lot in both WorldRenderer.java and RenderBlocks.java, and the best thing I can come up with would be for forge to add a hook into func_78588_a (on line 3692 of RenderBlocks.java), or wherever it is that I can render a second texture to the same block. :-) Now I'm one step further, I can render a block, and I can even make two separate "models" (rectangles), however, I am only able to apply one texture to both of these rectangles. :-( I need to be able to specify two separate textures, one for the plate, and one for the "block that I'm mimicking". I'm starting to wonder if this can be done with forge I'm going to keep digging though. I will be sure and update my post if I get anywhere, but at this point, I'm stuck on separating the textures of the two different pieces. Here is a picture, just showing how I'm able to do two different rectangles. So the next step would be, I need to be able to apply TWO textures to my "blocks" (I know it's only one block, but it's rendered as two). One texture will be my plate texture, and the other texture will be the texture of the block I'm mimicking. So I'm off to search for "how to render two textures to one TileEntitySpecialRenderer, OR, how to bindTileEntitySpecialRenderer TWO renderers to ONE class" :-P If anybody has any idea on how to do this, please don't hesitate to pitch in! :-D I'm starting to think I need forge to add a new hook for binding two textures to one TileEntitySpecialRenderer? What do you guys think? Also, if it helps any, here is my "TileEntitySpecialRenderer" class that I'm using which give me the awesome picture above... :-P But as you can see, the line "this.bindTextureByName("/myMod/Textures/blockPlate.png");" is only able to apply a single texture to the current TileEntity :-( -
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Any chance you could point me to example code for something like that? Thanks for the quick response! :-D -
How about rather than all that, just use: /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ @Override public void breakBlock(World world, int x, int y, int z, int par5, int par6) { //Do stuff here :-P //then use "world.getBlockMetadata(x, y, z);" to access your metadata :-) } (you would put that into your BlockNetherOres.java) And then in there you can code it to manually drop however many you choose. (Although I'm not quite sure why you need to access the metadata to determine the drop amount? :-P) Also, here is the code from "BlockOre.java", which I believe does what you asked... /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random par1Random) { return this.blockID == Block.oreLapis.blockID ? 4 + par1Random.nextInt(5) : 1; } Don't worry about the spoiler tags not working, they're a little weird with me too, but they work after awhile :-P
-
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
I've already re-coded everything to work how I think you suggested (with the block mimicking the block it's replacing). But I'm having trouble getting the information from the TileEntity, to the actual block texture, is there any way I can set the block texture of my block besides "getBlockTextureFromSideAndMetadata"? Because I don't think I can access the TileEntity from there? Thanks again for your help with this -
install.sh thinks the server jar is modified, errors
Bandayd replied to TorchicBlaziken's topic in Modder Support
@TorchicBlaziken You didn't mention your bin folder for minecraft. You need to have a bin folder, which means you have to have a vanilla minecraft (without any mods, or forge), then I think you have to fire it up once, just to make it generate the bin folder. Is it possible that's your problem? Really, if you download mcp, forge, minecraft_server, and minecraft (client). That should work perfectly. I know it took me a few tries because I had so many modded .jars, I wound up just re-downloading everything new. :-) -
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Nope, I already store it in the tileentity, however, when I try and access the tileentity in the getBlockTextureFromSideAndMetadata function, in order to get the tileentity, I need to use world.getBlockTileEntity(x, y, z); But.... the function is defined as follows... public int getBlockTextureFromSideAndMetadata(int side, int metadata) and there's no way to get the x,y,z of the current block. :-( Unless you know of another way to render the block without using the getBlockTextureFromSideAndMetadata function? That would be GREAT if you could give me a hint? :-D -
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Actually, I've been playing around with metadata and I got it where when you place the block, it backs up the block's metadata, and then when you break the plate, it restores the block's metadata. What's nice about that is, if you put the plate on a piston, it remembers which way the piston was facing, and if you put a plate on a jack-o-lantern, it remembers what type of pumpkin, and which the jack-o-lantern was facing. So I think I understand the whole metadata thing, which is how your normally determine how to render the block, the problem is, normally metadata is just a single integer. I need to be able to pass it an int, and 4 textures, and the name of the texture file. So I think I need a tileentity to do this, but you can't pass a tileentity to the getBlockTextureFromSideAndMetadata function. Any ideas? (sorry if I'm repeating myself a little :-P) -
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Ok, I think I've gotten a lot further, but I'm still stuck, so here's how far I've gotten... When I try and place my plate, it first finds the block ID of the block that the plate is going against. Then it replaces the block with my mimicking/plate block, which also stores the block ID and anything else I could want. I actually set it up similar to a chest so it's actually holding a single stack of that block. Then when you hit it, it drops the plate, and places the original plate back (or at least one with the same block ID :-P). The problem I'm having is... in the "getBlockTextureFromSideAndMetadata" for my plate block, I need to be able to read the texture of the block I'm storing/mimicking. The problem is, the only way I know how to do that is to use "world.getBlockTileEntity(x,y,z)" and it would be smooth sailing from there, however, I can't get the x,y,z of our current block in that function. Here, I'll just post a few screenshots showing how it currently works..... Before placing the plate block After placing the plate block After hitting at the plate block Here is the code for my TileEntityPlate: Here is my tryPlaceItemIntoWorld from my ItemPlate.java: And lastly, here is the code from my PlateBlock.java that I think I need to use to control my block's texture, so I can make it mimic the blocks I need to: Now I think I'm doing what both of you guys suggested, when the item is placed, it backs up the block it's replacing inside the new block. When the new block gets destroyed, it just restores it back. My problem is.... I need to have access to my TileEntity inside my "public int getBlockTextureFromSideAndMetadata(int side, int par2)", that way, if the "side" parameter is the side my plate is on, I'll override that with my plate texture, but on the remaining sides, I'll just use the texture from my stored block, the problem is, I can't access the TiledEntity in getBlockTextureFromSideAndMetadata therefore I can't mimic the block like I need to. Is there somewhere else I can control my plate block's texture from? I thought getBlockTextureFromSideAndMetadata was the only place really? And remember, my whole problem is really the second picture I showed you (the one labeled "After placing the plate block"), because it's showing the plate texture on ALL sides, rather than displaying dirt on 5 sides, and my plate on 1 side. (I'm familiar with how to show different textures on different sides, but I need to be able to access the TileEntity information to be able to do that) Thanks in advance for all your help! :-D -
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Ok, after again, thinking about how in the world I can get around this, I've decided to settle on making a "mimic" block, that pretends to be other blocks like DarkGuardsman suggested. I'm not happy about it, but, really it's the best way I can figure to get done what I needed without modding every class of block in minecraft. I'll mark this one as solved as soon as I manage to get a proof of concept working. Thanks for all your help! :-D -
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
Ok, after thinking about this WAY too much, I think there's really only one way to do what it is that I need.... I think I need to be able to define a class at runtime, then, if I could do that, here's how I could accomplish what I need.... Step 1: When I place my plate, I don't really place my plate, instead, I get the class of the block it's being put onto a: Therefore, I can dynamically generate a new class that extends the class of the block it's being put onto, but it overrides the texture to show a plate on one side and the amount of damage it can take Step 2: When the block gets hit with a tool/fist, have it only take 1 hit to destroy this modded block, but then when it gets destroyed, I'll have it replaces itself with a non-modded version of itself, and therefore making it seem like the plate was destroyed Does that sound like it would work? If so... um, could anybody point me to an easy way to implement what I need? The basic thing I'm currently missing is... I need to be able to do this: public class BlockPlatePositive extends UnknownClass{ Where UnknownClass can be any class that I need it to be. That way, if the plate is put on a piece of dirt, it will extend the dirt and put a plate on it. Actually I just thought of something, let's assume I could do what I'm saying.... I still don't think it would work though, because if I put down one plate that looked like dirt, then I put down another plate on a piece of wool. The first plate would now be on a piece of wool.... hmmmm.... apparently I'm back to where I started... so does anybody know how I might be able to do what I need? -
What you need to do is 2 things... (I know this because I recently had the exact same problem) 1. when the block gets placed, get the orientation of the player and store that in the block's metadata to indicate which way it should face. 2. then, use that metadata to change which texture is shown on which side Sounds easy right? .... well it's not :-P My best advice to you is to look at the ItemSign.java BlockSign.java TileEntitySign.java which you can find in common\net.minecraft.src\ They show examples of how to store the rotation angle, just like signs do! :-) Although, for signs, they have an item class for when you hold it, and a block class for when it's found in the world. In your case, those will be the same things. :-P Also, do NOT forget to do the following when your mod loads.... Make SURE you register your tileentity like this.... GameRegistry.registerTileEntity(TileEntityYourBlock.class, "direction"); Here's some code that you can put into your block class so when it gets placed it can store this value: int myAng = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; (it just gets the angle from the player's angle) Although you'll want to convert it to an integer, since you want it to face N, S, W, or E Don't feel bad if it takes you a bit to sort through all this junk, it took me about a week! :-P
-
[1.3.2 UNSOLVED] Create a flat block that can go between two blocks
Bandayd replied to Bandayd's topic in Modder Support
I have already looked into the halfslabs/doubeslabs and that wont really help me, the way those work is, they store metadata to keep track of if it's single/double, etc... And so with those blocks, it's not really two blocks when you put a second one down, it just reads the metadata, makes the block bigger, and changes the texture. Sorry, no dice :-(