Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into tridentsxbows

This commit is contained in:
nossr50 2020-09-01 13:40:01 -07:00
commit 9e5c9ec567
11 changed files with 94 additions and 29 deletions

View File

@ -60,11 +60,33 @@ Version 2.2.000
Notes:
These are the first new skills that I've written for mcMMO in about 9 years, I'll be listening closely to feedback and tweaking them often.
Version 2.1.145
Reverted 'Changed one of the PlayerInteractEvent listeners to ignore cancelled events' from 2.1.144
Version 2.1.144
Steel Arm Style damage is now customizable in advanced.yml (make sure to set override to true)
Fixed a bug where Deflect worked against non-arrow projectiles
Fixed a bug where Deflect was checked twice, resulting in two chances to deflect effectively
Fixed a bug where Roll wouldn't award XP when fall height was over a certain amount
Lowered the XP ceiling of Roll
Fixed a NPE that would happen involving taming in combat processing
Updated hu_HU locale (thanks andris155)
Fixed a bug where mcMMO could erase item data on Wheat Seeds when using Green Thumb on a block
Changed one of the PlayerInteractEvent listeners to ignore cancelled events (should improve plugin compatibility)
mmodebug mode now prints some information when fuel efficiency is applied to a furnace
NOTES:
I seem to consistently find old bugs in mcMMO, this deflect bug where it was checked twice, who knows how many years its been in mcMMO, I didn't check but its probably between 5-7.
I was waiting to make Steel Arm Customizable for the config update (due in the future), but enough people ask for it that I decided to do the extra work to put it into 2.1.XX
Tridents & Crossbows is likely going to be in development continuing into September, I am taking my time to make it feature packed and I hope you guys will appreciate it.
>>>>>>> 2810d36e085d6adaa209a6a119f92504234a0560
Version 2.1.143
mcMMO now tracks super ability boosted items through persistent metadata
mcMMO no longer relies on lore to tell if an item has been modified by a super ability
Slight buff to Rupture (1 more tick duration across all ranks)
Lore no longer gets added to items being buffed by mcMMO
Lore no longer gets added to items being buffed by mcMMO./
NOTES:
The item tracking is persistent for MC versions 1.13-1.16.2 (and beyond). However the code handling the persistence for 1.13.2 differs from the other versions. It shouldn't result in any problems.

View File

@ -981,6 +981,11 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
/* UNARMED */
public boolean isSteelArmDamageCustom() { return config.getBoolean("Skills.Unarmed.SteelArmStyle.Damage_Override", false); }
public double getSteelArmOverride(int rank, double def) {
String key = "Rank_" + rank;
return config.getDouble("Skills.Unarmed.SteelArmStyle.Override." + key, def);
}
public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); }
/* WOODCUTTING */

View File

@ -75,7 +75,7 @@ public class Roll extends AcrobaticsSubSkill {
*/
Player player = (Player) ((EntityDamageEvent) event).getEntity();
if (canRoll(player)) {
entityDamageEvent.setDamage(rollCheck(player, mmoPlayer, entityDamageEvent.getDamage()));
entityDamageEvent.setDamage(rollCheck(player, mmoPlayer, entityDamageEvent.getFinalDamage()));
if (entityDamageEvent.getFinalDamage() == 0) {
entityDamageEvent.setCancelled(true);
@ -119,8 +119,8 @@ public class Roll extends AcrobaticsSubSkill {
String rollChance, rollChanceLucky, gracefulRollChance, gracefulRollChanceLucky;
/* Values related to the player */
PlayerProfile playerProfile = mcMMO.getUserManager().getPlayer(player);
float skillValue = playerProfile.getSkillLevel(getPrimarySkill());
McMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
float skillValue = mmoPlayer.getExperienceManager().getSkillLevel(getPrimarySkill());
boolean isLucky = Permissions.lucky(player, getPrimarySkill());
String[] rollStrings = RandomChanceUtil.calculateAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL);
@ -188,7 +188,7 @@ public class Roll extends AcrobaticsSubSkill {
*/
private double rollCheck(Player player, McMMOPlayer mmoPlayer, double damage) {
int skillLevel = mmoPlayer.getSkillLevel(getPrimarySkill());
int skillLevel = mmoPlayer.getExperienceManager().getSkillLevel(getPrimarySkill());
if (player.isSneaking()) {
return gracefulRollCheck(player, mmoPlayer, damage, skillLevel);
@ -292,7 +292,7 @@ public class Roll extends AcrobaticsSubSkill {
private float calculateRollXP(Player player, double damage, boolean isRoll) {
//Clamp Damage to account for insane DRs
damage = Math.min(40, damage);
damage = Math.min(20, damage);
ItemStack boots = player.getInventory().getBoots();
float xp = (float) (damage * (isRoll ? ExperienceConfig.getInstance().getRollXPModifier() : ExperienceConfig.getInstance().getFallXPModifier()));

View File

@ -412,7 +412,7 @@ public class EntityListener implements Listener {
Player defendingPlayer = (Player) defender;
Player attackingPlayer;
//If the attacker is a Player or a projectile beloning to a player
//If the attacker is a Player or a projectile belonging to a player
if(attacker instanceof Projectile || attacker instanceof Player) {
if(attacker instanceof Projectile) {
Projectile projectile = (Projectile) attacker;
@ -433,7 +433,7 @@ public class EntityListener implements Listener {
UnarmedManager unarmedManager = mmoPlayer.getUnarmedManager();
if (unarmedManager.canDeflect()) {
if (unarmedManager.deflectCheck()) {
if (projectile instanceof Arrow && unarmedManager.deflectCheck()) {
event.setCancelled(true);
return;
}

View File

@ -12,6 +12,7 @@ import com.gmail.nossr50.skills.alchemy.Alchemy;
import com.gmail.nossr50.skills.alchemy.AlchemyPotionBrewer;
import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.worldguard.WorldGuardManager;
import com.gmail.nossr50.worldguard.WorldGuardUtils;
@ -71,7 +72,22 @@ public class InventoryListener implements Listener {
return;
}
boolean debugMode = player.isOnline() && mcMMO.getUserManager().getPlayer(player).isDebugMode();
if(debugMode) {
player.sendMessage("FURNACE FUEL EFFICIENCY DEBUG REPORT");
player.sendMessage("Furnace - "+furnace.hashCode());
player.sendMessage("Furnace Type: "+furnaceBlock.getType().toString());
player.sendMessage("Burn Length before Fuel Efficiency is applied - "+event.getBurnTime());
}
event.setBurnTime(mcMMO.getUserManager().getPlayer(player).getSmeltingManager().fuelEfficiency(event.getBurnTime()));
if(debugMode) {
player.sendMessage("New Furnace Burn Length (after applying fuel efficiency) "+event.getBurnTime());
player.sendMessage("");
}
}
}

View File

@ -155,12 +155,20 @@ public class UnarmedManager extends SkillManager {
public double getSteelArmStyleDamage() {
double rank = RankUtils.getRank(getPlayer(), SubSkillType.UNARMED_STEEL_ARM_STYLE);
double bonus = 0;
if(rank >= 18)
bonus = 1 + rank - 18;
return bonus + 0.5 + (rank / 2);
double finalBonus = bonus + 0.5 + (rank / 2);
if(AdvancedConfig.getInstance().isSteelArmDamageCustom()) {
return AdvancedConfig.getInstance().getSteelArmOverride(RankUtils.getRank(getPlayer(), SubSkillType.UNARMED_STEEL_ARM_STYLE), finalBonus);
} else {
return finalBonus;
}
}
/**

View File

@ -5,8 +5,8 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.compat.layers.attackcooldown.PlayerAttackCooldownExploitPreventionLayer;
import com.gmail.nossr50.util.compat.layers.persistentdata.AbstractPersistentDataLayer;
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer;
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotTemporaryDataLayer;
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_13;
import com.gmail.nossr50.util.compat.layers.persistentdata.SpigotPersistentDataLayer_1_14;
import com.gmail.nossr50.util.nms.NMSVersion;
import com.gmail.nossr50.util.platform.MinecraftGameVersion;
import org.bukkit.command.CommandSender;
@ -67,10 +67,10 @@ public class CompatibilityManager {
private void initPersistentDataLayer() {
if(minecraftGameVersion.getMinorVersion().asInt() >= 14 || minecraftGameVersion.getMajorVersion().asInt() >= 2) {
persistentDataLayer = new SpigotPersistentDataLayer();
persistentDataLayer = new SpigotPersistentDataLayer_1_14();
} else {
persistentDataLayer = new SpigotTemporaryDataLayer();
persistentDataLayer = new SpigotPersistentDataLayer_1_13();
}
supportedLayers.put(CompatibilityType.PERSISTENT_DATA, true);

View File

@ -16,7 +16,7 @@ import java.util.UUID;
/**
* Persistent Data API is unavailable
*/
public class SpigotTemporaryDataLayer extends AbstractPersistentDataLayer {
public class SpigotPersistentDataLayer_1_13 extends AbstractPersistentDataLayer {
private final String FURNACE_OWNER_METADATA_KEY = "mcMMO_furnace_owner";

View File

@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.UUID;
public class SpigotPersistentDataLayer extends AbstractPersistentDataLayer {
public class SpigotPersistentDataLayer_1_14 extends AbstractPersistentDataLayer {
/*
* Don't modify these keys

View File

@ -276,18 +276,6 @@ public final class CombatUtils {
double finalDamage = event.getDamage();
if (target instanceof Player && PrimarySkillType.UNARMED.getPVPEnabled()) {
UnarmedManager unarmedManager = mcMMO.getUserManager().getPlayer((Player) target).getUnarmedManager();
if (unarmedManager.canDeflect()) {
event.setCancelled(unarmedManager.deflectCheck());
if (event.isCancelled()) {
return;
}
}
}
if (archeryManager.canSkillShot()) {
//Not Additive
finalDamage = archeryManager.skillShot(initialDamage);
@ -496,6 +484,11 @@ public final class CombatUtils {
if (target.getType() != EntityType.CREEPER && !Misc.isNPCEntityExcludingVillagers(player) && PrimarySkillType.TAMING.getPermissions(player)) {
McMMOPlayer mmoPlayer = mcMMO.getUserManager().getPlayer(player);
if(mmoPlayer == null) {
return;
}
TamingManager tamingManager = mmoPlayer.getTamingManager();
tamingManager.attackTarget(target);
}

View File

@ -543,11 +543,32 @@ Skills:
Standard: 100
RetroMode: 1000
IronArmStyle:
SteelArmStyle:
# BonusMin: Minimum bonus damage for unarmed
# BonusMax: Maximum bonus damage for unarmed
# IncreaseLevel: Bonus damage increases every increase level
IncreaseLevel: 10
Damage_Override: false
Override:
Rank_1: 1
Rank_2: 1.5
Rank_3: 2.0
Rank_4: 2.5
Rank_5: 3.0
Rank_6: 3.5
Rank_7: 4.0
Rank_8: 4.5
Rank_9: 5.0
Rank_10: 5.5
Rank_11: 6.0
Rank_12: 6.5
Rank_13: 7.0
Rank_14: 7.5
Rank_15: 8.0
Rank_16: 8.5
Rank_17: 9.0
Rank_18: 10.5
Rank_19: 12.0
Rank_20: 13.5
#
# Settings for Woodcutting
###