细节调整

This commit is contained in:
17146 2024-10-21 15:23:39 +08:00
parent 7df6f559a7
commit 0d93444a98
6 changed files with 10 additions and 9 deletions

View file

@ -355,7 +355,7 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
} }
} }
this.onHitEntity(entity, entityHitResult.isHeadshot(), entityHitResult.isLegshot()); this.onHitEntity(entity, entityHitResult.isHeadshot(), entityHitResult.isLegShot());
entity.invulnerableTime = 0; entity.invulnerableTime = 0;
} }
} }

View file

@ -6,7 +6,6 @@ import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag; import net.minecraft.nbt.Tag;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
@ -185,7 +184,7 @@ public class ModVariables {
@SubscribeEvent @SubscribeEvent
public static void onAttachCapabilities(AttachCapabilitiesEvent<Entity> event) { public static void onAttachCapabilities(AttachCapabilitiesEvent<Entity> event) {
if (event.getObject() instanceof Player && !(event.getObject() instanceof FakePlayer)) if (event.getObject() instanceof Player && !(event.getObject() instanceof FakePlayer))
event.addCapability(new ResourceLocation(ModUtils.MODID, "player_variables"), new PlayerVariablesProvider()); event.addCapability(ModUtils.loc("player_variables"), new PlayerVariablesProvider());
} }
private final PlayerVariables playerVariables = new PlayerVariables(); private final PlayerVariables playerVariables = new PlayerVariables();

View file

@ -8,18 +8,19 @@ import net.minecraft.world.phys.EntityHitResult;
*/ */
public class ExtendedEntityRayTraceResult extends EntityHitResult { public class ExtendedEntityRayTraceResult extends EntityHitResult {
private final boolean headshot; private final boolean headshot;
private final boolean legshot; private final boolean legShot;
public ExtendedEntityRayTraceResult(ProjectileEntity.EntityResult result) { public ExtendedEntityRayTraceResult(ProjectileEntity.EntityResult result) {
super(result.getEntity(), result.getHitPos()); super(result.getEntity(), result.getHitPos());
this.headshot = result.isHeadshot(); this.headshot = result.isHeadshot();
this.legshot = result.isLegShot(); this.legShot = result.isLegShot();
} }
public boolean isHeadshot() { public boolean isHeadshot() {
return this.headshot; return this.headshot;
} }
public boolean isLegshot() {
return this.legshot; public boolean isLegShot() {
return this.legShot;
} }
} }

View file

@ -2,7 +2,7 @@ package net.mcreator.superbwarfare.tools;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
//from Botania // From Botania
public final class ItemNBTTool { public final class ItemNBTTool {
public static boolean verifyExistence(ItemStack stack, String tag) { public static boolean verifyExistence(ItemStack stack, String tag) {
return !stack.isEmpty() && stack.getOrCreateTag().contains(tag); return !stack.isEmpty() && stack.getOrCreateTag().contains(tag);

View file

@ -5,6 +5,6 @@ import net.minecraft.world.item.Rarity;
public class RarityTool { public class RarityTool {
public static final Rarity LEGENDARY = Rarity.create("target_legendary", ChatFormatting.GOLD); public static final Rarity LEGENDARY = Rarity.create("superbwarfare_legendary", ChatFormatting.GOLD);
} }

View file

@ -7,6 +7,7 @@ import net.minecraft.world.entity.projectile.ProjectileUtil;
import net.minecraft.world.phys.*; import net.minecraft.world.phys.*;
public class TraceTool { public class TraceTool {
public static Entity findLookingEntity(Entity player, double entityReach) { public static Entity findLookingEntity(Entity player, double entityReach) {
double distance = entityReach * entityReach; double distance = entityReach * entityReach;
Vec3 eyePos = player.getEyePosition(1.0f); Vec3 eyePos = player.getEyePosition(1.0f);