Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. ...in place of your current loop..?
  2. You have < 2 right now. Which means it will do 0 and 1, but not 2. Also, it's not centered on your pit trap. for(i=-1;i<=1;i++) { for(j=-1;j<=1;j++) { for(k=0;k<=3;k++ {
  3. You'll never believe what fixed it. world.setBlockMetadataWithNotify((int)c.xCoord, (int)c.yCoord-1, (int)c.zCoord, 1, 3); Had to forcibly set the metadata after creating the block. Because dispensers do this: public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); this.setDispenserDefaultDirection(par1World, par2, par3, par4); } Even the vanilla dispenser has this "problem."
  4. My bad. Ever since they changed things from "setBlock/setBlockWithNotify/setBlockAndMetadata/setBlockAndMetadataWithNotify" to only one function (actually, two) they've thrown me for a loop. You are correct, yours works and passes an implied metadata of 0 and a notify flag of 3. Just out of curiosity: You are doing this with the block on top of stone, yes? It's only clearing a 2x2x2 cube at the moment, and only stone. (Side note: new PitfallHandler(Minecraft.getMinecraft().theWorld, i, j, k); You can just use: new PitfallHandler(world, i, j, k); As the world is passed to the neighborChanged function)
  5. Ah. Try using more than one AABB instead. One for the front of the tractor, one for the middle, one for the back.
  6. I'm surprised this didn't throw an error. You don't have enough parameters. world.setBlock( i + x, // this makes blocks of air go out however many numOfBlocksOnXAxis was j - y, // this makes blocks of air go out however many numOfBlocksOnYAxis was k + z, // this makes blocks of air go out however many numOfBlocksOnZAxis was 00, // the block of air 3 //tells the client and server that a block update is required. );
  7. Frakking hell. Thanks for spotting that. >..x The -1 should actually be on another line entirely. public Icon getIcon(int par1, int par2) { if(par2 <= 1) return verticalFront; return blockIcon; } All it does it determine which overlay to use. The four horizontal facings have one icon (four "holes") the vertical one has another (two "holes"). The renderer is a tad bit more complex. But feel free.
  8. The wut? As for ents: As long as you're modifying the AI behavior of an existing entity, it's not too bad.
  9. world.getBlockTileEntity(x,y,z) returns null: world.setBlock((int)c.xCoord, (int)c.yCoord-1, (int)c.zCoord, TrapsBase.arrowSlot.blockID, 1, 3); TileEntityDispenser dis = (TileEntityDispenser)world.getBlockTileEntity((int)c.xCoord, (int)c.yCoord, (int)c.zCoord); if(dis != null) { addTrapItem(dis); } else { System.out.print("Boo."); //this runs } Yes, that's the right TE. public TileEntity createNewTileEntity(World par1World) { return new TileEntityDispenser(); } getIcon won't help you. I'm using a custom renderer and yes I checked that it wasn't just rendering wrong. It was still shooting arrows in the incorrect direction.
  10. And now....I need a tutorial on DataWatchers, which don't exist. Last time I tried adding one it didn't work* (rather than going "Hey wolves, you are what I need, duplicate. Also delete this garbage about taming and collar color. Ooh, free data watcher!" (hell, even that didn't work 100% right**)). *I was using it to change texture offsets for a TE. Renderer would register the change in the variable, but the setTextureOffsets...didn't. **I had three textures for the mob. Effectively passive, hostile, and "stone skin" (hostile, but under a potion effect). It would do the passive <--> hostile switch, but it would NEVER, and I mean NEVER, use the stone skin. I had wanted the mob to have Resistance 1 up all the time, and then below 50% health gain Resistance 3 (and change skins). Because the skin never changed I had to remove the Resistance 1 all the time effect, so the distinguishing factor was "oh hey, now it has a potion effect."
  11. I would like it to be rendered the same way as all other 3D items, with the "pixel thickness." That code already exists somewhere.
  12. I know about ChestGenHooks, but I don't want to add items to chests. I want to add them to dispensers (actually a custom block, but it uses the Dispenser's TE). If ChestGenHooks can do this, I haven't figured out how. Additionally, I can't seem to get the block to be oriented the way I want...it's weird: world.setBlock(x, y, z, TrapsBase.TrapBlock.blockID, 1, 3); //metadata 1 means it should point up Doing that in worldgen doesn't make it point up, it points south...which is metadata 3...and it doesn't matter what direction I tell it to face, it always faces south.
  13. Even so I still cannot render the god damn sword. Bigger issue than getting it to render WHEN I want it to.
  14. new ItemStack(Item.potion, 1, 8204); //potion of harm http://www.minecraftwiki.net/wiki/Potion#Data_value_table Note: Some potions in creative have different damage values than listed. Potion of harm gotten from the creative menu is 8268. They are functionally identical due to unused bitflags. https://mojang.atlassian.net/browse/MC-1705
  15. I deleted it and went back to using the vanilla dispenser as my TE (because without that one variable that's what I have and explored a different direction). All I did was copy that class an add: public renderFrame = 0, an onupdate function that decremented it if it was > 0 and in my "DispenserBehaviorSword" class I got a reference to the TE, cast it to a TileEntityTrap, and told the result to have renderFrame = 10.
  16. Are you passing them to generatePitfall()? Or are you pretending that they get magically set every time you want to use them? That is: Dynamic class-level variables aren't going to fix it alone.
  17. I had a public property in my tile entity (an integer, actually, which I'd set to 10 when the block was activated, then decrement in the TE's update function). When the renderer polled this variable it was always 0.
  18. Just as an FYI on Mew's code. Don't make x y and z static...or hell, even the world (there's a different world object for each dimension!) As soon as you have two of these suckers placed things will Go Weird.
  19. Yup. And now you know how to find stuff on your own. There is already a whole host of documentation inside the existing class files, use it.
  20. Please open up Item.java inside net.minecraft.items and search for "click." I'm sure you'll find the function your looking for.
  21. Alright, so my problem is that I've created a custom dispenser to act as a fairly generic "trap block" that uses items in slightly different ways than the vanilla dispenser. Essentially it doesn't pop out items that it doesn't know what they are (default behavior is do nothing). It does not empty/fill buckets, drop boats/minecarts, arrows fire twice, etc. One of the behaviors is that swords are used to attack the block directly in front of the dispenser--essentially becoming the spinning blade trap that we see in Indian Jones and the Last Crusade (the "kneel before God" trap). While I've got the attack working properly I'd like to actually render this. I'm coming up against two problems: 1) figuring out when it should render (even using a custom TE I can't get it to properly say "hey, the sword needs to render now...and stop"--the variable kept coming back false all the time) 2) how to render the damn thing. On (2) I was able to mess around with using a custom renderer using code stolen from ItemRenderer but it rendered the sword in a funny spot attached to the main camera, rather than being in-world (and also crashed the game when exiting). On (1) I'm just baffled. My solution that I used above (that crashed, but did render *something*) was to create a custom entity (like EntityArrow, but not a projectile) that was created when the dispenser action fired off.
  22. Mouseover that underline and it'll tell you what the problem is.
  23. It means that you've already installed it.
  24. Well. There went any remaining empathy I had for you. You do have the right to protect your code, but some problems are unsolvable without being able to actually look at what's going on. And for the record, we never once asked for your source code, we asked for your release zip.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.