修改ci名字
Some checks failed
Build1.21 / build (push) Failing after 8m35s

This commit is contained in:
expvintl
2024-09-02 02:22:46 +08:00
parent 5a613de1a9
commit e4b2ca67d7
3 changed files with 10 additions and 6 deletions

View File

@ -19,6 +19,7 @@ import net.minecraft.block.BambooShootBlock;
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
@ -66,7 +67,7 @@ public class CAutoToolCommand {
float bestScore=-1;
int slot=-1;
for(int i=0;i<9;i++) {
float score=getWeaponScore(event.player,event.target,i);
float score=getWeaponScore(event.player,i);
if(score<0) continue;
//选出最好分数的工具
if(score>bestScore){
@ -135,13 +136,16 @@ public class CAutoToolCommand {
score+=Utils.GetEnchantLevel(Enchantments.EFFICIENCY,item);
//经验修补
score+=Utils.GetEnchantLevel(Enchantments.MENDING,item);
if (item.getItem() instanceof SwordItem item1 && (state.getBlock() instanceof BambooBlock|| state.getBlock() instanceof BambooShootBlock))
//根据挖掘等级加分
score += 90 + (item1.getComponents().get(DataComponentTypes.TOOL).getSpeed(state) * 10);
if (item.getItem() instanceof SwordItem item1 && (state.getBlock() instanceof BambooBlock|| state.getBlock() instanceof BambooShootBlock)) {
if((item1.getComponents().get(DataComponentTypes.TOOL)!=null)){
//根据挖掘等级加分
score += 90 + (item1.getComponents().get(DataComponentTypes.TOOL).getSpeed(state) * 10);
}
}
}
return score;
}
public float getWeaponScore(PlayerEntity player,Entity target,int slot) {
public float getWeaponScore(PlayerEntity player,int slot) {
float damageScore = 0;
ItemStack item = player.getInventory().getStack(slot);
//剑优先