mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 02:25:57 +01:00
Set step height attribute on spawn centrally instead of locally
This commit is contained in:
parent
e78499f6ca
commit
59534df8c0
@ -9,6 +9,7 @@ import java.util.function.Consumer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -46,6 +47,7 @@ import net.citizensnpcs.api.util.DataKey;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.npc.ai.CitizensNavigator;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.AttributeTrait;
|
||||
import net.citizensnpcs.trait.CurrentLocation;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.HologramTrait;
|
||||
@ -390,7 +392,9 @@ public class CitizensNPC extends AbstractNPC {
|
||||
LivingEntity entity = (LivingEntity) getEntity();
|
||||
entity.setRemoveWhenFarAway(false);
|
||||
|
||||
if (NMS.getStepHeight(entity) < 1) {
|
||||
if ((!hasTrait(AttributeTrait.class)
|
||||
|| !getTrait(AttributeTrait.class).hasAttribute(Attribute.GENERIC_STEP_HEIGHT))
|
||||
&& (type == EntityType.PLAYER || Util.isHorse(type))) {
|
||||
NMS.setStepHeight(entity, 1);
|
||||
}
|
||||
if (type == EntityType.PLAYER) {
|
||||
|
@ -241,7 +241,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -218,7 +218,6 @@ public class HorseController extends MobEntityController {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
@ -270,7 +270,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -278,7 +278,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
} catch (IOException e) {
|
||||
}
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
// swallow
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
} catch (IOException e) {
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
} catch (IOException e) {
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,6 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
controllerMove = new PlayerControllerMove(this);
|
||||
navigation = new PlayerNavigation(this, world);
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing setSkinFlags((byte) 0xFF);
|
||||
}
|
||||
|
||||
public boolean isNavigating() {
|
||||
|
Loading…
Reference in New Issue
Block a user