mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-27 13:15:33 +01:00
Fix speed modifier for players
This commit is contained in:
parent
af40da3c0e
commit
bfe891495a
@ -16,7 +16,6 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
public class Chat implements VocalChord {
|
||||
|
||||
public final String VOCAL_CHORD_NAME = "chat";
|
||||
|
||||
@Override
|
||||
@ -26,7 +25,6 @@ public class Chat implements VocalChord {
|
||||
|
||||
@Override
|
||||
public void talk(SpeechContext context) {
|
||||
|
||||
// Check valid talker
|
||||
if (context.getTalker() == null)
|
||||
return;
|
||||
|
@ -208,7 +208,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
} else {
|
||||
jumpTicks = 0;
|
||||
}
|
||||
|
||||
be *= 0.98F;
|
||||
bf *= 0.98F;
|
||||
bg *= 0.9F;
|
||||
|
@ -109,8 +109,9 @@ public class Text extends Trait implements Runnable, Toggleable, Listener, Conve
|
||||
if (!event.getNPC().equals(npc))
|
||||
return;
|
||||
String localPattern = itemInHandPattern.equals("default") ? Setting.TALK_ITEM.asString() : itemInHandPattern;
|
||||
if (Util.matchesItemInHand(event.getClicker(), localPattern) && !shouldTalkClose())
|
||||
if (Util.matchesItemInHand(event.getClicker(), localPattern) && !shouldTalkClose()) {
|
||||
sendText(event.getClicker());
|
||||
}
|
||||
}
|
||||
|
||||
private void populateDefaultText() {
|
||||
|
@ -2,6 +2,7 @@ package net.citizensnpcs.util.nms;
|
||||
|
||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.minecraft.server.v1_6_R1.AttributeInstance;
|
||||
import net.minecraft.server.v1_6_R1.GenericAttributes;
|
||||
import net.minecraft.server.v1_6_R1.MathHelper;
|
||||
|
||||
@ -65,7 +66,9 @@ public class PlayerControllerMove {
|
||||
|
||||
this.a.yaw = this.a(this.a.yaw, f, 30.0F);
|
||||
NMS.setHeadYaw(a, this.a.yaw);
|
||||
float movement = (float) (this.e * this.a.a(GenericAttributes.d).e()) * 10;
|
||||
AttributeInstance speed = this.a.a(GenericAttributes.d);
|
||||
speed.a(0.1D * this.e);
|
||||
float movement = (float) (this.e * speed.e()) * 10;
|
||||
this.a.i(movement);
|
||||
this.a.bf = movement;
|
||||
if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) {
|
||||
|
Loading…
Reference in New Issue
Block a user