Search in sources :

Example 1 with SpongeEmptyChunk

use of org.spongepowered.common.world.SpongeEmptyChunk in project SpongeCommon by SpongePowered.

the class MixinChunkProviderServer method onConstruct.

@Inject(method = "<init>", at = @At("RETURN"))
private void onConstruct(WorldServer worldObjIn, IChunkLoader chunkLoaderIn, IChunkGenerator chunkGeneratorIn, CallbackInfo ci) {
    this.EMPTY_CHUNK = new SpongeEmptyChunk(worldObjIn, 0, 0);
    SpongeConfig<? extends GeneralConfigBase> spongeConfig = SpongeHooks.getActiveConfig(worldObjIn);
    ((IMixinWorldServer) worldObjIn).setActiveConfig(spongeConfig);
    this.denyChunkRequests = spongeConfig.getConfig().getWorld().getDenyChunkRequests();
    this.chunkUnloadDelay = spongeConfig.getConfig().getWorld().getChunkUnloadDelay() * 1000;
    this.maxChunkUnloads = spongeConfig.getConfig().getWorld().getMaxChunkUnloads();
}
Also used : IMixinWorldServer(org.spongepowered.common.interfaces.world.IMixinWorldServer) SpongeEmptyChunk(org.spongepowered.common.world.SpongeEmptyChunk) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

Inject (org.spongepowered.asm.mixin.injection.Inject)1 IMixinWorldServer (org.spongepowered.common.interfaces.world.IMixinWorldServer)1 SpongeEmptyChunk (org.spongepowered.common.world.SpongeEmptyChunk)1