Archived
0

переход на groovy конфигурацию

This commit is contained in:
2019-02-17 23:26:03 +03:00
parent f08190fba7
commit 72c24b2adf
17 changed files with 198 additions and 211 deletions

View File

@@ -2,4 +2,4 @@
Загрузчик "ванильных" (vanilla, ["Anvil"](https://minecraft.gamepedia.com/Anvil_file_format)) карт Minecraft.
Пример настройки можно посмотреть в файле `sample-config.xml`
Пример настройки можно посмотреть в файле [`sample-config.groovy`](./sample-config.groovy)

View File

@@ -0,0 +1,18 @@
beans {
xmlns([context:'http://www.springframework.org/schema/context'])
context.'annotation-config'()
spawnLocation(mc.core.EntityLocation) { bean ->
bean.constructorArgs = [ 8d/*X*/, 64d/*Y*/, 8d/*Z*/, 0f/*Yaw*/, 0f/*Pitch*/ ]
}
anvilChunkProvider(mc.world.anvil.AnvilChunkProvider) { bean ->
bean.constructorArgs = [ "path/to/minecraft/maps/New world" ]
}
/* В качестве хранилища, используется модуль Simple world */
simpleWorld(mc.world.simple.SimpleWorld) {
spawn = spawnLocation
chunkProvider = anvilChunkProvider
}
}

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:annotation-config />
<bean id="spawnLocation" class="mc.core.EntityLocation">
<constructor-arg index="0" type="double" value="8"/>
<constructor-arg index="1" type="double" value="64"/>
<constructor-arg index="2" type="double" value="8"/>
<constructor-arg index="3" type="float" value="0"/>
<constructor-arg index="4" type="float" value="0"/>
</bean>
<!-- В качестве хранилища, используется модуль Simple world -->
<bean id="simpleWorld" class="mc.world.simple.SimpleWorld">
<property name="spawn" ref="spawnLocation"/>
<property name="chunkProvider">
<bean class="mc.world.anvil.AnvilChunkProvider">
<constructor-arg index="0" type="java.lang.String" value="path/to/minecraft/maps/New world"/>
</bean>
</property>
</bean>
</beans>