Skip to content

Commit

Permalink
Update for 4.1.0 re-added GameReload Event.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantheleach committed Aug 17, 2016
1 parent fa3398f commit 6aa8b33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'au.id.rleach'
version '1.0.2-SNAPSHOT'
version '1.1.0'

apply plugin: 'java'

Expand All @@ -15,5 +15,5 @@ repositories {

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'org.spongepowered:spongeapi:4.0.0'
compile 'org.spongepowered:spongeapi:4.1.0'
}
8 changes: 8 additions & 0 deletions src/main/java/au/id/rleach/chatclear/ChatClear.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.filter.cause.Root;
import org.spongepowered.api.event.game.GameReloadEvent;
import org.spongepowered.api.event.game.state.GameInitializationEvent;
import org.spongepowered.api.event.network.ClientConnectionEvent;
import org.spongepowered.api.plugin.Plugin;
Expand Down Expand Up @@ -51,6 +52,13 @@ public void onPreInit(GameInitializationEvent event){
setup();
}

@Listener
public void onReload(final GameReloadEvent reload){
removeMapping(clearMapping);
removeMapping(globalClearMapping);
setup();
}

private void setup(){
configNode = ConfigLoader.loadConfigUnchecked("chatclear.conf", configDir, container);
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/au/id/rleach/chatclear/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public class Plugin {
static final String ID = "chatclear";
static final String NAME = "chatclear";
static final String VERSION = "1.0.2-SNAPSHOT";
static final String VERSION = "1.1.0";
static final String DESCRIPTION = "Simple command to clear the chat";
}

0 comments on commit 6aa8b33

Please sign in to comment.