Jump to content

FLUFFY2

Forge Modder
  • Posts

    424
  • Joined

  • Last visited

Everything posted by FLUFFY2

  1. Okey so my problem: I have a method where a light gets emitted where the player stands.(Dynamic light) In Default world its sometimes under the player sometimes slipped to X+1 or -1 ore the same on Y. In Flat world its never place the lght under the player. Yes its random. Sometimes work sometimes not. Its not flickering bettween positions its just like a ghost player. In my previous comment i failed to use spoiler so my 2 code again: TickHander: PacketHandlerClient:
  2. Okey here is what related to my light system: TickHandler:
  3. Yes but the only problem is that world.whatever requires int instead of floats and doubles.
  4. Okey okey. private double lastPlayerX = 0; private double lastPlayerY = 0; private double lastPlayerZ = 0; (X2, Y2, Z2 stay int because its for something else) Where i use them i add a casting to(int) because i cant use double for some methods in my packethandler. And its still not work.
  5. I tryed that but no luck. My new code:
  6. I have a dynamic light mod its works well but when i get the player coords its not under the player. Thanks for helping me! My code:
  7. I have a problem whit getting the player position. Sometimes its slipped away with -1 or +1 its tottally random. Mostly in superflat worlds. I make the following:
  8. Thank you for that! I never used that so its learning time.
  9. I have an item that takes damage when held. The only problem it bounces up and down and that dosen't look so cool. [spoiler=My item code:] package fluffy.lantern.items; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemReed; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fluffy.lantern.Lantern; import fluffy.lantern.handler.TickHandler; public class ItemCandleLanternon extends ItemReed{ public ItemCandleLanternon(int id) { super(id, Lantern.lanternOn); this.canRepair = false; this.setMaxDamage(Lantern.lanternFuelCapacity); } public int getItemStackLimit() { return 1; } public boolean isItemTool(ItemStack ist) { return false; } public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { if (!par2World.isRemote) { int damage = par1ItemStack.getItemDamage(); EntityPlayer player = (EntityPlayer)par3Entity; if (!player.capabilities.isCreativeMode && (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().itemID == par1ItemStack.itemID)){ if (damage >= this.getMaxDamage()) { this.killItemLantern(par2World, player, par1ItemStack); return; }else{ par1ItemStack.setItemDamage(damage + 1); } } } super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5); } private void killItemLantern(World world, EntityPlayer p, ItemStack ist) { world.playSoundAtEntity(p, "fluffy:Lanternoff", 0.7F, 1F); ist.setItemDamage(this.getMaxDamage()); ist.itemID = Lantern.lanternoffItem.itemID; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister icon) { this.itemIcon = icon.registerIcon("Fluffy:Lanternon"); } }
  10. So i got an item that is takeing damage when holding. Its workingn but due the item data changes it goes up and down like when you change an item to another. Its a 3D Item that place a block(ItemReed) I try super.onUpdate(itemstack, world, entity, slot, isHeld); but no luck. Thaks for helping me.
  11. I'm a modder and made a lantern mod. The only problem is when i use get the current player position its work in client, but on server slipped +1 on the X coordinate. Yes i uses the latest forge for 1.6.4(.965)! Its might be a forge bug and i hope it will be fixed.
×
×
  • Create New...

Important Information

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