Skip to content

Commit ae4957a

Browse files
authored
Merge pull request #3 from duccss/TestBranch
2.0
2 parents aee282a + a35f9ff commit ae4957a

11 files changed

Lines changed: 1458 additions & 217 deletions

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,58 @@
11
## PearlPlus
22

3-
PearlPlus lets you allow players at your base to load pearls through chat whispers without granting any other permissions. You can configure which pearls players can load using commands through discord or console. The config is saved to `plugins/config/pearl-plus.json`
3+
PearlPlus automatically detects new stasis pearls and registers them with zeniths built in pearl loader. Pearl throwers are then allowed to load these pearls through chat whispers.
4+
The config is saved to `plugins/config/pearlplus.json`
45

56
Download the [lastest build](https://github.com/duccss/PearlPlus/releases/latest) and place the jar file in your proxys plugin folder.
67

78
### Management Commands
89

9-
#### You can use either `pp` or `pearl+`
10+
#### You can use either `pp` or `pearlplus`
1011

1112
```bash
12-
pearl+ <on/off>
13+
pearlplus <on/off>
1314
```
1415
```bash
15-
pearl+ allow <playerName> <pearlName>
16+
pearlplus allow/deny playerName pearlID
1617
```
1718
```bash
18-
pearl+ deny <playerName> <pearlName>
19+
pearlplus list
1920
```
2021
```bash
21-
pearl+ list
22+
pearlplus strict on/off
2223
```
2324
```bash
24-
pearl+ strict <on/off>
25+
pearlplus autodetect on/off
26+
```
27+
```bash
28+
pearlplus autodetect temp on/off
2529
```
2630

2731
### Usage
2832

29-
Setup regular pearlloader positions using the built in zenithproxy module. E.g `pearlLoader add <id> <x> <y> <z>`. Add a player to pearl+'s config using `pearl+ allow <username> <id>`. That player can now whisper `load` to the zenith bot and the bot will load the pearl. Players with multiple pearls can add the ID after `load` to have a specific pearl loaded.
33+
Simply throw a new ender pearl and once it becomes stable the bot will register a pearl loader entry with zenith, setting the pearlID as the throwers name with an incrementing number. That player can now whisper `load` to the zenith bot and the bot will load the pearl. Players with multiple pearls can add the pearlID after `load` to have a specific pearl loaded. Players will recieve the pearlID from a whisper when a new pearl is registered.
3034
```bash
3135
/w <botName> load <optionalID>
3236
```
37+
Temp mode automatically removes pearl positions where a pearl isnt detected. May be buggy.
38+
39+
Can be enabled with `pearlplus autodetect temp on`
40+
41+
#### Manual setup
42+
Setup regular pearlloader positions using the built in zenithproxy module. E.g `pearlLoader add <id> <x> <y> <z>`. Add a player to pearlplus's config using `pearlplus allow <username> <id>`.
43+
3344
#### 2b2t / Anti-spam
3445

35-
On 2b2t or other servers with strict anti-spam plugins you may need to disable strict mode (enabled by default) which then allows you to add a random string after `load` or the `pearlID`.
36-
```bash
37-
/w <botName> load <optionalID> <randomString>
38-
```
46+
By default the bot checks the nearest player to a new pearl and assumes that player threw it. This might be buggy but might be necessary as it seems Hause has disabled resolving entity owners. Resolving the name is bulletproof but server owners can 'disable' it.
47+
48+
If you aren't playing 2b2t its highly recommended to resolve names, this can be done with `pearlplus 2b2t off`.
49+
50+
By default you can add a random word after `load` or the `pearlID` to get around anti-spam.
51+
52+
This can be disabled using `pearlplus strict on`.
3953

4054
### Building The Plugin
4155

42-
Clone the repo or download the zip.
43-
Run `./gradlew build`
56+
Clone the repo or download the zip.
57+
Run `chmod +x gradlew`
58+
then `./gradlew build`

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plugin_version=1.1.2
1+
plugin_version=2.0.0
22
plugin_name=PearlPlus
33
mc=1.21.4
44
maven_group=dev.zenith.pearlplus

gradlew

100644100755
File mode changed.
Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
package dev.zenith.pearlplus;
22

33
import java.util.LinkedHashMap;
4-
import java.util.List;
54
import java.util.Map;
65
import java.util.UUID;
76

87
public class PearlPlusConfig {
98
public final AutoLoadConfig autoLoad = new AutoLoadConfig();
9+
public final AutoDetectConfig autoDetect = new AutoDetectConfig();
10+
11+
public String defaultPearlId = "Base";
12+
13+
public final Map<UUID, PlayerPearls> players = new LinkedHashMap<>();
14+
1015
public static class AutoLoadConfig {
1116
public boolean enabled = true;
12-
public boolean allowNoiseAfterPearl = false;
13-
public Map<UUID, List<String>> allowed = new LinkedHashMap<>();
17+
public boolean allowNoiseAfterPearl = true;
18+
public boolean returnToStartPos = true;
19+
public boolean autoDefaultToPresent = true;
1420
}
1521

16-
public final AutoDetectConfig autoDetect = new AutoDetectConfig();
1722
public static final class AutoDetectConfig {
23+
public boolean enabled = true;
24+
public boolean temporaryMode = false;
25+
public boolean distanceCheck = false;
26+
public int temporaryRemovalRange = 32; //blocks
27+
}
28+
29+
public static final class PlayerPearls {
30+
public String playerName;
31+
public String defaultPearlId;
32+
public Map<String, StoredPearl> pearls = new LinkedHashMap<>();
33+
}
1834

35+
public static final class StoredPearl {
36+
public String pearlId;
37+
public int x;
38+
public int y;
39+
public int z;
1940
}
20-
}
41+
}

src/main/java/dev/zenith/pearlplus/PearlPlusPlugin.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
import com.zenith.plugin.api.Plugin;
55
import com.zenith.plugin.api.ZenithProxyPlugin;
66
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
7-
import dev.zenith.pearlplus.command.AutoLoadCommand;
8-
import dev.zenith.pearlplus.module.AutoLoadModule;
7+
import dev.zenith.pearlplus.command.*;
8+
import dev.zenith.pearlplus.module.*;
99

1010
@Plugin(
11-
id = "pearl-plus",
11+
id = "pearlplus",
1212
version = BuildConstants.VERSION,
13-
description = "Load pearls through whispers without whitelist.",
14-
url = "https://github.com/duccss/",
13+
description = "Slightly better pearl loading module.",
14+
url = "https://github.com/duccss/pearlplus/",
1515
authors = {"duccss"},
16-
mcVersions = {"1.21.0", "1.21.4", "1.21.5", "1.21.7", "1.21.8"}
16+
mcVersions = {"1.21.0", "1.21.4", "1.21.5", "1.21.7", "1.21.8", "1.21.10"}
1717
)
1818

1919
public class PearlPlusPlugin implements ZenithProxyPlugin {
@@ -25,10 +25,12 @@ public class PearlPlusPlugin implements ZenithProxyPlugin {
2525
public void onLoad(PluginAPI pluginAPI) {
2626
API = pluginAPI;
2727
LOG = pluginAPI.getLogger();
28-
LOG.info("Pearl+ Plugin loading...");
29-
PLUGIN_CONFIG = API.registerConfig("pearl-plus", PearlPlusConfig.class);
30-
API.registerCommand(new AutoLoadCommand());
28+
LOG.info("PearlPlus Plugin loading...");
29+
PLUGIN_CONFIG = API.registerConfig("pearlplus", PearlPlusConfig.class);
30+
API.registerCommand(new PearlPlusCommand());
3131
API.registerModule(new AutoLoadModule());
32-
LOG.info("Pearl+ Plugin loaded!");
32+
API.registerModule(new AutoDetectModule());
33+
34+
LOG.info("PearlPlus Plugin loaded!");
3335
}
3436
}

src/main/java/dev/zenith/pearlplus/command/AutoDetectCommand.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/main/java/dev/zenith/pearlplus/command/AutoLoadCommand.java

Lines changed: 0 additions & 127 deletions
This file was deleted.

0 commit comments

Comments
 (0)