This commit is contained in:
nossr50 2024-05-04 10:26:43 -07:00
parent 75561350c1
commit 5ba6305ad4
10 changed files with 122 additions and 45 deletions

View File

@ -1,11 +1,16 @@
Version 2.2.007 Version 2.2.007
Compatibility with the 1.20.5 / 1.20.6 MC Update Compatibility with the 1.20.5 / 1.20.6 MC Update
Fixed bug where Alchemy was not brewing certain potions (haste, etc) Fixed bug where Alchemy was not brewing certain potions (haste, etc)
Tree Feller no longer restricts how many saplings can drop
Tree Feller now drops leaves 25% of the time (up from 10%)
Alchemy XP has been DRAMATICALLY increased, it was extremely grindy by default
Alchemy experience values in experience.yml are now found under 'Experience_Values.Alchemy.Potion_Brewing'
Fixed bug where the probability of success of Graceful Roll was not being calculated correctly Fixed bug where the probability of success of Graceful Roll was not being calculated correctly
Added armadillo to combat experience in experience.yml
Fixed bug where Green Thumb did not replant if seed was in the off hand Fixed bug where Green Thumb did not replant if seed was in the off hand
Added armadillo to combat experience in experience.yml
NOTES: NOTES:
While fixing various Alchemy bugs, I noticed Alchemy leveled SUPER slow, I have increased it dramatically. Feel free to change it back by modifying the new values in experience.yml
I did my best to keep mcMMO compatible with older versions of Minecraft for this update. I did my best to keep mcMMO compatible with older versions of Minecraft for this update.
This update to MC was quite large, with breaking changes to a lot of code relating to Alchemy, and some other things. This update to MC was quite large, with breaking changes to a lot of code relating to Alchemy, and some other things.
I expect there to be bugs, please report them on GitHub or Discord, but preferably GitHub. I expect there to be bugs, please report them on GitHub or Discord, but preferably GitHub.

18
pom.xml
View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId> <groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId> <artifactId>mcMMO</artifactId>
<version>2.2.007-SNAPSHOT</version> <version>2.2.007</version>
<name>mcMMO</name> <name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url> <url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm> <scm>
@ -304,37 +304,37 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId> <artifactId>adventure-text-serializer-gson</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId> <artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json</artifactId> <artifactId>adventure-text-serializer-json</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json-legacy-impl</artifactId> <artifactId>adventure-text-serializer-json-legacy-impl</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId> <artifactId>adventure-api</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId> <artifactId>adventure-nbt</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId> <artifactId>adventure-key</artifactId>
<version>4.15.0</version> <version>4.16.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
@ -375,7 +375,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version> <version>1.20.5-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -467,7 +467,7 @@ public class ExperienceConfig extends BukkitConfig {
/* Alchemy */ /* Alchemy */
public double getPotionXP(PotionStage stage) { public double getPotionXP(PotionStage stage) {
return config.getDouble("Experience_Values.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); return config.getDouble("Experience_Values.Alchemy.Potion_Brewing.Stage_" + stage.toNumerical(), 10D);
} }
/* Archery */ /* Archery */

View File

@ -95,6 +95,7 @@ public class mcMMO extends JavaPlugin {
private static ChatManager chatManager; private static ChatManager chatManager;
private static CommandManager commandManager; //ACF private static CommandManager commandManager; //ACF
private static TransientEntityTracker transientEntityTracker; private static TransientEntityTracker transientEntityTracker;
// private static ProtocolLibManager protocolLibManager;
private SkillTools skillTools; private SkillTools skillTools;
@ -364,6 +365,9 @@ public class mcMMO extends JavaPlugin {
if(getServer().getPluginManager().getPlugin("WorldGuard") != null) { if(getServer().getPluginManager().getPlugin("WorldGuard") != null) {
WorldGuardManager.getInstance().registerFlags(); WorldGuardManager.getInstance().registerFlags();
} }
// ProtocolLib
// protocolLibManager = new ProtocolLibManager(this);
} }
/** /**
@ -825,4 +829,8 @@ public class mcMMO extends JavaPlugin {
public @NotNull FoliaLib getFoliaLib() { public @NotNull FoliaLib getFoliaLib() {
return foliaLib; return foliaLib;
} }
// public ProtocolLibManager getProtocolLibManager() {
// return protocolLibManager;
// }
} }

View File

@ -0,0 +1,36 @@
//package com.gmail.nossr50.protocollib;
//
//import com.comphenix.protocol.PacketType;
//import com.comphenix.protocol.ProtocolLibrary;
//import com.comphenix.protocol.ProtocolManager;
//import com.comphenix.protocol.events.ListenerPriority;
//import com.comphenix.protocol.events.PacketAdapter;
//import com.comphenix.protocol.events.PacketContainer;
//import com.comphenix.protocol.events.PacketEvent;
//import com.gmail.nossr50.mcMMO;
//import org.bukkit.entity.Player;
//
//public class ProtocolHandler {
// private final mcMMO pluginRef;
// private final ProtocolManager protocolManager;
//
// public ProtocolHandler(mcMMO pluginRef) {
// this.pluginRef = pluginRef;
// this.protocolManager = ProtocolLibrary.getProtocolManager();
// // TODO: encapsulate this in a method
// protocolManager.addPacketListener(new PacketAdapter(pluginRef, ListenerPriority.NORMAL, PacketType.Play.Server.WINDOW_DATA) {
// @Override
// public void onPacketSending(PacketEvent event) {
// Player player = event.getPlayer();
// PacketContainer packet = event.getPacket();
// if (packet.getIntegers().read(0) == 400) {
// event.setCancelled(true);
// }
// }
// });
// }
// public void sendPacketToPlayer(Player player) {
// final PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.WINDOW_DATA);
// protocolManager.sendServerPacket(player, packet);
// }
//}

View File

@ -1,18 +1,40 @@
package com.gmail.nossr50.protocollib; //package com.gmail.nossr50.protocollib;
//
import com.gmail.nossr50.mcMMO; //import com.gmail.nossr50.mcMMO;
import org.bukkit.plugin.Plugin; //import org.bukkit.Bukkit;
//import org.bukkit.entity.Player;
// TODO: Finish this class //import org.bukkit.plugin.Plugin;
public class ProtocolLibManager { //
Plugin protocolLibPluginRef; //public class ProtocolLibManager {
mcMMO pluginRef; // final Plugin protocolLibPluginRef;
public ProtocolLibManager(mcMMO pluginRef) { // final mcMMO pluginRef;
this.pluginRef = pluginRef; // final ProtocolHandler protocolHandler;
} //
// public ProtocolLibManager(mcMMO pluginRef) {
public boolean isProtocolLibPresent() { // this.pluginRef = pluginRef;
protocolLibPluginRef = pluginRef.getServer().getPluginManager().getPlugin("ProtocolLib"); //
return protocolLibPluginRef != null; // if (isProtocolLibPresent()) {
} // protocolLibPluginRef = pluginRef.getServer().getPluginManager().getPlugin("ProtocolLib");
} // protocolHandler = new ProtocolHandler(pluginRef);
// pluginRef.getLogger().info("ProtocolLib found, enabling ProtocolLib features.");
// } else {
// protocolLibPluginRef = null;
// protocolHandler = null;
// pluginRef.getLogger().info("No ProtocolLib found, some completely optional cosmetic features will not be enabled.");
// }
// }
//
// public boolean usingProtocolLib() {
// return protocolLibPluginRef != null && protocolHandler != null;
// }
//
// private boolean isProtocolLibPresent() {
// return Bukkit.getServer().getPluginManager().getPlugin("ProtocolLib") != null;
// }
//
// public void sendPacketToPlayer(Player player) {
// if (usingProtocolLib()) {
// protocolHandler.sendPacketToPlayer(player);
// }
// }
//}

View File

@ -178,7 +178,7 @@ public final class AlchemyPotionBrewer {
PotionStage potionStage = PotionStage.getPotionStage(input, output); PotionStage potionStage = PotionStage.getPotionStage(input, output);
// Update player alchemy skills or effects based on brewing success // Update player alchemy skills or effects based on brewing success
if (UserManager.hasPlayerDataKey(player)) { if (UserManager.getPlayer(player) != null) {
UserManager.getPlayer(player).getAlchemyManager().handlePotionBrewSuccesses(potionStage, 1); UserManager.getPlayer(player).getAlchemyManager().handlePotionBrewSuccesses(potionStage, 1);
} }
} }

View File

@ -323,9 +323,13 @@ public class WoodcuttingManager extends SkillManager {
//Bonus Drops / Harvest lumber checks //Bonus Drops / Harvest lumber checks
processBonusDropCheck(blockState); processBonusDropCheck(blockState);
} else if (BlockUtils.isNonWoodPartOfTree(blockState)) { } else if (BlockUtils.isNonWoodPartOfTree(blockState)) {
// 90% of the time do not drop leaf blocks // 75% of the time do not drop leaf blocks
if (ThreadLocalRandom.current().nextInt(100) > 90) { if (blockState.getType().getKey().getKey().toLowerCase().contains("sapling")
Misc.spawnItemsFromCollection(getPlayer(), Misc.getBlockCenter(blockState), block.getDrops(itemStack), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK); || ThreadLocalRandom.current().nextInt(100) > 75) {
Misc.spawnItemsFromCollection(getPlayer(),
Misc.getBlockCenter(blockState),
block.getDrops(itemStack),
ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
} }
//Drop displaced non-woodcutting XP blocks //Drop displaced non-woodcutting XP blocks

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.util; package com.gmail.nossr50.util;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
@ -404,7 +405,7 @@ public class PotionUtil {
try { try {
PotionType potionType = (PotionType) methodPotionMetaGetBasePotionType.invoke(potionMeta); PotionType potionType = (PotionType) methodPotionMetaGetBasePotionType.invoke(potionMeta);
List<PotionEffectType> potionEffectTypeList = (List<PotionEffectType>) methodPotionTypeGetPotionEffects.invoke(potionType); List<PotionEffectType> potionEffectTypeList = (List<PotionEffectType>) methodPotionTypeGetPotionEffects.invoke(potionType);
return potionEffectTypeList != null || !potionEffectTypeList.isEmpty(); return potionEffectTypeList != null && !potionEffectTypeList.isEmpty();
} catch (IllegalAccessException | InvocationTargetException ex) { } catch (IllegalAccessException | InvocationTargetException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }

View File

@ -239,17 +239,18 @@ Experience_Values:
# FeatherFall_Multiplier: Multiply Acrobatics XP by this value when wearing boots with the Feather Fall enchant # FeatherFall_Multiplier: Multiply Acrobatics XP by this value when wearing boots with the Feather Fall enchant
FeatherFall_Multiplier: 2.0 FeatherFall_Multiplier: 2.0
Alchemy: Alchemy:
# Alchemy potion stages are based on the number of ingredients added Potion_Brewing:
# Potion_Stage_1 represents a base potion # Alchemy potion stages are based on the number of ingredients added
# Potion_Stage_2 represents a base potion with one ingredient # Stage_1 represents a base potion
# Potion_Stage_3 represents a base potion with one ingredient and one amplifier # Stage_2 represents a base potion with one ingredient
# Potion_Stage_4 represents a base potion with one ingredient and two amplifiers # Stage_3 represents a base potion with one ingredient and one amplifier
# Potion_Stage_5 represents a base potion with one ingredient where the amplifiers are swapped # Stage_4 represents a base potion with one ingredient and two amplifiers
Potion_Stage_1: 15 # Stage_5 represents a base potion with one ingredient where the amplifiers are swapped
Potion_Stage_2: 30 Stage_1: 120
Potion_Stage_3: 60 Stage_2: 240
Potion_Stage_4: 120 Stage_3: 480
Potion_Stage_5: 0 Stage_4: 960
Stage_5: 0
Archery: Archery:
Distance_Multiplier: 0.025 Distance_Multiplier: 0.025
Fishing: Fishing: