略微调高无线收发器硬度;添加锁定状态时,挖掘速度为原来的10%
This commit is contained in:
parent
16bae740a1
commit
329e0d2f6c
|
|
@ -31,6 +31,8 @@
|
||||||
- Added version restrictions for MAE2
|
- Added version restrictions for MAE2
|
||||||
- 为部分文本添加翻译键支持,改善国际化体验
|
- 为部分文本添加翻译键支持,改善国际化体验
|
||||||
- Added translation key support for some previously hardcoded text, improving internationalization experience
|
- Added translation key support for some previously hardcoded text, improving internationalization experience
|
||||||
|
- 略微提升无线收发器基础硬度,锁定状态下挖掘速度降至10%
|
||||||
|
- Slightly increased wireless transceiver base hardness, mining speed reduced to 10% when locked
|
||||||
|
|
||||||
### Fixed / 修复
|
### Fixed / 修复
|
||||||
- 修复供应器高亮在服务器中不显示的问题
|
- 修复供应器高亮在服务器中不显示的问题
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.EntityBlock;
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
|
|
@ -154,6 +155,21 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock {
|
||||||
super.onRemove(state, level, pos, newState, isMoving);
|
super.onRemove(state, level, pos, newState, isMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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; // 正常挖掘速度
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) {
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) {
|
||||||
if (level.isClientSide) return null;
|
if (level.isClientSide) return null;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.extendedae_plus.init;
|
package com.extendedae_plus.init;
|
||||||
|
|
||||||
import com.extendedae_plus.ExtendedAEPlus;
|
|
||||||
import com.extendedae_plus.content.wireless.WirelessTransceiverBlock;
|
|
||||||
import com.extendedae_plus.content.matrix.UploadCoreBlock;
|
|
||||||
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
|
||||||
import appeng.block.crafting.CraftingUnitBlock;
|
import appeng.block.crafting.CraftingUnitBlock;
|
||||||
import appeng.blockentity.crafting.CraftingBlockEntity;
|
import appeng.blockentity.crafting.CraftingBlockEntity;
|
||||||
import appeng.core.definitions.AEBlockEntities;
|
import appeng.core.definitions.AEBlockEntities;
|
||||||
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
|
import com.extendedae_plus.content.crafting.EPlusCraftingUnitType;
|
||||||
|
import com.extendedae_plus.content.matrix.UploadCoreBlock;
|
||||||
|
import com.extendedae_plus.content.wireless.WirelessTransceiverBlock;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
import net.minecraft.world.level.material.MapColor;
|
import net.minecraft.world.level.material.MapColor;
|
||||||
|
|
@ -24,7 +24,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