-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also added a world chunk unloaded event, added a method to `ServerWorldExtension` for sending packets to nearby players (currently sends packets to all players in the `ServerWorld`, fixed `FallingBlockEntity`s and fixed `WorldGenerationProgressListener`s statuses being updated by non-overworld dimensions.
- Loading branch information
1 parent
def05ad
commit aa77dd4
Showing
9 changed files
with
212 additions
and
25 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
.../github/steveplays28/noisiumchunkmanager/extension/world/server/ServerWorldExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package io.github.steveplays28.noisiumchunkmanager.extension.world.server; | ||
|
||
import io.github.steveplays28.noisiumchunkmanager.server.world.ServerWorldChunkManager; | ||
import net.minecraft.network.packet.Packet; | ||
import net.minecraft.world.gen.noise.NoiseConfig; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public interface ServerWorldExtension { | ||
ServerWorldChunkManager noisiumchunkmanager$getServerWorldChunkManager(); | ||
|
||
NoiseConfig noisiumchunkmanager$getNoiseConfig(); | ||
|
||
void noisiumchunkmanager$sendPacketToNearbyPlayers(@NotNull Packet<?> packet); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...java/io/github/steveplays28/noisiumchunkmanager/mixin/entity/FallingBlockEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.github.steveplays28.noisiumchunkmanager.mixin.entity; | ||
|
||
import io.github.steveplays28.noisiumchunkmanager.extension.world.server.ServerWorldExtension; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.FallingBlockEntity; | ||
import net.minecraft.network.packet.Packet; | ||
import net.minecraft.server.world.ThreadedAnvilChunkStorage; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(FallingBlockEntity.class) | ||
public class FallingBlockEntityMixin { | ||
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;sendToOtherNearbyPlayers(Lnet/minecraft/entity/Entity;Lnet/minecraft/network/packet/Packet;)V")) | ||
private void noisiumchunkmanager$sendBlockUpdatePacketToAllPlayersInEntityWorld(@Nullable ThreadedAnvilChunkStorage instance, @NotNull Entity entity, @NotNull Packet<?> packet) { | ||
@NotNull var world = entity.getWorld(); | ||
if (world.isClient()) { | ||
return; | ||
} | ||
|
||
((ServerWorldExtension) world).noisiumchunkmanager$sendPacketToNearbyPlayers(packet); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.