-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add WorldDataManager to enable /warp functionality. - Add appropriate /warp toggle in Config. - Add ManagerLocator.init (to call appropriate function on contained managers on ServerStart. - Simplify various classes and avoid certain anti-patterns (PlayerData previously had required a reference to PlayerDataManager, for example) - Remove commented out code in various places.
- Loading branch information
1 parent
9006df3
commit 73dfadb
Showing
13 changed files
with
381 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 19 additions & 7 deletions
26
src/main/java/com/fibermc/essentialcommands/ManagerLocator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
package com.fibermc.essentialcommands; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
|
||
public class ManagerLocator { | ||
|
||
private PlayerDataManager dataManager; | ||
private TeleportRequestManager tpManager; | ||
private final PlayerDataManager playerDataManager; | ||
private final TeleportRequestManager tpManager; | ||
private final WorldDataManager worldDataManager; | ||
|
||
public ManagerLocator() { | ||
this.playerDataManager = new PlayerDataManager(); | ||
this.tpManager = new TeleportRequestManager(this.playerDataManager); | ||
this.worldDataManager = new WorldDataManager(); | ||
} | ||
|
||
public ManagerLocator(PlayerDataManager dataManager, TeleportRequestManager tpManager) { | ||
this.dataManager = dataManager; | ||
this.tpManager = tpManager; | ||
public void init(MinecraftServer server) { | ||
this.worldDataManager.init(server); | ||
} | ||
|
||
public PlayerDataManager getDataManager() { | ||
return dataManager; | ||
public PlayerDataManager getPlayerDataManager() { | ||
return playerDataManager; | ||
} | ||
|
||
public TeleportRequestManager getTpManager() { | ||
return tpManager; | ||
} | ||
|
||
public WorldDataManager getWorldDataManager() { | ||
return worldDataManager; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.