Skip to content

Commit

Permalink
Rename events.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertik committed Sep 20, 2020
1 parent 45a9e1f commit 399bda3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import org.jetbrains.annotations.NotNull;
import space.devport.wertik.czechcraftquery.system.struct.response.impl.ServerInfoResponse;

public class CzechcraftServerDropEvent extends Event {
public class ServerAdvanceEvent extends Event {

@Getter
private final ServerInfoResponse response;

public CzechcraftServerDropEvent(ServerInfoResponse response) {
public ServerAdvanceEvent(ServerInfoResponse response) {
this.response = response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import org.jetbrains.annotations.NotNull;
import space.devport.wertik.czechcraftquery.system.struct.response.impl.ServerInfoResponse;

public class CzechcraftServerAdvanceEvent extends Event {
public class ServerDropEvent extends Event {

@Getter
private final ServerInfoResponse response;

public CzechcraftServerAdvanceEvent(ServerInfoResponse response) {
public ServerDropEvent(ServerInfoResponse response) {
this.response = response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import space.devport.utils.ConsoleOutput;
import space.devport.utils.struct.Rewards;
import space.devport.wertik.czechcraftquery.QueryPlugin;
import space.devport.wertik.czechcraftquery.api.events.CzechcraftServerAdvanceEvent;
import space.devport.wertik.czechcraftquery.api.events.CzechcraftServerDropEvent;
import space.devport.wertik.czechcraftquery.api.events.ServerAdvanceEvent;
import space.devport.wertik.czechcraftquery.api.events.ServerDropEvent;

public class PositionChangeListener implements Listener {

Expand All @@ -26,7 +26,7 @@ public void load() {
}

@EventHandler
public void onAdvance(CzechcraftServerAdvanceEvent event) {
public void onAdvance(ServerAdvanceEvent event) {
ConsoleOutput.getInstance().debug("Caught event: " + event.getResponse().toString());

if (!plugin.getConfig().getBoolean("advance.enabled", false)) return;
Expand All @@ -39,7 +39,7 @@ public void onAdvance(CzechcraftServerAdvanceEvent event) {
}

@EventHandler
public void onDrop(CzechcraftServerDropEvent event) {
public void onDrop(ServerDropEvent event) {
ConsoleOutput.getInstance().debug("Caught event: " + event.getResponse().toString());

if (!plugin.getConfig().getBoolean("drop.enabled", false)) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import lombok.Setter;
import org.jetbrains.annotations.NotNull;
import space.devport.wertik.czechcraftquery.QueryPlugin;
import space.devport.wertik.czechcraftquery.api.events.CzechcraftServerAdvanceEvent;
import space.devport.wertik.czechcraftquery.api.events.CzechcraftServerDropEvent;
import space.devport.wertik.czechcraftquery.api.events.ServerAdvanceEvent;
import space.devport.wertik.czechcraftquery.api.events.ServerDropEvent;
import space.devport.wertik.czechcraftquery.exception.ResponseParserException;
import space.devport.wertik.czechcraftquery.system.struct.context.ContextModifier;
import space.devport.wertik.czechcraftquery.system.struct.context.RequestContext;
Expand Down Expand Up @@ -58,9 +58,9 @@ public RequestContext strip(@NotNull RequestContext context) {
ServerInfoResponse toCacheResponse = (ServerInfoResponse) toCache;

if (cachedResponse.getPosition() > toCacheResponse.getPosition()) {
QueryPlugin.callEvent(new CzechcraftServerAdvanceEvent(toCacheResponse));
QueryPlugin.callEvent(new ServerAdvanceEvent(toCacheResponse));
} else if (cachedResponse.getPosition() < toCacheResponse.getPosition()) {
QueryPlugin.callEvent(new CzechcraftServerDropEvent(toCacheResponse));
QueryPlugin.callEvent(new ServerDropEvent(toCacheResponse));
}
}),

Expand Down

0 comments on commit 399bda3

Please sign in to comment.