Merge branch 'development'

This commit is contained in:
Brianna 2020-12-23 11:46:53 -06:00
commit 7817beb831
6 changed files with 22 additions and 15 deletions

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>UltimateTimber</artifactId> <artifactId>UltimateTimber</artifactId>
<version>2.2</version> <version>2.2.1</version>
<relativePath>../../</relativePath> <relativePath>../../</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>UltimateTimber</artifactId> <artifactId>UltimateTimber</artifactId>
<version>2.2</version> <version>2.2.1</version>
<relativePath>../../</relativePath> <relativePath>../../</relativePath>
</parent> </parent>

View File

@ -12,8 +12,8 @@ import java.util.UUID;
public class ChoppingManager extends Manager { public class ChoppingManager extends Manager {
private Set<UUID> disabledPlayers; private final Set<UUID> disabledPlayers;
private Map<UUID, Boolean> cooldownedPlayers; private final Map<UUID, Boolean> cooldownedPlayers;
private boolean useCooldown; private boolean useCooldown;
private int cooldownAmount; private int cooldownAmount;

View File

@ -385,7 +385,8 @@ public class TreeDefinitionManager extends Manager {
toTry.addAll(this.globalEntireTreeLoot); toTry.addAll(this.globalEntireTreeLoot);
} else { } else {
if (ConfigurationManager.Setting.APPLY_SILK_TOUCH.getBoolean() && hasSilkTouch) { if (ConfigurationManager.Setting.APPLY_SILK_TOUCH.getBoolean() && hasSilkTouch) {
if (McMMOHook.hasWoodcuttingDoubleDrops(player)) if (ConfigurationManager.Setting.HOOKS_APPLY_EXTRA_DROPS.getBoolean()
&& McMMOHook.hasWoodcuttingDoubleDrops(player))
lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock)); lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock));
lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock)); lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock));
} else { } else {
@ -394,7 +395,8 @@ public class TreeDefinitionManager extends Manager {
toTry.addAll(treeDefinition.getLogLoot()); toTry.addAll(treeDefinition.getLogLoot());
toTry.addAll(this.globalLogLoot); toTry.addAll(this.globalLogLoot);
if (treeDefinition.shouldDropOriginalLog()) { if (treeDefinition.shouldDropOriginalLog()) {
if (McMMOHook.hasWoodcuttingDoubleDrops(player)) if (ConfigurationManager.Setting.HOOKS_APPLY_EXTRA_DROPS.getBoolean()
&& McMMOHook.hasWoodcuttingDoubleDrops(player))
lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock)); lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock));
lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock)); lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock));
} }
@ -403,7 +405,8 @@ public class TreeDefinitionManager extends Manager {
toTry.addAll(treeDefinition.getLeafLoot()); toTry.addAll(treeDefinition.getLeafLoot());
toTry.addAll(this.globalLeafLoot); toTry.addAll(this.globalLeafLoot);
if (treeDefinition.shouldDropOriginalLeaf()) { if (treeDefinition.shouldDropOriginalLeaf()) {
if (McMMOHook.hasWoodcuttingDoubleDrops(player)) if (ConfigurationManager.Setting.HOOKS_APPLY_EXTRA_DROPS.getBoolean()
&& McMMOHook.hasWoodcuttingDoubleDrops(player))
lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock)); lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock));
lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock)); lootedItems.addAll(BlockUtils.getBlockDrops(treeBlock));
} }
@ -421,13 +424,15 @@ public class TreeDefinitionManager extends Manager {
continue; continue;
if (treeLoot.hasItem()) { if (treeLoot.hasItem()) {
if (McMMOHook.hasWoodcuttingDoubleDrops(player)) if (ConfigurationManager.Setting.HOOKS_APPLY_EXTRA_DROPS.getBoolean()
&& McMMOHook.hasWoodcuttingDoubleDrops(player))
lootedItems.add(treeLoot.getItem()); lootedItems.add(treeLoot.getItem());
lootedItems.add(treeLoot.getItem()); lootedItems.add(treeLoot.getItem());
} }
if (treeLoot.hasCommand()) { if (treeLoot.hasCommand()) {
if (McMMOHook.hasWoodcuttingDoubleDrops(player)) if (ConfigurationManager.Setting.HOOKS_APPLY_EXTRA_DROPS.getBoolean()
&& McMMOHook.hasWoodcuttingDoubleDrops(player))
lootedCommands.add(treeLoot.getCommand()); lootedCommands.add(treeLoot.getCommand());
lootedCommands.add(treeLoot.getCommand()); lootedCommands.add(treeLoot.getCommand());
} }

View File

@ -139,12 +139,14 @@ public class TreeFallManager extends Manager implements Listener {
if (!isCreative) if (!isCreative)
ItemUtils.addDamage(tool, toolDamage); ItemUtils.addDamage(tool, toolDamage);
McMMOHook.addWoodcutting(player, detectedTree.getDetectedTreeBlocks().getAllTreeBlocks().stream() if (ConfigurationManager.Setting.HOOKS_APPLY_EXPERIENCE.getBoolean()) {
.map(ITreeBlock::getBlock).collect(Collectors.toList())); McMMOHook.addWoodcutting(player, detectedTree.getDetectedTreeBlocks().getAllTreeBlocks().stream()
.map(ITreeBlock::getBlock).collect(Collectors.toList()));
if (!isCreative && JobsHook.isEnabled()) if (!isCreative && JobsHook.isEnabled())
for (ITreeBlock<Block> treeBlock : detectedTree.getDetectedTreeBlocks().getLogBlocks()) for (ITreeBlock<Block> treeBlock : detectedTree.getDetectedTreeBlocks().getLogBlocks())
JobsHook.breakBlock(player, treeBlock.getBlock()); JobsHook.breakBlock(player, treeBlock.getBlock());
}
for (ITreeBlock<Block> treeBlock : detectedTree.getDetectedTreeBlocks().getAllTreeBlocks()) for (ITreeBlock<Block> treeBlock : detectedTree.getDetectedTreeBlocks().getAllTreeBlocks())
LogManager.logRemoval(player, treeBlock.getBlock()); LogManager.logRemoval(player, treeBlock.getBlock());

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>UltimateTimber</artifactId> <artifactId>UltimateTimber</artifactId>
<version>2.2</version> <version>2.2.1</version>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging> <packaging>pom</packaging>