use of net.minecraft.world.gen.ChunkGeneratorEnd in project SpongeCommon by SpongePowered.
the class MixinWorldServer method onCreateSpawnPosition.
@Inject(method = "createSpawnPosition(Lnet/minecraft/world/WorldSettings;)V", at = @At("HEAD"), cancellable = true)
private void onCreateSpawnPosition(WorldSettings settings, CallbackInfo ci) {
GeneratorType generatorType = (GeneratorType) settings.getTerrainType();
// Allow bonus chest generation for non-Overworld worlds
if (!this.provider.canRespawnHere() && this.getProperties().doesGenerateBonusChest()) {
this.createBonusChest();
}
if ((generatorType != null && generatorType.equals(GeneratorTypes.THE_END)) || ((((WorldServer) (Object) this)).getChunkProvider().chunkGenerator instanceof ChunkGeneratorEnd)) {
this.worldInfo.setSpawn(new BlockPos(100, 50, 0));
ci.cancel();
}
}
Aggregations