Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Add ChunkEvent#176

Merged
TheGlitch76 merged 2 commits intomasterfrom
feature/chunk_event
Aug 15, 2020
Merged

Add ChunkEvent#176
TheGlitch76 merged 2 commits intomasterfrom
feature/chunk_event

Conversation

@rikka0w0
Copy link
Contributor

Implements ChunkEvent.Load and ChunkEvent.Unload events.

Most of these events are backed with the corresponding Fabric events, except for ChunkEvent.Load, which needs 1 extra mixin.

@rikka0w0 rikka0w0 requested a review from TheGlitch76 August 13, 2020 13:52
* ChunkEvent is fired when an event involving a chunk occurs.<br>
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as
* its parameter, the method will receive every child event of this class.<br>
* <br>
Copy link
Member

Choose a reason for hiding this comment

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

i think for now I'm not going to require changing the javadocs for Forge classes besides MCP-B-Gone because it just adds noise

* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
*/
public static class Unload extends ChunkEvent {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like you forgot to implement the patch for this on the server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the server side, it is fired here:

ServerChunkEvents.CHUNK_UNLOAD.register((server, chunk) -> MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(chunk)));

* <br>
* This event is fired on the {@link MinecraftForge#EVENT_BUS}.<br>
*/
public static class Load extends ChunkEvent {
Copy link
Member

Choose a reason for hiding this comment

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

This event is fired in two different spots in TACS, but you only fire it once here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Server:

  1. ServerChunkEvents.CHUNK_LOAD.register((server, chunk) -> MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(chunk)));

  2. Client:
  3. ClientChunkEvents.CHUNK_LOAD.register((server, chunk) -> MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(chunk)));

This should behaves exactly the same as Forge. I dont think i missed anything.

Copy link
Member

@TheGlitch76 TheGlitch76 Aug 15, 2020

Choose a reason for hiding this comment

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

I missed this file! I marked it as "viewed" and glossed right over it

…t/world/WorldEventsClient.java

Co-authored-by: Glitch <glitchieproductionsofficial@gmail.com>
@TheGlitch76 TheGlitch76 merged commit 72a45a3 into master Aug 15, 2020
@TheGlitch76 TheGlitch76 deleted the feature/chunk_event branch August 15, 2020 00:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants