mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-29 05:55:19 +01:00
Moved the removeplayerselection method
This commit is contained in:
parent
031085f3bf
commit
c69c66c76c
@ -9,8 +9,6 @@ import com.sekwah.advancedportals.core.api.services.PortalServices;
|
||||
import com.sekwah.advancedportals.core.api.services.PortalTempDataServices;
|
||||
import com.sekwah.advancedportals.core.config.RepositoryModule;
|
||||
import com.sekwah.advancedportals.core.repository.ConfigRepository;
|
||||
import com.sekwah.advancedportals.core.repository.DestinationRepositoryImpl;
|
||||
import com.sekwah.advancedportals.core.repository.PortalRepositoryImpl;
|
||||
import com.sekwah.advancedportals.core.api.portal.AdvancedPortal;
|
||||
import com.sekwah.advancedportals.core.api.registry.TagRegistry;
|
||||
import com.sekwah.advancedportals.core.api.registry.WarpEffectRegistry;
|
||||
@ -26,6 +24,7 @@ import com.sekwah.advancedportals.coreconnector.command.CommandRegister;
|
||||
public class AdvancedPortalsCore {
|
||||
|
||||
private static AdvancedPortalsCore instance;
|
||||
|
||||
private final CommandRegister commandRegister;
|
||||
private final DataStorage dataStorage;
|
||||
private final InfoLogger infoLogger;
|
||||
@ -118,6 +117,7 @@ public class AdvancedPortalsCore {
|
||||
this.dataStorage.copyDefaultFile("lang/en_GB.lang", false);
|
||||
|
||||
this.loadPortalConfig();
|
||||
|
||||
Lang.loadLanguage(configRepository.getTranslation());
|
||||
|
||||
this.registerPortalCommand();
|
||||
@ -190,16 +190,16 @@ public class AdvancedPortalsCore {
|
||||
return this.dataStorage;
|
||||
}
|
||||
|
||||
public static InfoLogger getInfoLogger() {
|
||||
return instance.infoLogger;
|
||||
public InfoLogger getInfoLogger() {
|
||||
return this.infoLogger;
|
||||
}
|
||||
|
||||
public static ConnectorDataCollector getDataCollector() {
|
||||
return instance.dataCollector;
|
||||
public ConnectorDataCollector getDataCollector() {
|
||||
return this.dataCollector;
|
||||
}
|
||||
|
||||
public static CoreListeners getCoreListeners() {
|
||||
return instance.coreListeners;
|
||||
public CoreListeners getCoreListeners() {
|
||||
return this.coreListeners;
|
||||
}
|
||||
|
||||
public static PortalServices getPortalServices() {
|
||||
@ -210,7 +210,7 @@ public class AdvancedPortalsCore {
|
||||
return instance.destiServices;
|
||||
}
|
||||
|
||||
public static PortalTempDataServices getPortalTempDataServices() {
|
||||
public PortalTempDataServices getPortalTempDataServices() {
|
||||
return instance.portalTempDataServices;
|
||||
}
|
||||
|
||||
|
@ -42,4 +42,8 @@ public final class PortalServices {
|
||||
public AdvancedPortal createPortal(String name, PlayerContainer player, ArrayList<DataTag> portalTags) throws PortalException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void removePlayerSelection(PlayerContainer player) throws PortalException {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,20 @@
|
||||
package com.sekwah.advancedportals.core.api.services;
|
||||
|
||||
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
|
||||
import com.sekwah.advancedportals.core.api.portal.PortalException;
|
||||
import com.sekwah.advancedportals.core.entities.PlayerTempData;
|
||||
import com.sekwah.advancedportals.core.entities.PortalLocation;
|
||||
import com.sekwah.advancedportals.coreconnector.container.PlayerContainer;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class PortalTempDataServices {
|
||||
|
||||
/**
|
||||
* Possibly change to the cache map Aztec was talking about
|
||||
*/
|
||||
private Map<UUID, PlayerTempData> tempDataMap = new HashMap<>();
|
||||
|
||||
public void activateCooldown(PlayerContainer player) {
|
||||
}
|
||||
@ -16,8 +25,4 @@ public final class PortalTempDataServices {
|
||||
public void playerSelectorActivate(PlayerContainer player, PortalLocation blockLoc, boolean leftClick) {
|
||||
|
||||
}
|
||||
|
||||
public void removePlayerSelection(PlayerContainer player) throws PortalException {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class RemoveSubCommand implements SubCommand {
|
||||
}
|
||||
else {
|
||||
try {
|
||||
AdvancedPortalsCore.getPortalTempDataServices().removePlayerSelection(player);
|
||||
AdvancedPortalsCore.getPortalServices().removePlayerSelection(player);
|
||||
} catch (PortalException portalTagExeption) {
|
||||
sender.sendMessage(Lang.translateColor("messageprefix.negative")
|
||||
+ Lang.translateColor("command.remove.error") + " " + Lang.translate(portalTagExeption.getMessage()));
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.sekwah.advancedportals.core.entities;
|
||||
|
||||
public class PlayerTempData {
|
||||
|
||||
private PortalLocation pos1;
|
||||
|
||||
private PortalLocation pos2;
|
||||
|
||||
private long lastAttempt;
|
||||
|
||||
private String selectedPortal;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user