Fabric Entity Events API compatibility

This commit is contained in:
Aleksey 2021-01-03 22:55:29 +03:00
parent 479f506ca8
commit 08d104b49b
4 changed files with 6 additions and 4 deletions

View file

@ -15,6 +15,6 @@
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
patchouli_version = 48-FABRIC
fabric_version = 0.29.1+1.16
fabric_version = 0.29.2+1.16
canvas_version = 1.0.+
rei_version = 5.8.10

View file

@ -8,6 +8,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.server.world.ServerWorld;
@ -69,10 +70,11 @@ public abstract class EntityMixin implements TeleportingEntity {
}
this.removed = true;
this.world.getProfiler().pop();
((ServerWorld) this.world).resetIdleTimeout();
((ServerWorld) world).resetIdleTimeout();
destination.resetIdleTimeout();
this.world.getProfiler().pop();
this.beExitPos = null;
ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD.invoker().afterChangeWorld(Entity.class.cast(this), entity, (ServerWorld) world, (ServerWorld) entity.world);
info.setReturnValue(entity);
info.cancel();
}

View file

@ -348,7 +348,7 @@ public class InfusionRecipes {
.setOutput(createEnchantedBook(Enchantments.SILK_TOUCH, 1))
.addCatalyst(0, EndItems.ENCHANTED_PETAL)
.addCatalyst(2, Blocks.COBWEB)
.addCatalyst(4, Blocks.COBWEB)
.addCatalyst(4, EndItems.ETERNAL_CRYSTAL)
.addCatalyst(6, Blocks.COBWEB)
.addCatalyst(1, Items.LAPIS_LAZULI)
.addCatalyst(3, Items.LAPIS_LAZULI)

View file

@ -39,7 +39,7 @@
"depends": {
"fabricloader": ">=0.10.0",
"fabric": ">=0.26.0",
"fabric": ">=0.29.0",
"minecraft": ">=1.16.3"
}
}