improved leaves cutting

This commit is contained in:
Jottyfan
2023-02-05 21:22:08 +01:00
parent 207d201785
commit 2843712fca
10 changed files with 33 additions and 53 deletions

View File

@ -20,5 +20,6 @@ public class QuickieFabric implements ModInitializer {
RegistryManager.registerFeatures();
RegistryManager.registerContainer();
RegistryManager.registerLootings();
RegistryManager.registerTags();
}
}

View File

@ -1,27 +0,0 @@
package de.jottyfan.minecraft.quickiefabric.help;
/**
*
* @author jotty
*
*/
public class ClassHelper {
/**
* check if c is instance of name
*
* @param c the class
* @param name the name
* @return true or false
*/
public static final Boolean isInstanceOf(Class<?> c, String name) {
Class<?>[] a = c.getInterfaces();
for (Class<?> cl : a) {
String simpleName = cl.getSimpleName();
if (simpleName.equals(name)) {
return true;
}
}
return false;
}
}

View File

@ -42,6 +42,8 @@ import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
@ -290,4 +292,7 @@ public class RegistryManager {
|| id.equals(new Identifier("blocks/tall_grass"));
}
public final static void registerTags() {
TagKey<Item> BLOCKSTACKER = TagKey.of(RegistryKeys.ITEM, new Identifier(QUICKIEFABRIC, "blockstacker"));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -0,0 +1,11 @@
{
"replace": false,
"values": [
"quickiefabric:blockstackereast",
"quickiefabric:blockstackersouth",
"quickiefabric:blockstackerwest",
"quickiefabric:blockstackernorth",
"quickiefabric:blockstackerup",
"quickiefabric:blockstackerdown"
]
}

View File

@ -1,25 +0,0 @@
package de.jottyfan.minecraft.quickiefabric.help;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.HashMap;
import org.junit.Test;
/**
*
* @author jotty
*
*/
public class TestClassHelper {
@Test
public void testIsInstanceOf() {
assertTrue(ClassHelper.isInstanceOf(new HashMap<String, Integer>().getClass(), "Cloneable"));
assertTrue(ClassHelper.isInstanceOf(new HashMap<String, Integer>().getClass(), "Map"));
assertTrue(ClassHelper.isInstanceOf(new HashMap<String, Integer>().getClass(), "Serializable"));
assertTrue(ClassHelper.isInstanceOf(HashMap.class, "Cloneable"));
assertTrue(ClassHelper.isInstanceOf(HashMap.class, "Map"));
assertTrue(ClassHelper.isInstanceOf(HashMap.class, "Serializable"));
}
}