Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement blocks ticking per world API #6204

Open
wants to merge 4 commits into
base: minor-next
Choose a base branch
from

Conversation

ShockedPlot7560
Copy link
Member

@ShockedPlot7560 ShockedPlot7560 commented Dec 20, 2023

Introduction

We already support to change the random tick speed in server, however we can't control which world or change it at runtime. This PR fix that by providing an API and adding new configuration key.

Relevant issues

Changes

API changes

Adding the following functions to World:

  • setTickedBlocksPerSubchunkPerTick
  • getTickedBlocksPerSubchunkPerTick

Adding a new event WorldTickedBlocksChangeEvent which is fired when the value of tickedBlocksPerSubchunkPerTick change (not at the initialisation).

Backwards compatibility

No

Follow-up

Change the configuration nested the worlds per-tick and the default value under a blocks-per-subchunk-per-tick

@ShockedPlot7560 ShockedPlot7560 added Category: API Related to the plugin API Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Dec 20, 2023
resources/pocketmine.yml Outdated Show resolved Hide resolved
@CicciogamerRrr

This comment was marked as spam.

Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the method names are too esoteric for anyone to ever actually use them. Can we simplify these names at all without losing the meaning?

@@ -215,6 +215,7 @@ worlds:
# seed: 404
# generator: FLAT
# preset: 2;bedrock,59xstone,3xdirt,grass;1
# blocks-per-subchunk-per-tick: xx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# blocks-per-subchunk-per-tick: xx
# blocks-per-subchunk-per-tick: 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: API Related to the plugin API Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants