mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 18:43:43 +01:00 
			
		
		
		
	Optimize even more things.
This commit is contained in:
		@@ -162,7 +162,7 @@ public class mcBlockListener implements Listener
 | 
				
			|||||||
    	//Green Terra
 | 
					    	//Green Terra
 | 
				
			||||||
   		if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && block.getTypeId() == 59 && block.getData() == (byte) 0x07)
 | 
					   		if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && block.getTypeId() == 59 && block.getData() == (byte) 0x07)
 | 
				
			||||||
   		{
 | 
					   		{
 | 
				
			||||||
   			Herbalism.greenTerraCheck(player, block);
 | 
					   			Herbalism.greenTerraCheck(player);
 | 
				
			||||||
   		}
 | 
					   		}
 | 
				
			||||||
   		
 | 
					   		
 | 
				
			||||||
   		//Wheat && Triple drops
 | 
					   		//Wheat && Triple drops
 | 
				
			||||||
@@ -224,7 +224,7 @@ public class mcBlockListener implements Listener
 | 
				
			|||||||
    	 */
 | 
					    	 */
 | 
				
			||||||
    	if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(block))
 | 
					    	if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(block))
 | 
				
			||||||
    	{
 | 
					    	{
 | 
				
			||||||
    		Herbalism.greenTerraCheck(player, block);
 | 
					    		Herbalism.greenTerraCheck(player);
 | 
				
			||||||
    	}
 | 
					    	}
 | 
				
			||||||
    	
 | 
					    	
 | 
				
			||||||
    	if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5)
 | 
					    	if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5)
 | 
				
			||||||
@@ -252,19 +252,22 @@ public class mcBlockListener implements Listener
 | 
				
			|||||||
    	/*
 | 
					    	/*
 | 
				
			||||||
    	 * ABILITY PREPARATION CHECKS
 | 
					    	 * ABILITY PREPARATION CHECKS
 | 
				
			||||||
    	 */
 | 
					    	 */
 | 
				
			||||||
   		if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
 | 
					    	if(m.abilityBlockCheck(block))
 | 
				
			||||||
    		Herbalism.greenTerraCheck(player, block);
 | 
					    	{
 | 
				
			||||||
    	if(PP.getAxePreparationMode() && block.getTypeId() == 17)
 | 
						   		if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
 | 
				
			||||||
    		WoodCutting.treeFellerCheck(player, block);
 | 
						    		Herbalism.greenTerraCheck(player);
 | 
				
			||||||
    	if(PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(block))
 | 
						    	if(PP.getAxePreparationMode() && block.getTypeId() == 17)
 | 
				
			||||||
    		Mining.superBreakerCheck(player, block);
 | 
						    		WoodCutting.treeFellerCheck(player);
 | 
				
			||||||
    	if(PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(block))
 | 
						    	if(PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(block))
 | 
				
			||||||
    		Excavation.gigaDrillBreakerActivationCheck(player, block);
 | 
						    		Mining.superBreakerCheck(player);
 | 
				
			||||||
 | 
						    	if(PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(block))
 | 
				
			||||||
 | 
						    		Excavation.gigaDrillBreakerActivationCheck(player);
 | 
				
			||||||
 | 
					    	}
 | 
				
			||||||
    	if(PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(block) || block.getTypeId() == 78))
 | 
					    	if(PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(block) || block.getTypeId() == 78))
 | 
				
			||||||
    		Unarmed.berserkActivationCheck(player);
 | 
					    		Unarmed.berserkActivationCheck(player);
 | 
				
			||||||
    	
 | 
					    	
 | 
				
			||||||
    	/*
 | 
					    	/*
 | 
				
			||||||
    	 * TREE FELLAN STUFF
 | 
					    	 * TREE FELLER STUFF
 | 
				
			||||||
    	 */
 | 
					    	 */
 | 
				
			||||||
    	if(LoadProperties.spoutEnabled && block.getTypeId() == 17 && Users.getProfile(player).getTreeFellerMode())
 | 
					    	if(LoadProperties.spoutEnabled && block.getTypeId() == 17 && Users.getProfile(player).getTreeFellerMode())
 | 
				
			||||||
    		SpoutStuff.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
 | 
					    		SpoutStuff.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
 | 
				
			||||||
@@ -273,9 +276,7 @@ public class mcBlockListener implements Listener
 | 
				
			|||||||
    	 * GREEN TERRA STUFF
 | 
					    	 * GREEN TERRA STUFF
 | 
				
			||||||
    	 */
 | 
					    	 */
 | 
				
			||||||
    	if(PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player) && PP.getGreenTerraMode())
 | 
					    	if(PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player) && PP.getGreenTerraMode())
 | 
				
			||||||
    	{
 | 
					 | 
				
			||||||
   			Herbalism.greenTerra(player, block);
 | 
					   			Herbalism.greenTerra(player, block);
 | 
				
			||||||
   		}
 | 
					 | 
				
			||||||
    	
 | 
					    	
 | 
				
			||||||
    	/*
 | 
					    	/*
 | 
				
			||||||
    	 * GIGA DRILL BREAKER CHECKS
 | 
					    	 * GIGA DRILL BREAKER CHECKS
 | 
				
			||||||
@@ -296,11 +297,11 @@ public class mcBlockListener implements Listener
 | 
				
			|||||||
    		    
 | 
					    		    
 | 
				
			||||||
    		    if(LoadProperties.toolsLoseDurabilityFromAbilities)
 | 
					    		    if(LoadProperties.toolsLoseDurabilityFromAbilities)
 | 
				
			||||||
    	        {
 | 
					    	        {
 | 
				
			||||||
    	            if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
 | 
					    	            if(!inhand.containsEnchantment(Enchantment.DURABILITY))
 | 
				
			||||||
    	            {
 | 
					    	            {
 | 
				
			||||||
    	                short durability = player.getItemInHand().getDurability();
 | 
					    	                short durability = inhand.getDurability();
 | 
				
			||||||
    	                durability += (LoadProperties.abilityDurabilityLoss);
 | 
					    	                durability += (LoadProperties.abilityDurabilityLoss);
 | 
				
			||||||
    	                player.getItemInHand().setDurability(durability);
 | 
					    	                inhand.setDurability(durability);
 | 
				
			||||||
    	            }
 | 
					    	            }
 | 
				
			||||||
    	        }
 | 
					    	        }
 | 
				
			||||||
    		    
 | 
					    		    
 | 
				
			||||||
@@ -337,15 +338,15 @@ public class mcBlockListener implements Listener
 | 
				
			|||||||
    		{
 | 
					    		{
 | 
				
			||||||
    			if(m.isMiningPick(inhand)){
 | 
					    			if(m.isMiningPick(inhand)){
 | 
				
			||||||
    			    
 | 
					    			    
 | 
				
			||||||
    			    if(LoadProperties.toolsLoseDurabilityFromAbilities)
 | 
					    				if(LoadProperties.toolsLoseDurabilityFromAbilities)
 | 
				
			||||||
    		        {
 | 
					        	        {
 | 
				
			||||||
    		            if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
 | 
					        	            if(!inhand.containsEnchantment(Enchantment.DURABILITY))
 | 
				
			||||||
    		            {
 | 
					        	            {
 | 
				
			||||||
    		                short durability = player.getItemInHand().getDurability();
 | 
					        	                short durability = inhand.getDurability();
 | 
				
			||||||
    		                durability += (LoadProperties.abilityDurabilityLoss);
 | 
					        	                durability += (LoadProperties.abilityDurabilityLoss);
 | 
				
			||||||
    		                player.getItemInHand().setDurability(durability);
 | 
					        	                inhand.setDurability(durability);
 | 
				
			||||||
    		            }
 | 
					        	            }
 | 
				
			||||||
    		        }
 | 
					        	        }
 | 
				
			||||||
    			    
 | 
					    			    
 | 
				
			||||||
    				event.setInstaBreak(true);
 | 
					    				event.setInstaBreak(true);
 | 
				
			||||||
    				Mining.SuperBreakerBlockCheck(player, block, plugin);
 | 
					    				Mining.SuperBreakerBlockCheck(player, block, plugin);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -41,20 +41,14 @@ import org.getspout.spoutapi.sound.SoundEffect;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class Excavation
 | 
					public class Excavation
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	public static void gigaDrillBreakerActivationCheck(Player player, Block block)
 | 
						public static void gigaDrillBreakerActivationCheck(Player player)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		PlayerProfile PP = Users.getProfile(player);
 | 
							PlayerProfile PP = Users.getProfile(player);
 | 
				
			||||||
		if(m.isShovel(player.getItemInHand()))
 | 
							if(m.isShovel(player.getItemInHand()))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
	    	if(block != null)
 | 
					 | 
				
			||||||
	    	{
 | 
					 | 
				
			||||||
		    	if(!m.abilityBlockCheck(block))
 | 
					 | 
				
			||||||
		    		return;
 | 
					 | 
				
			||||||
	    	}
 | 
					 | 
				
			||||||
	    	if(PP.getShovelPreparationMode())
 | 
						    	if(PP.getShovelPreparationMode())
 | 
				
			||||||
	    	{
 | 
					 | 
				
			||||||
    			PP.setShovelPreparationMode(false);
 | 
					    			PP.setShovelPreparationMode(false);
 | 
				
			||||||
    		}
 | 
						    	
 | 
				
			||||||
	    	int ticks = 2;
 | 
						    	int ticks = 2;
 | 
				
			||||||
	    	int x = PP.getSkillLevel(SkillType.EXCAVATION);
 | 
						    	int x = PP.getSkillLevel(SkillType.EXCAVATION);
 | 
				
			||||||
    		while(x >= 50)
 | 
					    		while(x >= 50)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,20 +37,13 @@ import com.gmail.nossr50.locale.mcLocale;
 | 
				
			|||||||
public class Herbalism 
 | 
					public class Herbalism 
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public static void greenTerraCheck(Player player, Block block)
 | 
						public static void greenTerraCheck(Player player)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		PlayerProfile PP = Users.getProfile(player);
 | 
							PlayerProfile PP = Users.getProfile(player);
 | 
				
			||||||
	    if(m.isHoe(player.getItemInHand()))
 | 
						    if(m.isHoe(player.getItemInHand()))
 | 
				
			||||||
	    {
 | 
						    {
 | 
				
			||||||
	    	if(block != null)
 | 
					 | 
				
			||||||
	    	{
 | 
					 | 
				
			||||||
		    	if(!m.abilityBlockCheck(block))
 | 
					 | 
				
			||||||
		    		return;
 | 
					 | 
				
			||||||
	    	}
 | 
					 | 
				
			||||||
	    	if(PP.getHoePreparationMode())
 | 
						    	if(PP.getHoePreparationMode())
 | 
				
			||||||
	    	{
 | 
					 | 
				
			||||||
				PP.setHoePreparationMode(false);
 | 
									PP.setHoePreparationMode(false);
 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
	    	int ticks = 2;
 | 
						    	int ticks = 2;
 | 
				
			||||||
	    	int x = PP.getSkillLevel(SkillType.HERBALISM);
 | 
						    	int x = PP.getSkillLevel(SkillType.HERBALISM);
 | 
				
			||||||
			while(x >= 50)
 | 
								while(x >= 50)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,20 +39,13 @@ import com.gmail.nossr50.locale.mcLocale;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class Mining 
 | 
					public class Mining 
 | 
				
			||||||
{	
 | 
					{	
 | 
				
			||||||
	public static void superBreakerCheck(Player player, Block block)
 | 
						public static void superBreakerCheck(Player player)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		PlayerProfile PP = Users.getProfile(player);
 | 
							PlayerProfile PP = Users.getProfile(player);
 | 
				
			||||||
	    if(m.isMiningPick(player.getItemInHand()))
 | 
						    if(m.isMiningPick(player.getItemInHand()))
 | 
				
			||||||
	    {
 | 
						    {
 | 
				
			||||||
	    	if(block != null)
 | 
					 | 
				
			||||||
	    	{
 | 
					 | 
				
			||||||
		    	if(!m.abilityBlockCheck(block))
 | 
					 | 
				
			||||||
		    		return;
 | 
					 | 
				
			||||||
	    	}
 | 
					 | 
				
			||||||
	    	if(PP.getPickaxePreparationMode())
 | 
						    	if(PP.getPickaxePreparationMode())
 | 
				
			||||||
	    	{
 | 
					 | 
				
			||||||
    			PP.setPickaxePreparationMode(false);
 | 
					    			PP.setPickaxePreparationMode(false);
 | 
				
			||||||
    		}
 | 
					 | 
				
			||||||
	    	
 | 
						    	
 | 
				
			||||||
	    	int ticks = 2;
 | 
						    	int ticks = 2;
 | 
				
			||||||
	    	int x = PP.getSkillLevel(SkillType.MINING);
 | 
						    	int x = PP.getSkillLevel(SkillType.MINING);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -194,23 +194,16 @@ public class WoodCutting
 | 
				
			|||||||
    	}
 | 
					    	}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public static void treeFellerCheck(Player player, Block block)
 | 
					    public static void treeFellerCheck(Player player)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
    	PlayerProfile PP = Users.getProfile(player);
 | 
					    	PlayerProfile PP = Users.getProfile(player);
 | 
				
			||||||
    	if(m.isAxes(player.getItemInHand()))
 | 
					    	if(m.isAxes(player.getItemInHand()))
 | 
				
			||||||
    	{
 | 
					    	{
 | 
				
			||||||
    		if(block != null)
 | 
					 | 
				
			||||||
    		{
 | 
					 | 
				
			||||||
        		if(!m.abilityBlockCheck(block))
 | 
					 | 
				
			||||||
        			return;
 | 
					 | 
				
			||||||
        	}
 | 
					 | 
				
			||||||
    		/*
 | 
					    		/*
 | 
				
			||||||
    		 * CHECK FOR AXE PREP MODE
 | 
					    		 * CHECK FOR AXE PREP MODE
 | 
				
			||||||
    		 */
 | 
					    		 */
 | 
				
			||||||
    		if(PP.getAxePreparationMode())
 | 
					    		if(PP.getAxePreparationMode())
 | 
				
			||||||
    		{
 | 
					 | 
				
			||||||
    			PP.setAxePreparationMode(false);
 | 
					    			PP.setAxePreparationMode(false);
 | 
				
			||||||
    		}
 | 
					 | 
				
			||||||
    		
 | 
					    		
 | 
				
			||||||
    		int ticks = 2;
 | 
					    		int ticks = 2;
 | 
				
			||||||
    		int x = PP.getSkillLevel(SkillType.WOODCUTTING);
 | 
					    		int x = PP.getSkillLevel(SkillType.WOODCUTTING);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user