2024/11/02

Fix some little bug
Add areaTalk Command
This commit is contained in:
叁玖领域 2024-11-02 23:25:06 +08:00
parent 867a79f96b
commit 93e5d73fa4
4 changed files with 4 additions and 3 deletions

View File

@ -54,6 +54,7 @@ runs {
client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
server {

View File

@ -50,7 +50,7 @@ public class CommonEventHandler {
}
if (entity instanceof LivingEntity living) {
MobEffectInstance effect = living.getEffect(ModEffectRegister.NO_LEASH_EFFECT);
if(effect != null && effect.getDuration() > 0){
if(effect != null && effect.getDuration() != 0){
if (entity instanceof PlayerLeashable player) {
if (player.getLeashHolder() != null) {
if (player.getLeashHolder() instanceof LeashRopeArrow arrow)

View File

@ -212,7 +212,7 @@ public class LeashRopeArrow extends AbstractArrow {
hitOnEntityHandler(entity);
if(this.getOwner() instanceof LivingEntity livingEntity ) {
MobEffectInstance effect = livingEntity.getEffect(ModEffectRegister.NO_LEASH_EFFECT);
if(effect != null && effect.getDuration() > 0) {
if(effect != null && effect.getDuration() != 0) {
this.setOwner(null);
}
}

View File

@ -204,7 +204,7 @@ public abstract class MixinPlayer extends LivingEntity implements PlayerLeashabl
float leashLengthSelf = iEntityExtension.getLeashLength();
leashLength = leashLengthSelf > LeashCommand.MIN_VALUE ? leashLengthSelf : LeashCommand.MIN_VALUE;
MobEffectInstance effect = this.getEffect(ModEffectRegister.NO_LEASH_EFFECT);
if(effect != null && effect.getDuration() > 0) {
if(effect != null && effect.getDuration() != 0) {
if (entity instanceof LeashRopeArrow arrow)
arrow.setOwner(null);
this.dropLeash(true, !(entity instanceof LeashRopeArrow));