mirror of
https://github.com/songoda/UltimateTimber.git
synced 2025-02-11 09:11:24 +01:00
Merge branch 'development'
This commit is contained in:
commit
0bf1b4c263
@ -1,4 +1,4 @@
|
||||
dependencies {
|
||||
compile project(':UltimateTimber-Core')
|
||||
compileOnly 'org.spigotmc:spigot:1.14'
|
||||
compileOnly 'org.spigotmc:spigot:1.14.4'
|
||||
}
|
||||
|
5
UltimateTimber-Hook/CoreProtect/build.gradle
Normal file
5
UltimateTimber-Hook/CoreProtect/build.gradle
Normal file
@ -0,0 +1,5 @@
|
||||
dependencies {
|
||||
compile project(':UltimateTimber-Core')
|
||||
compileOnly 'org.spigotmc:spigot:1.14.4'
|
||||
compileOnly 'net:coreprotect:2.17.5'
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.songoda.ultimatetimber.hook;
|
||||
|
||||
import com.songoda.ultimatetimber.tree.ITreeBlock;
|
||||
import com.songoda.ultimatetimber.tree.TreeBlockSet;
|
||||
import com.songoda.ultimatetimber.utils.NMSUtil;
|
||||
import net.coreprotect.CoreProtect;
|
||||
import net.coreprotect.CoreProtectAPI;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CoreProtectHook implements TimberHook {
|
||||
|
||||
private CoreProtectAPI api;
|
||||
private boolean useDeprecatedMethod = NMSUtil.getVersionNumber() <= 12;
|
||||
|
||||
public CoreProtectHook() {
|
||||
this.api = CoreProtect.getInstance().getAPI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyExperience(Player player, TreeBlockSet<Block> treeBlocks) {
|
||||
if (!this.api.isEnabled())
|
||||
return;
|
||||
|
||||
for (ITreeBlock<Block> treeBlock : treeBlocks.getAllTreeBlocks()) {
|
||||
if (this.useDeprecatedMethod) {
|
||||
this.api.logRemoval(player.getName(), treeBlock.getLocation(), treeBlock.getBlock().getType(), treeBlock.getBlock().getData());
|
||||
} else {
|
||||
this.api.logRemoval(player.getName(), treeBlock.getLocation(), treeBlock.getBlock().getType(), treeBlock.getBlock().getBlockData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldApplyDoubleDrops(Player player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsingAbility(Player player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
dependencies {
|
||||
compile project(':UltimateTimber-Core')
|
||||
compileOnly 'org.spigotmc:spigot:1.14'
|
||||
compileOnly 'org.spigotmc:spigot:1.14.4'
|
||||
compileOnly 'com.gamingmesh:jobs:4.13.0'
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
dependencies {
|
||||
compile project(':UltimateTimber-Core')
|
||||
compileOnly 'org.spigotmc:spigot:1.14'
|
||||
compileOnly 'org.spigotmc:spigot:1.14.4'
|
||||
compileOnly 'com.gmail.nossr50:mcmmo:2.1.50'
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
dependencies {
|
||||
compile project(':UltimateTimber-Core')
|
||||
compileOnly 'org.spigotmc:spigot:1.14'
|
||||
compileOnly 'org.spigotmc:spigot:1.14.4'
|
||||
compileOnly 'com.gmail.nossr50:mcmmo:1.6.0'
|
||||
}
|
||||
|
@ -13,7 +13,8 @@ dependencies {
|
||||
compile project(':UltimateTimber-McMMOClassic13')
|
||||
compile project(':UltimateTimber-McMMOClassic12')
|
||||
compile project(':UltimateTimber-McMMOClassic8')
|
||||
compileOnly 'org.spigotmc:spigot:1.14'
|
||||
compile project(':UltimateTimber-CoreProtect')
|
||||
compileOnly 'org.spigotmc:spigot:1.14.4'
|
||||
extraLibs 'com.songoda:songodaupdater:1'
|
||||
|
||||
configurations.compileOnly.extendsFrom(configurations.extraLibs)
|
||||
|
@ -2,6 +2,7 @@ package com.songoda.ultimatetimber.manager;
|
||||
|
||||
import com.songoda.ultimatetimber.UltimateTimber;
|
||||
import com.songoda.ultimatetimber.adapter.VersionAdapterType;
|
||||
import com.songoda.ultimatetimber.hook.CoreProtectHook;
|
||||
import com.songoda.ultimatetimber.hook.JobsHook;
|
||||
import com.songoda.ultimatetimber.hook.McMMOClassic12Hook;
|
||||
import com.songoda.ultimatetimber.hook.McMMOClassic13Hook;
|
||||
@ -32,6 +33,7 @@ public class HookManager extends Manager {
|
||||
this.hooks.clear();
|
||||
|
||||
this.tryHook("Jobs", JobsHook.class);
|
||||
this.tryHook("CoreProtect", CoreProtectHook.class);
|
||||
|
||||
if (this.ultimateTimber.getVersionAdapter().getVersionAdapterType().equals(VersionAdapterType.CURRENT)) {
|
||||
Plugin mcMMO = Bukkit.getPluginManager().getPlugin("mcMMO");
|
||||
|
@ -1,7 +1,7 @@
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
group = 'com.songoda.ultimatetimber'
|
||||
version = '2.0.2'
|
||||
version = '2.0.3'
|
||||
}
|
||||
|
||||
subprojects {
|
||||
@ -26,6 +26,7 @@ dependencies {
|
||||
compile project(':UltimateTimber-McMMOClassic13')
|
||||
compile project(':UltimateTimber-McMMOClassic12')
|
||||
compile project(':UltimateTimber-McMMOClassic8')
|
||||
compile project(':UltimateTimber-CoreProtect')
|
||||
compile project(':UltimateTimber-Plugin')
|
||||
}
|
||||
|
||||
|
@ -24,5 +24,8 @@ project(':UltimateTimber-McMMOClassic12').projectDir = file('UltimateTimber-Hook
|
||||
include(':UltimateTimber-McMMOClassic8')
|
||||
project(':UltimateTimber-McMMOClassic8').projectDir = file('UltimateTimber-Hook/McMMOClassic8')
|
||||
|
||||
include(':UltimateTimber-CoreProtect')
|
||||
project(':UltimateTimber-CoreProtect').projectDir = file('UltimateTimber-Hook/CoreProtect')
|
||||
|
||||
include(':UltimateTimber-Plugin')
|
||||
project(':UltimateTimber-Plugin').projectDir = file('UltimateTimber/Plugin')
|
||||
|
Loading…
Reference in New Issue
Block a user