Compare commits
51
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79a8ae1e81
|
||
|
|
5af16dac0f
|
||
|
|
d433d95062 | ||
|
|
88a3d84a64 | ||
|
|
8341b47d9d | ||
|
|
2e1f6ab7ae | ||
|
|
24bb6b0af3 | ||
|
|
455ebec9a5 | ||
|
|
78858e593c | ||
|
|
ed9f5dcb34 | ||
|
|
2df8ffa37c | ||
|
|
78b4ffb1ed | ||
|
|
04a5485699 | ||
|
|
531754db4e | ||
|
|
2bc88a4731 | ||
|
|
0148d72608 | ||
|
|
3f04f2dd5d | ||
|
|
d45cedea88 | ||
|
|
40aa2a8ddf | ||
|
|
a43311aae6 | ||
|
|
8474ef46f6 | ||
|
|
325846b5c6 | ||
|
|
99e026e94f | ||
|
|
eee83ba1d4 | ||
|
|
b92f5983d8 | ||
|
|
8ba2c13ff9 | ||
|
|
b4824cd8c8 | ||
|
|
93b2e37453 | ||
|
|
a6548c5f89 | ||
|
|
65a2313746 | ||
|
|
ee291692f9 | ||
|
|
f8038376b7 | ||
|
|
63e91a2145 | ||
|
|
79d6ccb1c5 | ||
|
|
e1f6596cf7 | ||
|
|
025d0cc90b | ||
|
|
5d028d994f | ||
|
|
896a3aa890 | ||
|
|
178f61249c | ||
|
|
a1f0e46071 | ||
|
|
9ce16b3bd0 | ||
|
|
23daeded95 | ||
|
|
3ac5a3b320 | ||
|
|
6f71deaa47 | ||
|
|
3bbd732508 | ||
|
|
4021ca3985 | ||
|
|
c9fb8cd762 | ||
|
|
a19fcdd56f | ||
|
|
9ce2079c1d | ||
|
|
a338b1c4b6 | ||
|
|
859dc09793 |
No files matched your search
@@ -0,0 +1 @@
|
||||
.gitea/CODEOWNERS linguist-detectable=false
|
||||
@@ -0,0 +1,3 @@
|
||||
# Pull requests request review from the eligible staff team(s).
|
||||
# One approval from either an Admin or Developer satisfies branch protection.
|
||||
* @trueog/Admins @trueog/Developers
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,174 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
@@ -0,0 +1,11 @@
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/jOxHje1.png" width="300" height="180">
|
||||
</p>
|
||||
|
||||
# FastCrystals-OG
|
||||
|
||||
FastCrystals-OG is a fork of FastCrystals by Exyron maintained for 1.19.4 by [TrueOG Network](https://trueog.net). It is an addon that enables more dynamic Crystal PvP gameplay. It is a well-known plugin on strictly PvP servers, but also on other servers where Crystal PvP is present.
|
||||
|
||||
# Command presentation
|
||||
|
||||
Messages are configurable in the file **/FastCrystals-OG/config.yml**
|
||||
@@ -1,10 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group 'xyz.exyron.fastcrystals'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
eclipse
|
||||
id("com.gradleup.shadow") version "8.3.9" apply false
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
subprojects {
|
||||
pluginManager.withPlugin("com.gradleup.shadow") {
|
||||
tasks.named<ShadowJar>("shadowJar") {
|
||||
archiveFileName.set("${rootProject.name}-${rootProject.version}.jar")
|
||||
destinationDirectory.set(file("${rootProject.projectDir}/build/libs"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
tasks.named("assemble") {
|
||||
dependsOn(":core:shadowJar")
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.gradleup.shadow")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT")
|
||||
compileOnly("me.clip:placeholderapi:2.11.6")
|
||||
|
||||
implementation(project(":shared"))
|
||||
implementation(project(":v1_16"))
|
||||
implementation(project(":v1_17"))
|
||||
implementation(project(":v1_18"))
|
||||
implementation(project(":v1_19"))
|
||||
implementation(project(":v1_19_3"))
|
||||
implementation(project(":v1_19_4"))
|
||||
implementation(project(":v1_20"))
|
||||
implementation(project(":v1_20_2"))
|
||||
implementation(project(":v1_20_4"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class FastCrystalsPlaceholder extends PlaceholderExpansion {
|
||||
|
||||
private final String statusTrue, statusFalse;
|
||||
private final FastCrystalsPlugin plugin;
|
||||
|
||||
public FastCrystalsPlaceholder(FastCrystalsPlugin fastCrystalsPlugin) {
|
||||
this.plugin = fastCrystalsPlugin;
|
||||
this.statusFalse = this.plugin.getConfiguration().getString("placeholderStatusFalse");
|
||||
this.statusTrue = this.plugin.getConfiguration().getString("placeholderStatusTrue");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdentifier() {
|
||||
return "fastcrystals";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getAuthor() {
|
||||
return "Exyron.XYZ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
|
||||
if (params.equalsIgnoreCase("status")) {
|
||||
return this.plugin.isUsingFastCrystals(player.getUniqueId()) ? this.statusTrue : this.statusFalse;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.EnderCrystal;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class FastCrystalsPlugin extends JavaPlugin implements Listener {
|
||||
|
||||
private final FileConfiguration configuration = this.getConfig();
|
||||
private final boolean currentStatus = this.configuration.getBoolean("defaultStatus");
|
||||
|
||||
private final Set<UUID> playersUUID = new HashSet<>();
|
||||
private CrystalDamage crystalDamage;
|
||||
|
||||
private static final int BSTATS_ID = 21848;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
this.saveDefaultConfig();
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
new FastCrystalsPlaceholder(this).register();
|
||||
}
|
||||
|
||||
this.crystalDamage = this.assignCrystalDamageFromServerVersion(Bukkit.getBukkitVersion().split("-")[0]);
|
||||
|
||||
String disableMessage = this.colorize(Objects.requireNonNull(this.configuration.getString("disableMessage")));
|
||||
String enableMessage = this.colorize(Objects.requireNonNull(this.configuration.getString("enableMessage")));
|
||||
|
||||
if (this.configuration.getBoolean("commandEnabled")) {
|
||||
Objects.requireNonNull(this.getCommand("fastcrystals")).setExecutor(((sender, command, label, args) -> {
|
||||
if (sender instanceof Player player) {
|
||||
UUID playerUniqueId = player.getUniqueId();
|
||||
|
||||
if (this.playersUUID.contains(playerUniqueId)) {
|
||||
player.sendMessage(disableMessage);
|
||||
this.playersUUID.remove(playerUniqueId);
|
||||
} else {
|
||||
player.sendMessage(enableMessage);
|
||||
this.playersUUID.add(playerUniqueId);
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(this.colorize("&cYou cannot run this command from Console."));
|
||||
}
|
||||
return false;
|
||||
}));
|
||||
}
|
||||
|
||||
this.getServer().getPluginManager().registerEvents(this, this);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
if (event.getDamager() instanceof Player player && event.getEntity() instanceof EnderCrystal crystal && this.isUsingFastCrystals(player.getUniqueId())) {
|
||||
this.crystalDamage.handle(player, crystal);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
if (this.currentStatus) {
|
||||
this.playersUUID.add(event.getPlayer().getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isUsingFastCrystals(UUID uniqueId) {
|
||||
return this.playersUUID.contains(uniqueId);
|
||||
}
|
||||
|
||||
private CrystalDamage assignCrystalDamageFromServerVersion(String version) {
|
||||
return switch (version) {
|
||||
case "1.20.4", "1.20.3" -> new CrystalDamage_v1_20_4();
|
||||
case "1.20", "1.20.1", "1.20.2" -> new CrystalDamage_v1_20_2();
|
||||
case "1.19.4" -> new CrystalDamage_v1_19_4();
|
||||
case "1.19.3" -> new CrystalDamage_v1_19_3();
|
||||
case "1.19.2", "1.19.1", "1.19" -> new CrystalDamage_v1_19();
|
||||
case "1.18.2", "1.18.1", "1.18" -> new CrystalDamage_v1_18();
|
||||
case "1.17.2", "1.17.1", "1.17" -> new CrystalDamage_v1_17();
|
||||
case "1.16.5", "1.16.4" -> new CrystalDamage_v1_16();
|
||||
|
||||
default -> {
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
throw new IllegalStateException(
|
||||
"Plugin is disabling due to unsupported minecraft version (" + version + "). We currently support only 1.16.4+ versions."
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static final Pattern HEX_PATTERN = Pattern.compile("#[A-Fa-f0-9]{6}");
|
||||
|
||||
private String colorize(String message) {
|
||||
Matcher matcher = HEX_PATTERN.matcher(message);
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
while (matcher.find()) {
|
||||
matcher.appendReplacement(result, ChatColor.of(matcher.group()).toString());
|
||||
}
|
||||
|
||||
matcher.appendTail(result);
|
||||
message = result.toString();
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', message.replace(">>", "»").replace("<<", "«"));
|
||||
}
|
||||
|
||||
public FileConfiguration getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# ___ __ __ _ _ _ __ ___ _ __ __ __ _ _ ____
|
||||
# / _ \\ \/ /| | | || '__|/ _ \ | '_ \ \ \/ /| | | ||_ /
|
||||
# | __/ > < | |_| || | | (_) || | | | _ > < | |_| | / /
|
||||
# \___|/_/\_\ \__, ||_| \___/ |_| |_|(_)/_/\_\ \__, |/___|
|
||||
# |___/ |___/
|
||||
#
|
||||
|
||||
# Set this value to "false" if you don't want to be fast crystals automatically enabled on player join.
|
||||
defaultStatus: true
|
||||
|
||||
# Set this value to "false" if you don't want "/fastcrystals" command to be working. (it's going to be completely disabled)
|
||||
commandEnabled: false
|
||||
|
||||
enableMessage: "&7Fast crystal feature is now &aenabled&7."
|
||||
disableMessage: "&7Fast crystal feature is now &cdisabled&7."
|
||||
|
||||
placeholderStatusTrue: "&atrue"
|
||||
placeholderStatusFalse: "&cfalse"
|
||||
@@ -0,0 +1,9 @@
|
||||
name: FastCrystals-OG
|
||||
version: 1.0
|
||||
api-version: 1.16
|
||||
main: xyz.exyron.fastcrystals.FastCrystalsPlugin
|
||||
authors: [ Exyron.XYZ, KamlaX, KinczeK ]
|
||||
softdepend: [ PlaceholderAPI ]
|
||||
commands:
|
||||
fastcrystals:
|
||||
aliases: [ fastercrystals, fastcrystal, quickcrystal ]
|
||||
@@ -0,0 +1,28 @@
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.gradleup.shadow") version "8.3.9"
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/central") }
|
||||
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT")
|
||||
compileOnly("me.clip:placeholderapi:2.11.6")
|
||||
|
||||
implementation(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class FastCrystalsPlaceholder extends PlaceholderExpansion {
|
||||
|
||||
private final String statusTrue, statusFalse;
|
||||
private final FastCrystalsPlugin plugin;
|
||||
|
||||
public FastCrystalsPlaceholder(FastCrystalsPlugin fastCrystalsPlugin) {
|
||||
this.plugin = fastCrystalsPlugin;
|
||||
this.statusFalse = this.plugin.getConfiguration().getString("placeholderStatusFalse");
|
||||
this.statusTrue = this.plugin.getConfiguration().getString("placeholderStatusTrue");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdentifier() {
|
||||
return "fastcrystals";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getAuthor() {
|
||||
return "Exyron.XYZ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
|
||||
if (params.equalsIgnoreCase("status")) {
|
||||
return this.plugin.isUsingFastCrystals(player.getUniqueId()) ? this.statusTrue : this.statusFalse;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.EnderCrystal;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class FastCrystalsPlugin extends JavaPlugin implements Listener {
|
||||
|
||||
private final FileConfiguration configuration = this.getConfig();
|
||||
private final boolean currentStatus = this.configuration.getBoolean("defaultStatus");
|
||||
|
||||
private final Set<UUID> playersUUID = new HashSet<>();
|
||||
private CrystalDamage crystalDamage;
|
||||
|
||||
private static final int BSTATS_ID = 21848;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
this.saveDefaultConfig();
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
new FastCrystalsPlaceholder(this).register();
|
||||
}
|
||||
|
||||
String disableMessage = this.colorize(Objects.requireNonNull(this.configuration.getString("disableMessage")));
|
||||
String enableMessage = this.colorize(Objects.requireNonNull(this.configuration.getString("enableMessage")));
|
||||
|
||||
if (this.configuration.getBoolean("commandEnabled")) {
|
||||
Objects.requireNonNull(this.getCommand("fastcrystals")).setExecutor(((sender, command, label, args) -> {
|
||||
if (sender instanceof Player player) {
|
||||
UUID playerUniqueId = player.getUniqueId();
|
||||
|
||||
if (this.playersUUID.contains(playerUniqueId)) {
|
||||
player.sendMessage(disableMessage);
|
||||
this.playersUUID.remove(playerUniqueId);
|
||||
} else {
|
||||
player.sendMessage(enableMessage);
|
||||
this.playersUUID.add(playerUniqueId);
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(this.colorize("&cYou cannot run this command from Console."));
|
||||
}
|
||||
return false;
|
||||
}));
|
||||
}
|
||||
|
||||
this.getServer().getPluginManager().registerEvents(this, this);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
if (event.getDamager() instanceof Player player && event.getEntity() instanceof EnderCrystal crystal && this.isUsingFastCrystals(player.getUniqueId())) {
|
||||
this.crystalDamage.handle(player, crystal);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
if (this.currentStatus) {
|
||||
this.playersUUID.add(event.getPlayer().getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isUsingFastCrystals(UUID uniqueId) {
|
||||
return this.playersUUID.contains(uniqueId);
|
||||
}
|
||||
|
||||
private static final Pattern HEX_PATTERN = Pattern.compile("#[A-Fa-f0-9]{6}");
|
||||
|
||||
private String colorize(String message) {
|
||||
Matcher matcher = HEX_PATTERN.matcher(message);
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
while (matcher.find()) {
|
||||
matcher.appendReplacement(result, ChatColor.of(matcher.group()).toString());
|
||||
}
|
||||
|
||||
matcher.appendTail(result);
|
||||
message = result.toString();
|
||||
|
||||
return ChatColor.translateAlternateColorCodes('&', message.replace(">>", "»").replace("<<", "«"));
|
||||
}
|
||||
|
||||
public FileConfiguration getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#
|
||||
# ___ __ __ _ _ _ __ ___ _ __ __ __ _ _ ____
|
||||
# / _ \\ \/ /| | | || '__|/ _ \ | '_ \ \ \/ /| | | ||_ /
|
||||
# | __/ > < | |_| || | | (_) || | | | _ > < | |_| | / /
|
||||
# \___|/_/\_\ \__, ||_| \___/ |_| |_|(_)/_/\_\ \__, |/___|
|
||||
# |___/ |___/
|
||||
#
|
||||
|
||||
# Set this value to "false" if you don't want to be fast crystals automatically enabled on player join.
|
||||
defaultStatus: true
|
||||
|
||||
# Set this value to "false" if you don't want "/fastcrystals" command to be working. (it's going to be completely disabled)
|
||||
commandEnabled: true
|
||||
|
||||
enableMessage: "&7Fast crystal feature is now &aenabled&7."
|
||||
disableMessage: "&7Fast crystal feature is now &cdisabled&7."
|
||||
|
||||
placeholderStatusTrue: "&atrue"
|
||||
placeholderStatusFalse: "&cfalse"
|
||||
@@ -0,0 +1,9 @@
|
||||
name: FastCrystals-OG
|
||||
version: 1.0
|
||||
api-version: 1.20
|
||||
main: xyz.exyron.fastcrystals.FastCrystalsPlugin
|
||||
authors: [ Exyron.XYZ, KamlaX, KinczeK ]
|
||||
softdepend: [ PlaceholderAPI ]
|
||||
commands:
|
||||
fastcrystals:
|
||||
aliases: [ fastercrystals, fastcrystal, quickcrystal ]
|
||||
@@ -1,15 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group 'xyz.exyron.fastcrystals'
|
||||
version '1.0'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
||||
maven { url 'https://repo.codemc.org/repository/nms/' }
|
||||
}
|
||||
dependencies {
|
||||
compileOnly 'org.spigotmc:spigot:1.16.2-R0.1-SNAPSHOT'
|
||||
}
|
||||
BIN
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
enableMessage: "&aFastCrystals has been enabled!"
|
||||
disableMessage: "&cFastCrystals has been disabled!"
|
||||
@@ -1,7 +0,0 @@
|
||||
name: Exyron-FastCrystals
|
||||
version: 1.0
|
||||
api-version: 1.13
|
||||
main: xyz.exyron.fastcrystals.FastCrystalsPlugin
|
||||
authors: [Exyron.XYZ, KamlaX]
|
||||
commands:
|
||||
fastcrystals:
|
||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.minecraft.server.v1_16_R2.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EnderCrystal;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public final class FastCrystalsPlugin extends JavaPlugin implements Listener {
|
||||
private final Set<UUID> playersUUID = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
this.saveDefaultConfig();
|
||||
String enableMessage = colorize(Objects.requireNonNull(this.getConfig().getString("enableMessage")));
|
||||
String disableMessage = colorize(Objects.requireNonNull(this.getConfig().getString("disableMessage")));
|
||||
Objects.requireNonNull(getCommand("fastcrystals")).setExecutor(((sender, command, label, args) -> {
|
||||
if (sender instanceof Player player) {
|
||||
if (this.playersUUID.contains(player.getUniqueId())) {
|
||||
player.sendMessage(disableMessage);
|
||||
this.playersUUID.remove(player.getUniqueId());
|
||||
} else {
|
||||
player.sendMessage(enableMessage);
|
||||
this.playersUUID.add(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}));
|
||||
this.getServer().getPluginManager().registerEvents(this, this);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void event(EntityDamageByEntityEvent event) {
|
||||
if (event.getDamager() instanceof Player player && event.getEntity() instanceof EnderCrystal && this.playersUUID.contains(player.getUniqueId()))
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(event.getEntity().getEntityId()));
|
||||
}
|
||||
|
||||
private final Pattern HEX_PATTERN = Pattern.compile("#[A-Fa-f0-9]{6}");
|
||||
|
||||
private String colorize(String message) {
|
||||
Matcher matcher = HEX_PATTERN.matcher(message);
|
||||
StringBuilder result = new StringBuilder();
|
||||
while (matcher.find()) {
|
||||
matcher.appendReplacement(result, ChatColor.of(matcher.group()).toString());
|
||||
}
|
||||
matcher.appendTail(result);
|
||||
message = result.toString();
|
||||
return ChatColor.translateAlternateColorCodes('&', message
|
||||
.replace(">>", "\u00BB")
|
||||
.replace("<<", "\u00AB"));
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
enableMessage: "&aFastCrystals has been enabled!"
|
||||
disableMessage: "&cFastCrystals has been disabled!"
|
||||
@@ -1,7 +0,0 @@
|
||||
name: Exyron-FastCrystals
|
||||
version: 1.0
|
||||
api-version: 1.13
|
||||
main: xyz.exyron.fastcrystals.FastCrystalsPlugin
|
||||
authors: [Exyron.XYZ, KamlaX]
|
||||
commands:
|
||||
fastcrystals:
|
||||
@@ -1,27 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group 'xyz.exyron.fastcrystals'
|
||||
version '1.0'
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
||||
maven { url 'https://repo.codemc.org/repository/nms/' }
|
||||
maven {
|
||||
name = 'papermc-repo'
|
||||
url = 'https://papermc.io/repo/repository/maven-public/'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
compileOnly 'io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT'
|
||||
compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
|
||||
compileOnly 'org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT'
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
enableMessage: "&aFastCrystals has been enabled!"
|
||||
disableMessage: "&cFastCrystals has been disabled!"
|
||||
@@ -1,7 +0,0 @@
|
||||
name: Exyron-FastCrystals
|
||||
version: 1.0
|
||||
api-version: 1.13
|
||||
main: xyz.exyron.fastcrystals.FastCrystalsPlugin
|
||||
authors: [Exyron.XYZ, KamlaX]
|
||||
commands:
|
||||
fastcrystals:
|
||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EnderCrystal;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public final class FastCrystalsPlugin extends JavaPlugin implements Listener {
|
||||
private final Set<UUID> playersUUID = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
saveDefaultConfig();
|
||||
String enableMessage = colorize(Objects.requireNonNull(this.getConfig().getString("enableMessage")));
|
||||
String disableMessage = colorize(Objects.requireNonNull(this.getConfig().getString("disableMessage")));
|
||||
Objects.requireNonNull(getCommand("fastcrystals")).setExecutor(((sender, command, label, args) -> {
|
||||
if (sender instanceof Player player) {
|
||||
if (this.playersUUID.contains(player.getUniqueId())) {
|
||||
player.sendMessage(disableMessage);
|
||||
this.playersUUID.remove(player.getUniqueId());
|
||||
} else {
|
||||
player.sendMessage(enableMessage);
|
||||
this.playersUUID.add(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}));
|
||||
getServer().getPluginManager().registerEvents(this, this);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void event(EntityDamageByEntityEvent event) {
|
||||
if (event.getDamager() instanceof Player player && event.getEntity() instanceof EnderCrystal && this.playersUUID.contains(player.getUniqueId()))
|
||||
((CraftPlayer) player).getHandle().b.a(new PacketPlayOutEntityDestroy(event.getEntity().getEntityId()));
|
||||
}
|
||||
|
||||
private final Pattern HEX_PATTERN = Pattern.compile("#[A-Fa-f0-9]{6}");
|
||||
|
||||
private String colorize(String message) {
|
||||
Matcher matcher = HEX_PATTERN.matcher(message);
|
||||
StringBuilder result = new StringBuilder();
|
||||
while (matcher.find()) {
|
||||
matcher.appendReplacement(result, ChatColor.of(matcher.group()).toString());
|
||||
}
|
||||
matcher.appendTail(result);
|
||||
message = result.toString();
|
||||
return ChatColor.translateAlternateColorCodes('&', message
|
||||
.replace(">>", "\u00BB")
|
||||
.replace("<<", "\u00AB"));
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
enableMessage: "&aFastCrystals has been enabled!"
|
||||
disableMessage: "&cFastCrystals has been disabled!"
|
||||
@@ -1,7 +0,0 @@
|
||||
name: Exyron-FastCrystals
|
||||
version: 1.0
|
||||
api-version: 1.13
|
||||
main: xyz.exyron.fastcrystals.FastCrystalsPlugin
|
||||
authors: [Exyron.XYZ, KamlaX]
|
||||
commands:
|
||||
fastcrystals:
|
||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,5 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -15,81 +15,115 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MSYS* | MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -98,88 +132,120 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+94
-89
@@ -1,89 +1,94 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,4 +0,0 @@
|
||||
rootProject.name = 'FastCrystalsPlugin'
|
||||
include 'fast-crystals-plugin-1.16'
|
||||
include 'fast-crystals-plugin-1.18'
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention").version("0.10.0")
|
||||
}
|
||||
|
||||
rootProject.name = "FastCrystals-OG"
|
||||
|
||||
include(
|
||||
"core",
|
||||
"core_new",
|
||||
"shared",
|
||||
"v1_16",
|
||||
"v1_17",
|
||||
"v1_18",
|
||||
"v1_19",
|
||||
"v1_19_3",
|
||||
"v1_19_4",
|
||||
"v1_20",
|
||||
"v1_20_2",
|
||||
"v1_20_4",
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface CrystalDamage {
|
||||
|
||||
void handle(Player damager, Entity crystal);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.server.v1_16_R3.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_16 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_17 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().b.sendPacket(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_18 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().b.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://libraries.minecraft.net/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.19-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_19 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().b.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://libraries.minecraft.net/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_19_3 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().b.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://libraries.minecraft.net/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_19_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_19_4 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().b.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://libraries.minecraft.net/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_20 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().c.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://libraries.minecraft.net/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_20_2 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().c.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "xyz.exyron.fastcrystals"
|
||||
version = "1.0"
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/nms/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://libraries.minecraft.net/") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
|
||||
compileOnly(project(":shared"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package xyz.exyron.fastcrystals;
|
||||
|
||||
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
|
||||
import org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CrystalDamage_v1_20_4 implements CrystalDamage {
|
||||
|
||||
@Override
|
||||
public void handle(Player damager, Entity crystal) {
|
||||
((CraftPlayer) damager).getHandle().c.a(new PacketPlayOutEntityDestroy(crystal.getEntityId()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user