Implement new metadata

This commit is contained in:
fullwall 2021-11-28 00:09:30 +08:00
parent 3da3cc2ae8
commit 8f341ccaf2
10 changed files with 9 additions and 92 deletions

View File

@ -36,7 +36,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
private final CitizensNPC npc;
public EntityVillagerNPC(World world) {
@ -71,7 +70,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
}
return super.a(entityhuman, enumhand, itemstack);
@ -163,10 +162,6 @@ public class VillagerController extends MobEntityController {
return npc;
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isLeashed() {
if (npc == null)
@ -210,10 +205,6 @@ public class VillagerController extends MobEntityController {
super.onLightningStrike(entitylightning);
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
}
public static class VillagerNPC extends CraftVillager implements NPCHolder {

View File

@ -38,7 +38,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
private final CitizensNPC npc;
public EntityVillagerNPC(World world) {
@ -73,7 +72,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
List<MerchantRecipe> list = getOffers(entityhuman);
if (list != null) {
@ -169,10 +168,6 @@ public class VillagerController extends MobEntityController {
return npc;
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isLeashed() {
if (npc == null)
@ -216,10 +211,6 @@ public class VillagerController extends MobEntityController {
super.onLightningStrike(entitylightning);
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
}
public static class VillagerNPC extends CraftVillager implements NPCHolder {

View File

@ -39,7 +39,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
private final CitizensNPC npc;
public EntityVillagerNPC(World world) {
@ -74,7 +73,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
List<MerchantRecipe> list = getOffers(entityhuman);
if (list != null) {
@ -172,10 +171,6 @@ public class VillagerController extends MobEntityController {
return npc;
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isLeashed() {
if (npc == null)
@ -219,10 +214,6 @@ public class VillagerController extends MobEntityController {
super.onLightningStrike(entitylightning);
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
}
public static class VillagerNPC extends CraftVillager implements NPCHolder {

View File

@ -42,7 +42,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
private final CitizensNPC npc;
public EntityVillagerNPC(World world) {
@ -77,7 +76,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
List<MerchantRecipe> list = getOffers(entityhuman);
if (list != null) {
@ -182,10 +181,6 @@ public class VillagerController extends MobEntityController {
}
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isLeashed() {
if (npc == null)
@ -222,10 +217,6 @@ public class VillagerController extends MobEntityController {
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
@Override
public boolean z_() {
if (npc == null || !npc.isFlyable()) {

View File

@ -48,7 +48,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private TreeMap<?, ?> behaviorMap;
private boolean blockingATrade;
private boolean blockTrades = true;
boolean calledNMSHeight = false;
private final CitizensNPC npc;
private BehaviorController<EntityVillager> previousBehaviorController;
@ -85,7 +84,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
List<MerchantRecipe> list = getOffers();
if (list != null) {
@ -191,10 +190,6 @@ public class VillagerController extends MobEntityController {
return NMSImpl.getSoundEffect(npc, super.getSoundHurt(damagesource), NPC.HURT_SOUND_METADATA);
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isClimbing() {
if (npc == null || !npc.isFlyable()) {
@ -249,10 +244,6 @@ public class VillagerController extends MobEntityController {
super.onLightningStrike(entitylightning);
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
}
public static class VillagerNPC extends CraftVillager implements NPCHolder {

View File

@ -46,7 +46,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -83,7 +82,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
List<MerchantRecipe> list = getOffers();
if (list != null) {
@ -190,10 +189,6 @@ public class VillagerController extends MobEntityController {
}
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isClimbing() {
if (npc == null || !npc.isFlyable()) {
@ -241,10 +236,6 @@ public class VillagerController extends MobEntityController {
super.onLightningStrike(entitylightning);
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
}
public static class VillagerNPC extends CraftVillager implements NPCHolder {

View File

@ -49,7 +49,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -86,7 +85,7 @@ public class VillagerController extends MobEntityController {
@Override
public EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
List<MerchantRecipe> list = getOffers();
if (list != null) {
@ -193,10 +192,6 @@ public class VillagerController extends MobEntityController {
}
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isClimbing() {
if (npc == null || !npc.isFlyable()) {
@ -244,10 +239,6 @@ public class VillagerController extends MobEntityController {
super.onLightningStrike(server, entitylightning);
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
}
public static class VillagerNPC extends CraftVillager implements ForwardingNPCHolder {

View File

@ -46,7 +46,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends Villager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -145,10 +144,6 @@ public class VillagerController extends MobEntityController {
return npc;
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean isLeashed() {
if (npc == null)
@ -173,7 +168,7 @@ public class VillagerController extends MobEntityController {
@Override
public InteractionResult mobInteract(Player entityhuman, InteractionHand enumhand) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
MerchantOffers list = getOffers();
if (list != null) {
@ -227,10 +222,6 @@ public class VillagerController extends MobEntityController {
return npc == null ? super.save(save) : false;
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
@Override
public void thunderHit(ServerLevel worldserver, LightningBolt entitylightning) {
if (npc == null) {

View File

@ -16,7 +16,6 @@ import net.minecraft.world.entity.monster.Slime;
public class PlayerMoveControl extends MoveControl {
protected LivingEntity entity;
private int jumpTicks;
private int keepMovingTicks;
protected boolean moving;
protected double speed;
protected double tx;
@ -91,7 +90,6 @@ public class PlayerMoveControl extends MoveControl {
this.tz = d2;
this.speed = d3;
this.moving = true;
this.keepMovingTicks = 1;
}
private boolean shouldJump() {

View File

@ -33,7 +33,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private boolean blockTrades = true;
private final CitizensNPC npc;
public EntityVillagerNPC(World world) {
@ -68,7 +67,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean a(EntityHuman entityhuman) {
if (npc != null && blockTrades) {
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
blockingATrade = true;
}
return super.a(entityhuman);
@ -183,10 +182,6 @@ public class VillagerController extends MobEntityController {
return npc;
}
public boolean isBlockingTrades() {
return blockTrades;
}
@Override
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
@ -203,10 +198,6 @@ public class VillagerController extends MobEntityController {
}
}
public void setBlockTrades(boolean blocked) {
this.blockTrades = blocked;
}
@Override
protected String z() {
return NMSImpl.getSoundEffect(npc, super.z(), NPC.AMBIENT_SOUND_METADATA);