Signed-off-by: Minecon724 <minecon724@noreply.git.m724.eu>
This commit is contained in:
parent
2213ebe3cf
commit
e67c187f4e
3 changed files with 11 additions and 15 deletions
10
README.md
10
README.md
|
|
@ -92,7 +92,7 @@ Adds a "gateway" item that are controlled over internet. \
|
||||||
Control knockback dealt by entities
|
Control knockback dealt by entities
|
||||||
|
|
||||||
### Kill switch
|
### Kill switch
|
||||||
Quickly kills (terminates) the server on trigger, via command or HTTP request.
|
Quickly kills (terminates) the server on trigger, by command or HTTP request.
|
||||||
[KILLSWITCH.md for more info](/Minecon724/tweaks724/src/branch/master/docs/KILLSWITCH.md)
|
[KILLSWITCH.md for more info](/Minecon724/tweaks724/src/branch/master/docs/KILLSWITCH.md)
|
||||||
|
|
||||||
### Swing through grass
|
### Swing through grass
|
||||||
|
|
@ -101,12 +101,10 @@ Self-explanatory
|
||||||
### Durability alert
|
### Durability alert
|
||||||
Self-explanatory too.
|
Self-explanatory too.
|
||||||
|
|
||||||
`/durabilityalert` (`tweaks724.durabilityalert`)
|
### WordCoords
|
||||||
|
Converts coords to words and back so you easily remember them.
|
||||||
|
|
||||||
### Word coords
|
`/wordcoords` (`tweaks724.wordcoords`)
|
||||||
Convert coordinates to easier to remember words
|
|
||||||
|
|
||||||
`/wordcoords` (`tweaks724.tauth`)
|
|
||||||
|
|
||||||
### Utility commands
|
### Utility commands
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import java.util.NoSuchElementException;
|
||||||
public class WordCoordsModule extends TweaksModule implements CommandExecutor, Listener {
|
public class WordCoordsModule extends TweaksModule implements CommandExecutor, Listener {
|
||||||
private static final int MAX_RADIUS = 30_000_000;
|
private static final int MAX_RADIUS = 30_000_000;
|
||||||
|
|
||||||
|
private WordList wordList;
|
||||||
private WordCoordsCodec converter;
|
private WordCoordsCodec converter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -48,14 +49,13 @@ public class WordCoordsModule extends TweaksModule implements CommandExecutor, L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WordList wordList;
|
|
||||||
try {
|
try {
|
||||||
wordList = WordList.fromFile(wordListFile);
|
this.wordList = WordList.fromFile(wordListFile);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("Failed to load word list", e);
|
throw new RuntimeException("Failed to load word list", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.converter = new WordCoordsCodec(wordList);
|
this.converter = new WordCoordsCodec(this.wordList);
|
||||||
|
|
||||||
registerCommand("wordcoords", this);
|
registerCommand("wordcoords", this);
|
||||||
registerEvents(this);
|
registerEvents(this);
|
||||||
|
|
@ -171,11 +171,10 @@ public class WordCoordsModule extends TweaksModule implements CommandExecutor, L
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onCommand(PlayerCommandPreprocessEvent event) {
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||||
if (event.getMessage().startsWith("///")) {
|
if (!event.getMessage().startsWith("///")) return;
|
||||||
event.setCancelled(true);
|
|
||||||
|
|
||||||
event.getPlayer().performCommand("wordcoords " + event.getMessage().substring(3));
|
event.getPlayer().performCommand("wordcoords " + event.getMessage().substring(3));
|
||||||
}
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,5 @@ public class WordList {
|
||||||
|
|
||||||
return new WordList(list);
|
return new WordList(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue