Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Some features and a bug fix #12

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,29 @@ plugins {

repositories {
mavenCentral()
jcenter()
maven ("https://rayzr.dev/repo/")
Gabo6480 marked this conversation as resolved.
Show resolved Hide resolved
maven("https://jitpack.io")
maven("https://eldonexus.de/repository/maven-public")
maven("https://eldonexus.de/repository/maven-proxies")
maven("https://raw.githubusercontent.com/FabioZumbi12/RedProtect/mvn-repo/")
}

dependencies {
implementation("de.eldoria", "eldo-util", "1.13.9")

compileOnly("org.spigotmc", "spigot-api", "1.16.5-R0.1-SNAPSHOT")
compileOnly("com.mojang", "authlib", "1.5.25")
compileOnly("org.jetbrains", "annotations", "16.0.2")
compileOnly("me.rayzr522", "jsonmessage", "1.3.0")
Gabo6480 marked this conversation as resolved.
Show resolved Hide resolved
compileOnly("com.github.SaberLLC", "Saber-Factions", "2.9.1-RC"){
exclude("net.dv8tion.JDA")
exclude("com.jagrosh.jda-utilities")
Gabo6480 marked this conversation as resolved.
Show resolved Hide resolved
}
compileOnly("world.bentobox", "bentobox", "1.16.2-SNAPSHOT")
compileOnly("com.github.TechFortress", "GriefPrevention", "16.17.1")
compileOnly("com.github.TownyAdvanced", "Towny", "0.97.1.0")
implementation("com.plotsquared", "PlotSquared-Core", "6.9.0") {
compileOnly("com.plotsquared", "PlotSquared-Core", "6.9.0") {
exclude("com.intellectualsites.paster")
exclude("net.kyori")
exclude("org.apache.logging.log4j")
Expand Down Expand Up @@ -131,7 +140,7 @@ bukkit {
main = "de.eldoria.pickmeup.PickMeUp"
website = "https://www.spigotmc.org/resources/88151/"
apiVersion = "1.13"
softDepend = listOf("BentoBox", "RedProtect", "GriefPrevention", "PlotSquared", "Towny")
softDepend = listOf("BentoBox", "RedProtect", "GriefPrevention", "PlotSquared", "Towny", "Factions")
commands {
register("pickmeup") {
description = "Main command of pick me up"
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/de/eldoria/pickmeup/PickMeUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import de.eldoria.pickmeup.listener.CarryListener;
import de.eldoria.pickmeup.services.ProtectionService;
import de.eldoria.pickmeup.util.Permissions;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.serialization.ConfigurationSerializable;

import java.util.Arrays;
Expand All @@ -24,6 +25,13 @@ public class PickMeUp extends EldoPlugin {

private boolean initialized;
private Configuration configuration;
private static PickMeUp instance;
private static NamespacedKey offsetterIdentifierKey;

public PickMeUp(){
instance = this;
offsetterIdentifierKey = new NamespacedKey(this, "IsOffsetter");
}

@Override
public void onPluginEnable(boolean reload) {
Expand Down Expand Up @@ -57,4 +65,11 @@ public void onReload() {
onDisable();
onEnable();
}
public static PickMeUp instance(){
return instance;
}
Gabo6480 marked this conversation as resolved.
Show resolved Hide resolved
public static NamespacedKey offsetterIdentifierKey(){
return offsetterIdentifierKey;
}
Gabo6480 marked this conversation as resolved.
Show resolved Hide resolved

}
2 changes: 1 addition & 1 deletion src/main/java/de/eldoria/pickmeup/commands/Reload.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Reload(Plugin plugin) {

@Override
public void onCommand(@NotNull CommandSender sender, @NotNull String alias, @NotNull Arguments args) throws CommandException {
getPlugin().onEnable();
PickMeUp.instance().onReload();
Gabo6480 marked this conversation as resolved.
Show resolved Hide resolved
messageSender().sendLocalizedMessage(sender, "reload.success");
PickMeUp.logger().info("PickMeUp reloaded!");
}
Expand Down
23 changes: 19 additions & 4 deletions src/main/java/de/eldoria/pickmeup/config/CarrySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@
@SerializableAs("pickMeUpCarrySettings")
public class CarrySettings implements ConfigurationSerializable {
private double throwForce = 2.0;
private boolean allowStacking;
private int throwDelay = 10;
private boolean allowStacking = false;
private int maximumStacking = 0;
//private int maximumSelfCarry = 1;

public CarrySettings(Map<String, Object> objectMap) {
TypeResolvingMap map = SerializationUtil.mapOf(objectMap);
throwForce = map.getValueOrDefault("throwForce", throwForce);
throwDelay = map.getValueOrDefault("throwDelay", throwDelay);
allowStacking = map.getValueOrDefault("allowStacking", allowStacking);
maximumStacking = map.getValueOrDefault("maximumStacking", maximumStacking);
//maximumSelfCarry = map.getValueOrDefault("maximumSelfCarry", maximumSelfCarry);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was leaving it on the chance it could be rescued later

}

public CarrySettings() {

}
public CarrySettings() {}

@Override
public @NotNull Map<String, Object> serialize() {
Expand All @@ -32,7 +36,18 @@ public double throwForce() {
return throwForce;
}

public long throwDelay() {
return throwDelay;
}

public boolean isAllowStacking() {
return allowStacking;
}

public int maximumStacking() {
return maximumStacking;
}
/*public int maximumSelfCarry() {
return maximumSelfCarry;
}*/
Comment on lines +50 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not used

Suggested change
/*public int maximumSelfCarry() {
return maximumSelfCarry;
}*/

}
Loading