переход на groovy конфигурацию
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
|
||||
Загрузчик "ванильных" (vanilla, ["Anvil"](https://minecraft.gamepedia.com/Anvil_file_format)) карт Minecraft.
|
||||
|
||||
Пример настройки можно посмотреть в файле `sample-config.xml`
|
||||
Пример настройки можно посмотреть в файле [`sample-config.groovy`](./sample-config.groovy)
|
||||
|
||||
18
anvil-loader/sample-config.groovy
Normal file
18
anvil-loader/sample-config.groovy
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Ядро сервера.
|
||||
|
||||
Пример настройки можно посмотреть в файле `sample-config.xml`.
|
||||
Пример настройки можно посмотреть в файле [`sample-config.groovy`](./sample-config.groovy).
|
||||
|
||||
## Spring beans
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean class="mc.core.CoreEventListener"/>
|
||||
```groovy
|
||||
beans {
|
||||
coreEventListener(mc.core.CoreEventListener)
|
||||
}
|
||||
```
|
||||
|
||||
#### ConfigFromSpring
|
||||
@@ -31,12 +33,14 @@
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="config" class="mc.core.embedded.ConfigFromSpring">
|
||||
<property name="descriptionServer" value="MC Core"/>
|
||||
<property name="maxPlayers" value="100"/>
|
||||
<property name="favicon" value="icon.png"/>
|
||||
</bean>
|
||||
```groovy
|
||||
beans {
|
||||
config(mc.core.embedded.ConfigFromSpring) {
|
||||
descriptionServer = 'MC Core - LIMBO'
|
||||
maxPlayers = 1
|
||||
favicon = 'icon.png'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### GameLoop
|
||||
@@ -47,11 +51,13 @@
|
||||
* `gameTimer` - бин, управляющий ходом времени
|
||||
* `percentWarnLowTps` - порог "низкого" значения TPS, в процентах
|
||||
|
||||
```xml
|
||||
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||
<property name="gameTimer" ref="timeProcessor"/>
|
||||
<property name="percentWarnLowTps" value="15"/>
|
||||
</bean>
|
||||
```groovy
|
||||
beans {
|
||||
gameLoop(mc.core.GameLoop) {
|
||||
gameTimer = ref('timeProcessor')
|
||||
percentWarnLowTps = 15
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### SimpleChatProcessor
|
||||
@@ -62,8 +68,10 @@
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="chatProcessor" class="mc.core.chat.SimpleChatProcessor" />
|
||||
```groovy
|
||||
beans {
|
||||
chatProcessor(mc.core.chat.SimpleChatProcessor)
|
||||
}
|
||||
```
|
||||
|
||||
### Время
|
||||
@@ -79,10 +87,12 @@
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="idleTime" class="mc.core.time.IdleTime">
|
||||
<property name="gameTime" value="1000"/>
|
||||
</bean>
|
||||
```groovy
|
||||
beans {
|
||||
timeProcessor(mc.core.time.IdleTime) {
|
||||
gameTime = 1000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### TimePerTick
|
||||
@@ -96,10 +106,12 @@
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="timePerTick" class="mc.core.time.TimePerTick">
|
||||
<property name="startGameTime" value="1000"/>
|
||||
</bean>
|
||||
```groovy
|
||||
beans {
|
||||
timeProcessor(mc.core.time.TimePerTick) {
|
||||
startGameTime = 1000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### RealTime
|
||||
@@ -110,6 +122,8 @@
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="realTime" class="mc.core.time.RealTime"/>
|
||||
```groovy
|
||||
beans {
|
||||
timeProcessor(mc.core.time.RealTime)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
version '0.2'
|
||||
version '0.2.1'
|
||||
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = "mc.core.Main"
|
||||
mainClassName = 'mc.core.Main'
|
||||
|
||||
ext {
|
||||
groovy_version = '2.5.6'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
/* Spring Groovy Bean Configuration */
|
||||
compile (group: 'org.codehaus.groovy', name: 'groovy', version: groovy_version)
|
||||
compile (group: 'org.codehaus.groovy', name: 'groovy-xml', version: groovy_version)
|
||||
|
||||
/* Components */
|
||||
compile (group: 'commons-io', name: 'commons-io', version: '2.6')
|
||||
compile (group: 'com.google.guava', name: 'guava', version: '26.0-jre')
|
||||
/* Named Binary Tags */
|
||||
compile (group: 'commons-io', name: 'commons-io', version: '2.6')
|
||||
compile (group: 'com.google.guava', name: 'guava', version: '26.0-jre')
|
||||
|
||||
/* NBT, Named Binary Tags */
|
||||
compile (group: 'com.flowpowered', name: 'flow-nbt', version: '1.0.1-SNAPSHOT')
|
||||
}
|
||||
|
||||
26
core/sample-config.groovy
Normal file
26
core/sample-config.groovy
Normal file
@@ -0,0 +1,26 @@
|
||||
beans {
|
||||
xmlns([context:'http://www.springframework.org/schema/context'])
|
||||
context.'annotation-config'()
|
||||
|
||||
config(mc.core.embedded.ConfigFromSpring) {
|
||||
descriptionServer = 'MC Core - LIMBO'
|
||||
maxPlayers = 1
|
||||
}
|
||||
|
||||
playerManager(mc.core.embedded.FakePlayerManager)
|
||||
|
||||
timer(mc.core.time.IdleTime) {
|
||||
gameTime = 1000
|
||||
}
|
||||
|
||||
coreEventListener(mc.core.CoreEventListener)
|
||||
|
||||
gameLoop(mc.core.GameLoop) {
|
||||
gameTimer = timer
|
||||
percentWarnLowTps = 15
|
||||
}
|
||||
|
||||
chatProcessor(mc.core.chat.SimpleChatProcessor)
|
||||
|
||||
server(mc.core.embedded.FakeServer)
|
||||
}
|
||||
@@ -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-2.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
<context:annotation-config />
|
||||
|
||||
<bean id="config" class="mc.core.embedded.ConfigFromSpring">
|
||||
<property name="descriptionServer" value="MC Core - LIMBO"/>
|
||||
<property name="maxPlayers" value="1"/>
|
||||
</bean>
|
||||
|
||||
<bean id="timer" class="mc.core.time.IdleTime">
|
||||
<property name="gameTime" value="1000"/>
|
||||
</bean>
|
||||
|
||||
<bean class="mc.core.CoreEventListener"/>
|
||||
|
||||
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||
<property name="gameTimer" ref="timer"/>
|
||||
<property name="percentWarnLowTps" value="15"/>
|
||||
</bean>
|
||||
|
||||
<bean id="chatProcessor" class="mc.core.chat.SimpleChatProcessor" />
|
||||
</beans>
|
||||
@@ -5,7 +5,7 @@ import mc.core.network.Server;
|
||||
import mc.core.network.StartServerException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.FileSystemXmlApplicationContext;
|
||||
import org.springframework.context.support.GenericGroovyApplicationContext;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -15,19 +15,20 @@ import java.nio.file.Paths;
|
||||
@Slf4j
|
||||
public class Main {
|
||||
private static ApplicationContext createContext() {
|
||||
final String springXml = System.getProperty("springConfig", "./spring.xml");
|
||||
final String defautlSpringConfig = "spring.groovy";
|
||||
final String springConfig = System.getProperty("springConfig", "./" + defautlSpringConfig);
|
||||
|
||||
if (!Files.exists(Paths.get(springXml))) {
|
||||
log.info("File \"{}\" not found. Get default config.", springXml);
|
||||
try (FileOutputStream fos = new FileOutputStream(springXml)) {
|
||||
IOUtils.copy(Main.class.getResourceAsStream("/spring.xml"), fos);
|
||||
if (!Files.exists(Paths.get(springConfig))) {
|
||||
log.info("File \"{}\" not found. Get default config.", springConfig);
|
||||
try (FileOutputStream fos = new FileOutputStream(springConfig)) {
|
||||
IOUtils.copy(Main.class.getResourceAsStream("/" + defautlSpringConfig), fos);
|
||||
} catch (IOException e) {
|
||||
log.error("Get default spring config", e);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
return new FileSystemXmlApplicationContext(springXml);
|
||||
return new GenericGroovyApplicationContext("file:" + springConfig);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
14
core/src/main/resources/spring.groovy
Normal file
14
core/src/main/resources/spring.groovy
Normal file
@@ -0,0 +1,14 @@
|
||||
beans {
|
||||
xmlns([context:'http://www.springframework.org/schema/context'])
|
||||
context.'annotation-config'()
|
||||
|
||||
playerManager(mc.core.embedded.FakePlayerManager)
|
||||
|
||||
timer(mc.core.time.TimePerTick)
|
||||
|
||||
gameLoop(mc.core.GameLoop) {
|
||||
gameTimer = timer
|
||||
}
|
||||
|
||||
server(mc.core.embedded.FakeServer)
|
||||
}
|
||||
@@ -1,20 +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-2.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
<context:annotation-config />
|
||||
|
||||
<bean id="playerManager" class="mc.core.embedded.FakePlayerManager"/>
|
||||
|
||||
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||
<property name="gameTimer">
|
||||
<bean class="mc.core.time.TimePerTick"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="server" class="mc.core.embedded.FakeServer"/>
|
||||
</beans>
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Хранилище данных игроков на базе [H2 Database](http://www.h2database.com/).
|
||||
|
||||
Пример настройки можно посмотреть в файле `sample-config.xml`
|
||||
Пример настройки можно посмотреть в файле [`sample-config.groovy`](./sample-config.groovy)
|
||||
|
||||
31
h2_playermanager/sample-config.groovy
Normal file
31
h2_playermanager/sample-config.groovy
Normal file
@@ -0,0 +1,31 @@
|
||||
def hibernateProps = new Properties()
|
||||
hibernateProps.put('hibernate.dialect', 'org.hibernate.dialect.H2Dialect')
|
||||
hibernateProps.put('hibernate.show_sql', false)
|
||||
hibernateProps.put('hibernate.hbm2ddl.auto', 'update')
|
||||
|
||||
beans {
|
||||
xmlns([context: 'http://www.springframework.org/schema/context'])
|
||||
context.'annotation-config'()
|
||||
context.'component-scan'('base-package': 'mc.core.h2db')
|
||||
|
||||
xmlns([jpa: 'http://www.springframework.org/schema/data/jpa'])
|
||||
jpa.'repositories'('base-package': 'mc.core.h2db.repository')
|
||||
|
||||
dataSource(org.springframework.jdbc.datasource.DriverManagerDataSource) {
|
||||
driverClassName = 'org.h2.Driver'
|
||||
url = 'jdbc:h2:mem:test;DB_CLOSE_DELAY=-1'
|
||||
username = 'sa'
|
||||
password = 's3cReT'
|
||||
}
|
||||
|
||||
entityManagerFactory(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean) {
|
||||
dataSource = ref('dataSource')
|
||||
persistenceProviderClass = 'org.hibernate.jpa.HibernatePersistenceProvider'
|
||||
packagesToScan = 'mc.core.h2db.entity'
|
||||
jpaProperties = hibernateProps
|
||||
}
|
||||
|
||||
transactionManager(org.springframework.orm.jpa.JpaTransactionManager) {
|
||||
entityManagerFactory = ref('entityManagerFactory')
|
||||
}
|
||||
}
|
||||
@@ -1,39 +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"
|
||||
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
|
||||
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
|
||||
http://www.springframework.org/schema/data/jpa
|
||||
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
|
||||
<context:annotation-config />
|
||||
<context:component-scan base-package="mc.core.h2db"/>
|
||||
<jpa:repositories base-package="mc.core.h2db.repository"/>
|
||||
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="org.h2.Driver"/>
|
||||
<property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1"/>
|
||||
<property name="username" value="sa"/>
|
||||
<property name="password" value="s3cReT"/>
|
||||
</bean>
|
||||
|
||||
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="persistenceProviderClass" value="org.hibernate.jpa.HibernatePersistenceProvider"/>
|
||||
<property name="packagesToScan" value="mc.core.h2db.entity"/>
|
||||
<property name="jpaProperties">
|
||||
<props>
|
||||
<prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop>
|
||||
<prop key="hibernate.show_sql">false</prop>
|
||||
<prop key="hibernate.hbm2ddl.auto">update</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
|
||||
<property name="entityManagerFactory" ref="entityManagerFactory"/>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
Реализация протокола на сетевом движке [Netty.IO](https://netty.io/).
|
||||
|
||||
Пример настройки можно посмотреть в файле `sample-config.xml`
|
||||
Пример настройки можно посмотреть в файле [`sample-config.groovy`](./sample-config.groovy)
|
||||
|
||||
|
||||
|
||||
18
proto_1.12.2_netty/sample-config.groovy
Normal file
18
proto_1.12.2_netty/sample-config.groovy
Normal file
@@ -0,0 +1,18 @@
|
||||
beans {
|
||||
xmlns([context: 'http://www.springframework.org/schema/context'])
|
||||
context.'annotation-config'()
|
||||
context.'component-scan'('base-package': 'mc.core.network.proto_1_12_2.netty')
|
||||
|
||||
/* Для логирования сетевых пакетов, можно добавить нижезакомментированный бин */
|
||||
//'pipeline.log'(io.netty.handler.logging.LoggingHandler) { bean -> bean.scope = 'prototype' }
|
||||
'pipeline.decoder'(mc.core.network.proto_1_12_2.netty.PacketDecoder) { bean -> bean.scope = 'prototype' }
|
||||
'pipeline.postencoder'(mc.core.network.proto_1_12_2.netty.PacketPostEncoder) { bean -> bean.scope = 'prototype' }
|
||||
'pipeline.encoder'(mc.core.network.proto_1_12_2.netty.PacketEncoder) { bean -> bean.scope = 'prototype' }
|
||||
'pipeline.handler'(mc.core.network.proto_1_12_2.netty.PacketHandler) { bean -> bean.scope = 'prototype' }
|
||||
|
||||
server(mc.core.network.proto_1_12_2.netty.NettyServer) {
|
||||
host = '127.0.0.1'
|
||||
port = 25565
|
||||
workerGroupCount = 2
|
||||
}
|
||||
}
|
||||
@@ -1,24 +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 />
|
||||
<context:component-scan base-package="mc.core.network.proto_1_12_2.netty" />
|
||||
|
||||
<!-- Для логирования сетевых пакетов, можно добавить нижезакомментированный бин -->
|
||||
<!-- <bean id="pipeline.log" class="io.netty.handler.logging.LoggingHandler" scope="prototype"/> -->
|
||||
<bean id="pipeline.decoder" class="mc.core.network.proto_1_12_2.netty.PacketDecoder" scope="prototype"/>
|
||||
<bean id="pipeline.postencoder" class="mc.core.network.proto_1_12_2.netty.PacketPostEncoder" scope="prototype"/>
|
||||
<bean id="pipeline.encoder" class="mc.core.network.proto_1_12_2.netty.PacketEncoder" scope="prototype"/>
|
||||
<bean id="pipeline.handler" class="mc.core.network.proto_1_12_2.netty.PacketHandler" scope="prototype"/>
|
||||
|
||||
<bean id="server" class="mc.core.network.proto_1_12_2.netty.NettyServer">
|
||||
<property name="host" value="127.0.0.1"/>
|
||||
<property name="port" value="25565"/>
|
||||
<property name="workerGroupCount" value="2"/>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -4,36 +4,32 @@
|
||||
|
||||
## Spring bean
|
||||
|
||||
```xml
|
||||
<bean id="simpleWorld" class="mc.world.simple.SimpleWorld">
|
||||
<property name="spawn">
|
||||
<bean class="mc.core.EntityLocation">
|
||||
<constructor-arg index="0" type="double" value="8"/>
|
||||
<constructor-arg index="1" type="double" value="6"/>
|
||||
<constructor-arg index="2" type="double" value="8"/>
|
||||
<constructor-arg index="3" type="float" value="0"/>
|
||||
<constructor-arg index="4" type="float" value="0"/>
|
||||
<constructor-arg index="5" type="mc.core.world.World">
|
||||
<null/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="layersBlock">
|
||||
<list value-type="java.lang.String">
|
||||
<value>1;BEDROCK</value>
|
||||
<value>2;DIRT</value>
|
||||
<value>1;GRASS</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
```groovy
|
||||
def layers = new ArrayList<String>();
|
||||
layers.add('1;BEDROCK')
|
||||
layers.add('2;DIRT')
|
||||
layers.add('1;GRASS')
|
||||
|
||||
beans {
|
||||
spawnLocation(mc.core.EntityLocation) { bean ->
|
||||
bean.constructorArgs = [ 8d/*X*/, 6d/*Y*/, 8d/*Z*/, 0f/*Yaw*/, 0f/*Pitch*/ ]
|
||||
}
|
||||
|
||||
flatChunkProvider(mc.world.simple.FlatChunkProvider) {
|
||||
layersBlock = layers
|
||||
}
|
||||
|
||||
simpleWorld(mc.world.simple.SimpleWorld) {
|
||||
spawn = ref('spawnLocation')
|
||||
chunkProvider = ref('flatChunkProvider')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`spawn` - точка спавна.
|
||||
`spawn` - точка спавна
|
||||
`chunkProvider` - провайдер чанков
|
||||
|
||||
При указании точки спавна, указывать шестой параметр `World` не имеет смысла,
|
||||
т.к. `SimpleWorld` всё равно перезапишет этот параметр.
|
||||
|
||||
`layersBlock` - слои блоков.
|
||||
|
||||
В качестве значения указывается спиток строк, каждая из которых описывает слой блоков.
|
||||
Формат строк такой: `кол-во_слоёв;тип_блока`. Порядок строк такой: сверху нижние слои, а снизу - верхние.
|
||||
У `flatChunkProvider` указан только один параметр - `layersBlock`. В качестве значения указывается спиток строк,
|
||||
каждая из которых описывает слой блоков.
|
||||
Формат строк следующий: `кол-во_слоёв;тип_блока`.
|
||||
Порядок строк следующий: сверху **нижние слои**, а снизу - **верхние**.
|
||||
|
||||
Reference in New Issue
Block a user