Remove unnecessary synchronized blocks

This commit is contained in:
Felix Cravic 2020-12-08 03:37:00 +01:00
parent eca6a657c3
commit 91dc4eb675
2 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ import net.minestom.server.world.biomes.Biome;
import net.minestom.server.world.biomes.BiomeManager;
/**
* Hacky class for Optifine because of an issue making the client crash if biomes 'swamp' or 'swamp_hills'
* Hacky class for Optifine because of an issue making the client crash if biomes 'swamp' and 'swamp_hills'
* are not registered.
* <p>
* Can be removed anytime, hope that it will be fixed.

View File

@ -508,7 +508,7 @@ public abstract class Chunk implements Viewable, DataContainer {
*
* @param player the player
*/
public synchronized void sendChunk(@NotNull Player player) {
public void sendChunk(@NotNull Player player) {
// Only send loaded chunk
if (!isLoaded())
return;
@ -521,7 +521,7 @@ public abstract class Chunk implements Viewable, DataContainer {
playerConnection.sendPacket(getLightPacket());
}
public synchronized void sendChunk() {
public void sendChunk() {
if (!isLoaded()) {
return;
}
@ -535,7 +535,7 @@ public abstract class Chunk implements Viewable, DataContainer {
*
* @param player the player to update the chunk to
*/
public synchronized void sendChunkUpdate(@NotNull Player player) {
public void sendChunkUpdate(@NotNull Player player) {
final PlayerConnection playerConnection = player.getPlayerConnection();
playerConnection.sendPacket(getFreshFullDataPacket());
}
@ -543,7 +543,7 @@ public abstract class Chunk implements Viewable, DataContainer {
/**
* Sends a full {@link ChunkDataPacket} to all chunk viewers.
*/
public synchronized void sendChunkUpdate() {
public void sendChunkUpdate() {
PacketUtils.sendGroupedPacket(getViewers(), getFreshFullDataPacket());
}
@ -554,7 +554,7 @@ public abstract class Chunk implements Viewable, DataContainer {
* @param player the player to send the packet to
* @throws IllegalArgumentException if {@code section} is not a valid section
*/
public synchronized void sendChunkSectionUpdate(int section, @NotNull Player player) {
public void sendChunkSectionUpdate(int section, @NotNull Player player) {
if (!PlayerUtils.isNettyClient(player))
return;
Check.argCondition(!MathUtils.isBetween(section, 0, CHUNK_SECTION_COUNT),