Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wiki to network items #152

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.Slimefun</groupId>
<groupId>com.github.ybw0014</groupId>
<artifactId>Slimefun4</artifactId>
<version>RC-35</version>
<version>d034570832</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -173,7 +173,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -205,7 +205,7 @@
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.221</version>
<version>2.2.004</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/io/github/sefiraat/networks/Networks.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.github.sefiraat.networks.slimefun.network.NetworkController;
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.GitHubBuildsUpdater;
import io.github.thebusybiscuit.slimefun4.utils.WikiUtils;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.AdvancedPie;
import org.bukkit.plugin.PluginManager;
Expand Down Expand Up @@ -70,6 +71,7 @@ && getDescription().getVersion().startsWith("DEV")

public void setupSlimefun() {
NetworkSlimefunItems.setup();
WikiUtils.setupWiki(this);
if (supportedPluginManager.isNetheopoiesis()){
try {
NetheoPlants.setup();
Expand Down Expand Up @@ -103,6 +105,12 @@ public String getBugTrackerURL() {
return MessageFormat.format("https://github.com/{0}/{1}/issues/", this.username, this.repo);
}

@Nonnull
@Override
public String getWikiUrlTemplate() {
return "https://docs.sefiraat.dev/networks/%item%";
}

@Nonnull
public static PluginManager getPluginManager() {
return Networks.getInstance().getServer().getPluginManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

public class NetworkQuantumStorage extends SlimefunItem implements DistinctiveItem {

private static final String WIKI_PAGE = "network-nodes/network-memory-shell";
private static final int[] SIZES = new int[]{
4096,
32768,
Expand Down Expand Up @@ -219,6 +220,7 @@ private void setItem(@Nonnull BlockMenu blockMenu, @Nonnull Player player) {

@Override
public void postRegister() {
addWikiPage(WIKI_PAGE);
new BlockMenuPreset(this.getId(), this.getItemName()) {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

public class NetworkRemote extends SlimefunItem {

private static final String WIKI_PAGE = "tools/network-remote";
private static final NamespacedKey KEY = Keys.newKey("location");
private static final int[] RANGES = new int[]{
150,
Expand Down Expand Up @@ -119,4 +120,9 @@ public int getRange() {
public static int[] getRanges() {
return RANGES;
}

@Override
public void postRegister() {
addWikiPage(WIKI_PAGE);
}
}
31 changes: 31 additions & 0 deletions src/main/resources/wiki.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"NTW_CONTROLLER": "network-nodes/network-controller",
"NTW_GRID": "network-nodes/network-grid",
"NTW_CRAFTING_GRID": "network-nodes/network-grid",
"NTW_BRIDGE": "network-nodes/network-bridge",
"NTW_CELL": "network-nodes/network-cell",
"NTW_MONITOR": "network-nodes/network-monitor",
"NTW_IMPORT": "network-nodes/network-importer",
"NTW_EXPORT": "network-nodes/network-exporter",
"NTW_GRABBER": "network-nodes/network-grabber",
"NTW_PUSHER": "network-nodes/network-pusher",
"NTW_TRASH": "network-nodes/network-purger",
"NTW_CAPACITOR_1": "network-nodes/network-capacitor",
"NTW_CAPACITOR_2": "network-nodes/network-capacitor",
"NTW_POWER_DISPLAY": "network-nodes/network-power-display",
"NTW_RECIPE_ENCODER": "network-nodes/network-encoder",
"NTW_AUTO_CRAFTER": "network-nodes/network-autocrafters",
"NTW_AUTO_CRAFTER_WITHHOLDING": "network-nodes/network-autocrafters",
"NTW_VANILLA_PUSHER": "network-nodes/network-vanilla-pusher",
"NTW_VANILLA_GRABBER": "network-nodes/network-vanilla-grabber",
"NTW_NETWORK_WIRELESS_TRANSMITTER": "network-nodes/network-wireless-transmitter",
"NTW_NETWORK_WIRELESS_RECEIVER": "network-nodes/network-wireless-receiver",
"NTW_CONTROL_X": "network-nodes/network-control-x",
"NTW_CONTROL_V": "network-nodes/network-control-v",
"NTW_VACUUM": "network-nodes/network-vacuum",
"NTW_CRAFTING_BLUEPRINT": "tools/crafting-blueprint",
"NTW_CRAYON": "tools/network-crayon",
"NTW_CONFIGURATOR": "tools/network-configurator",
"NTW_WIRELESS_CONFIGURATOR": "tools/network-wireless-configurator",
"NTW_PROBE": "tools/network-probe"
}