mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Default allow to entity head pitching.
This commit is contained in:
parent
283a2a3381
commit
0b82ee214e
@ -8,16 +8,15 @@ import net.minecraft.server.v1_14_R1.ControllerLook;
|
||||
import net.minecraft.server.v1_14_R1.EntityInsentient;
|
||||
|
||||
public class PitchableLookControl extends ControllerLook {
|
||||
private boolean explicit = true;
|
||||
private final Supplier<Boolean> resetOnTick;
|
||||
|
||||
public PitchableLookControl(EntityInsentient var0) {
|
||||
super(var0);
|
||||
if (var0 instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) var0).getNPC();
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, explicit);
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, false);
|
||||
} else {
|
||||
resetOnTick = () -> explicit;
|
||||
resetOnTick = () -> true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +24,4 @@ public class PitchableLookControl extends ControllerLook {
|
||||
public boolean b() {
|
||||
return resetOnTick.get();
|
||||
}
|
||||
|
||||
public void setResetXRotOnTick(boolean val) {
|
||||
explicit = val;
|
||||
}
|
||||
}
|
@ -8,16 +8,15 @@ import net.minecraft.server.v1_15_R1.ControllerLook;
|
||||
import net.minecraft.server.v1_15_R1.EntityInsentient;
|
||||
|
||||
public class PitchableLookControl extends ControllerLook {
|
||||
private boolean explicit = true;
|
||||
private final Supplier<Boolean> resetOnTick;
|
||||
|
||||
public PitchableLookControl(EntityInsentient var0) {
|
||||
super(var0);
|
||||
if (var0 instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) var0).getNPC();
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, explicit);
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, false);
|
||||
} else {
|
||||
resetOnTick = () -> explicit;
|
||||
resetOnTick = () -> true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +24,4 @@ public class PitchableLookControl extends ControllerLook {
|
||||
public boolean b() {
|
||||
return resetOnTick.get();
|
||||
}
|
||||
|
||||
public void setResetXRotOnTick(boolean val) {
|
||||
explicit = val;
|
||||
}
|
||||
}
|
@ -8,16 +8,15 @@ import net.minecraft.server.v1_16_R3.ControllerLook;
|
||||
import net.minecraft.server.v1_16_R3.EntityInsentient;
|
||||
|
||||
public class PitchableLookControl extends ControllerLook {
|
||||
private boolean explicit = true;
|
||||
private final Supplier<Boolean> resetOnTick;
|
||||
|
||||
public PitchableLookControl(EntityInsentient var0) {
|
||||
super(var0);
|
||||
if (var0 instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) var0).getNPC();
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, explicit);
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, false);
|
||||
} else {
|
||||
resetOnTick = () -> explicit;
|
||||
resetOnTick = () -> true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +24,4 @@ public class PitchableLookControl extends ControllerLook {
|
||||
public boolean b() {
|
||||
return resetOnTick.get();
|
||||
}
|
||||
|
||||
public void setResetXRotOnTick(boolean val) {
|
||||
explicit = val;
|
||||
}
|
||||
}
|
@ -8,16 +8,15 @@ import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.control.LookControl;
|
||||
|
||||
public class PitchableLookControl extends LookControl {
|
||||
private boolean explicit = true;
|
||||
private final Supplier<Boolean> resetOnTick;
|
||||
|
||||
public PitchableLookControl(Mob var0) {
|
||||
super(var0);
|
||||
if (var0 instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) var0).getNPC();
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, explicit);
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, false);
|
||||
} else {
|
||||
resetOnTick = () -> explicit;
|
||||
resetOnTick = () -> true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +24,4 @@ public class PitchableLookControl extends LookControl {
|
||||
public boolean resetXRotOnTick() {
|
||||
return resetOnTick.get();
|
||||
}
|
||||
|
||||
public void setResetXRotOnTick(boolean val) {
|
||||
explicit = val;
|
||||
}
|
||||
}
|
@ -8,16 +8,15 @@ import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.control.LookControl;
|
||||
|
||||
public class PitchableLookControl extends LookControl {
|
||||
private boolean explicit = true;
|
||||
private final Supplier<Boolean> resetOnTick;
|
||||
|
||||
public PitchableLookControl(Mob var0) {
|
||||
super(var0);
|
||||
if (var0 instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) var0).getNPC();
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, explicit);
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, false);
|
||||
} else {
|
||||
resetOnTick = () -> explicit;
|
||||
resetOnTick = () -> true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +24,4 @@ public class PitchableLookControl extends LookControl {
|
||||
public boolean resetXRotOnTick() {
|
||||
return resetOnTick.get();
|
||||
}
|
||||
|
||||
public void setResetXRotOnTick(boolean val) {
|
||||
explicit = val;
|
||||
}
|
||||
}
|
@ -59,7 +59,6 @@ public class AllayController extends MobEntityController {
|
||||
|
||||
public static class EntityAllayNPC extends Allay implements NPCHolder {
|
||||
private final CitizensNPC npc;
|
||||
|
||||
private int taskId = -1;
|
||||
|
||||
public EntityAllayNPC(EntityType<? extends Allay> types, Level level) {
|
||||
|
@ -1197,8 +1197,9 @@ public class NMSImpl implements NMSBridge {
|
||||
changed = true;
|
||||
}
|
||||
MirrorTrait trait = npc.getTraitNullable(MirrorTrait.class);
|
||||
if (trait == null || !trait.isMirroring(player))
|
||||
if (trait == null || !trait.isMirroring(player)) {
|
||||
continue;
|
||||
}
|
||||
GameProfile profile = NMS.getProfile(player);
|
||||
if (trait.mirrorName()) {
|
||||
list.set(i,
|
||||
|
@ -8,16 +8,15 @@ import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.control.LookControl;
|
||||
|
||||
public class PitchableLookControl extends LookControl {
|
||||
private boolean explicit = true;
|
||||
private final Supplier<Boolean> resetOnTick;
|
||||
|
||||
public PitchableLookControl(Mob var0) {
|
||||
super(var0);
|
||||
if (var0 instanceof NPCHolder) {
|
||||
NPC npc = ((NPCHolder) var0).getNPC();
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, explicit);
|
||||
resetOnTick = () -> npc.data().get(NPC.Metadata.RESET_PITCH_ON_TICK, false);
|
||||
} else {
|
||||
resetOnTick = () -> explicit;
|
||||
resetOnTick = () -> true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +24,4 @@ public class PitchableLookControl extends LookControl {
|
||||
public boolean resetXRotOnTick() {
|
||||
return resetOnTick.get();
|
||||
}
|
||||
|
||||
public void setResetXRotOnTick(boolean val) {
|
||||
explicit = val;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user