Compare commits
5 Commits
1.21
...
0c00184c92
Author | SHA1 | Date | |
---|---|---|---|
0c00184c92 | |||
b79d28ac4f | |||
470e79e3bd | |||
d8c271b246 | |||
1d6b3db118 |
2
.idea/runConfigurations/Minecraft_Server.xml
generated
2
.idea/runConfigurations/Minecraft_Server.xml
generated
@ -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.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>
|
||||
<classpathModifications><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-opengl\3.3.2\ee8e95be0b438602038bc1f02dc5e3d011b1b216\lwjgl-opengl-3.3.2.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-compress\1.22\691a8b4e6cf4248c3bc72c8b719337d5cb7359fa\commons-compress-1.22.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\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.lwjgl\lwjgl-openal\3.3.2\ae5357ed6d934546d3533993ea84c0cfb75eed95\lwjgl-openal-3.3.2.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.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.2\757920418805fb90bfebb3d46b1d9e7669fca2eb\lwjgl-glfw-3.3.2.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\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.lwjgl\lwjgl\3.3.2\4421d94af68e35dcaa31737a6fc59136a1e61b94\lwjgl-3.3.2.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.lwjgl\lwjgl-jemalloc\3.3.2\877e17e39ebcd58a9c956dc3b5b777813de0873a\lwjgl-jemalloc-3.3.2.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\a2550795014d622b686e9caac50b14baa87d2c70\lwjgl-stb-3.3.2.jar"/><entry exclude="true" path="C:\Users\expvintl\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-tinyfd\3.3.2\9f65c248dd77934105274fcf8351abb75b34327c\lwjgl-tinyfd-3.3.2.jar"/></classpathModifications></configuration>
|
||||
</component>
|
@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21
|
||||
yarn_mappings=1.21+build.9
|
||||
minecraft_version=1.20.4
|
||||
yarn_mappings=1.20.4+build.3
|
||||
loader_version=0.16.0
|
||||
|
||||
#Fabric api
|
||||
fabric_version=0.100.8+1.21
|
||||
fabric_version=0.97.2+1.20.4
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0
|
||||
|
@ -6,21 +6,12 @@ import com.expvintl.mctools.modules.CameraZoom;
|
||||
import com.expvintl.mctools.modules.PlayerListTextLatency;
|
||||
import com.expvintl.mctools.texthud.MCInfo;
|
||||
import com.expvintl.mctools.texthud.PotionInfo;
|
||||
import com.expvintl.mctools.utils.Utils;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Colors;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
|
||||
public class MCToolsClient implements ClientModInitializer {
|
||||
|
@ -6,31 +6,28 @@ import com.expvintl.mctools.events.player.PlayerAttackBlockEvent;
|
||||
import com.expvintl.mctools.events.player.PlayerAttackEntityEvent;
|
||||
import com.expvintl.mctools.mixin.interfaces.ClientPlayerInteractionManagerAccessor;
|
||||
import com.expvintl.mctools.utils.CommandUtils;
|
||||
import com.expvintl.mctools.utils.Utils;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.BoolArgumentType;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.BambooBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
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.EnchantmentHelper;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.attribute.EntityAttribute;
|
||||
import net.minecraft.entity.attribute.EntityAttributeModifier;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.registry.tag.EntityTypeTags;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.world.GameMode;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.Collection;
|
||||
|
||||
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
|
||||
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
|
||||
@ -43,9 +40,9 @@ public class CAutoToolCommand {
|
||||
dispatcher.register(
|
||||
literal("cautotool")
|
||||
.then(argument("开关", BoolArgumentType.bool())
|
||||
.executes(CAutoToolCommand::execute)
|
||||
.then(argument("包含玩家",BoolArgumentType.bool())
|
||||
.executes(CAutoToolCommand::execute))));
|
||||
.executes(CAutoToolCommand::execute)
|
||||
.then(argument("包含玩家",BoolArgumentType.bool())
|
||||
.executes(CAutoToolCommand::execute))));
|
||||
}
|
||||
|
||||
private static int execute(CommandContext<FabricClientCommandSource> context) {
|
||||
@ -62,12 +59,13 @@ public class CAutoToolCommand {
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
|
||||
// @Subscribe
|
||||
// @Subscribe
|
||||
// private void onBreakBlock(PlayerBreakBlockEvent event){
|
||||
// if(!Globals.autoTool.get()) return;
|
||||
// MinecraftClient mc=MinecraftClient.getInstance();
|
||||
// if (mc.world == null||mc.player==null) return;
|
||||
// }
|
||||
|
||||
@Subscribe
|
||||
private void onAttackEntity(PlayerAttackEntityEvent event){
|
||||
if(!FeaturesSettings.INSTANCE.autoTool.getValue()) return;
|
||||
@ -76,7 +74,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.getHotbarSize();i++) {
|
||||
for(int i=0;i<9;i++) {
|
||||
ItemStack item = event.player.getInventory().getStack(i);
|
||||
if(!isSwordItem(item.getItem())&&!isToolItem(item.getItem())) continue;
|
||||
float score=getWeaponScore(event.target, item);
|
||||
@ -106,9 +104,6 @@ public class CAutoToolCommand {
|
||||
//自动工具
|
||||
MinecraftClient mc=MinecraftClient.getInstance();
|
||||
if (mc.world == null||mc.player==null) 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;
|
||||
@ -117,7 +112,7 @@ public class CAutoToolCommand {
|
||||
//工具槽
|
||||
int slot=-1;
|
||||
//遍历每一个物品槽
|
||||
for(int i = 0; i< PlayerInventory.getHotbarSize(); i++){
|
||||
for(int i=0;i<9;i++){
|
||||
ItemStack item = mc.player.getInventory().getStack(i);
|
||||
float score= getToolsScore(item,state);
|
||||
if(score<=0) continue;
|
||||
@ -190,11 +185,13 @@ public class CAutoToolCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 海晶灯
|
||||
return block == Blocks.GLOWSTONE || // 荧石
|
||||
if (block == Blocks.GLOWSTONE || // 荧石
|
||||
block == Blocks.MELON || // 西瓜
|
||||
block == Blocks.GRAVEL || // 沙砾 (影响燧石掉落概率)
|
||||
block == Blocks.SEA_LANTERN;
|
||||
block == Blocks.SEA_LANTERN){ // 海晶灯
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public float getToolsScore(ItemStack item, BlockState state){
|
||||
float score=0;
|
||||
@ -203,20 +200,20 @@ public class CAutoToolCommand {
|
||||
score+=item.getMiningSpeedMultiplier(state)*2;
|
||||
//附魔加分
|
||||
//耐久
|
||||
score+= Utils.GetEnchantLevel(Enchantments.UNBREAKING, item);
|
||||
score+= EnchantmentHelper.getLevel(Enchantments.UNBREAKING, item);
|
||||
//效率
|
||||
score+=Utils.GetEnchantLevel(Enchantments.EFFICIENCY,item);
|
||||
score+=EnchantmentHelper.getLevel(Enchantments.EFFICIENCY,item);
|
||||
//经验修补
|
||||
score+=Utils.GetEnchantLevel(Enchantments.MENDING,item);
|
||||
score+=EnchantmentHelper.getLevel(Enchantments.MENDING,item);
|
||||
|
||||
if(isBlockFortune(state.getBlock())){
|
||||
score+=Utils.GetEnchantLevel(Enchantments.FORTUNE,item);//时运
|
||||
score+=EnchantmentHelper.getLevel(Enchantments.FORTUNE,item);//时运
|
||||
}
|
||||
|
||||
if (isSwordItem(item.getItem()) && (state.getBlock() instanceof BambooBlock|| state.getBlock() instanceof BambooShootBlock)) {
|
||||
if((item.getItem().getComponents().get(DataComponentTypes.TOOL)!=null)){
|
||||
if (isSwordItem(item.getItem()) && (state.getBlock() instanceof BambooBlock)) {
|
||||
if(item.getItem() instanceof ToolItem tool){
|
||||
//根据挖掘等级加分
|
||||
score += 90 + item.getMiningSpeedMultiplier(state);
|
||||
score += 90 + tool.getMaterial().getMiningSpeedMultiplier();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -227,33 +224,31 @@ public class CAutoToolCommand {
|
||||
//剑优先
|
||||
if (isSwordItem(item.getItem())) damageScore += 100;
|
||||
//计算物品的基础伤害属性(较为复杂)
|
||||
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.GENERIC_ATTACK_DAMAGE)){
|
||||
//计算基础伤害
|
||||
damageHolder [0]= (float)modify.value();
|
||||
Multimap<EntityAttribute, EntityAttributeModifier> modifiers = item.getAttributeModifiers(EquipmentSlot.MAINHAND);
|
||||
Collection<EntityAttributeModifier> damageModifiers = modifiers.get(EntityAttributes.GENERIC_ATTACK_DAMAGE);
|
||||
for (EntityAttributeModifier modifier : damageModifiers) {
|
||||
if (modifier.getOperation() == EntityAttributeModifier.Operation.ADDITION) {
|
||||
damageScore+=(float) modifier.getValue();
|
||||
break;
|
||||
}
|
||||
};
|
||||
comp.applyModifiers(EquipmentSlot.MAINHAND,baseDamage);//计算主手时的伤害
|
||||
damageScore+=damageHolder[0];
|
||||
}
|
||||
//节肢杀手
|
||||
EntityType<?> id=ent.getType();
|
||||
if(id==EntityType.SPIDER||id==EntityType.CAVE_SPIDER||id==EntityType.SILVERFISH||id==EntityType.ENDERMITE||id==EntityType.BEE) {
|
||||
damageScore += Utils.GetEnchantLevel(Enchantments.BANE_OF_ARTHROPODS, item) * 3;
|
||||
damageScore += EnchantmentHelper.getLevel(Enchantments.BANE_OF_ARTHROPODS, item) * 3;
|
||||
}
|
||||
//亡灵杀手(这伤害通常更高)
|
||||
if(ent.getType().isIn(EntityTypeTags.UNDEAD)){
|
||||
damageScore+=Utils.GetEnchantLevel(Enchantments.SMITE,item)*3;// 3倍
|
||||
if(((LivingEntity)ent).getGroup()== EntityGroup.UNDEAD){
|
||||
damageScore+=EnchantmentHelper.getLevel(Enchantments.SMITE,item)*3;// 3倍
|
||||
}
|
||||
//锋利加分
|
||||
damageScore += Utils.GetEnchantLevel(Enchantments.SHARPNESS, item) * 2;
|
||||
damageScore += EnchantmentHelper.getLevel(Enchantments.SHARPNESS, item) * 2;
|
||||
//精修
|
||||
damageScore += Utils.GetEnchantLevel(Enchantments.MENDING, item);
|
||||
damageScore += EnchantmentHelper.getLevel(Enchantments.MENDING, item);
|
||||
//火焰附加
|
||||
damageScore += Utils.GetEnchantLevel(Enchantments.FIRE_ASPECT, item);
|
||||
damageScore += EnchantmentHelper.getLevel(Enchantments.FIRE_ASPECT, item);
|
||||
//击退
|
||||
damageScore += Utils.GetEnchantLevel(Enchantments.KNOCKBACK, item);
|
||||
damageScore += EnchantmentHelper.getLevel(Enchantments.KNOCKBACK, item);
|
||||
return damageScore;
|
||||
}
|
||||
//停用低耐久度
|
||||
@ -269,6 +264,6 @@ public class CAutoToolCommand {
|
||||
item == Items.IRON_AXE || item == Items.IRON_SHOVEL ||
|
||||
item == Items.IRON_HOE;
|
||||
return !(isWooden||isStone||isIron) //忽略木/石/铁工具
|
||||
&&(itemStack.getMaxDamage() - itemStack.getDamage()) < (itemStack.getMaxDamage() * 10 / 100);
|
||||
&&(itemStack.getMaxDamage() - itemStack.getDamage()) < (itemStack.getMaxDamage() * 2 / 100);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package com.expvintl.mctools.commands;
|
||||
import com.expvintl.mctools.utils.PlayerUtils;
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
@ -17,7 +16,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -9,14 +9,14 @@ import net.minecraft.text.Text;
|
||||
|
||||
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
|
||||
|
||||
public class CFullbirghtCommand{
|
||||
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher){
|
||||
public class CFullbirghtCommand {
|
||||
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
|
||||
dispatcher.register(literal("cfullbirght").executes(CFullbirghtCommand::execute));
|
||||
}
|
||||
|
||||
private static int execute(CommandContext<FabricClientCommandSource> context) {
|
||||
((SimpleOptionAccessor)(Object)context.getSource().getClient().options.getGamma()).forceSetValue(32767.0);
|
||||
context.getSource().getPlayer().sendMessage(Text.literal("已应用高亮"),false);
|
||||
((SimpleOptionAccessor) (Object) context.getSource().getClient().options.getGamma()).forceSetValue(32767.0);
|
||||
context.getSource().getPlayer().sendMessage(Text.literal("已应用高亮"), false);
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ package com.expvintl.mctools.events.player;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
public class PlayerAttackEntityEvent {
|
||||
private static final PlayerAttackEntityEvent INSTANCE=new PlayerAttackEntityEvent();
|
||||
|
@ -1,19 +1,15 @@
|
||||
package com.expvintl.mctools.mixin.client;
|
||||
|
||||
import com.expvintl.mctools.modules.CameraZoom;
|
||||
import com.expvintl.mctools.utils.Utils;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(GameRenderer.class)
|
||||
public class GameRendererMixin {
|
||||
@ModifyReturnValue(method = "getFov",at=@At("RETURN"))
|
||||
private float getFov(float origin){
|
||||
return CameraZoom.INSTANCE.isZoom?20.f:origin;
|
||||
private double getFov(double original){
|
||||
return CameraZoom.INSTANCE.isZoom?20.f:original;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package com.expvintl.mctools.mixin.hud;
|
||||
import com.expvintl.mctools.utils.Utils;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReceiver;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.hud.ChatHud;
|
||||
@ -11,7 +10,6 @@ import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(ChatHud.class)
|
||||
public class ChatHudMixin {
|
||||
|
@ -4,12 +4,10 @@ import com.expvintl.mctools.events.MCEventBus;
|
||||
import com.expvintl.mctools.events.item.ItemStackTooltipEvent;
|
||||
import com.expvintl.mctools.utils.Utils;
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -3,8 +3,6 @@ package com.expvintl.mctools.modules;
|
||||
import com.expvintl.mctools.events.MCEventBus;
|
||||
import com.expvintl.mctools.events.item.ItemStackTooltipEvent;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class BetterTooltip {
|
||||
public static BetterTooltip INSTANCE=new BetterTooltip();
|
||||
|
@ -2,7 +2,6 @@ package com.expvintl.mctools.modules;
|
||||
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
@ -3,12 +3,10 @@ package com.expvintl.mctools.texthud;
|
||||
import com.expvintl.mctools.utils.DrawUtils;
|
||||
import com.expvintl.mctools.utils.Utils;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Colors;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Objects;
|
||||
@ -44,7 +42,7 @@ public class MCInfo {
|
||||
|
||||
return timeString.toString();
|
||||
}
|
||||
public static void drawHUD(DrawContext drawContext, RenderTickCounter v) {
|
||||
public static void drawHUD(DrawContext drawContext, float v) {
|
||||
MinecraftClient mc=MinecraftClient.getInstance();
|
||||
//跳过调试
|
||||
if(mc.getDebugHud().shouldShowDebugHud()||mc.options.hudHidden) return;
|
||||
|
@ -10,7 +10,7 @@ import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import java.util.Collection;
|
||||
|
||||
public class PotionInfo {
|
||||
public static void drawHUD(DrawContext drawContext, RenderTickCounter v) {
|
||||
public static void drawHUD(DrawContext drawContext, float v) {
|
||||
MinecraftClient mc=MinecraftClient.getInstance();
|
||||
//跳过调试
|
||||
if(mc.getDebugHud().shouldShowDebugHud()||mc.options.hudHidden) return;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.expvintl.mctools.utils;
|
||||
|
||||
import com.expvintl.mctools.FeaturesSettings;
|
||||
import com.expvintl.mctools.settingtype.BooleanSetting;
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
|
||||
public class CommandUtils {
|
||||
public static void CreateStatusCommand(String cmd, BooleanSetting setting, CommandDispatcher<FabricClientCommandSource> dispatcher){
|
||||
|
@ -3,8 +3,6 @@ package com.expvintl.mctools.utils;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class PlayerUtils {
|
||||
public static void DropItem(int slot){
|
||||
MinecraftClient mc=MinecraftClient.getInstance();
|
||||
|
@ -2,9 +2,6 @@ package com.expvintl.mctools.utils;
|
||||
|
||||
import com.expvintl.mctools.mixin.interfaces.MinecraftClientAccessor;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
@ -12,28 +9,15 @@ import net.minecraft.client.gui.PlayerSkinDrawer;
|
||||
import net.minecraft.client.gui.hud.ChatHudLine;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.network.PlayerListEntry;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -44,7 +28,7 @@ public class Utils {
|
||||
|
||||
public static String getCurrentDimensionName() {
|
||||
if (mc.world != null) {
|
||||
String dismenName = mc.world.getDimensionEntry().getIdAsString();
|
||||
String dismenName = mc.world.getDimensionKey().getValue().toString();
|
||||
switch (dismenName) {
|
||||
case "minecraft:overworld":
|
||||
return "主世界";
|
||||
@ -199,18 +183,6 @@ public class Utils {
|
||||
return "未知";
|
||||
}
|
||||
|
||||
public static int GetEnchantLevel(RegistryKey<Enchantment> enchantName, ItemStack item){
|
||||
//跳过附魔书
|
||||
if(item.getItem()== Items.ENCHANTED_BOOK) return 0;
|
||||
Set<Object2IntMap.Entry<RegistryEntry<Enchantment>>> enchants=item.getEnchantments().getEnchantmentEntries();
|
||||
for(Object2IntMap.Entry<RegistryEntry<Enchantment>> entry:enchants){
|
||||
//返回找到的附魔等级
|
||||
if(entry.getKey().matchesKey(enchantName)) {
|
||||
return entry.getIntValue();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public static void rightClick() {
|
||||
((MinecraftClientAccessor) mc).doItemUse();
|
||||
}
|
||||
|
@ -21,6 +21,6 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.8.0",
|
||||
"fabric": "*",
|
||||
"minecraft": "~1.21"
|
||||
"minecraft": "~1.20.1"
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "com.expvintl.mctools.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"hud.ChatHudMixin",
|
||||
"hud.PlayerListHudMixin",
|
||||
|
Reference in New Issue
Block a user