diff --git a/src/main/java/com/reider745/Main.java b/src/main/java/com/reider745/Main.java index 20708694f..e670bc1b3 100644 --- a/src/main/java/com/reider745/Main.java +++ b/src/main/java/com/reider745/Main.java @@ -9,6 +9,7 @@ import com.reider745.event.DispenseBehaviorOverrides; import com.reider745.hooks.*; import com.reider745.hooks.bugfix.DimensionsFix; +import com.reider745.hooks.bugfix.SaplingFix; import com.reider745.network.CraftingTransactionPacket; import com.reider745.network.InnerCorePacket; @@ -55,6 +56,7 @@ public static void main(String[] args) throws Throwable { // bug fix loader.registerHooksInitializationForClass(DimensionsFix.class); + loader.registerHooksInitializationForClass(SaplingFix.class); loader.init(Arrays.stream(args).anyMatch("--debug-hooks"::equals)); loader.run("cn.nukkit.Nukkit", args); diff --git a/src/main/java/com/reider745/hooks/bugfix/SaplingFix.java b/src/main/java/com/reider745/hooks/bugfix/SaplingFix.java new file mode 100644 index 000000000..02e58ee41 --- /dev/null +++ b/src/main/java/com/reider745/hooks/bugfix/SaplingFix.java @@ -0,0 +1,14 @@ +package com.reider745.hooks.bugfix; + +import cn.nukkit.block.BlockSapling; +import com.reider745.api.hooks.HookClass; +import com.reider745.api.hooks.annotation.Hooks; +import com.reider745.api.hooks.annotation.Inject; + +@Hooks(className = "cn.nukkit.block.BlockSapling") +public class SaplingFix implements HookClass { + @Inject + public static boolean isAged(BlockSapling self) { + return true; + } +} diff --git a/src/main/java/com/reider745/item/ItemMethod.java b/src/main/java/com/reider745/item/ItemMethod.java index 4d4958c05..5984d5c3c 100644 --- a/src/main/java/com/reider745/item/ItemMethod.java +++ b/src/main/java/com/reider745/item/ItemMethod.java @@ -72,8 +72,9 @@ public static int getCreativeCategory(int id) { CustomManager manager = getCustomManager(id); if (manager != null) return manager.get(PropertiesNames.CREATIVE_CATEGORY, 1); - Logger.warning("not get CreativeCategory " + id); - return 0; + if(id != 0)//Какова вообще фига? + Logger.warning("not get CreativeCategory " + id); + return 1; } public static int getMaxStackForId(int id, int data) {