mirror of
https://github.com/songoda/UltimateTimber.git
synced 2024-11-29 05:16:29 +01:00
Add Jobs Reborn hook, add delete log setting, fix some sapling replants
This commit is contained in:
parent
d9f7c60836
commit
319298968f
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "UltimateTimber"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "1.0.12"
|
||||
version: "1.0.13"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
9
pom.xml
9
pom.xml
@ -82,6 +82,13 @@
|
||||
<version>1.5.09</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--Jobs Reborn-->
|
||||
<dependency>
|
||||
<groupId>com.gamingmesh</groupId>
|
||||
<artifactId>jobs</artifactId>
|
||||
<version>4.6.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -15,6 +15,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.songoda.ultimatetimber.commands.CommandHandler;
|
||||
import com.songoda.ultimatetimber.configurations.DefaultConfig;
|
||||
import com.songoda.ultimatetimber.hooks.JobsRebornHook;
|
||||
import com.songoda.ultimatetimber.hooks.McMMOHook;
|
||||
import com.songoda.ultimatetimber.treefall.CustomLoot;
|
||||
import com.songoda.ultimatetimber.treefall.TreeFallAnimation;
|
||||
@ -86,6 +87,17 @@ public class UltimateTimber extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Check for Jobs Reborn
|
||||
*/
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("Jobs")) {
|
||||
if (JobsRebornHook.setEnabled()) {
|
||||
console.sendMessage("Hooks: Hooked into Jobs Reborn");
|
||||
} else {
|
||||
console.sendMessage("Hooks: Unable to hook with Jobs Reborn, the version installed is not supported!");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Register command executor and tab completer
|
||||
*/
|
||||
|
@ -26,6 +26,7 @@ public class DefaultConfig {
|
||||
public static final String PERMISSIONS_ONLY = "Only allow players with the permission node to topple down trees";
|
||||
public static final String VALID_WORLDS = "Valid worlds.";
|
||||
public static final String DAMAGE_PLAYERS = "Damage players when trees fall on them";
|
||||
public static final String DELETE_BROKEN_LOG = "Delete the log that initiated the tree fall";
|
||||
public static final String REPLANT_SAPLING = "Replant sapling when tree is cut down";
|
||||
public static final String REPLANT_FROM_LEAVES = "Fallen leaves have a chance to plant saplings";
|
||||
public static final String CUSTOM_AUDIO = "Use custom sounds for trees falling";
|
||||
@ -49,6 +50,7 @@ public class DefaultConfig {
|
||||
configuration.addDefault(CREATIVE_DISALLOWED, true);
|
||||
configuration.addDefault(PERMISSIONS_ONLY, true);
|
||||
configuration.addDefault(DAMAGE_PLAYERS, true);
|
||||
configuration.addDefault(DELETE_BROKEN_LOG, false);
|
||||
configuration.addDefault(REPLANT_SAPLING, true);
|
||||
configuration.addDefault(REPLANT_FROM_LEAVES, true);
|
||||
configuration.addDefault(CUSTOM_AUDIO, true);
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.songoda.ultimatetimber.hooks;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.actions.BlockActionInfo;
|
||||
import com.gamingmesh.jobs.container.ActionType;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
import com.songoda.ultimatetimber.utils.WoodToLogConverter;
|
||||
|
||||
public class JobsRebornHook {
|
||||
|
||||
private static boolean enabled = false;
|
||||
|
||||
/**
|
||||
* Updates a Player's Woodcutter job based on the number of logs they broke
|
||||
*
|
||||
* @param player The Player to update
|
||||
* @param treeBlocks The tree blocks that were broken
|
||||
*/
|
||||
public static void updateWoodcutterJob(Player player, HashSet<Block> treeBlocks) {
|
||||
if (!enabled) return;
|
||||
if (player.getGameMode().equals(GameMode.CREATIVE)) return;
|
||||
|
||||
try {
|
||||
// Replicate the same code that Jobs Reborn uses
|
||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
||||
if (jPlayer == null)
|
||||
return;
|
||||
|
||||
for (Block log : getLogs(treeBlocks)) {
|
||||
BlockActionInfo bInfo = new BlockActionInfo(log, ActionType.BREAK);
|
||||
Jobs.action(jPlayer, bInfo, log);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Bukkit.getLogger().warning("[UltimateTimber] Warning: The version of Jobs Reborn you are using is not compatible with UltimateTimber. Disabling hook...");
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the hook to enabled
|
||||
*/
|
||||
public static boolean setEnabled() {
|
||||
enabled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Separates out the logs from the rest of the tree blocks
|
||||
*
|
||||
* @param treeBlocks The set of blocks in the tree that was broken
|
||||
* @return A set of the logs in the tree blocks
|
||||
*/
|
||||
private static Set<Block> getLogs(HashSet<Block> treeBlocks) {
|
||||
return treeBlocks.stream().filter(x -> WoodToLogConverter.convert(x.getType()).name().endsWith("LOG")).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +1,8 @@
|
||||
package com.songoda.ultimatetimber.treefall;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
class NoAnimationTreeDestroyer {
|
||||
|
||||
@ -13,33 +10,11 @@ class NoAnimationTreeDestroyer {
|
||||
Only ever triggers when people have tree falling animations off in the config
|
||||
*/
|
||||
static void destroyTree(HashSet<Block> blocks, boolean hasBonusLoot, boolean hasSilkTouch) {
|
||||
Material leavesType = null;
|
||||
|
||||
if (!blocks.stream().filter(b -> b.getType() == Material.BROWN_MUSHROOM_BLOCK).collect(Collectors.toList()).isEmpty()) {
|
||||
leavesType = Material.BROWN_MUSHROOM_BLOCK;
|
||||
} else if (!blocks.stream().filter(b -> b.getType() == Material.RED_MUSHROOM_BLOCK).collect(Collectors.toList()).isEmpty()) {
|
||||
leavesType = Material.RED_MUSHROOM_BLOCK;
|
||||
}
|
||||
|
||||
// Drop loot and plant a new sapling
|
||||
for (Block block : blocks) {
|
||||
TreeLoot.dropTreeLoot(block.getBlockData(), block.getLocation().clone().add(0.5, 0.5, 0.5), hasBonusLoot, hasSilkTouch);
|
||||
|
||||
if (leavesType != null) {
|
||||
TreeReplant.replaceOriginalBlock(block, leavesType);
|
||||
} else {
|
||||
TreeReplant.replaceOriginalBlock(block);
|
||||
}
|
||||
TreeReplant.replaceOriginalBlock(block);
|
||||
}
|
||||
}
|
||||
|
||||
static ItemStack getItem(Material material) {
|
||||
if (material == Material.BROWN_MUSHROOM_BLOCK) {
|
||||
return new ItemStack(Material.BROWN_MUSHROOM, 1);
|
||||
} else if (material == Material.RED_MUSHROOM_BLOCK) {
|
||||
return new ItemStack(Material.RED_MUSHROOM, 1);
|
||||
}
|
||||
return new ItemStack(material, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ public class TreeChecker {
|
||||
private int numLeavesRequiredForTree;
|
||||
private boolean allowMixedTreeTypes;
|
||||
private boolean onlyBreakLogsUpwards;
|
||||
private boolean destroyBaseLog;
|
||||
private boolean isMushroom = false;
|
||||
|
||||
static {
|
||||
@ -129,6 +130,7 @@ public class TreeChecker {
|
||||
this.maxBranchBlocksAllowed = config.getInt(DefaultConfig.MAX_BRANCH_BLOCKS);
|
||||
this.numLeavesRequiredForTree = config.getInt(DefaultConfig.LEAVES_FOR_TREE);
|
||||
this.onlyBreakLogsUpwards = config.getBoolean(DefaultConfig.ONLY_BREAK_LOGS_UPWARDS);
|
||||
this.destroyBaseLog = config.getBoolean(DefaultConfig.DELETE_BROKEN_LOG);
|
||||
|
||||
// Detect tree trunk
|
||||
Set<Block> trunkBlocks = new HashSet<>();
|
||||
@ -159,6 +161,10 @@ public class TreeChecker {
|
||||
if (!this.isMushroom && this.treeBlocks.stream().filter(x -> this.isValidLeafType(x.getType())).count() < this.numLeavesRequiredForTree)
|
||||
return null;
|
||||
|
||||
// Delete the starting block if applicable
|
||||
if (this.destroyBaseLog)
|
||||
this.treeBlocks.remove(block);
|
||||
|
||||
return this.treeBlocks;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class TreeFallAnimation implements Listener, Runnable {
|
||||
fallingBlock.setDropItem(false);
|
||||
registerFallingBlock(fallingBlock);
|
||||
|
||||
/*
|
||||
/*
|
||||
Remove original block
|
||||
*/
|
||||
TreeReplant.replaceOriginalBlock(block);
|
||||
|
@ -15,6 +15,7 @@ import com.songoda.ultimatetimber.UltimateTimber;
|
||||
import com.songoda.ultimatetimber.configurations.DefaultConfig;
|
||||
import com.songoda.ultimatetimber.events.TreeFallEvent;
|
||||
import com.songoda.ultimatetimber.events.TreeFellEvent;
|
||||
import com.songoda.ultimatetimber.hooks.JobsRebornHook;
|
||||
import com.songoda.ultimatetimber.hooks.McMMOHook;
|
||||
|
||||
public class TreeFallListener implements Listener {
|
||||
@ -26,15 +27,15 @@ public class TreeFallListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onTreeBreak(BlockBreakEvent event) {
|
||||
|
||||
FileConfiguration fileConfiguration = UltimateTimber.getInstance().getConfig();
|
||||
FileConfiguration config = UltimateTimber.getInstance().getConfig();
|
||||
|
||||
Block block = event.getBlock();
|
||||
|
||||
if (block != null && block.getType().name().contains("SAPLING") &&
|
||||
fileConfiguration.getBoolean(DefaultConfig.TIMEOUT_BREAK) && TreeReplant.isTimeout(block))
|
||||
config.getBoolean(DefaultConfig.TIMEOUT_BREAK) && TreeReplant.isTimeout(block))
|
||||
event.setCancelled(true);
|
||||
if (!EventFilter.eventIsValid(event)) return;
|
||||
if (fileConfiguration.getBoolean(DefaultConfig.SNEAK_ONLY) && !event.getPlayer().isSneaking()) return;
|
||||
if (config.getBoolean(DefaultConfig.SNEAK_ONLY) && !event.getPlayer().isSneaking()) return;
|
||||
|
||||
if (!UltimateTimber.getInstance().isChopping(event.getPlayer())) return;
|
||||
|
||||
@ -59,15 +60,20 @@ public class TreeFallListener implements Listener {
|
||||
// Do not let any items drop, it will be handled later
|
||||
event.setDropItems(false);
|
||||
|
||||
// Add to mcMMO XP if installed
|
||||
// Remove log if it's enabled
|
||||
if (config.getBoolean(DefaultConfig.DELETE_BROKEN_LOG))
|
||||
TreeReplant.replaceOriginalBlock(block);
|
||||
|
||||
// Add to hooks
|
||||
McMMOHook.updateWoodCuttingSkill(event.getPlayer(), blocks);
|
||||
JobsRebornHook.updateWoodcutterJob(event.getPlayer(), blocks);
|
||||
|
||||
if (fileConfiguration.getBoolean(DefaultConfig.ACCURATE_AXE_DURABILITY))
|
||||
if (config.getBoolean(DefaultConfig.ACCURATE_AXE_DURABILITY))
|
||||
AxeDurability.adjustAxeDamage(blocks, event.getPlayer());
|
||||
if (fileConfiguration.getBoolean(DefaultConfig.CUSTOM_AUDIO))
|
||||
if (config.getBoolean(DefaultConfig.CUSTOM_AUDIO))
|
||||
TreeSounds.tipOverNoise(block.getLocation());
|
||||
|
||||
if (fileConfiguration.getBoolean(DefaultConfig.SHOW_ANIMATION)) {
|
||||
if (config.getBoolean(DefaultConfig.SHOW_ANIMATION)) {
|
||||
TreeFallAnimation treeFallAnimation = new TreeFallAnimation();
|
||||
treeFallAnimation.startAnimation(block, blocks, event.getPlayer());
|
||||
} else {
|
||||
|
@ -1,26 +1,25 @@
|
||||
package com.songoda.ultimatetimber.treefall;
|
||||
|
||||
import com.songoda.ultimatetimber.UltimateTimber;
|
||||
import com.songoda.ultimatetimber.configurations.DefaultConfig;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import com.songoda.ultimatetimber.UltimateTimber;
|
||||
import com.songoda.ultimatetimber.configurations.DefaultConfig;
|
||||
import com.songoda.ultimatetimber.utils.WoodToLogConverter;
|
||||
|
||||
class TreeReplant {
|
||||
|
||||
private static List<Location> timeout = new ArrayList<>();
|
||||
|
||||
static void replaceOriginalBlock(Block block) {
|
||||
|
||||
|
||||
boolean isTimeout = UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.TIMEOUT_BREAK);
|
||||
|
||||
if (!UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.REPLANT_SAPLING)) {
|
||||
@ -29,122 +28,55 @@ class TreeReplant {
|
||||
}
|
||||
|
||||
Material belowBlockType = block.getLocation().clone().subtract(new Vector(0, 1, 0)).getBlock().getType();
|
||||
if (!belowBlockType.equals(Material.DIRT) && !belowBlockType.equals(Material.COARSE_DIRT) && !belowBlockType.equals(Material.PODZOL)) {
|
||||
if (!belowBlockType.equals(Material.DIRT) && !belowBlockType.equals(Material.COARSE_DIRT) && !belowBlockType.equals(Material.PODZOL) && !belowBlockType.equals(Material.GRASS_BLOCK)) {
|
||||
block.setType(Material.AIR);
|
||||
return;
|
||||
}
|
||||
|
||||
Material material = block.getType();
|
||||
|
||||
if (isTimeout) {
|
||||
timeout.add(block.getLocation());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(UltimateTimber.getInstance(), () -> timeout.remove(block.getLocation()), 20 * 5);
|
||||
}
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
switch (material) {
|
||||
case ACACIA_LOG:
|
||||
case STRIPPED_ACACIA_LOG:
|
||||
block.setType(Material.ACACIA_SAPLING);
|
||||
return;
|
||||
case BIRCH_LOG:
|
||||
case STRIPPED_BIRCH_LOG:
|
||||
block.setType(Material.BIRCH_SAPLING);
|
||||
return;
|
||||
case DARK_OAK_LOG:
|
||||
case STRIPPED_DARK_OAK_LOG:
|
||||
block.setType(Material.DARK_OAK_SAPLING);
|
||||
return;
|
||||
case JUNGLE_LOG:
|
||||
case STRIPPED_JUNGLE_LOG:
|
||||
block.setType(Material.JUNGLE_SAPLING);
|
||||
return;
|
||||
case OAK_LOG:
|
||||
case STRIPPED_OAK_LOG:
|
||||
block.setType(Material.OAK_SAPLING);
|
||||
return;
|
||||
case SPRUCE_LOG:
|
||||
case STRIPPED_SPRUCE_LOG:
|
||||
block.setType(Material.SPRUCE_SAPLING);
|
||||
return;
|
||||
case BROWN_MUSHROOM_BLOCK:
|
||||
block.setType(Material.BROWN_MUSHROOM);
|
||||
return;
|
||||
case RED_MUSHROOM_BLOCK:
|
||||
block.setType(Material.RED_MUSHROOM);
|
||||
return;
|
||||
default:
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
}.runTaskLater(UltimateTimber.getInstance(), 1);
|
||||
|
||||
|
||||
Material material = WoodToLogConverter.convert(block.getType());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(UltimateTimber.getInstance(), () -> performReplacement(block, material), 1);
|
||||
}
|
||||
|
||||
static void replaceOriginalBlock(Block block, Material leavesType) {
|
||||
|
||||
boolean isTimeout = UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.TIMEOUT_BREAK);
|
||||
|
||||
if (!UltimateTimber.getInstance().getConfig().getBoolean(DefaultConfig.REPLANT_SAPLING)) {
|
||||
block.setType(Material.AIR);
|
||||
return;
|
||||
|
||||
static void performReplacement(Block block, Material material) {
|
||||
switch (material) {
|
||||
case ACACIA_LOG:
|
||||
case STRIPPED_ACACIA_LOG:
|
||||
block.setType(Material.ACACIA_SAPLING);
|
||||
return;
|
||||
case BIRCH_LOG:
|
||||
case STRIPPED_BIRCH_LOG:
|
||||
block.setType(Material.BIRCH_SAPLING);
|
||||
return;
|
||||
case DARK_OAK_LOG:
|
||||
case STRIPPED_DARK_OAK_LOG:
|
||||
block.setType(Material.DARK_OAK_SAPLING);
|
||||
return;
|
||||
case JUNGLE_LOG:
|
||||
case STRIPPED_JUNGLE_LOG:
|
||||
block.setType(Material.JUNGLE_SAPLING);
|
||||
return;
|
||||
case OAK_LOG:
|
||||
case STRIPPED_OAK_LOG:
|
||||
block.setType(Material.OAK_SAPLING);
|
||||
return;
|
||||
case SPRUCE_LOG:
|
||||
case STRIPPED_SPRUCE_LOG:
|
||||
block.setType(Material.SPRUCE_SAPLING);
|
||||
return;
|
||||
case BROWN_MUSHROOM_BLOCK:
|
||||
block.setType(Material.BROWN_MUSHROOM);
|
||||
return;
|
||||
case RED_MUSHROOM_BLOCK:
|
||||
block.setType(Material.RED_MUSHROOM);
|
||||
return;
|
||||
default:
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
|
||||
if (!block.getLocation().clone().subtract(new Vector(0, 1, 0)).getBlock().getType().equals(Material.DIRT) &&
|
||||
!block.getLocation().clone().subtract(new Vector(0, 1, 0)).getBlock().getType().equals(Material.COARSE_DIRT) && !block.getLocation().clone().subtract(new Vector(0, 1, 0)).getBlock().getType().equals(Material.PODZOL)) {
|
||||
block.setType(Material.AIR);
|
||||
return;
|
||||
}
|
||||
|
||||
Material material = block.getType();
|
||||
|
||||
if (isTimeout) {
|
||||
timeout.add(block.getLocation());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(UltimateTimber.getInstance(), () -> timeout.remove(block.getLocation()), 20 * 5);
|
||||
}
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
switch (material) {
|
||||
case ACACIA_LOG:
|
||||
case STRIPPED_ACACIA_LOG:
|
||||
block.setType(Material.ACACIA_SAPLING);
|
||||
return;
|
||||
case BIRCH_LOG:
|
||||
case STRIPPED_BIRCH_LOG:
|
||||
block.setType(Material.BIRCH_SAPLING);
|
||||
return;
|
||||
case DARK_OAK_LOG:
|
||||
case STRIPPED_DARK_OAK_LOG:
|
||||
block.setType(Material.DARK_OAK_SAPLING);
|
||||
return;
|
||||
case JUNGLE_LOG:
|
||||
case STRIPPED_JUNGLE_LOG:
|
||||
block.setType(Material.JUNGLE_SAPLING);
|
||||
return;
|
||||
case OAK_LOG:
|
||||
case STRIPPED_OAK_LOG:
|
||||
block.setType(Material.OAK_SAPLING);
|
||||
return;
|
||||
case SPRUCE_LOG:
|
||||
case STRIPPED_SPRUCE_LOG:
|
||||
block.setType(Material.SPRUCE_SAPLING);
|
||||
return;
|
||||
default:
|
||||
if (leavesType == Material.BROWN_MUSHROOM_BLOCK) {
|
||||
block.setType(Material.BROWN_MUSHROOM);
|
||||
} else if (leavesType == Material.RED_MUSHROOM_BLOCK) {
|
||||
block.setType(Material.RED_MUSHROOM);
|
||||
} else {
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskLater(UltimateTimber.getInstance(), 1);
|
||||
|
||||
}
|
||||
|
||||
static void leafFallReplant(FallingBlock fallingBlock) {
|
||||
@ -152,7 +84,6 @@ class TreeReplant {
|
||||
Material material;
|
||||
|
||||
switch (fallingBlock.getBlockData().getMaterial()) {
|
||||
|
||||
case ACACIA_LEAVES:
|
||||
material = Material.ACACIA_SAPLING;
|
||||
break;
|
||||
@ -173,7 +104,6 @@ class TreeReplant {
|
||||
break;
|
||||
default:
|
||||
material = null;
|
||||
|
||||
}
|
||||
|
||||
if (material == null) return;
|
||||
@ -182,7 +112,7 @@ class TreeReplant {
|
||||
|
||||
Block block = fallingBlock.getLocation().clone().subtract(new Vector(0, 1, 0)).getBlock();
|
||||
|
||||
if (block.getType().equals(Material.DIRT) || block.getType().equals(Material.COARSE_DIRT) || block.getType().equals(Material.GRASS_BLOCK)) {
|
||||
if (block.getType().equals(Material.DIRT) || block.getType().equals(Material.COARSE_DIRT) || block.getType().equals(Material.PODZOL) || block.getType().equals(Material.GRASS_BLOCK)) {
|
||||
Block blockAbove = block.getLocation().clone().add(new Vector(0, 1, 0)).getBlock();
|
||||
if (blockAbove.getType().equals(Material.AIR))
|
||||
fallingBlock.getLocation().getBlock().setType(material);
|
||||
|
@ -3,7 +3,7 @@ version: maven-version-number
|
||||
author: Songoda
|
||||
main: com.songoda.ultimatetimber.UltimateTimber
|
||||
api-version: 1.13
|
||||
softdepend: [Multiverse-Core, mcMMO]
|
||||
softdepend: [Multiverse-Core, mcMMO, Jobs]
|
||||
commands:
|
||||
ultimatetimber:
|
||||
description: Reloads the configuration file
|
||||
|
Loading…
Reference in New Issue
Block a user