Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
92c3eadf8f | |||
92f452df00 | |||
6eb7649e0d |
19
HEADER
Normal file
19
HEADER
Normal 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/>.
|
@ -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
|
||||
|
4
pom.xml
4
pom.xml
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>net.knarcraft</groupId>
|
||||
<artifactId>Stargate</artifactId>
|
||||
<version>0.9.3.7</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>
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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 + ")";
|
||||
|
@ -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;
|
||||
|
@ -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<>();
|
||||
|
@ -230,11 +230,14 @@ 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();
|
||||
if (itemName.endsWith("DYE") || itemName.endsWith("INK_SAC")) {
|
||||
event.setUseInteractedBlock(Event.Result.ALLOW);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(Stargate.getInstance(), portal::drawSign, 1);
|
||||
return;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -1,11 +1,11 @@
|
||||
name: Stargate
|
||||
main: net.knarcraft.stargate.Stargate
|
||||
version: 0.9.3.7
|
||||
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:
|
||||
|
Reference in New Issue
Block a user