Fix speed modifier for players

This commit is contained in:
fullwall 2013-07-07 15:57:21 +08:00
parent af40da3c0e
commit bfe891495a
4 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -208,7 +208,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
} else {
jumpTicks = 0;
}
be *= 0.98F;
bf *= 0.98F;
bg *= 0.9F;

View File

@ -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() {

View File

@ -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) {