Jump to content

Naiten

Members
  • Posts

    325
  • Joined

  • Last visited

Everything posted by Naiten

  1. So, anyone? --- This is just weird. If i put the loco on rails, it twithes, if i put it on the ground, it runs well. But if i put it on the ground and then it runs on the rails it also runs well o_O
  2. I bet no, because on flat grass it runs well. However on my rails (0.375 m high) and on half-blocks everything is not so good...
  3. Sure? My block extends BlockContainer that in it's turn extends Block that has next code: And min/max x/y/z are set in setBlockBounds: public final void setBlockBounds(float par1, float par2, float par3, float par4, float par5, float par6) { this.minX = (double)par1; this.minY = (double)par2; this.minZ = (double)par3; this.maxX = (double)par4; this.maxY = (double)par5; this.maxZ = (double)par6; } --- And please, use spoiler for code like that for it not to fuck the whole topic up...
  4. Hello. I've fixed problems with my entities being jumping, but now i have antoher problem. Whenever i try to move the wagon, it runs some distance and then teleports to the place i've spawned it at. Any help?
  5. Well, i've used setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); to set my collision box, and, as 0.375 < 0.5 i expected to walk upon those blocks, but i can't. Why?
  6. Huh. Maybe my Rails of War are copying Railcraft or Traincraft ideas? What do you mean by idea? You made a film and digital cameras, i made a plate one, what's wrong with that?
  7. You haven't said it was example, you wrote that and said "use it"...
  8. My phographic implementation is still different, and if there's one way to move camera, so and so it will be same. However, i understand his position, i hust want to say i'm not copying his mod.
  9. Alternative != copy.
  10. Hmmm... That code actually worked for me when in classic mode, but not in creative... Don't know then. Sorry.
  11. Copy? I actually made a model by myself and write the code only with some help from Draco18s, he can prove that. I'm not copying your mod, i'm creating alternative. -- And yea, if i was copying your mod, i would just decompile it with JAD, look into code and not ask silly questions here.
  12. Use par3EntityPlayer.inventoryContainer.detectAndSendChanges(); after you decrease your itemstack. May help.
  13. Well, no my photo-mod is almost finished. The only thing i need i to set camera (viewport) position before i take a photo. Any ideas on how to make that?
  14. Thanks. And, i actually should not. ItemStack has a constructor without quantity that automatically sets it to 1.
  15. @Override public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffSet){ if (!world.isRemote && item.getItemDamage() == 0){ if(world.getBlockId(x, y, z) == ObscuraCraft.camera.blockID){ if(world.getBlockMetadata(x, y, z) == 4){ y--; } int meta = world.getBlockMetadata(x, y, z); world.setBlockMetadataWithNotify(x, y, z, 4, 0x02); world.setBlockMetadataWithNotify(x, y, z, meta, 0x02); TileEntityObscura tl = (TileEntityObscura)world.getBlockTileEntity(x, y, z); tl.filled = true; BlockObscura.takePhoto(player); if (!player.capabilities.isCreativeMode){--item.stackSize;} player.inventory.addItemStackToInventory(new ItemStack(ObscuraCraft.icamera)); return true; } } return false; }
  16. There's public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffSet) And i can't use onItemRightClick, because i need clicked block coordinates.
  17. In onItemUse().
  18. Now i need to update inventory, as my item appear them only after s/l -____-
  19. public class BlockObscura extends BlockContainer{ blablabla; //called from other place public static void takePhoto(){ blablabla; Minecraft mineCraft = Minecraft.getMinecraft(); mineCraft.thePlayer.inventory.addItemStackToInventory(new ItemStack(ObscuraCraft.icamera)); //mineCraft.thePlayer.inventory.setCurrentItem(ObscuraCraft.icamera.itemID, 0, false, true); blablabla; } }
  20. I've just tried that, no result.
  21. I want my block to give item to player.
  22. Oh, i got it. It's in mineCraft.thePlayer.inventory.setCurrentItem(ObscuraCraft.icamera.itemID, 0, false, true); How do i do that in right way?
  23. Also, items are getting lost if i right-click a block with it in my hand...
  24. I think, what you gonna do is override onItemUse in your MagicHoe class: @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10){ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)){ return false; }else{ UseHoeEvent event = new UseHoeEvent(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6); if (MinecraftForge.EVENT_BUS.post(event)){ return false; } if (event.getResult() == Result.ALLOW){ par1ItemStack.damageItem(1, par2EntityPlayer); return true; } for(int i = -1; i < 2; i++){ for(int j = -1; j < 2; j++){ int i1 = par3World.getBlockId(par4+j, par5, par6+i); int j1 = par3World.getBlockId(par4+j, par5 + 1, par6+i); if (!((par7 == 0 || j1 != 0 || i1 != Block.grass.blockID) && i1 != Block.dirt.blockID)){ Block block = Block.tilledField; par3World.playSoundEffect((double)((float)par4 + j + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + j + 0.5F), block.stepSound.getStepSound(), block.stepSound.getVolume() + 1.0F) /2.0F, block.stepSound.getPitch() * 0.8F); if (!par3World.isRemote){ par3World.setBlock(par4 + j, par5, par6 + i, Block.tilledField.blockID); } } } } par1ItemStack.damageItem(1, par2EntityPlayer); return true; } } kaikaii99, your code is extremely bulky and unoptimized... And why should he create a new class and extend his MagicHoe with it, when he can just add that one method (sic!) that does the work, to his own class?
  25. I've made several items in this mod and they don't get lost. Also, as i remember, no spetial registration is needed so far...
×
×
  • Create New...

Important Information

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