mirror of
				https://github.com/CodeMC/WorldGuardWrapper.git
				synced 2025-10-30 23:02:36 +01:00 
			
		
		
		
	Actually make API class a singleton
(Don't know what I even thought earlier)
This commit is contained in:
		
							parent
							
								
									35e1d50c25
								
							
						
					
					
						commit
						7e0ba6d8e7
					
				|  | @ -6,6 +6,15 @@ import lombok.experimental.Delegate; | |||
| 
 | ||||
| public class WorldGuardWrapper implements IWorldGuardImplementation { | ||||
| 
 | ||||
|     private static WorldGuardWrapper instance; | ||||
| 
 | ||||
|     public static WorldGuardWrapper getInstance() { | ||||
|         if (instance == null) { | ||||
|             instance = new WorldGuardWrapper(); | ||||
|         } | ||||
|         return instance; | ||||
|     } | ||||
| 
 | ||||
|     @Delegate | ||||
|     private IWorldGuardImplementation delegate; | ||||
| 
 | ||||
|  | @ -18,9 +27,5 @@ public class WorldGuardWrapper implements IWorldGuardImplementation { | |||
|             delegate = new org.codemc.worldguardwrapper.implementation.v6.WorldGuardImplementation(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public WorldGuardWrapper getInstance() { | ||||
|         return this; | ||||
|     } | ||||
|      | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user