Compare commits
2 Commits
3563413c06
...
5f13340dea
Author | SHA1 | Date |
---|---|---|
fullwall | 5f13340dea | |
fullwall | 809ef01b5d |
|
@ -222,14 +222,20 @@ public class RabbitController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRabbitType(int i) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.getRabbitTypeField() == null)
|
||||
return;
|
||||
this.datawatcher.set(NMSImpl.getRabbitTypeField(), i);
|
||||
public void setRabbitType(int type) {
|
||||
if (npc == null) {
|
||||
super.setRabbitType(type);
|
||||
return;
|
||||
}
|
||||
super.setRabbitType(i);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.c().count() == 0) {
|
||||
initPathfinder(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setRabbitType(type);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.getRabbitTypeField() != null) {
|
||||
datawatcher.set(NMSImpl.getRabbitTypeField(), type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,14 +222,20 @@ public class RabbitController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRabbitType(int i) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.getRabbitTypeField() == null)
|
||||
return;
|
||||
this.datawatcher.set(NMSImpl.getRabbitTypeField(), i);
|
||||
public void setRabbitType(int type) {
|
||||
if (npc == null) {
|
||||
super.setRabbitType(type);
|
||||
return;
|
||||
}
|
||||
super.setRabbitType(i);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.c().count() == 0) {
|
||||
initPathfinder(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setRabbitType(type);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.getRabbitTypeField() != null) {
|
||||
datawatcher.set(NMSImpl.getRabbitTypeField(), type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,14 +222,20 @@ public class RabbitController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRabbitType(int i) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.getRabbitTypeField() == null)
|
||||
return;
|
||||
this.datawatcher.set(NMSImpl.getRabbitTypeField(), i);
|
||||
public void setRabbitType(int type) {
|
||||
if (npc == null) {
|
||||
super.setRabbitType(type);
|
||||
return;
|
||||
}
|
||||
super.setRabbitType(i);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.d().count() == 0) {
|
||||
initPathfinder(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setRabbitType(type);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.getRabbitTypeField() != null) {
|
||||
datawatcher.set(NMSImpl.getRabbitTypeField(), type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -206,14 +206,20 @@ public class RabbitController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRabbitType(int i) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.getRabbitTypeField() == null)
|
||||
return;
|
||||
this.entityData.set(NMSImpl.getRabbitTypeField(), i);
|
||||
public void setRabbitType(int type) {
|
||||
if (npc == null) {
|
||||
super.setRabbitType(type);
|
||||
return;
|
||||
}
|
||||
super.setRabbitType(i);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.getAvailableGoals().size() == 0) {
|
||||
registerGoals(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setRabbitType(type);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.getRabbitTypeField() != null) {
|
||||
entityData.set(NMSImpl.getRabbitTypeField(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -207,14 +207,20 @@ public class RabbitController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRabbitType(int i) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.getRabbitTypeField() == null)
|
||||
return;
|
||||
this.entityData.set(NMSImpl.getRabbitTypeField(), i);
|
||||
public void setRabbitType(int type) {
|
||||
if (npc == null) {
|
||||
super.setRabbitType(type);
|
||||
return;
|
||||
}
|
||||
super.setRabbitType(i);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.getAvailableGoals().size() == 0) {
|
||||
registerGoals(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setRabbitType(type);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.getRabbitTypeField() != null) {
|
||||
entityData.set(NMSImpl.getRabbitTypeField(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -209,13 +209,19 @@ public class RabbitController extends MobEntityController {
|
|||
|
||||
@Override
|
||||
public void setVariant(Variant variant) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.getRabbitTypeField() == null)
|
||||
return;
|
||||
this.entityData.set(NMSImpl.getRabbitTypeField(), variant.id());
|
||||
if (npc == null) {
|
||||
super.setVariant(variant);
|
||||
return;
|
||||
}
|
||||
super.setVariant(variant);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.getAvailableGoals().size() == 0) {
|
||||
registerGoals(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setVariant(variant);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.getRabbitTypeField() != null) {
|
||||
entityData.set(NMSImpl.getRabbitTypeField(), variant.id());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -199,13 +199,19 @@ public class RabbitController extends MobEntityController {
|
|||
|
||||
@Override
|
||||
public void setVariant(Variant variant) {
|
||||
if (npc != null) {
|
||||
if (NMSImpl.RABBIT_TYPE_DATAWATCHER == null)
|
||||
return;
|
||||
this.entityData.set(NMSImpl.RABBIT_TYPE_DATAWATCHER, variant.id());
|
||||
if (npc == null) {
|
||||
super.setVariant(variant);
|
||||
return;
|
||||
}
|
||||
super.setVariant(variant);
|
||||
if (npc.useMinecraftAI()) {
|
||||
if (goalSelector.getAvailableGoals().size() == 0) {
|
||||
registerGoals(); // make sure the evil goals include the default AI goals
|
||||
}
|
||||
super.setVariant(variant);
|
||||
NMSImpl.clearGoals(npc, goalSelector, targetSelector);
|
||||
} else if (NMSImpl.RABBIT_TYPE_DATAWATCHER != null) {
|
||||
entityData.set(NMSImpl.RABBIT_TYPE_DATAWATCHER, variant.id());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2553,7 +2553,6 @@ public class NMSImpl implements NMSBridge {
|
|||
|
||||
private static final MethodHandle ADVANCEMENTS_PLAYER_SETTER = NMS.getFirstFinalSetter(ServerPlayer.class,
|
||||
PlayerAdvancements.class);
|
||||
|
||||
private static final MethodHandle ATTRIBUTE_PROVIDER_MAP = NMS.getFirstGetter(AttributeSupplier.class, Map.class);
|
||||
private static final MethodHandle ATTRIBUTE_PROVIDER_MAP_SETTER = NMS.getFirstFinalSetter(AttributeSupplier.class,
|
||||
Map.class);
|
||||
|
|
Loading…
Reference in New Issue