略微调高无线收发器硬度;添加锁定状态时,挖掘速度为原来的10%
This commit is contained in:
parent
20a7610d50
commit
603d543038
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.level.block.EntityBlock;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.StateDefinition;
|
import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||||
|
|
@ -220,4 +221,19 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock {
|
||||||
}
|
}
|
||||||
super.attack(state, level, pos, player);
|
super.attack(state, level, pos, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getDestroyProgress(BlockState state, Player player, BlockGetter level, BlockPos pos) {
|
||||||
|
// 基础挖掘进度
|
||||||
|
float baseProgress = super.getDestroyProgress(state, player, level, pos);
|
||||||
|
|
||||||
|
// 获取方块实体并检查锁定状态
|
||||||
|
if (level.getBlockEntity(pos) instanceof WirelessTransceiverBlockEntity te) {
|
||||||
|
if (te.isLocked()) {
|
||||||
|
// 如果被锁定,大幅降低挖掘速度
|
||||||
|
return baseProgress * 0.1f; // 只有10%的挖掘速度
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return baseProgress; // 正常挖掘速度
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,17 @@
|
||||||
package com.extendedae_plus.init;
|
package com.extendedae_plus.init;
|
||||||
|
|
||||||
|
import appeng.block.crafting.CraftingUnitBlock;
|
||||||
import com.extendedae_plus.ExtendedAEPlus;
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
import com.extendedae_plus.content.ae2.MirrorPatternProviderBlock;
|
import com.extendedae_plus.content.ae2.MirrorPatternProviderBlock;
|
||||||
import com.extendedae_plus.content.controller.NetworkPatternControllerBlock;
|
import com.extendedae_plus.content.controller.NetworkPatternControllerBlock;
|
||||||
|
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
||||||
|
import com.extendedae_plus.content.decor.DollBlock;
|
||||||
import com.extendedae_plus.content.matrix.CrafterCorePlusBlock;
|
import com.extendedae_plus.content.matrix.CrafterCorePlusBlock;
|
||||||
import com.extendedae_plus.content.matrix.PatternCorePlusBlock;
|
import com.extendedae_plus.content.matrix.PatternCorePlusBlock;
|
||||||
import com.extendedae_plus.content.matrix.SpeedCorePlusBlock;
|
import com.extendedae_plus.content.matrix.SpeedCorePlusBlock;
|
||||||
import com.extendedae_plus.content.matrix.UploadCoreBlock;
|
import com.extendedae_plus.content.matrix.UploadCoreBlock;
|
||||||
import com.extendedae_plus.content.decor.DollBlock;
|
|
||||||
import com.extendedae_plus.content.wireless.LabeledWirelessTransceiverBlock;
|
import com.extendedae_plus.content.wireless.LabeledWirelessTransceiverBlock;
|
||||||
import com.extendedae_plus.content.wireless.WirelessTransceiverBlock;
|
import com.extendedae_plus.content.wireless.WirelessTransceiverBlock;
|
||||||
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
|
||||||
import appeng.block.crafting.CraftingUnitBlock;
|
|
||||||
import appeng.blockentity.crafting.CraftingBlockEntity;
|
|
||||||
import appeng.core.definitions.AEBlockEntities;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
|
|
@ -31,7 +29,7 @@ public final class ModBlocks {
|
||||||
() -> new WirelessTransceiverBlock(
|
() -> new WirelessTransceiverBlock(
|
||||||
BlockBehaviour.Properties.of()
|
BlockBehaviour.Properties.of()
|
||||||
.mapColor(MapColor.METAL)
|
.mapColor(MapColor.METAL)
|
||||||
.strength(1.5F, 6.0F)
|
.strength(2F, 6.0F)
|
||||||
.requiresCorrectToolForDrops()
|
.requiresCorrectToolForDrops()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user