跟进新版
Some checks failed
Build / build (push) Failing after 7s

This commit is contained in:
expvintl
2025-05-19 04:44:45 +08:00
parent 9365282f2b
commit 64cf681e6d
3 changed files with 19 additions and 16 deletions

View File

@ -12,5 +12,5 @@
</envs>
<shortenClasspath name="ARGS_FILE"/>
<classpathModifications><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-compress\1.27.1\a19151084758e2fbb6b41eddaa88e7b8ff4e6599\commons-compress-1.27.1.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.3\b543467b7ff3c6920539a88ee602d34098628be5\lwjgl-jemalloc-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.mojang\text2speech\1.18.11\e853a12cdd6ba4f4836e8f4bf3b37844a13482b6\text2speech-1.18.11.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpclient\4.5.14\1194890e6f56ec29177673f2f12d0b8e627dec98\httpclient-4.5.14.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.ibm.icu\icu4j\76.1\215f3a8e936d4069344bd75f2b1368fd58112894\icu4j-76.1.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.4.16\51cf043c87253c9f58b539c9f7e44c8894223850\httpcore-4.4.16.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.3\25dd6161988d7e65f71d5065c99902402ee32746\lwjgl-stb-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.3\29589b5f87ed335a6c7e7ee6a5775f81f97ecb84\lwjgl-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\commons-codec\commons-codec\1.17.1\973638b7149d333563584137ebf13a691bb60579\commons-codec-1.17.1.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-freetype\3.3.3\a0db6c84a8becc8ca05f9dbfa985edc348a824c7\lwjgl-freetype-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.3\2f6b0147078396a58979125a4c947664e98293a\lwjgl-opengl-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-tinyfd\3.3.3\82d755ca94b102e9ca77283b9e2dc46d1b15fbe5\lwjgl-tinyfd-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.3\daada81ceb5fc0c291fbfdd4433cb8d9423577f2\lwjgl-openal-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.mojang\patchy\2.2.10\da05971b07cbb379d002cf7eaec6a2048211fefc\patchy-2.2.10.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\commons-logging\commons-logging\1.3.4\b9fc14968d63a8b8a8a2c1885fe3e90564239708\commons-logging-1.3.4.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.mojang\blocklist\1.0.10\5c685c5ffa94c4cd39496c7184c1d122e515ecef\blocklist-1.0.10.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.jcraft\jorbis\0.0.17\8872d22b293e8f5d7d56ff92be966e6dc28ebdc6\jorbis-0.0.17.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.3\efa1eb78c5ccd840e9f329717109b5e892d72f8e\lwjgl-glfw-3.3.3.jar"/></classpathModifications></configuration>
<classpathModifications><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.jcraft\jorbis\0.0.17\8872d22b293e8f5d7d56ff92be966e6dc28ebdc6\jorbis-0.0.17.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.mojang\blocklist\1.0.10\5c685c5ffa94c4cd39496c7184c1d122e515ecef\blocklist-1.0.10.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.ibm.icu\icu4j\73.2\61ad4ef7f9131fcf6d25c34b817f90d6da06c9e9\icu4j-73.2.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.3\b543467b7ff3c6920539a88ee602d34098628be5\lwjgl-jemalloc-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.3\29589b5f87ed335a6c7e7ee6a5775f81f97ecb84\lwjgl-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.3\daada81ceb5fc0c291fbfdd4433cb8d9423577f2\lwjgl-openal-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.4.16\51cf043c87253c9f58b539c9f7e44c8894223850\httpcore-4.4.16.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.mojang\patchy\2.2.10\da05971b07cbb379d002cf7eaec6a2048211fefc\patchy-2.2.10.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpclient\4.5.13\e5f6cae5ca7ecaac1ec2827a9e2d65ae2869cada\httpclient-4.5.13.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.3\efa1eb78c5ccd840e9f329717109b5e892d72f8e\lwjgl-glfw-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-freetype\3.3.3\a0db6c84a8becc8ca05f9dbfa985edc348a824c7\lwjgl-freetype-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\com.mojang\text2speech\1.17.9\3cad216e3a7f0c19b4b394388bc9ffc446f13b14\text2speech-1.17.9.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.3\2f6b0147078396a58979125a4c947664e98293a\lwjgl-opengl-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\commons-codec\commons-codec\1.16.0\4e3eb3d79888d76b54e28b350915b5dc3919c9de\commons-codec-1.16.0.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.3\25dd6161988d7e65f71d5065c99902402ee32746\lwjgl-stb-3.3.3.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\commons-logging\commons-logging\1.2\4bfc12adfe4842bf07b657f0369c4cb522955686\commons-logging-1.2.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-compress\1.26.0\659feffdd12280201c8aacb8f7be94f9a883c824\commons-compress-1.26.0.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-tinyfd\3.3.3\82d755ca94b102e9ca77283b9e2dc46d1b15fbe5\lwjgl-tinyfd-3.3.3.jar"/></classpathModifications></configuration>
</component>

View File

@ -2,15 +2,15 @@
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.5
yarn_mappings=1.21.5+build.1
loader_version=0.16.12
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21
yarn_mappings=1.21+build.9
loader_version=0.16.0
#Fabric api
fabric_version=0.119.9+1.21.5
#Fabric api
fabric_version=0.100.8+1.21
# Mod Properties
mod_version = 1.0
maven_group = com.expvintl
archives_base_name = MCTools
mod_version = 1.0
maven_group = com.expvintl
archives_base_name = MCTools

View File

@ -15,6 +15,7 @@ import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.block.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.AttributeModifiersComponent;
import net.minecraft.enchantment.Enchantments;
@ -75,7 +76,7 @@ public class CAutoToolCommand {
if(FeaturesSettings.INSTANCE.autoToolIncludePlayer.getValue()&&event.target.isPlayer()) return;
float bestScore=-1;
int slot=-1;
for(int i=0;i<PlayerInventory.HOTBAR_SIZE;i++) {
for(int i=0;i<PlayerInventory.getHotbarSize();i++) {
ItemStack item = event.player.getInventory().getStack(i);
if(!isSwordItem(item.getItem())&&!isToolItem(item.getItem())) continue;
float score=getWeaponScore(event.target, item);
@ -91,7 +92,7 @@ public class CAutoToolCommand {
//低耐久测试
if(!isLowDurability(currentItem)) {
//切换过去
event.player.getInventory().setSelectedSlot(slot);
event.player.getInventory().selectedSlot=slot;
MinecraftClient mc=MinecraftClient.getInstance();
if(mc.interactionManager!=null) {
((ClientPlayerInteractionManagerAccessor) mc.interactionManager).syncSelectedSlot();
@ -105,7 +106,9 @@ public class CAutoToolCommand {
//自动工具
MinecraftClient mc=MinecraftClient.getInstance();
if (mc.world == null||mc.player==null) return;
if(mc.player.getGameMode() != GameMode.SURVIVAL) return; //跳过不符合条件的游戏模式
PlayerListEntry entry=mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid());
if(entry==null) return;
if(entry.getGameMode() != GameMode.SURVIVAL) return; //跳过不符合条件的游戏模式
BlockState state= mc.world.getBlockState(event.blockPos);
//跳过不可破坏
if(state.getHardness(mc.world, event.blockPos) < 0) return;
@ -114,7 +117,7 @@ public class CAutoToolCommand {
//工具槽
int slot=-1;
//遍历每一个物品槽
for(int i = 0; i< PlayerInventory.HOTBAR_SIZE; i++){
for(int i = 0; i< PlayerInventory.getHotbarSize(); i++){
ItemStack item = mc.player.getInventory().getStack(i);
float score= getToolsScore(item,state);
if(score<=0) continue;
@ -129,7 +132,7 @@ public class CAutoToolCommand {
//确定已经选择好了工具就切换
if(!isLowDurability(currentItem)) {
//切换过去
mc.player.getInventory().setSelectedSlot(slot);
mc.player.getInventory().selectedSlot=slot;
if(mc.interactionManager!=null) {
((ClientPlayerInteractionManagerAccessor) mc.interactionManager).syncSelectedSlot();
}
@ -227,7 +230,7 @@ public class CAutoToolCommand {
AttributeModifiersComponent comp=item.getOrDefault(DataComponentTypes.ATTRIBUTE_MODIFIERS, AttributeModifiersComponent.DEFAULT);
final float[] damageHolder = {0.0f};
BiConsumer<RegistryEntry<EntityAttribute>, EntityAttributeModifier> baseDamage=(attentry, modify)->{
if(attentry.matches(EntityAttributes.ATTACK_DAMAGE)){
if(attentry.matches(EntityAttributes.GENERIC_ATTACK_DAMAGE)){
//计算基础伤害
damageHolder [0]= (float)modify.value();
}