fixes leaves breaking
This commit is contained in:
parent
189d090276
commit
1c36640cb0
@ -9,7 +9,7 @@
|
||||
loader_version=0.14.11
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.19.3.1
|
||||
mod_version = 1.19.3.2
|
||||
maven_group = de.jottyfan.minecraft
|
||||
archives_base_name = quickiefabric
|
||||
|
||||
|
@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
|
||||
import de.jottyfan.minecraft.quickiefabric.help.ClassHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.item.AxeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
@ -36,7 +37,9 @@ public class ToolRangeableAxe extends AxeItem implements ToolRangeable {
|
||||
@Override
|
||||
public boolean canBreakNeighbors(BlockState blockIn) {
|
||||
Class<?> c = blockIn.getBlock().getClass();
|
||||
return super.isSuitableFor(blockIn) || ClassHelper.isInstanceOf(c, "LeavesBlock")
|
||||
return super.isSuitableFor(blockIn)
|
||||
|| blockIn.getBlock() instanceof LeavesBlock // works the old way
|
||||
|| ClassHelper.isInstanceOf(c, "LeavesBlock") // doesn't work, but why?
|
||||
|| ClassHelper.isInstanceOf(c, "ExtendedLeavesBlock"); // from terrestria
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
package de.jottyfan.minecraft.quickiefabric.help;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import de.jottyfan.minecraft.quickiefabric.blocks.BlockCottonplant;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -13,6 +15,11 @@ public class TestClassHelper {
|
||||
|
||||
@Test
|
||||
public void testIsInstanceOf() {
|
||||
ClassHelper.isInstanceOf(BlockCottonplant.class, "Fertilizable");
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user