10 Commits

Author SHA1 Message Date
92c3eadf8f Updates Stargate for Spigot 1.19
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
2022-06-17 12:40:15 +02:00
92f452df00 Adds LGPL version to the README
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
2022-03-11 17:16:26 +01:00
6eb7649e0d Clarifies license to prevent any disputes 2022-03-11 17:10:10 +01:00
5c2cbaae58 Merge branch 'master' into dev
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
# Conflicts:
#	README.md
#	pom.xml
#	src/main/resources/plugin.yml
2022-02-17 20:17:11 +01:00
0c69dc8991 Adds the Japanese language file provided by spigot user furplag (0.9.3.7) 2022-02-17 20:08:24 +01:00
68bed24137 Merge branch 'master' of https://git.knarcraft.net/EpicKnarvik97/Stargate
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
 Conflicts:
	README.md
	pom.xml
	src/main/resources/plugin.yml
2022-02-15 18:27:25 +01:00
5c1f9036c2 Merge branch 'dev' of https://git.knarcraft.net/EpicKnarvik97/Stargate into dev
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
 Conflicts:
	README.md
	pom.xml
	src/main/resources/plugin.yml
2022-02-15 18:24:38 +01:00
8488c5abdb Fixes some after-merge problems 2022-02-15 18:21:42 +01:00
e3189e9ab2 Merge branch 'master' into dev
# Conflicts:
#	README.md
#	pom.xml
#	src/main/resources/plugin.yml
2022-02-15 18:16:53 +01:00
8c334ff5f0 Adds simplified chinese, courtesy of YKDZ 2022-02-15 18:15:22 +01:00
13 changed files with 168 additions and 24 deletions

19
HEADER Normal file
View File

@ -0,0 +1,19 @@
Stargate - A portal plugin for Bukkit
Copyright (C) 2011 Shaun (sturmeh)
Copyright (C) 2011 Dinnerbone
Copyright (C) 2011-2013 Steven "Drakia" Scott <Contact@TheDgtl.net>
Copyright (C) 2015-2020 Michael Smith (PseudoKnight)
Copyright (C) 2021-2022 Kristian Knarvik (EpicKnarvik97)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -7,7 +7,7 @@ can share a network or be split into clusters; they can be hidden on a network o
- **Vault economy support** -- can add costs for create, destroy and use.
- **Ability to create custom gate configurations**. Four different default gate configurations are available.
- **Message customization**
- **Multiple built-in languages** (de, en, es, fr, hu, it, nb-no, nl, nn-no, pt-br, ru)
- **Multiple built-in languages** (de, en, es, fr, hu, it, ja, nb-no, nl, nn-no, pt-br, ru, zh_cn)
- **Teleport across worlds or servers** (BungeeCord supported)
- **Vehicle teleportation** -- teleport minecarts, boats, horses, pigs and striders
- **Leashed teleportation** -- teleport any creature in a leash with the player
@ -26,6 +26,11 @@ This was originally TheDgtl's Bukkit port of the Stargate plugin for hMod by Din
of [PseudoKnight's fork](https://github.com/PseudoKnight/Stargate-Bukkit). This fork's main purpose is to create a clean
version of Stargate compliant with Spigot 1.17, even if it means changing the entire project's previous structure.
## License
Stargate is licensed under the GNU Lesser General Public License Version 3.0. This includes every source and resource
file. See the HEADER file for a more detailed license description.
## Migration
This plugin should be compatible with configurations from the Stargate plugin all the way back. The nethergate.gate
@ -298,7 +303,7 @@ while the per-gate costs re defined in the .gate files. To define a certain cost
# Configuration
```
language - The language to use (Included languages: en, de, es, fr, hu, it, nb-no, nl, nn-no, pt-br, ru)
language - The language to use (Included languages: en, de, es, fr, hu, it, ja, nb-no, nl, nn-no, pt-br, ru, zh_cn)
adminUpdateAlert - Whether to alert admins about an available update when joining the server
folders:
portalFolder - The folder your portal databases are saved in
@ -343,7 +348,7 @@ advanced:
# Message Customization
It is possible to customize all the messages Stargate displays, including the [Stargate] prefix. You can find the
It is possible to customize all the messages Stargate displays, including the \[Stargate] prefix. You can find the
strings in plugins/Stargate/lang/chosenLanguage.txt.
If a string is removed, or left blank, it will default to the default english string. There are some special cases
@ -400,6 +405,14 @@ portalInfoServer=Server: %server%
# Changes
#### \[Version 0.9.3.7] EpicKnarvik97 fork
- Adds the Japanese language file provided by spigot user furplag
#### \[Version 0.9.3.6] EpicKnarvik97 fork
- Adds the simplified Chinese language file provided by spigot user YKDZ
#### \[Version 0.9.3.5] EpicKnarvik97 fork
- Fixes the wait for player delay being too low by default

View File

@ -4,7 +4,7 @@
<groupId>net.knarcraft</groupId>
<artifactId>Stargate</artifactId>
<version>0.9.3.5</version>
<version>0.9.4.0</version>
<licenses>
<license>
@ -34,7 +34,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<version>1.19-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>

View File

@ -39,6 +39,30 @@ import java.util.Queue;
import java.util.logging.Level;
import java.util.logging.Logger;
/*
Stargate - A portal plugin for Bukkit
Copyright (C) 2011 Shaun (sturmeh)
Copyright (C) 2011 Dinnerbone
Copyright (C) 2011-2013 Steven "Drakia" Scott <Contact@TheDgtl.net>
Copyright (C) 2015-2020 Michael Smith (PseudoKnight)
Copyright (C) 2021-2022 Kristian Knarvik (EpicKnarvik97)
The following license notice applies to all source and resource files in the Stargate project:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* The main class of the Stargate plugin
*/

View File

@ -8,7 +8,6 @@ import net.knarcraft.stargate.portal.Portal;
import net.knarcraft.stargate.portal.PortalRegistry;
import net.knarcraft.stargate.portal.PortalSignDrawer;
import net.md_5.bungee.api.ChatColor;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -416,7 +415,7 @@ public class CommandConfig implements CommandExecutor {
Object defaultValue = option.getDefaultValue();
String stringValue = String.valueOf(defaultValue);
if (option.getDataType() == OptionDataType.STRING_LIST) {
stringValue = "[" + StringUtils.join((String[]) defaultValue, ",") + "]";
stringValue = "[" + String.join(",", (String[]) defaultValue) + "]";
}
return ChatColor.GOLD + option.getName() + ChatColor.WHITE + " - " + ChatColor.GREEN + option.getDescription() +
ChatColor.DARK_GRAY + " (Default: " + ChatColor.GRAY + stringValue + ChatColor.DARK_GRAY + ")";

View File

@ -2,12 +2,13 @@ package net.knarcraft.stargate.command;
import net.knarcraft.stargate.Stargate;
import net.md_5.bungee.api.ChatColor;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
/**
* This command represents any command which starts with stargate
*
@ -25,7 +26,7 @@ public class CommandStarGate implements CommandExecutor {
} else if (args[0].equalsIgnoreCase("reload")) {
return new CommandReload().onCommand(commandSender, command, s, args);
} else if (args[0].equalsIgnoreCase("config")) {
String[] subArgs = (String[]) ArrayUtils.remove(args, 0);
String[] subArgs = Arrays.copyOfRange(args, 1, args.length);
return new CommandConfig().onCommand(commandSender, command, s, subArgs);
}
return false;

View File

@ -237,11 +237,13 @@ public class ConfigTabCompleter implements TabCompleter {
languages.add("fr");
languages.add("hu");
languages.add("it");
languages.add("ja");
languages.add("nb-no");
languages.add("nl");
languages.add("nn-no");
languages.add("pt-br");
languages.add("ru");
languages.add("zh_cn");
//TODO: Generate this list dynamically by listing the language files in the jar and adding the user's custom
// language files
}

View File

@ -1,6 +1,5 @@
package net.knarcraft.stargate.command;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
@ -9,6 +8,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -29,7 +29,7 @@ public class StarGateTabCompleter implements TabCompleter {
}
return matchingCommands;
} else if (args.length > 1 && args[0].equalsIgnoreCase("config")) {
String[] subArgs = (String[]) ArrayUtils.remove(args, 0);
String[] subArgs = Arrays.copyOfRange(args, 1, args.length);
return new ConfigTabCompleter().onTabComplete(commandSender, command, s, subArgs);
} else {
return new ArrayList<>();

View File

@ -230,13 +230,16 @@ public class PlayerEventListener implements Listener {
EquipmentSlot hand = event.getHand();
if (hand != null && (PermissionHelper.hasPermission(player, "stargate.admin.dye") ||
portal.isOwner(player))) {
String itemName = player.getInventory().getItem(hand).getType().toString();
ItemStack item = player.getInventory().getItem(hand);
if (item != null) {
String itemName = item.getType().toString();
if (itemName.endsWith("DYE") || itemName.endsWith("INK_SAC")) {
event.setUseInteractedBlock(Event.Result.ALLOW);
Bukkit.getScheduler().scheduleSyncDelayedTask(Stargate.getInstance(), portal::drawSign, 1);
return;
}
}
}
event.setUseInteractedBlock(Event.Result.DENY);
if (leftClick) {
@ -325,7 +328,7 @@ public class PlayerEventListener implements Listener {
} else {
//Display information about the portal if it has no sign
ItemStack heldItem = player.getInventory().getItem(hand);
if (heldItem.getType().isAir() || !heldItem.getType().isBlock()) {
if (heldItem != null && (heldItem.getType().isAir() || !heldItem.getType().isBlock())) {
displayPortalInfo(block, player);
}
}

View File

@ -1,7 +1,7 @@
# stargate Configuration File
# Main stargate config
# language - The language file to load for messages
# language - The language file to load for messages (de,en,es,fr,hu,it,ja,nb-no,nl,nn-no,pt-br,ru,zh_cn)
language: en
# adminUpdateAlert - Whether to alert admins about new plugin updates
adminUpdateAlert: true
@ -57,9 +57,9 @@ gates:
# enableCraftBookRemoveOnEjectFix - Whether to enable a fix that causes loss of NBT data, but allows vehicle teleportation to work when CraftBook's remove minecart/boat on eject setting is enabled
enableCraftBookRemoveOnEjectFix: false
# I------------I-------------I #
#############################
# stargate economy options #
# I------------I-------------I #
############################
economy:
# useEconomy - Whether to use an economy plugin
useEconomy: false
@ -78,9 +78,9 @@ economy:
# freeGatesColor - The color to use for marking free gates
freeGatesColor: DARK_GREEN
# I-------I-------I #
#################
# Debug options #
# I-------I-------I #
#################
debugging:
# debug - Debug -- Only enable if you have issues, massive console output
debug: false

View File

@ -0,0 +1,44 @@
author=furplag
prefix=[Stargate]
teleportMsg=テレポート
destroyMsg=ゲートが破壊されました
invalidMsg=無効な行き先
blockMsg=ブロックされた行き先
destEmpty=行き先リストが空です
denyMsg=アクセスが拒否されました
reloaded= Stargate をリロードしました
ecoDeduct=cost の値引き
ecoRefund=cost の返金
ecoObtain= Stargate portal から cost を得ました
ecoInFunds=資金の不足
ecoLoadError= Vault が読み込まれましたが、Economy プラグインをフックできませんでした
vaultLoadError=Economy は有効になっていますが、Vault をロードできないため Economy は無効化されました
vaultLoaded= Vault vversion が見つかりました
createMsg=ゲートが作成されました
createNetDeny=対象のネットワークにアクセスできません
createGateDeny=対象のゲートレイアウトにアクセスできません
createPersonal=パーソナルネットワーク上にゲートを作成する
createNameLength=ゲート名が短すぎるか長すぎます
createExists=すでに存在するゲート名です
createFull=対象のネットワークはいっぱいです
createWorldDeny=あなたはその世界にアクセスできません
createConflict=ゲートが既存のゲートと競合しています
signRightClick=右クリック
signToUse=ゲートを使用する
signRandom=ランダム
signDisconnected=切断
signInvalidGate=無効なゲート
bungeeDisabled=BungeeCord サポートは無効になっています
bungeeDeny=BungeeCord ゲートを作成する権限がありません
bungeeEmpty=BungeeCord ゲートには、行き先とネットワークの両方が必要です
bungeeSign=テレポート先:
portalInfoTitle=[STARGATE INFO]
portalInfoName=ゲート名: name
portalInfoDestination=行き先: destination
portalInfoNetwork=ネットワーク: network
portalInfoServer=サーバー: server

View File

@ -0,0 +1,39 @@
author=YKDZ
signRightClick=右键
ecoLoadError=Vault 已加载, 但未检测到合适的经济插件
createConflict=星门与现有星门冲突
invalidMsg=无效的目的地
prefix=[星门]
ecoObtain=从星门 %portal% 收取了 %cost%
vaultLoaded=检测到 Vault v%version%
reloaded=星门插件已重载
bungeeDeny=你没有创建跨服星门的权限.
signToUse=以使用星门
signInvalidGate=未知星门
bungeeEmpty=跨服星门需要提供目的地和网络.
createMsg=星门已创建
bungeeDisabled=跨服功能已被禁用.
blockMsg=目的地被阻挡
ecoInFunds=余额不足
createNameLength=名称过短或过长.
vaultLoadError=未检测到Vault. 经济模块已禁用
denyMsg=访问被拒
ecoDeduct=花费 %cost%
signDisconnected=已取消链接
createNetDeny=你没有这个星门网络的许可
bungeeSign=传送到
portalInfoName=名称: %name%
destroyMsg=星门已被破坏
portalInfoTitle=[星门信息]
createExists=与已有星门重名
teleportMsg=已传送
createGateDeny=你没有使用这个星门结构的权限
signRandom=随机
portalInfoServer=服务器: %server%
createWorldDeny=你没有链接这个世界的权限
portalInfoDestination=目的地: %destination%
portalInfoNetwork=星门网络: %network%
destEmpty=目的地列表为空
createPersonal=在私人网络中创建星门
ecoRefund=退款 %cost%
createFull=此星门网络已满

View File

@ -1,11 +1,11 @@
name: Stargate
main: net.knarcraft.stargate.Stargate
version: 0.9.3.5
version: 0.9.4.0
description: Stargate mod for Bukkit Revived
author: EpicKnarvik97
authors: [ Drakia, PseudoKnight, EpicKnarvik97 ]
website: https://git.knarcraft.net/EpicKnarvik97/Stargate
api-version: 1.18
api-version: 1.19
softdepend: [ Vault ]
commands:
stargate: