added continuity to optional modrinth dependencies + made blocks addition possible by placing correct shape on existing frame
This commit is contained in:
@@ -7,6 +7,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
@@ -49,6 +50,29 @@ public abstract class ReFramedDoubleBlock extends ReFramedBlock {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public final <T extends Comparable<T>> boolean matchesAnyOutline(Vec3d hit, BlockPos pos, Property<T> property, T... values) {
|
||||
for (T value : values)
|
||||
if (matchesOutline(hit, pos, property, value)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public <T extends Comparable<T>> boolean matchesOutline(Vec3d hit, BlockPos pos, Property<T> property, T value) {
|
||||
Vec3d rel = BlockHelper.getRelativePos(hit, pos);
|
||||
return BlockHelper.cursorMatchesFace(
|
||||
getOutlineShape(getDefaultState().with(property, value), null, null, null),
|
||||
rel
|
||||
);
|
||||
}
|
||||
|
||||
public <T extends Comparable<T>> boolean matchesShape(Vec3d hit, BlockPos pos, BlockState state, int i) {
|
||||
Vec3d rel = BlockHelper.getRelativePos(hit, pos);
|
||||
return BlockHelper.cursorMatchesFace(
|
||||
getShape(state, i),
|
||||
rel
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransparent(BlockState state, BlockView world, BlockPos pos) {
|
||||
return world.getBlockEntity(pos) instanceof ThemeableBlockEntity framed_entity
|
||||
|
||||
Reference in New Issue
Block a user