mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2024-11-29 12:45:14 +01:00
Fix LogBlock integration
This commit is contained in:
parent
221adfa7bb
commit
cc8d142ad9
@ -29,10 +29,10 @@ public class LogBlockBarrel {
|
||||
private static Method queueChestAccess;
|
||||
|
||||
static {
|
||||
if (P.use1_13) {
|
||||
if (!P.use1_13) {
|
||||
try {
|
||||
rawData = BukkitUtils.class.getDeclaredMethod("rawData", ItemStack.class);
|
||||
queueChestAccess = Consumer.class.getDeclaredMethod("queueChestAccess", String.class, Location.class, int.class, short.class, short.class);
|
||||
queueChestAccess = Consumer.class.getDeclaredMethod("queueChestAccess", String.class, Location.class, int.class, short.class, short.class, short.class);
|
||||
} catch (NoSuchMethodException e) {
|
||||
P.p.errorLog("Failed to hook into LogBlock to log barrels. Logging barrel contents is not going to work.");
|
||||
P.p.errorLog("Brewery was tested with version 1.12 to 1.13.1 of LogBlock.");
|
||||
@ -59,7 +59,7 @@ public class LogBlockBarrel {
|
||||
}
|
||||
final ItemStack[] diff = compareInventories(items, after);
|
||||
for (final ItemStack item : diff) {
|
||||
if (P.use1_13) {
|
||||
if (!P.use1_13) {
|
||||
try {
|
||||
queueChestAccess.invoke(consumer, player.getName(), loc, LegacyUtil.getBlockTypeIdAt(loc), (short) item.getType().getId(), (short) item.getAmount(), (short) rawData.invoke(null, item));
|
||||
} catch(IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
||||
@ -101,7 +101,7 @@ public class LogBlockBarrel {
|
||||
if (!isLogging(spigotLoc.getWorld(), Logging.CHESTACCESS)) return;
|
||||
final ItemStack[] items = compressInventory(contents);
|
||||
for (final ItemStack item : items) {
|
||||
if (P.use1_13) {
|
||||
if (!P.use1_13) {
|
||||
try {
|
||||
queueChestAccess.invoke(consumer, playerName, spigotLoc, LegacyUtil.getBlockTypeIdAt(spigotLoc), (short) item.getType().getId(), (short) (item.getAmount() * -1), rawData.invoke(null, item));
|
||||
} catch(IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user