Jump to content

Boolean


Moritz

Recommended Posts

Hello.

 

Here is the code.

 

 

 

 

package spmod.tools.src.core;

 

import java.util.HashSet;

 

import org.lwjgl.input.Mouse;

import org.lwjgl.input.Controllers;

import net.minecraft.client.Minecraft;

 

import net.minecraft.src.*;

 

public class SpmodMouseReader

{

public static boolean isMining = false;

 

private void clickMouse(int par1, Material par2)

{

if(par1 == 0)

{

if(par2 != null)

{

isMining = true;

}

}

}

 

 

 

 

 

and here is the tool:

 

 

 

 

package spmod.tools.src.items.basic;

 

import net.minecraft.src.*;

import net.minecraft.src.forge.*;

import spmod.tools.src.core.SpmodMouseReader;

 

public class ItemTestPickaxe extends Item implements ITextureProvider

{

 

public static boolean isMining = false;

private int damageTool = 0;

private int minMining = 0;

 

public ItemTestPickaxe(int id)

{

super(id);

setMaxDamage(10);

}

 

@Override

public String getTextureFile()

{

return "/gui/items.png";

}

 

public int getIconIndex()

{

return 200;

}

 

public String getItemDisplayName(ItemStack par1)

{

return "Lol";

}

 

public void onUpdate(ItemStack par1, World par2World, Entity par3, int par4, boolean par5)

{

EntityPlayer par6 = null;

if(isMining == true)

{

damageTool = damageTool + 1;

minMining = minMining + 1;

}

 

if(isMining == false && minMining > 0 && minMining < 3)

{

par1.damageItem(1, par6);

minMining = 0;

}

 

if(isMining == false && minMining >= 3)

{

minMining = 0;

}

 

if(isMining == true && damageTool >= 8)

{

par1.damageItem(1, par6);

damageTool = 0;

}

}

}

 

 

 

 

how can i make it that the boolean will be on both sides true if its mining.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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