Compare commits

...

6 Commits

Author SHA1 Message Date
nossr50
99f7437d9d back to dev builds 2025-08-23 13:16:59 -07:00
nossr50
4bfbfa2de7 2.2.041 2025-08-23 13:12:58 -07:00
nossr50
724b66afaa expand Block Cracker to other blocks with cracked variants 2025-08-23 13:09:52 -07:00
nossr50
6ba4475a77 Fix Berserk block cracker not functioning Fixes #5207 2025-08-23 13:01:11 -07:00
nossr50
2c1c1fe53f update changelog 2025-08-23 12:38:30 -07:00
Warrior
ba673a02d0
Add early return for brewing stand hopper check (#5208) 2025-08-23 12:37:11 -07:00
8 changed files with 61 additions and 50 deletions

View File

@ -1,4 +1,9 @@
Version 2.2.041 Version 2.2.041
Fixed Berserk failing to crack blocks
Added 'Skills.Unarmed.Block_Cracker.Allow_Block_Cracker' to config.yml
Removed 'SmoothBrick_To_CrackedBrick', it has been replaced by `Allow_Block_Cracker`
Block Cracker can now crack deepslate bricks, deepslate tiles, polished blackstone bricks, and netherbricks
Optimizations for Hoppers & Alchemy (thanks Warriorrrr)
Fixed buckets being consumed by furnaces (thanks RunqRun) Fixed buckets being consumed by furnaces (thanks RunqRun)
Fixed Repair stripping unsafe enchantments from items (thanks Techirion) Fixed Repair stripping unsafe enchantments from items (thanks Techirion)
Fixed IronGolem causing cast exceptions in rare cases (thanks Techirion) Fixed IronGolem causing cast exceptions in rare cases (thanks Techirion)

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.041-SNAPSHOT</version> <version>2.2.042-SNAPSHOT</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>
@ -14,7 +14,7 @@
<properties> <properties>
<!-- <spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>--> <!-- <spigot.version>1.19-R0.1-SNAPSHOT</spigot.version>-->
<spigot.version>1.21.7-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.21.8-R0.1-SNAPSHOT</spigot.version>
<kyori.adventure.version>4.23.0</kyori.adventure.version> <kyori.adventure.version>4.23.0</kyori.adventure.version>
<kyori.adventure.platform.version>4.4.1-SNAPSHOT</kyori.adventure.platform.version> <kyori.adventure.platform.version>4.4.1-SNAPSHOT</kyori.adventure.platform.version>
<kyori.option.version>1.1.0</kyori.option.version> <kyori.option.version>1.1.0</kyori.option.version>
@ -393,7 +393,7 @@
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>io.papermc.paper</groupId>--> <!-- <groupId>io.papermc.paper</groupId>-->
<!-- <artifactId>paper-api</artifactId>--> <!-- <artifactId>paper-api</artifactId>-->
<!-- <version>1.21.5-R0.1-SNAPSHOT</version>--> <!-- <version>1.21.8-R0.1-SNAPSHOT</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>

View File

@ -872,8 +872,8 @@ public class GeneralConfig extends BukkitConfig {
} }
/* Unarmed */ /* Unarmed */
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { public boolean isBlockCrackerAllowed() {
return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); return config.getBoolean("Skills.Unarmed.Block_Cracker.Allow_Block_Cracker", true);
} }
public boolean getUnarmedItemPickupDisabled() { public boolean getUnarmedItemPickupDisabled() {

View File

@ -696,7 +696,7 @@ public class BlockListener implements Listener {
if (mmoPlayer.getUnarmedManager().canUseBlockCracker() if (mmoPlayer.getUnarmedManager().canUseBlockCracker()
&& BlockUtils.affectedByBlockCracker(block)) { && BlockUtils.affectedByBlockCracker(block)) {
if (EventUtils.simulateBlockBreak(block, player)) { if (EventUtils.simulateBlockBreak(block, player)) {
mmoPlayer.getUnarmedManager().blockCrackerCheck(block.getState()); mmoPlayer.getUnarmedManager().blockCrackerCheck(block);
} }
} else if (!event.getInstaBreak() && SuperAbilityType.BERSERK.blockCheck(block) } else if (!event.getInstaBreak() && SuperAbilityType.BERSERK.blockCheck(block)
&& EventUtils.simulateBlockBreak(block, player)) { && EventUtils.simulateBlockBreak(block, player)) {

View File

@ -406,39 +406,41 @@ public class InventoryListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) { public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) {
/* WORLD BLACKLIST CHECK */
if (event.getSource().getLocation() != null) {
if (WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld())) {
return;
}
}
final Inventory inventory = event.getDestination(); final Inventory inventory = event.getDestination();
if (!(inventory instanceof BrewerInventory)) { if (!(inventory instanceof BrewerInventory)) {
return; return;
} }
/* WORLD BLACKLIST CHECK */
final Location sourceLocation = event.getSource().getLocation();
if (sourceLocation != null && WorldBlacklist.isWorldBlacklisted(sourceLocation.getWorld())) {
return;
}
ItemStack item = event.getItem();
if (mcMMO.p.getGeneralConfig().getPreventHopperTransferIngredients()
&& item.getType() != Material.POTION && item.getType() != Material.SPLASH_POTION
&& item.getType() != Material.LINGERING_POTION) {
event.setCancelled(true);
return;
}
if (mcMMO.p.getGeneralConfig().getPreventHopperTransferBottles() && (
item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION
|| item.getType() == Material.LINGERING_POTION)) {
event.setCancelled(true);
return;
}
if (!mcMMO.p.getGeneralConfig().getEnabledForHoppers()) {
return;
}
final InventoryHolder holder = inventory.getHolder(); final InventoryHolder holder = inventory.getHolder();
if (holder instanceof BrewingStand brewingStand) { if (holder instanceof BrewingStand brewingStand) {
ItemStack item = event.getItem();
if (mcMMO.p.getGeneralConfig().getPreventHopperTransferIngredients()
&& item.getType() != Material.POTION && item.getType() != Material.SPLASH_POTION
&& item.getType() != Material.LINGERING_POTION) {
event.setCancelled(true);
return;
}
if (mcMMO.p.getGeneralConfig().getPreventHopperTransferBottles() && (
item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION
|| item.getType() == Material.LINGERING_POTION)) {
event.setCancelled(true);
return;
}
int ingredientLevel = 1; int ingredientLevel = 1;
OfflinePlayer offlinePlayer = ContainerMetadataUtils.getContainerOwner(brewingStand); OfflinePlayer offlinePlayer = ContainerMetadataUtils.getContainerOwner(brewingStand);
@ -449,8 +451,7 @@ public class InventoryListener implements Listener {
} }
} }
if (mcMMO.p.getGeneralConfig().getEnabledForHoppers() if (AlchemyPotionBrewer.isValidIngredientByLevel(ingredientLevel, item)) {
&& AlchemyPotionBrewer.isValidIngredientByLevel(ingredientLevel, item)) {
AlchemyPotionBrewer.scheduleCheck(brewingStand); AlchemyPotionBrewer.scheduleCheck(brewingStand);
} }
} }

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.skills.unarmed; package com.gmail.nossr50.skills.unarmed;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType; import com.gmail.nossr50.util.sounds.SoundType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -8,8 +7,6 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public class Unarmed { public class Unarmed {
public static boolean blockCrackerSmoothBrick = mcMMO.p.getGeneralConfig()
.getUnarmedBlockCrackerSmoothbrickToCracked();
public static double berserkDamageModifier = 1.5; public static double berserkDamageModifier = 1.5;
public static void handleItemPickup(Player player, EntityPickupItemEvent event) { public static void handleItemPickup(Player player, EntityPickupItemEvent event) {

View File

@ -1,6 +1,8 @@
package com.gmail.nossr50.skills.unarmed; package com.gmail.nossr50.skills.unarmed;
import static com.gmail.nossr50.util.random.ProbabilityUtil.isSkillRNGSuccessful; import static com.gmail.nossr50.util.random.ProbabilityUtil.isSkillRNGSuccessful;
import static org.bukkit.Material.INFESTED_STONE_BRICKS;
import static org.bukkit.Material.STONE_BRICKS;
import com.gmail.nossr50.api.ItemSpawnReason; import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
@ -21,6 +23,7 @@ import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.random.ProbabilityUtil; import com.gmail.nossr50.util.random.ProbabilityUtil;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.entity.Item; import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
@ -79,28 +82,33 @@ public class UnarmedManager extends SkillManager {
return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER); return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER);
} }
public void blockCrackerCheck(@NotNull BlockState blockState) { public void blockCrackerCheck(@NotNull Block block) {
if (!mcMMO.p.getGeneralConfig().isBlockCrackerAllowed()) {
return;
}
if (!ProbabilityUtil.isNonRNGSkillActivationSuccessful(SubSkillType.UNARMED_BLOCK_CRACKER, if (!ProbabilityUtil.isNonRNGSkillActivationSuccessful(SubSkillType.UNARMED_BLOCK_CRACKER,
mmoPlayer)) { mmoPlayer)) {
return; return;
} }
switch (blockState.getType()) { switch (block.getType()) {
case STONE_BRICKS: case STONE_BRICKS:
if (!Unarmed.blockCrackerSmoothBrick) { block.setType(Material.CRACKED_STONE_BRICKS);
return;
}
blockState.getBlock().setType(Material.CRACKED_STONE_BRICKS);
blockState.update(true);
return; return;
case INFESTED_STONE_BRICKS: case INFESTED_STONE_BRICKS:
if (!Unarmed.blockCrackerSmoothBrick) { block.setType(Material.INFESTED_CRACKED_STONE_BRICKS);
return; return;
} case DEEPSLATE_BRICKS:
block.setType(Material.CRACKED_DEEPSLATE_BRICKS);
blockState.getBlock().setType(Material.INFESTED_CRACKED_STONE_BRICKS); return;
blockState.update(true); case DEEPSLATE_TILES:
block.setType(Material.CRACKED_DEEPSLATE_TILES);
return;
case POLISHED_BLACKSTONE_BRICKS:
block.setType(Material.CRACKED_POLISHED_BLACKSTONE_BRICKS);
return;
case NETHER_BRICKS:
block.setType(Material.CRACKED_NETHER_BRICKS);
return; return;
default: default:
} }

View File

@ -460,7 +460,7 @@ Skills:
Enabled_For_PVE: true Enabled_For_PVE: true
Level_Cap: 0 Level_Cap: 0
Block_Cracker: Block_Cracker:
SmoothBrick_To_CrackedBrick: true Allow_Block_Cracker: true
# When using Unarmed, picked up items will automatically get moved to a free slot instead of going in the slot # When using Unarmed, picked up items will automatically get moved to a free slot instead of going in the slot
# of your hand. Should item pickup be disabled when your entire inventory - except for your hand - is full? # of your hand. Should item pickup be disabled when your entire inventory - except for your hand - is full?
Item_Pickup_Disabled_Full_Inventory: true Item_Pickup_Disabled_Full_Inventory: true