Fix zombie turn into zombie villager (#189)
This commit is contained in:
parent
5dc8432243
commit
088ce37ce4
@ -22,11 +22,19 @@ public class RecipeIteratorMixin {
|
|||||||
@Shadow @Final private Iterator<Map.Entry<IRecipeType<?>, Map<ResourceLocation, IRecipe<?>>>> recipes;
|
@Shadow @Final private Iterator<Map.Entry<IRecipeType<?>, Map<ResourceLocation, IRecipe<?>>>> recipes;
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author IzzelAliz
|
||||||
|
* @reason
|
||||||
|
*/
|
||||||
@Overwrite
|
@Overwrite
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return (current != null && current.hasNext()) || recipes.hasNext();
|
return (current != null && current.hasNext()) || recipes.hasNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author IzzelAliz
|
||||||
|
* @reason
|
||||||
|
*/
|
||||||
@Overwrite
|
@Overwrite
|
||||||
public Recipe next() {
|
public Recipe next() {
|
||||||
if (current == null || !current.hasNext()) {
|
if (current == null || !current.hasNext()) {
|
||||||
|
|||||||
@ -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;"))
|
@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) {
|
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) {
|
if (t == null) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user