Add isBottomInventoryAllowed to ChestGui.
This commit is contained in:
		
							parent
							
								
									1281173689
								
							
						
					
					
						commit
						77da60510e
					
				@ -151,6 +151,14 @@ public class ChestGui
 | 
			
		||||
	public boolean isAutoremoving() { return this.autoremoving; }
 | 
			
		||||
	public void setAutoremoving(boolean autoremoving) { this.autoremoving = autoremoving; }
 | 
			
		||||
	
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// ALLOWBOTTOMINVENTORY
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	
 | 
			
		||||
	private boolean allowBottomInventory = false;
 | 
			
		||||
	public boolean isBottomInventoryAllowed() { return this.allowBottomInventory; }
 | 
			
		||||
	public void setBottomInventoryAllow(boolean allowBottomInventory) { this.allowBottomInventory = allowBottomInventory; }
 | 
			
		||||
	
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
	// CONSTRUCT
 | 
			
		||||
	// -------------------------------------------- //
 | 
			
		||||
 | 
			
		||||
@ -48,8 +48,18 @@ public class EngineMassiveCoreChestGui extends Engine
 | 
			
		||||
		
 | 
			
		||||
		// ... warn on bottom inventory ...
 | 
			
		||||
		if (InventoryUtil.isBottomInventory(event))
 | 
			
		||||
		{
 | 
			
		||||
			// ... only if its not allowed.
 | 
			
		||||
			if (gui.isBottomInventoryAllowed())
 | 
			
		||||
			{
 | 
			
		||||
				event.setCancelled(false);
 | 
			
		||||
				event.setResult(Result.DEFAULT);
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				MixinMessage.get().msgOne(event.getWhoClicked(), "<b>Exit the GUI to edit your items.");
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user