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

v1.13.1 #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

v1.13.1 #53

wants to merge 2 commits into from

Conversation

stumper66
Copy link

Added support for LevelledMobs. Added a new config value for it.

Added support for LevelledMobs. Added a new config value for it.
pom.xml Outdated
@@ -6,7 +6,7 @@

<groupId>me.justeli.coins</groupId>
<artifactId>Coins</artifactId>
<version>1.13</version>
<version>1.14</version>
Copy link
Owner

Choose a reason for hiding this comment

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

not quite yet

Copy link
Author

Choose a reason for hiding this comment

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

changed to 1.13.1

@@ -30,6 +30,8 @@
@ConfigEntry ("drop-with-any-death") public static Boolean DROP_WITH_ANY_DEATH = false;
@ConfigEntry ("enchanted-coin") public static Boolean ENCHANTED_COIN = false;
@ConfigEntry ("disable-mythic-mob-handling") public static Boolean DISABLE_MYTHIC_MOB_HANDLING = false;

@ConfigEntry("levelledmobs-level-multiplier") public static Double LEVELLEDMOBS_LEVEL_MULTIPLIER = 0.0;
Copy link
Owner

Choose a reason for hiding this comment

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

lets place it at all the other Doubles in the class

Copy link
Author

Choose a reason for hiding this comment

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

I don't think I can move this double since it is a config value.

import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

public class LevelledMobsHandler {
Copy link
Owner

Choose a reason for hiding this comment

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

would appreciate using the project's code style

Copy link
Author

Choose a reason for hiding this comment

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

Done, I think.

@@ -38,16 +39,20 @@
private final Coins coins;
private final NamespacedKey playerDamage;

private final LevelledMobsHandler levelledMobsHandler;
Copy link
Owner

Choose a reason for hiding this comment

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

i would prefer if the hook was initialized in the main class, just like with mythicmobs, and then you can move getLevelledMobsMultipliedAmount() to LevelledMobsHandler as well, and use the created main.lmHook() for getLevelledMobsMultipliedAmount().

for deadMob, idrk what's going on there, but i guess you could add an @EventHandler in the hook as well and register the hook (if lm is installed)

i just prefer to keep classes to their main usage, so if things like deadMob and getLevelledMobsMultipliedAmount() are from another plugin, i'd rather keep it in a separate class

Copy link
Author

Choose a reason for hiding this comment

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

done

}

private final HashMap<Location, Integer> locationAmountCache = new HashMap<>();
private final HashMap<Location, Long> locationLastTimeCache = new HashMap<>();

private static final SplittableRandom RANDOM = new SplittableRandom();
private LivingEntity deadMob;
Copy link
Owner

Choose a reason for hiding this comment

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

see other comment

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -283,6 +297,18 @@ private void drop (int amount, @Nullable Player player, @NotNull Location locati
}
}

private double getLevelledMobsMultipliedAmount(double increment){
Copy link
Owner

Choose a reason for hiding this comment

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

could add a LivingEntity parameter instead of getting it through this.deadMob (when applying the requested in other comment)

(and yeah as said before i'd rather have this function moved to the hook)

Copy link
Author

Choose a reason for hiding this comment

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

I changed it

@justEli
Copy link
Owner

justEli commented Jun 13, 2022

ill add a .editorconfig soon

@ghost
Copy link

ghost commented Feb 22, 2023

@stumper66

@Whitebrim
Copy link

@stumper66 Please finish this, we need it ♥

@stumper66
Copy link
Author

Sorry guys I totally forgot about this PR. I'll see what I can do in the next few days.

Made requested updates from JustEli
@stumper66 stumper66 changed the title v1.14 v1.13.1 Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants