mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-10-29 11:52:22 +00:00
Compare commits
6 Commits
7cf4409c35
...
99f7437d9d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99f7437d9d | ||
|
|
4bfbfa2de7 | ||
|
|
724b66afaa | ||
|
|
6ba4475a77 | ||
|
|
2c1c1fe53f | ||
|
|
ba673a02d0 |
@ -1,4 +1,9 @@
|
||||
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 Repair stripping unsafe enchantments from items (thanks Techirion)
|
||||
Fixed IronGolem causing cast exceptions in rare cases (thanks Techirion)
|
||||
|
||||
6
pom.xml
6
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>2.2.041-SNAPSHOT</version>
|
||||
<version>2.2.042-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.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.platform.version>4.4.1-SNAPSHOT</kyori.adventure.platform.version>
|
||||
<kyori.option.version>1.1.0</kyori.option.version>
|
||||
@ -393,7 +393,7 @@
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.papermc.paper</groupId>-->
|
||||
<!-- <artifactId>paper-api</artifactId>-->
|
||||
<!-- <version>1.21.5-R0.1-SNAPSHOT</version>-->
|
||||
<!-- <version>1.21.8-R0.1-SNAPSHOT</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
|
||||
@ -872,8 +872,8 @@ public class GeneralConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
/* Unarmed */
|
||||
public boolean getUnarmedBlockCrackerSmoothbrickToCracked() {
|
||||
return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true);
|
||||
public boolean isBlockCrackerAllowed() {
|
||||
return config.getBoolean("Skills.Unarmed.Block_Cracker.Allow_Block_Cracker", true);
|
||||
}
|
||||
|
||||
public boolean getUnarmedItemPickupDisabled() {
|
||||
|
||||
@ -696,7 +696,7 @@ public class BlockListener implements Listener {
|
||||
if (mmoPlayer.getUnarmedManager().canUseBlockCracker()
|
||||
&& BlockUtils.affectedByBlockCracker(block)) {
|
||||
if (EventUtils.simulateBlockBreak(block, player)) {
|
||||
mmoPlayer.getUnarmedManager().blockCrackerCheck(block.getState());
|
||||
mmoPlayer.getUnarmedManager().blockCrackerCheck(block);
|
||||
}
|
||||
} else if (!event.getInstaBreak() && SuperAbilityType.BERSERK.blockCheck(block)
|
||||
&& EventUtils.simulateBlockBreak(block, player)) {
|
||||
|
||||
@ -406,39 +406,41 @@ public class InventoryListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
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();
|
||||
|
||||
if (!(inventory instanceof BrewerInventory)) {
|
||||
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();
|
||||
|
||||
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;
|
||||
|
||||
OfflinePlayer offlinePlayer = ContainerMetadataUtils.getContainerOwner(brewingStand);
|
||||
@ -449,8 +451,7 @@ public class InventoryListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (mcMMO.p.getGeneralConfig().getEnabledForHoppers()
|
||||
&& AlchemyPotionBrewer.isValidIngredientByLevel(ingredientLevel, item)) {
|
||||
if (AlchemyPotionBrewer.isValidIngredientByLevel(ingredientLevel, item)) {
|
||||
AlchemyPotionBrewer.scheduleCheck(brewingStand);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.gmail.nossr50.skills.unarmed;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.sounds.SoundManager;
|
||||
import com.gmail.nossr50.util.sounds.SoundType;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -8,8 +7,6 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Unarmed {
|
||||
public static boolean blockCrackerSmoothBrick = mcMMO.p.getGeneralConfig()
|
||||
.getUnarmedBlockCrackerSmoothbrickToCracked();
|
||||
public static double berserkDamageModifier = 1.5;
|
||||
|
||||
public static void handleItemPickup(Player player, EntityPickupItemEvent event) {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.gmail.nossr50.skills.unarmed;
|
||||
|
||||
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.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.skills.RankUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -79,28 +82,33 @@ public class UnarmedManager extends SkillManager {
|
||||
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,
|
||||
mmoPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (blockState.getType()) {
|
||||
switch (block.getType()) {
|
||||
case STONE_BRICKS:
|
||||
if (!Unarmed.blockCrackerSmoothBrick) {
|
||||
return;
|
||||
}
|
||||
|
||||
blockState.getBlock().setType(Material.CRACKED_STONE_BRICKS);
|
||||
blockState.update(true);
|
||||
block.setType(Material.CRACKED_STONE_BRICKS);
|
||||
return;
|
||||
case INFESTED_STONE_BRICKS:
|
||||
if (!Unarmed.blockCrackerSmoothBrick) {
|
||||
return;
|
||||
}
|
||||
|
||||
blockState.getBlock().setType(Material.INFESTED_CRACKED_STONE_BRICKS);
|
||||
blockState.update(true);
|
||||
block.setType(Material.INFESTED_CRACKED_STONE_BRICKS);
|
||||
return;
|
||||
case DEEPSLATE_BRICKS:
|
||||
block.setType(Material.CRACKED_DEEPSLATE_BRICKS);
|
||||
return;
|
||||
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;
|
||||
default:
|
||||
}
|
||||
|
||||
@ -460,7 +460,7 @@ Skills:
|
||||
Enabled_For_PVE: true
|
||||
Level_Cap: 0
|
||||
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
|
||||
# of your hand. Should item pickup be disabled when your entire inventory - except for your hand - is full?
|
||||
Item_Pickup_Disabled_Full_Inventory: true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user