mirror of
				https://github.com/simon987/Much-Assembly-Required.git
				synced 2025-10-31 16:26:51 +00:00 
			
		
		
		
	New players are now scattered around the spawn point
This commit is contained in:
		
							parent
							
								
									4e76d57ef9
								
							
						
					
					
						commit
						1a0291d517
					
				| @ -9,6 +9,7 @@ import net.simon987.server.logging.LogManager; | |||||||
| import net.simon987.server.user.User; | import net.simon987.server.user.User; | ||||||
| 
 | 
 | ||||||
| import java.awt.*; | import java.awt.*; | ||||||
|  | import java.util.Random; | ||||||
| 
 | 
 | ||||||
| public class UserCreationListener implements GameEventListener { | public class UserCreationListener implements GameEventListener { | ||||||
|     @Override |     @Override | ||||||
| @ -25,9 +26,11 @@ public class UserCreationListener implements GameEventListener { | |||||||
| 
 | 
 | ||||||
|         Cubot cubot = new Cubot(); |         Cubot cubot = new Cubot(); | ||||||
| 
 | 
 | ||||||
|         cubot.setWorld(GameServer.INSTANCE.getGameUniverse().getWorld( |         Random random = new Random(); | ||||||
|                 GameServer.INSTANCE.getConfig().getInt("new_user_worldX"), |         int spawnX = GameServer.INSTANCE.getConfig().getInt("new_user_worldX") + random.nextInt(5); | ||||||
|                 GameServer.INSTANCE.getConfig().getInt("new_user_worldY"), true)); |         int spawnY = GameServer.INSTANCE.getConfig().getInt("new_user_worldY") + random.nextInt(5); | ||||||
|  | 
 | ||||||
|  |         cubot.setWorld(GameServer.INSTANCE.getGameUniverse().getWorld(spawnX, spawnY, true)); | ||||||
|         cubot.getWorld().getGameObjects().add(cubot); |         cubot.getWorld().getGameObjects().add(cubot); | ||||||
|         cubot.getWorld().incUpdatable(); |         cubot.getWorld().incUpdatable(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user