0.5.2 • Published 9 months ago

@serenityjs/world v0.5.2

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

Introduction

This package contains the basic behavior for Worlds within SerenityJS. Worlds are handled by WorldProviders, in which they handle the loading/saving world information such as Dimension Chunks. World Dimensions hold a TerrianGenerator property, in which this does the actual generating of Dimension Chunks.

World

Worlds can by dynamically registered and unregistered during Serenity's runtime, this allows seperate world nodes to be used in specific cases, such as Skyblock Islands.

Creating a World

// First we need to decide what type of WorldProvider we want to use
// SerenityJS comes with a few built-in WorldProviders, but developers can create their own
// The built-in WorldProviders are: InternalProvider & FileSystemProvider
import { InternalProvider } from "@serenityjs/world"

// Create an instance of the InternalProvider
// This provider is used to create a world that stores all of the data in memory
const provider = new InternalProvider()

// Create a new world with the name "example-world" and the provider we just created
const world = new World("example-world", provider)

Dimension

Once a new World has been registered, a new Dimension needs to registered to the World before Players can access that World. The Dimension will hold the generator in which it will use to generate Chunks for the Dimension.

Creating a Dimension

import { Superflat } from "@serenityjs/world"
import { DimensionType } from "@serenityjs/protocol"

// Extening upon the previous example, we must contain the world to register the new dimension
const world = new World("example-world", provider)

// Create a new dimension with the name "superflat-test" and the type "Overworld"
// We also need to pass in the WorldGenerator we want to use, in this case, Superflat
world.createDimension("superflat-test", DimensionType.Overworld, new Superflat())
0.5.2

10 months ago

0.5.0

10 months ago

0.5.1

10 months ago

0.3.0

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.4.4

11 months ago

0.4.1

11 months ago

0.4.0

12 months ago

0.4.3

11 months ago

0.4.2

11 months ago

0.2.3

1 year ago

0.2.4

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.0-beta.5

1 year ago

0.1.0-beta.10

1 year ago

0.1.0-beta.7

1 year ago

0.1.0-beta.6

1 year ago

0.1.0-beta.9

1 year ago

0.1.0-beta.8

1 year ago

0.1.0-beta.4

1 year ago

0.1.0-beta.3

1 year ago

0.1.0-beta.2

1 year ago

0.0.1-beta.0

1 year ago

0.0.0

1 year ago

0.1.0-beta.0

1 year ago