1.0.1
This commit is contained in:
1 parent
3de3a4b831
commit
958948a642
17 files changed
+239
-207
No files matched your search
+147
-2
@@ -1,17 +1,162 @@
|
||||
package com.craisinlord.antarchy.content.block;
|
||||
|
||||
import com.craisinlord.antarchy.content.entity.UpwardFallingBlockEntity;
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.item.FallingBlockEntity;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.ScaffoldingBlock;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
public class AntimetalScaffoldingBlock extends ScaffoldingBlock {
|
||||
|
||||
public static final MapCodec<AntimetalScaffoldingBlock> CODEC = simpleCodec(AntimetalScaffoldingBlock::new);
|
||||
public static final BooleanProperty INVERTED = BooleanProperty.create("inverted");
|
||||
|
||||
// @Override
|
||||
// public MapCodec<AntimetalScaffoldingBlock> codec() { return CODEC; }
|
||||
private static final VoxelShape MIRRORED_STABLE_SHAPE;
|
||||
private static final VoxelShape MIRRORED_UNSTABLE_SHAPE;
|
||||
|
||||
static {
|
||||
VoxelShape frame = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
|
||||
VoxelShape post1 = Block.box(0.0D, 0.0D, 0.0D, 2.0D, 16.0D, 2.0D);
|
||||
VoxelShape post2 = Block.box(14.0D, 0.0D, 0.0D, 16.0D, 16.0D, 2.0D);
|
||||
VoxelShape post3 = Block.box(0.0D, 0.0D, 14.0D, 2.0D, 16.0D, 16.0D);
|
||||
VoxelShape post4 = Block.box(14.0D, 0.0D, 14.0D, 16.0D, 16.0D, 16.0D);
|
||||
MIRRORED_STABLE_SHAPE = Shapes.or(frame, post1, post2, post3, post4);
|
||||
|
||||
VoxelShape topSlab = Block.box(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D);
|
||||
VoxelShape edge1 = Block.box(0.0D, 14.0D, 0.0D, 2.0D, 16.0D, 16.0D);
|
||||
VoxelShape edge2 = Block.box(14.0D, 14.0D, 0.0D, 16.0D, 16.0D, 16.0D);
|
||||
VoxelShape edge3 = Block.box(0.0D, 14.0D, 0.0D, 16.0D, 16.0D, 2.0D);
|
||||
VoxelShape edge4 = Block.box(0.0D, 14.0D, 14.0D, 16.0D, 16.0D, 16.0D);
|
||||
MIRRORED_UNSTABLE_SHAPE = Shapes.or(topSlab, MIRRORED_STABLE_SHAPE, edge1, edge2, edge3, edge4);
|
||||
}
|
||||
|
||||
public AntimetalScaffoldingBlock(BlockBehaviour.Properties properties) {
|
||||
super(properties);
|
||||
this.registerDefaultState(this.stateDefinition.any()
|
||||
.setValue(DISTANCE, 7)
|
||||
.setValue(WATERLOGGED, false)
|
||||
.setValue(BOTTOM, false)
|
||||
.setValue(INVERTED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder);
|
||||
builder.add(INVERTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
BlockPos pos = context.getClickedPos();
|
||||
Level level = context.getLevel();
|
||||
boolean inverted = context.getPlayer() != null && AntarchyGravityApi.isGravityInverted(context.getPlayer());
|
||||
int distance = getDistance(level, pos, inverted);
|
||||
if (inverted && distance >= 7) {
|
||||
return null;
|
||||
}
|
||||
return this.defaultBlockState()
|
||||
.setValue(WATERLOGGED, level.getFluidState(pos).getType() == Fluids.WATER)
|
||||
.setValue(DISTANCE, distance)
|
||||
.setValue(BOTTOM, antarchy$isBottom(level, pos, distance, inverted))
|
||||
.setValue(INVERTED, inverted);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) {
|
||||
return getDistance(level, pos, state.getValue(INVERTED)) < 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
||||
boolean inverted = state.getValue(INVERTED);
|
||||
int distance = getDistance(level, pos, inverted);
|
||||
BlockState updated = state.setValue(DISTANCE, distance).setValue(BOTTOM, antarchy$isBottom(level, pos, distance, inverted));
|
||||
if (updated.getValue(DISTANCE) == 7) {
|
||||
if (state.getValue(DISTANCE) == 7) {
|
||||
if (inverted) {
|
||||
UpwardFallingBlockEntity.fallUp(level, pos, updated);
|
||||
} else {
|
||||
FallingBlockEntity.fall(level, pos, updated);
|
||||
}
|
||||
} else {
|
||||
level.destroyBlock(pos, true);
|
||||
}
|
||||
} else if (state != updated) {
|
||||
level.setBlock(pos, updated, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
||||
if (!state.getValue(INVERTED)) {
|
||||
return super.getShape(state, level, pos, context);
|
||||
}
|
||||
if (context.isHoldingItem(state.getBlock().asItem())) {
|
||||
return Shapes.block();
|
||||
}
|
||||
return state.getValue(BOTTOM) ? MIRRORED_UNSTABLE_SHAPE : MIRRORED_STABLE_SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected VoxelShape getCollisionShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
|
||||
if (!state.getValue(INVERTED)) {
|
||||
return super.getCollisionShape(state, level, pos, context);
|
||||
}
|
||||
return this.getShape(state, level, pos, context);
|
||||
}
|
||||
|
||||
private static boolean antarchy$isMatchingScaffold(BlockState state, boolean inverted) {
|
||||
return state.getBlock() instanceof AntimetalScaffoldingBlock && state.getValue(INVERTED) == inverted;
|
||||
}
|
||||
|
||||
public static int getDistance(LevelReader level, BlockPos pos, boolean inverted) {
|
||||
Direction supportDirection = inverted ? Direction.UP : Direction.DOWN;
|
||||
BlockPos.MutableBlockPos cursor = pos.mutable().move(supportDirection);
|
||||
BlockState supportNeighbor = level.getBlockState(cursor);
|
||||
int distance = 7;
|
||||
if (antarchy$isMatchingScaffold(supportNeighbor, inverted)) {
|
||||
distance = supportNeighbor.getValue(DISTANCE);
|
||||
} else if (supportNeighbor.isFaceSturdy(level, cursor, supportDirection.getOpposite())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (Direction direction : Direction.Plane.HORIZONTAL) {
|
||||
BlockPos.MutableBlockPos neighborPos = pos.mutable().move(direction);
|
||||
BlockState neighbor = level.getBlockState(neighborPos);
|
||||
if (!antarchy$isMatchingScaffold(neighbor, inverted)) {
|
||||
continue;
|
||||
}
|
||||
distance = Math.min(distance, neighbor.getValue(DISTANCE) + 1);
|
||||
if (distance == 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return distance;
|
||||
}
|
||||
|
||||
private static boolean antarchy$isBottom(LevelReader level, BlockPos pos, int distance, boolean inverted) {
|
||||
if (distance <= 0) {
|
||||
return false;
|
||||
}
|
||||
Direction supportDirection = inverted ? Direction.UP : Direction.DOWN;
|
||||
return !antarchy$isMatchingScaffold(level.getBlockState(pos.relative(supportDirection)), inverted);
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -124,12 +124,15 @@ public class UpwardFallingBlockEntity extends Entity {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
float thicknessMultiplier = switch (state.getValue(PointedDripstoneBlock.THICKNESS)) {
|
||||
float thicknessMultiplier = 1.0F;
|
||||
if (state.hasProperty(PointedDripstoneBlock.THICKNESS)) {
|
||||
thicknessMultiplier = switch (state.getValue(PointedDripstoneBlock.THICKNESS)) {
|
||||
case TIP, TIP_MERGE -> 2.0F;
|
||||
case FRUSTUM -> 1.5F;
|
||||
case MIDDLE -> 1.25F;
|
||||
case BASE -> 1.0F;
|
||||
};
|
||||
}
|
||||
|
||||
return Math.min(baseDamage * thicknessMultiplier, 40.0F);
|
||||
}
|
||||
|
||||
+66
-3
@@ -1,13 +1,76 @@
|
||||
package com.craisinlord.antarchy.content.item;
|
||||
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import com.craisinlord.antarchy.content.block.AntimetalScaffoldingBlock;
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
|
||||
import java.util.List;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.ScaffoldingBlockItem;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class AntimetalScaffoldingItem extends BlockItem {
|
||||
public AntimetalScaffoldingItem(Block block, Properties properties) {
|
||||
public class AntimetalScaffoldingItem extends ScaffoldingBlockItem {
|
||||
public AntimetalScaffoldingItem(Block block, Item.Properties properties) {
|
||||
super(block, properties);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
||||
// tooltipComponents.add(Component.translatable("tooltip.antarchy.antimetal_scaffolding").withStyle(ChatFormatting.DARK_AQUA));
|
||||
// super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
|
||||
// }
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockPlaceContext updatePlacementContext(BlockPlaceContext context) {
|
||||
BlockPos clickedPos = context.getClickedPos();
|
||||
Level level = context.getLevel();
|
||||
BlockState clickedState = level.getBlockState(clickedPos);
|
||||
Block block = this.getBlock();
|
||||
boolean inverted = context.getPlayer() != null && AntarchyGravityApi.isGravityInverted(context.getPlayer());
|
||||
|
||||
if (!clickedState.is(block)) {
|
||||
return AntimetalScaffoldingBlock.getDistance(level, clickedPos, inverted) == 7 ? null : context;
|
||||
}
|
||||
|
||||
Direction awayFromSupport = inverted ? Direction.DOWN : Direction.UP;
|
||||
Direction direction;
|
||||
if (context.isSecondaryUseActive()) {
|
||||
direction = context.isInside() ? context.getClickedFace().getOpposite() : context.getClickedFace();
|
||||
} else {
|
||||
direction = context.getClickedFace() == awayFromSupport ? context.getHorizontalDirection() : awayFromSupport;
|
||||
}
|
||||
|
||||
int steps = 0;
|
||||
BlockPos.MutableBlockPos cursor = clickedPos.mutable().move(direction);
|
||||
|
||||
while (steps < 7) {
|
||||
if (!level.isClientSide && !level.isInWorldBounds(cursor)) {
|
||||
break;
|
||||
}
|
||||
|
||||
BlockState state = level.getBlockState(cursor);
|
||||
if (!state.is(block)) {
|
||||
if (state.canBeReplaced(context)) {
|
||||
return BlockPlaceContext.at(context, cursor, direction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
cursor.move(direction);
|
||||
if (direction.getAxis().isHorizontal()) {
|
||||
steps++;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"multipart": [
|
||||
{ "when": { "bottom": "false" }, "apply": { "model": "antarchy:block/antimetal_scaffolding_stable" } },
|
||||
{ "when": { "bottom": "true" }, "apply": { "model": "antarchy:block/antimetal_scaffolding_unstable" } }
|
||||
{ "when": { "bottom": "false", "inverted": "false" }, "apply": { "model": "antarchy:block/antimetal_scaffolding_stable" } },
|
||||
{ "when": { "bottom": "true", "inverted": "false" }, "apply": { "model": "antarchy:block/antimetal_scaffolding_unstable" } },
|
||||
{ "when": { "bottom": "false", "inverted": "true" }, "apply": { "model": "antarchy:block/antimetal_scaffolding_stable", "x": 180 } },
|
||||
{ "when": { "bottom": "true", "inverted": "true" }, "apply": { "model": "antarchy:block/antimetal_scaffolding_unstable", "x": 180 } }
|
||||
]
|
||||
}
|
||||
@@ -165,6 +165,7 @@
|
||||
"tooltip.antarchy.signal_saving_bulb": "Toggles on/off. Has light level equal to the signal strength stored on it.",
|
||||
"tooltip.antarchy.bluestone_placement": "Places below blocks",
|
||||
"tooltip.antarchy.ceiling_compatible_placement": "Can also be placed on ceilings",
|
||||
"tooltip.antarchy.antimetal_scaffolding": "Acts as normal scaffolding, or inverted scaffolding while your gravity is flipped",
|
||||
"block.antarchy.bile": "Bile",
|
||||
"block.antarchy.ichor": "Ichor",
|
||||
"block.antarchy.antiwater": "Antiwater",
|
||||
|
||||
@@ -2,75 +2,5 @@
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "antarchy:item/basilisk_dagger"
|
||||
},
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [
|
||||
0,
|
||||
90,
|
||||
0
|
||||
],
|
||||
"translation": [
|
||||
0,
|
||||
4.0,
|
||||
0.5
|
||||
],
|
||||
"scale": [
|
||||
0.85,
|
||||
0.85,
|
||||
0.85
|
||||
]
|
||||
},
|
||||
"thirdperson_lefthand": {
|
||||
"rotation": [
|
||||
0,
|
||||
-90,
|
||||
0
|
||||
],
|
||||
"translation": [
|
||||
0,
|
||||
4.0,
|
||||
0.5
|
||||
],
|
||||
"scale": [
|
||||
0.85,
|
||||
0.85,
|
||||
0.85
|
||||
]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [
|
||||
0,
|
||||
90,
|
||||
25
|
||||
],
|
||||
"translation": [
|
||||
1.13,
|
||||
3.2,
|
||||
1.13
|
||||
],
|
||||
"scale": [
|
||||
0.68,
|
||||
0.68,
|
||||
0.68
|
||||
]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
"rotation": [
|
||||
0,
|
||||
-90,
|
||||
-25
|
||||
],
|
||||
"translation": [
|
||||
1.13,
|
||||
3.2,
|
||||
1.13
|
||||
],
|
||||
"scale": [
|
||||
0.68,
|
||||
0.68,
|
||||
0.68
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 276 B |
Binary file not shown.
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 250 B |
@@ -4,7 +4,7 @@
|
||||
"pattern": [
|
||||
"UGN",
|
||||
"UCT",
|
||||
" T"
|
||||
" BT"
|
||||
],
|
||||
"key": {
|
||||
"U": {
|
||||
@@ -21,6 +21,9 @@
|
||||
},
|
||||
"C": {
|
||||
"item": "minecraft:comparator"
|
||||
},
|
||||
"B": {
|
||||
"item": "antarchy:bluestone_comparator"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"tag": "c:ingots/netherite"
|
||||
},
|
||||
"C": {
|
||||
"item": "minecraft:comparator"
|
||||
"item": "antarchy:bluestone_comparator"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
|
||||
@@ -59,8 +59,7 @@
|
||||
"creature_spawn_probability": 0.04,
|
||||
"spawners": {
|
||||
"monster": [
|
||||
{ "type": "antarchy:missile_squid", "weight": 12, "minCount": 1, "maxCount": 3 },
|
||||
{ "type": "antarchy:octopus_bomb", "weight": 4, "minCount": 1, "maxCount": 2 }
|
||||
{ "type": "antarchy:missile_squid", "weight": 12, "minCount": 1, "maxCount": 3 }
|
||||
],
|
||||
"creature": [
|
||||
{ "type": "minecraft:turtle", "weight": 5, "minCount": 1, "maxCount": 2 }
|
||||
@@ -68,7 +67,9 @@
|
||||
"ambient": [],
|
||||
"axolotls": [],
|
||||
"underground_water_creature": [],
|
||||
"water_creature": [],
|
||||
"water_creature": [
|
||||
{ "type": "antarchy:octopus_bomb", "weight": 4, "minCount": 1, "maxCount": 2 }
|
||||
],
|
||||
"water_ambient": [
|
||||
{ "type": "minecraft:tropical_fish", "weight": 20, "minCount": 4, "maxCount": 8 }
|
||||
],
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package com.craisinlord.antarchy.fabric.item;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ScaffoldingBlockItem;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
public final class AntimetalScaffoldingItem extends ScaffoldingBlockItem {
|
||||
public AntimetalScaffoldingItem(Block block, Item.Properties properties) {
|
||||
super(block, properties);
|
||||
}
|
||||
}
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
package com.craisinlord.antarchy.fabric.mixin;
|
||||
import com.craisinlord.antarchy.fabric.registry.AntarchyFabricBlocks;
|
||||
|
||||
import com.craisinlord.antarchy.fabric.AntarchyFabricContent;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.item.FallingBlockEntity;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.ScaffoldingBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ScaffoldingBlock.class)
|
||||
public abstract class AntimetalScaffoldingMixin {
|
||||
@Inject(method = "getStateForPlacement", at = @At("HEAD"), cancellable = true)
|
||||
private void antarchy$antimetalPlacement(BlockPlaceContext context, CallbackInfoReturnable<BlockState> cir) {
|
||||
if (!antarchy$isAntimetalScaffolding()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockPos pos = context.getClickedPos();
|
||||
Level level = context.getLevel();
|
||||
int distance = antarchy$getDistance(level, pos);
|
||||
BlockState state = ((ScaffoldingBlock) (Object) this).defaultBlockState()
|
||||
.setValue(ScaffoldingBlock.WATERLOGGED, level.getFluidState(pos).getType().isSame(net.minecraft.world.level.material.Fluids.WATER))
|
||||
.setValue(ScaffoldingBlock.DISTANCE, distance)
|
||||
.setValue(ScaffoldingBlock.BOTTOM, antarchy$isBottom(level, pos, distance));
|
||||
cir.setReturnValue(state);
|
||||
}
|
||||
|
||||
@Inject(method = "canSurvive", at = @At("HEAD"), cancellable = true)
|
||||
private void antarchy$antimetalCanSurvive(BlockState state, LevelReader level, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (!antarchy$isAntimetalScaffolding()) {
|
||||
return;
|
||||
}
|
||||
|
||||
cir.setReturnValue(antarchy$getDistance(level, pos) < 7);
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
|
||||
private void antarchy$antimetalTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random, CallbackInfo ci) {
|
||||
if (!antarchy$isAntimetalScaffolding()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int distance = antarchy$getDistance(level, pos);
|
||||
BlockState updated = state.setValue(ScaffoldingBlock.DISTANCE, distance)
|
||||
.setValue(ScaffoldingBlock.BOTTOM, antarchy$isBottom(level, pos, distance));
|
||||
|
||||
if (updated.getValue(ScaffoldingBlock.DISTANCE) == 7) {
|
||||
if (state.getValue(ScaffoldingBlock.DISTANCE) == 7) {
|
||||
FallingBlockEntity.fall(level, pos, updated);
|
||||
} else {
|
||||
level.destroyBlock(pos, true);
|
||||
}
|
||||
} else if (state != updated) {
|
||||
level.setBlock(pos, updated, 3);
|
||||
}
|
||||
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
private boolean antarchy$isAntimetalScaffolding() {
|
||||
return ((ScaffoldingBlock) (Object) this).asItem() == AntarchyFabricBlocks.ANTIMETAL_SCAFFOLDING.get().asItem();
|
||||
}
|
||||
|
||||
private int antarchy$getDistance(BlockGetter level, BlockPos pos) {
|
||||
BlockPos.MutableBlockPos cursor = pos.mutable().move(Direction.DOWN);
|
||||
BlockState below = level.getBlockState(cursor);
|
||||
int distance = 7;
|
||||
if (below.is((ScaffoldingBlock) (Object) this)) {
|
||||
distance = below.getValue(ScaffoldingBlock.DISTANCE) + 1;
|
||||
} else if (below.isFaceSturdy(level, cursor, Direction.UP)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (Direction direction : Direction.Plane.HORIZONTAL) {
|
||||
BlockPos.MutableBlockPos neighborPos = pos.mutable().move(direction);
|
||||
BlockState neighbor = level.getBlockState(neighborPos);
|
||||
if (!neighbor.is((ScaffoldingBlock) (Object) this)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
distance = Math.min(distance, neighbor.getValue(ScaffoldingBlock.DISTANCE) + 1);
|
||||
if (distance == 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return distance;
|
||||
}
|
||||
|
||||
private boolean antarchy$isBottom(BlockGetter level, BlockPos pos, int distance) {
|
||||
if (distance <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !level.getBlockState(pos.below()).is((ScaffoldingBlock) (Object) this);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -18,7 +18,7 @@ import com.craisinlord.antarchy.content.item.BasiliskDaggerItem;
|
||||
import com.craisinlord.antarchy.content.item.BigBerthaItem;
|
||||
import com.craisinlord.antarchy.content.item.KrakensGraspItem;
|
||||
import com.craisinlord.antarchy.content.item.AntimetalBlockItem;
|
||||
import com.craisinlord.antarchy.fabric.item.AntimetalScaffoldingItem;
|
||||
import com.craisinlord.antarchy.content.item.AntimetalScaffoldingItem;
|
||||
import com.craisinlord.antarchy.content.item.CloudSharkFinSoupItem;
|
||||
import com.craisinlord.antarchy.content.item.CorneaEarItem;
|
||||
import com.craisinlord.antarchy.content.item.GravityGunItem;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
"WaterlikeFluidLivingEntityMixin",
|
||||
"WaterlikeFluidItemEntityMixin",
|
||||
"AntimetalInversionMixin",
|
||||
"AntimetalScaffoldingMixin",
|
||||
"ElytraStartFlyingMixin",
|
||||
"ElytraFallFlyingMixin",
|
||||
"BloodglassEquipMixin",
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx4G
|
||||
minecraft_version=1.21.1
|
||||
modid=antarchy
|
||||
mod_id=antarchy
|
||||
mod_version=1.0.0
|
||||
mod_version=1.0.1
|
||||
maven_group=com.craisinlord
|
||||
mixin_version=0.15.4+mixin.0.8.7
|
||||
|
||||
|
||||
+6
-1
@@ -1,6 +1,11 @@
|
||||
{
|
||||
"type": "neoforge:add_spawns",
|
||||
"biomes": "#antarchy:octopus_bomb_spawn_biomes",
|
||||
"biomes": [
|
||||
"minecraft:deep_ocean",
|
||||
"minecraft:deep_cold_ocean",
|
||||
"minecraft:deep_lukewarm_ocean",
|
||||
"minecraft:deep_frozen_ocean"
|
||||
],
|
||||
"spawners": [
|
||||
{
|
||||
"type": "antarchy:octopus_bomb",
|
||||
|
||||
Reference in new issue
Block a user