Skip to content

Commit

Permalink
Fixed: Рост саженцев
Browse files Browse the repository at this point in the history
- Удален WARN при добалении воздуха в креатив
  • Loading branch information
Reider745 committed Jun 18, 2024
1 parent 1501794 commit 1744971
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/reider745/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/reider745/hooks/bugfix/SaplingFix.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
5 changes: 3 additions & 2 deletions src/main/java/com/reider745/item/ItemMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1744971

Please sign in to comment.