mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-10-29 20:02:12 +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
|
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)
|
||||||
|
|||||||
6
pom.xml
6
pom.xml
@ -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>
|
||||||
|
|||||||
@ -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() {
|
||||||
|
|||||||
@ -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)) {
|
||||||
|
|||||||
@ -406,23 +406,17 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
final InventoryHolder holder = inventory.getHolder();
|
/* WORLD BLACKLIST CHECK */
|
||||||
|
final Location sourceLocation = event.getSource().getLocation();
|
||||||
if (holder instanceof BrewingStand brewingStand) {
|
if (sourceLocation != null && WorldBlacklist.isWorldBlacklisted(sourceLocation.getWorld())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
|
|
||||||
@ -439,6 +433,14 @@ public class InventoryListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mcMMO.p.getGeneralConfig().getEnabledForHoppers()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final InventoryHolder holder = inventory.getHolder();
|
||||||
|
|
||||||
|
if (holder instanceof BrewingStand brewingStand) {
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
@ -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:
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user