mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-21 15:59:33 +00:00
Fix protocols (#534)
* Try to fix LMS * Fix jade empty ender chest * Remove useless code
This commit is contained in:
@@ -7,6 +7,7 @@ import net.minecraft.network.codec.ByteBufCodecs;
|
|||||||
import net.minecraft.network.codec.StreamCodec;
|
import net.minecraft.network.codec.StreamCodec;
|
||||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||||
import org.leavesmc.leaves.LeavesConfig;
|
import org.leavesmc.leaves.LeavesConfig;
|
||||||
@@ -67,9 +68,9 @@ public class LMSPasterProtocol implements LeavesProtocol {
|
|||||||
private static void triggerCommand(ServerPlayer player, String playerName, String command) {
|
private static void triggerCommand(ServerPlayer player, String playerName, String command) {
|
||||||
if (command.isEmpty()) {
|
if (command.isEmpty()) {
|
||||||
LeavesLogger.LOGGER.warning(String.format("Player %s sent an empty command", playerName));
|
LeavesLogger.LOGGER.warning(String.format("Player %s sent an empty command", playerName));
|
||||||
} else {
|
return;
|
||||||
player.getBukkitEntity().performCommand(command);
|
|
||||||
}
|
}
|
||||||
|
MinecraftServer.getServer().execute(() -> player.getBukkitEntity().performCommand(command));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.minecraft.world.entity.vehicle.ContainerEntity;
|
|||||||
import net.minecraft.world.inventory.PlayerEnderChestContainer;
|
import net.minecraft.world.inventory.PlayerEnderChestContainer;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.block.ChestBlock;
|
import net.minecraft.world.level.block.ChestBlock;
|
||||||
|
import net.minecraft.world.level.block.EnderChestBlock;
|
||||||
import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
|
import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.EnderChestBlockEntity;
|
import net.minecraft.world.level.block.entity.EnderChestBlockEntity;
|
||||||
@@ -99,6 +100,9 @@ public enum ItemStorageExtensionProvider implements IServerExtensionProvider<Ite
|
|||||||
case ContainerEntity containerEntity when containerEntity.getContainerLootTable() != null -> {
|
case ContainerEntity containerEntity when containerEntity.getContainerLootTable() != null -> {
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
|
case EnderChestBlockEntity enderChest when request.getPlayer().getEnderChestInventory().isEmpty() -> {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
default -> {
|
default -> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user