mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Check if brewing stand still exists before processing AlchemyBrewTask
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
				
			|||||||
package com.gmail.nossr50.runnables.skills;
 | 
					package com.gmail.nossr50.runnables.skills;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.Bukkit;
 | 
					import org.bukkit.Bukkit;
 | 
				
			||||||
 | 
					import org.bukkit.Material;
 | 
				
			||||||
import org.bukkit.block.Block;
 | 
					import org.bukkit.block.Block;
 | 
				
			||||||
import org.bukkit.block.BrewingStand;
 | 
					import org.bukkit.block.BrewingStand;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
@@ -57,6 +58,16 @@ public class AlchemyBrewTask extends BukkitRunnable {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void run() {
 | 
					    public void run() {
 | 
				
			||||||
 | 
					        if (brewingStand.getType() != Material.BREWING_STAND) {
 | 
				
			||||||
 | 
					            if (Alchemy.brewingStandMap.containsKey(brewingStand)) {
 | 
				
			||||||
 | 
					                Alchemy.brewingStandMap.remove(brewingStand);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.cancel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        brewTimer -= brewSpeed;
 | 
					        brewTimer -= brewSpeed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Vanilla potion brewing completes when BrewingTime == 1
 | 
					        // Vanilla potion brewing completes when BrewingTime == 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user