Optimize villager bed chunk loads (#719)
This commit is contained in:
parent
44e5c725c0
commit
8f9d1b76cc
|
@ -7,7 +7,7 @@ A Bukkit server implementation utilizing Mixin.
|
||||||
| Minecraft | Forge | Status | Build |
|
| Minecraft | Forge | Status | Build |
|
||||||
|:---------:|:-------:| :---: |:------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:---------:|:-------:| :---: |:------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
| 1.19.x | 43.1.3 | ACTIVE | [![1.19 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
|
| 1.19.x | 43.1.3 | ACTIVE | [![1.19 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
|
||||||
| 1.18.x | 40.1.76 | ACTIVE | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
|
| 1.18.x | 40.1.80 | ACTIVE | [![1.18 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-18?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
|
||||||
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [![1.17 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-17?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
|
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [![1.17 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-17?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
|
||||||
| 1.16.x | 36.2.39 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
| 1.16.x | 36.2.39 | ACTIVE | [![1.16 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-16?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
|
||||||
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
|
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package io.izzel.arclight.common.mixin.optimization.general.chunkload;
|
||||||
|
|
||||||
|
import net.minecraft.core.GlobalPos;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.ai.Brain;
|
||||||
|
import net.minecraft.world.entity.ai.behavior.SleepInBed;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||||
|
|
||||||
|
@Mixin(SleepInBed.class)
|
||||||
|
public class SleepInBedMixin_Optimize {
|
||||||
|
|
||||||
|
@Inject(method = "checkExtraStartConditions",cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;"))
|
||||||
|
private void arclight$returnIfNotLoaded(ServerLevel level, LivingEntity entity, CallbackInfoReturnable<Boolean> cir, Brain<?> brain, GlobalPos pos) {
|
||||||
|
if (!level.isLoaded(pos.pos())) {
|
||||||
|
cir.setReturnValue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,6 +22,7 @@
|
||||||
"activationrange.entity.ItemEntityMixin_ActivationRange",
|
"activationrange.entity.ItemEntityMixin_ActivationRange",
|
||||||
"activationrange.entity.LivingEntityMixin_ActivationRange",
|
"activationrange.entity.LivingEntityMixin_ActivationRange",
|
||||||
"activationrange.entity.VillagerEntityMixin_ActivationRange",
|
"activationrange.entity.VillagerEntityMixin_ActivationRange",
|
||||||
|
"chunkload.SleepInBedMixin_Optimize",
|
||||||
"network.ChunkMapMixin_Optimize",
|
"network.ChunkMapMixin_Optimize",
|
||||||
"network.ChunkMapMixin_Optimize$TrackedEntityMixin",
|
"network.ChunkMapMixin_Optimize$TrackedEntityMixin",
|
||||||
"network.ConnectionMixin_Optimize",
|
"network.ConnectionMixin_Optimize",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user