mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-28 15:17:43 +02: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;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
public class Chat implements VocalChord {
|
public class Chat implements VocalChord {
|
||||||
|
|
||||||
public final String VOCAL_CHORD_NAME = "chat";
|
public final String VOCAL_CHORD_NAME = "chat";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -26,7 +25,6 @@ public class Chat implements VocalChord {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void talk(SpeechContext context) {
|
public void talk(SpeechContext context) {
|
||||||
|
|
||||||
// Check valid talker
|
// Check valid talker
|
||||||
if (context.getTalker() == null)
|
if (context.getTalker() == null)
|
||||||
return;
|
return;
|
||||||
|
@ -208,7 +208,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||||||
} else {
|
} else {
|
||||||
jumpTicks = 0;
|
jumpTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
be *= 0.98F;
|
be *= 0.98F;
|
||||||
bf *= 0.98F;
|
bf *= 0.98F;
|
||||||
bg *= 0.9F;
|
bg *= 0.9F;
|
||||||
|
@ -109,8 +109,9 @@ public class Text extends Trait implements Runnable, Toggleable, Listener, Conve
|
|||||||
if (!event.getNPC().equals(npc))
|
if (!event.getNPC().equals(npc))
|
||||||
return;
|
return;
|
||||||
String localPattern = itemInHandPattern.equals("default") ? Setting.TALK_ITEM.asString() : itemInHandPattern;
|
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());
|
sendText(event.getClicker());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateDefaultText() {
|
private void populateDefaultText() {
|
||||||
|
@ -2,6 +2,7 @@ package net.citizensnpcs.util.nms;
|
|||||||
|
|
||||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||||
import net.citizensnpcs.util.NMS;
|
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.GenericAttributes;
|
||||||
import net.minecraft.server.v1_6_R1.MathHelper;
|
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);
|
this.a.yaw = this.a(this.a.yaw, f, 30.0F);
|
||||||
NMS.setHeadYaw(a, this.a.yaw);
|
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.i(movement);
|
||||||
this.a.bf = movement;
|
this.a.bf = movement;
|
||||||
if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) {
|
if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) {
|
||||||
|
Loading…
Reference in New Issue
Block a user