mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-10-29 20:02:12 +00:00
Compare commits
3 Commits
5b67aa04c4
...
61c5ded677
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61c5ded677 | ||
|
|
5c12606e8c | ||
|
|
99e8ae3722 |
@ -1,5 +1,9 @@
|
||||
Version 2.2.035
|
||||
Support for new additions from Minecraft 1.21.5
|
||||
Fixed bug where Blast Mining would not drop deep slate
|
||||
Swords subskill Stab is now configurable in advanced.yml
|
||||
Added 'Skills.Swords.Stab.Base_Damage' to advanced.yml
|
||||
Added 'Skills.Swords.Stab.Per_Rank_Multiplier' to advanced.yml
|
||||
Added 'Bush' to experience.yml for Herbalism
|
||||
Added 'Bush' to config.yml Bonus Drops for Herbalism
|
||||
Added 'Cactus_Flower' to experience.yml for Herbalism
|
||||
@ -14,9 +18,7 @@ Version 2.2.035
|
||||
Added 'Tall_Dry_Grass' to config.yml Bonus Drops for Herbalism
|
||||
Added 'Wildflowers' to experience.yml for Herbalism
|
||||
Added 'Wildflowers' to config.yml Bonus Drops for Herbalism
|
||||
Swords subskill Stab is now configurable in advanced.yml
|
||||
Added 'Skills.Swords.Stab.Base_Damage' to advanced.yml
|
||||
Added 'Skills.Swords.Stab.Per_Rank_Multiplier' to advanced.yml
|
||||
|
||||
|
||||
NOTES:
|
||||
The mob variants will use the "base" mob definition for values for now, such a a warm chicken using chicken values from experience.yml
|
||||
|
||||
9
pom.xml
9
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.2.035-SNAPSHOT</version>
|
||||
<version>2.2.036-SNAPSHOT</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<scm>
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
<properties>
|
||||
<!-- <spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>-->
|
||||
<spigot.version>1.21.4-R0.1-SNAPSHOT</spigot.version>
|
||||
<spigot.version>1.21.5-R0.1-SNAPSHOT</spigot.version>
|
||||
<adventure.version>4.3.5-SNAPSHOT</adventure.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
@ -385,6 +385,11 @@
|
||||
<version>3.0.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.papermc.paper</groupId>-->
|
||||
<!-- <artifactId>paper-api</artifactId>-->
|
||||
<!-- <version>1.21.5-R0.1-SNAPSHOT</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
|
||||
@ -3,6 +3,7 @@ package com.gmail.nossr50.skills.mining;
|
||||
import com.gmail.nossr50.api.ItemSpawnReason;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.experience.XPGainSource;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
@ -35,8 +36,8 @@ import static com.gmail.nossr50.util.Misc.getBlockCenter;
|
||||
|
||||
public class MiningManager extends SkillManager {
|
||||
|
||||
public static final String BUDDING_AMETHYST = "budding_amethyst";
|
||||
public static final Collection<Material> BLAST_MINING_BLACKLIST = Set.of(Material.SPAWNER,
|
||||
private static final String BUDDING_AMETHYST = "budding_amethyst";
|
||||
private static final Collection<Material> BLAST_MINING_BLACKLIST = Set.of(Material.SPAWNER,
|
||||
Material.INFESTED_COBBLESTONE, Material.INFESTED_DEEPSLATE, Material.INFESTED_STONE,
|
||||
Material.INFESTED_STONE_BRICKS, Material.INFESTED_CRACKED_STONE_BRICKS,
|
||||
Material.INFESTED_CHISELED_STONE_BRICKS, Material.INFESTED_MOSSY_STONE_BRICKS);
|
||||
@ -52,17 +53,23 @@ public class MiningManager extends SkillManager {
|
||||
if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DEMOLITIONS_EXPERTISE))
|
||||
return false;
|
||||
|
||||
return getSkillLevel() >= BlastMining.getDemolitionExpertUnlockLevel() && Permissions.demolitionsExpertise(getPlayer());
|
||||
return getSkillLevel() >= BlastMining.getDemolitionExpertUnlockLevel()
|
||||
&& Permissions.demolitionsExpertise(getPlayer());
|
||||
}
|
||||
|
||||
public boolean canDetonate() {
|
||||
Player player = getPlayer();
|
||||
|
||||
return canUseBlastMining() && player.isSneaking()
|
||||
&& (isPickaxe(getPlayer().getInventory().getItemInMainHand()) || player.getInventory().getItemInMainHand().getType() == mcMMO.p.getGeneralConfig().getDetonatorItem())
|
||||
return canUseBlastMining()
|
||||
&& player.isSneaking()
|
||||
&& (isPickaxe(getPlayer().getInventory().getItemInMainHand()) || isDetonatorInHand(player))
|
||||
&& Permissions.remoteDetonation(player);
|
||||
}
|
||||
|
||||
private static boolean isDetonatorInHand(Player player) {
|
||||
return player.getInventory().getItemInMainHand().getType() == mcMMO.p.getGeneralConfig().getDetonatorItem();
|
||||
}
|
||||
|
||||
public boolean canUseBlastMining() {
|
||||
//Not checking permissions?
|
||||
return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BLAST_MINING);
|
||||
@ -76,7 +83,8 @@ public class MiningManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canDoubleDrop() {
|
||||
return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS);
|
||||
return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS)
|
||||
&& Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS);
|
||||
}
|
||||
|
||||
public boolean canMotherLode() {
|
||||
@ -150,8 +158,8 @@ public class MiningManager extends SkillManager {
|
||||
* Detonate TNT for Blast Mining
|
||||
*/
|
||||
public void remoteDetonation() {
|
||||
Player player = getPlayer();
|
||||
Block targetBlock = player.getTargetBlock(BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
|
||||
final Player player = getPlayer();
|
||||
final Block targetBlock = player.getTargetBlock(BlockUtils.getTransparentBlocks(), BlastMining.MAXIMUM_REMOTE_DETONATION_DISTANCE);
|
||||
|
||||
//Blast mining cooldown check needs to be first so the player can be messaged
|
||||
if (!blastMiningCooldownOver()
|
||||
@ -160,7 +168,7 @@ public class MiningManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class);
|
||||
final TNTPrimed tnt = player.getWorld().spawn(targetBlock.getLocation(), TNTPrimed.class);
|
||||
|
||||
NotificationManager.sendPlayerInformation(player, NotificationType.SUPER_ABILITY, "Mining.Blast.Boom");
|
||||
|
||||
@ -171,7 +179,9 @@ public class MiningManager extends SkillManager {
|
||||
|
||||
mmoPlayer.setAbilityDATS(SuperAbilityType.BLAST_MINING, System.currentTimeMillis());
|
||||
mmoPlayer.setAbilityInformed(SuperAbilityType.BLAST_MINING, false);
|
||||
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(mmoPlayer.getPlayer(), new AbilityCooldownTask(mmoPlayer, SuperAbilityType.BLAST_MINING), (long) SuperAbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
|
||||
mcMMO.p.getFoliaLib().getScheduler().runAtEntityLater(mmoPlayer.getPlayer(),
|
||||
new AbilityCooldownTask(mmoPlayer, SuperAbilityType.BLAST_MINING),
|
||||
(long) SuperAbilityType.BLAST_MINING.getCooldown() * Misc.TICK_CONVERSION_FACTOR);
|
||||
}
|
||||
|
||||
private boolean isInfestedBlock(String material) {
|
||||
@ -190,8 +200,8 @@ public class MiningManager extends SkillManager {
|
||||
|
||||
var increasedYieldFromBonuses = yield + (yield * getOreBonus());
|
||||
// Strip out only stuff that gives mining XP
|
||||
List<Block> ores = new ArrayList<>();
|
||||
List<Block> notOres = new ArrayList<>();
|
||||
final List<Block> ores = new ArrayList<>();
|
||||
final List<Block> notOres = new ArrayList<>();
|
||||
for (Block targetBlock : event.blockList()) {
|
||||
|
||||
if(mcMMO.getUserBlockTracker().isIneligible(targetBlock))
|
||||
@ -200,6 +210,8 @@ public class MiningManager extends SkillManager {
|
||||
if (ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, targetBlock) != 0) {
|
||||
if (BlockUtils.isOre(targetBlock) && !(targetBlock instanceof Container)) {
|
||||
ores.add(targetBlock);
|
||||
} else {
|
||||
notOres.add(targetBlock);
|
||||
}
|
||||
} else {
|
||||
notOres.add(targetBlock);
|
||||
@ -220,6 +232,7 @@ public class MiningManager extends SkillManager {
|
||||
ItemSpawnReason.BLAST_MINING_DEBRIS_NON_ORES); // Initial block that would have been dropped
|
||||
}
|
||||
}
|
||||
|
||||
for (Block block : ores) {
|
||||
// currentOreYield only used for drop calculations for ores
|
||||
float currentOreYield = Math.min(increasedYieldFromBonuses, 3F);
|
||||
@ -256,7 +269,7 @@ public class MiningManager extends SkillManager {
|
||||
|
||||
// Replace the event blocklist with the newYield list
|
||||
event.setYield(0F);
|
||||
applyXpGain(xp, XPGainReason.PVE);
|
||||
applyXpGain(xp, XPGainReason.PVE, XPGainSource.SELF);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user