Fix zombie turn into zombie villager (#189)

This commit is contained in:
IzzelAliz 2021-03-06 15:21:30 +08:00
parent 5dc8432243
commit 088ce37ce4
2 changed files with 11 additions and 1 deletions

View File

@ -22,11 +22,19 @@ public class RecipeIteratorMixin {
@Shadow @Final private Iterator<Map.Entry<IRecipeType<?>, Map<ResourceLocation, IRecipe<?>>>> recipes;
// @formatter:on
/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public boolean hasNext() {
return (current != null && current.hasNext()) || recipes.hasNext();
}
/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public Recipe next() {
if (current == null || !current.hasNext()) {

View File

@ -68,7 +68,9 @@ public abstract class ZombieEntityMixin extends CreatureEntityMixin {
@Eject(method = "onKillEntity", at = @At(value = "INVOKE", remap = false, target = "Lnet/minecraft/entity/merchant/villager/VillagerEntity;func_233656_b_(Lnet/minecraft/entity/EntityType;Z)Lnet/minecraft/entity/MobEntity;"))
private <T extends MobEntity> T arclight$transform(VillagerEntity villagerEntity, EntityType<T> entityType, boolean flag, CallbackInfo ci) {
T t = this.a(entityType, flag, EntityTransformEvent.TransformReason.INFECTION, CreatureSpawnEvent.SpawnReason.INFECTION);
((WorldBridge) villagerEntity.world).bridge$pushAddEntityReason(CreatureSpawnEvent.SpawnReason.INFECTION);
((MobEntityBridge) villagerEntity).bridge$pushTransformReason(EntityTransformEvent.TransformReason.INFECTION);
T t = villagerEntity.func_233656_b_(entityType, flag);
if (t == null) {
ci.cancel();
}