mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 03:44:54 -04:00
network: advancements
This commit is contained in:
parent
c93cc75825
commit
d6d1220778
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020 Moritz Zwerger
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -11,14 +11,11 @@
|
|||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.bixilon.minosoft.data.player.advancements;
|
package de.bixilon.minosoft.advancements
|
||||||
|
|
||||||
import java.util.HashMap;
|
data class Advancement(
|
||||||
|
val parent: String?,
|
||||||
public class AdvancementProgress {
|
val display: AdvancementDisplay?,
|
||||||
private final HashMap<String, CriterionProgress> progress;
|
val criteria: Set<String>,
|
||||||
|
val requirements: Set<Set<String>>,
|
||||||
public AdvancementProgress(HashMap<String, CriterionProgress> progress) {
|
)
|
||||||
this.progress = progress;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Minosoft
|
||||||
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.bixilon.minosoft.advancements
|
||||||
|
|
||||||
|
import de.bixilon.minosoft.data.inventory.ItemStack
|
||||||
|
import de.bixilon.minosoft.data.text.ChatComponent
|
||||||
|
import glm_.vec2.Vec2
|
||||||
|
|
||||||
|
data class AdvancementDisplay(
|
||||||
|
val title: ChatComponent,
|
||||||
|
val description: ChatComponent,
|
||||||
|
val icon: ItemStack?,
|
||||||
|
val frame: AdvancementFrames,
|
||||||
|
val background: String?,
|
||||||
|
val position: Vec2,
|
||||||
|
)
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020 Moritz Zwerger
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -11,22 +11,19 @@
|
|||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.bixilon.minosoft.data.player.advancements;
|
package de.bixilon.minosoft.advancements
|
||||||
|
|
||||||
public class CriterionProgress {
|
import de.bixilon.kutil.enums.EnumUtil
|
||||||
private final boolean archived;
|
import de.bixilon.kutil.enums.ValuesEnum
|
||||||
private final Long archiveTime;
|
|
||||||
|
|
||||||
public CriterionProgress(boolean archived, Long archiveTime) {
|
enum class AdvancementFrames {
|
||||||
this.archived = archived;
|
TASK,
|
||||||
this.archiveTime = archiveTime;
|
CHALLENGE,
|
||||||
}
|
GOAL,
|
||||||
|
;
|
||||||
|
|
||||||
public boolean isArchived() {
|
companion object : ValuesEnum<AdvancementFrames> {
|
||||||
return this.archived;
|
override val VALUES: Array<AdvancementFrames> = values()
|
||||||
}
|
override val NAME_MAP: Map<String, AdvancementFrames> = EnumUtil.getEnumValues(VALUES)
|
||||||
|
|
||||||
public Long getArchiveTime() {
|
|
||||||
return this.archiveTime;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Minosoft
|
||||||
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.bixilon.minosoft.advancements
|
||||||
|
|
||||||
|
data class AdvancementProgress(
|
||||||
|
val criterion: String,
|
||||||
|
val archiveTime: Long?,
|
||||||
|
)
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Minosoft
|
|
||||||
* Copyright (C) 2020 Moritz Zwerger
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.bixilon.minosoft.data.player.advancements;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class Advancement {
|
|
||||||
private final String parentName;
|
|
||||||
private final AdvancementDisplay display;
|
|
||||||
private final ArrayList<String> criteria;
|
|
||||||
private final ArrayList<String[]> requirements;
|
|
||||||
|
|
||||||
public Advancement(String parentName, AdvancementDisplay display, ArrayList<String> criteria, ArrayList<String[]> requirements) {
|
|
||||||
this.parentName = parentName;
|
|
||||||
this.display = display;
|
|
||||||
this.criteria = criteria;
|
|
||||||
this.requirements = requirements;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentName() {
|
|
||||||
return this.parentName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AdvancementDisplay getDisplay() {
|
|
||||||
return this.display;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String> getCriteria() {
|
|
||||||
return this.criteria;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<String[]> getRequirements() {
|
|
||||||
return this.requirements;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,103 +0,0 @@
|
|||||||
/*
|
|
||||||
* Minosoft
|
|
||||||
* Copyright (C) 2020 Moritz Zwerger
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.bixilon.minosoft.data.player.advancements;
|
|
||||||
|
|
||||||
import de.bixilon.minosoft.data.inventory.ItemStack;
|
|
||||||
import de.bixilon.minosoft.data.text.ChatComponent;
|
|
||||||
import de.bixilon.minosoft.util.BitByte;
|
|
||||||
|
|
||||||
public class AdvancementDisplay {
|
|
||||||
private final ChatComponent title;
|
|
||||||
private final ChatComponent description;
|
|
||||||
private final ItemStack icon;
|
|
||||||
private final AdvancementFrameTypes frameType;
|
|
||||||
private final int flags;
|
|
||||||
private final String backgroundTexture;
|
|
||||||
private final float x;
|
|
||||||
private final float y;
|
|
||||||
|
|
||||||
public AdvancementDisplay(ChatComponent title, ChatComponent description, ItemStack icon, AdvancementFrameTypes frameType, int flags, String backgroundTexture, float x, float y) {
|
|
||||||
this.title = title;
|
|
||||||
this.description = description;
|
|
||||||
this.icon = icon;
|
|
||||||
this.frameType = frameType;
|
|
||||||
this.flags = flags;
|
|
||||||
this.backgroundTexture = backgroundTexture;
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AdvancementDisplay(ChatComponent title, ChatComponent description, ItemStack icon, AdvancementFrameTypes frameType, int flags, float x, float y) {
|
|
||||||
this.title = title;
|
|
||||||
this.description = description;
|
|
||||||
this.icon = icon;
|
|
||||||
this.frameType = frameType;
|
|
||||||
this.flags = flags;
|
|
||||||
this.backgroundTexture = null;
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatComponent getTitle() {
|
|
||||||
return this.title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatComponent getDescription() {
|
|
||||||
return this.description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getIcon() {
|
|
||||||
return this.icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AdvancementFrameTypes getFrameType() {
|
|
||||||
return this.frameType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasBackgroundTexture() {
|
|
||||||
return BitByte.isBitMask(this.flags, 0x01);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean showToast() {
|
|
||||||
return BitByte.isBitMask(this.flags, 0x02);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isHidden() {
|
|
||||||
return BitByte.isBitMask(this.flags, 0x04);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBackgroundTexture() {
|
|
||||||
return this.backgroundTexture;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getX() {
|
|
||||||
return this.x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getY() {
|
|
||||||
return this.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum AdvancementFrameTypes {
|
|
||||||
TASK,
|
|
||||||
CHALLENGE,
|
|
||||||
GOAL;
|
|
||||||
|
|
||||||
private static final AdvancementFrameTypes[] ADVANCEMENT_FRAME_TYPES = values();
|
|
||||||
|
|
||||||
public static AdvancementFrameTypes byId(int id) {
|
|
||||||
return ADVANCEMENT_FRAME_TYPES[id];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -87,7 +87,7 @@ class PlayConnection(
|
|||||||
val tags: MutableMap<ResourceLocation, Map<ResourceLocation, Tag<Any>>> = synchronizedMapOf()
|
val tags: MutableMap<ResourceLocation, Map<ResourceLocation, Tag<Any>>> = synchronizedMapOf()
|
||||||
lateinit var language: LanguageManager
|
lateinit var language: LanguageManager
|
||||||
|
|
||||||
var commandRootNode: CommandRootNode? = null
|
var commandRoot: CommandRootNode? = null
|
||||||
|
|
||||||
|
|
||||||
var rendering: Rendering? = null
|
var rendering: Rendering? = null
|
||||||
|
@ -15,7 +15,7 @@ package de.bixilon.minosoft.protocol.packets.s2c.interfaces
|
|||||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||||
|
|
||||||
interface CompressionThresholdChange : PlayS2CPacket {
|
interface CompressionS2CP : PlayS2CPacket {
|
||||||
val threshold: Int
|
val threshold: Int
|
||||||
|
|
||||||
override fun handle(connection: PlayConnection) {
|
override fun handle(connection: PlayConnection) {
|
@ -13,7 +13,7 @@
|
|||||||
package de.bixilon.minosoft.protocol.packets.s2c.login
|
package de.bixilon.minosoft.protocol.packets.s2c.login
|
||||||
|
|
||||||
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.interfaces.CompressionThresholdChange
|
import de.bixilon.minosoft.protocol.packets.s2c.interfaces.CompressionS2CP
|
||||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||||
import de.bixilon.minosoft.protocol.protocol.ProtocolStates
|
import de.bixilon.minosoft.protocol.protocol.ProtocolStates
|
||||||
import de.bixilon.minosoft.util.logging.Log
|
import de.bixilon.minosoft.util.logging.Log
|
||||||
@ -21,7 +21,7 @@ import de.bixilon.minosoft.util.logging.LogLevels
|
|||||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||||
|
|
||||||
@LoadPacket(state = ProtocolStates.LOGIN, threadSafe = false)
|
@LoadPacket(state = ProtocolStates.LOGIN, threadSafe = false)
|
||||||
class CompressionS2CP(buffer: PlayInByteBuffer) : CompressionThresholdChange {
|
class CompressionS2CP(buffer: PlayInByteBuffer) : CompressionS2CP {
|
||||||
override val threshold: Int = buffer.readVarInt()
|
override val threshold: Int = buffer.readVarInt()
|
||||||
|
|
||||||
override fun log(reducedLog: Boolean) {
|
override fun log(reducedLog: Boolean) {
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Minosoft
|
||||||
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
|
*/
|
||||||
|
package de.bixilon.minosoft.protocol.packets.s2c.play
|
||||||
|
|
||||||
|
import de.bixilon.kutil.cast.CastUtil.unsafeCast
|
||||||
|
import de.bixilon.minosoft.data.commands.CommandArgumentNode
|
||||||
|
import de.bixilon.minosoft.data.commands.CommandLiteralNode
|
||||||
|
import de.bixilon.minosoft.data.commands.CommandNode
|
||||||
|
import de.bixilon.minosoft.data.commands.CommandRootNode
|
||||||
|
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
||||||
|
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
||||||
|
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||||
|
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||||
|
import de.bixilon.minosoft.util.logging.Log
|
||||||
|
import de.bixilon.minosoft.util.logging.LogLevels
|
||||||
|
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||||
|
|
||||||
|
@LoadPacket
|
||||||
|
class CommandsS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||||
|
val nodes = buffer.readCommandNodeArray()
|
||||||
|
val root = nodes[buffer.readVarInt()].unsafeCast<CommandRootNode>()
|
||||||
|
|
||||||
|
override fun handle(connection: PlayConnection) {
|
||||||
|
connection.commandRoot = root
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun log(reducedLog: Boolean) {
|
||||||
|
Log.log(LogMessageType.NETWORK_PACKETS_IN, LogLevels.VERBOSE) { "Commands (nodes=$nodes, root=$root)" }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun PlayInByteBuffer.readCommandNode(): CommandNode {
|
||||||
|
val flags = readByte().toInt()
|
||||||
|
return when (CommandNode.NodeTypes.byId(flags and 0x03)!!) {
|
||||||
|
CommandNode.NodeTypes.ROOT -> CommandRootNode(flags, this)
|
||||||
|
CommandNode.NodeTypes.LITERAL -> CommandLiteralNode(flags, this)
|
||||||
|
CommandNode.NodeTypes.ARGUMENT -> CommandArgumentNode(flags, this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmOverloads
|
||||||
|
@Deprecated("refactor")
|
||||||
|
fun PlayInByteBuffer.readCommandNodeArray(length: Int = readVarInt()): Array<CommandNode> {
|
||||||
|
val nodes = readArray(length) { readCommandNode() }
|
||||||
|
for (node in nodes) {
|
||||||
|
if (node.redirectNodeId != -1) {
|
||||||
|
node.redirectNode = nodes[node.redirectNodeId]
|
||||||
|
}
|
||||||
|
|
||||||
|
for (childId in node.childrenIds) {
|
||||||
|
when (val child = nodes[childId]) {
|
||||||
|
is CommandArgumentNode -> {
|
||||||
|
node.argumentsChildren.add(child)
|
||||||
|
}
|
||||||
|
is CommandLiteralNode -> {
|
||||||
|
node.literalChildren[child.name] = child
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nodes
|
||||||
|
}
|
||||||
|
}
|
@ -13,14 +13,14 @@
|
|||||||
package de.bixilon.minosoft.protocol.packets.s2c.play
|
package de.bixilon.minosoft.protocol.packets.s2c.play
|
||||||
|
|
||||||
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.interfaces.CompressionThresholdChange
|
import de.bixilon.minosoft.protocol.packets.s2c.interfaces.CompressionS2CP
|
||||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||||
import de.bixilon.minosoft.util.logging.Log
|
import de.bixilon.minosoft.util.logging.Log
|
||||||
import de.bixilon.minosoft.util.logging.LogLevels
|
import de.bixilon.minosoft.util.logging.LogLevels
|
||||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||||
|
|
||||||
@LoadPacket(threadSafe = false)
|
@LoadPacket(threadSafe = false)
|
||||||
class CompressionS2CP(buffer: PlayInByteBuffer) : CompressionThresholdChange {
|
class CompressionS2CP(buffer: PlayInByteBuffer) : CompressionS2CP {
|
||||||
override val threshold: Int = buffer.readVarInt()
|
override val threshold: Int = buffer.readVarInt()
|
||||||
|
|
||||||
override fun log(reducedLog: Boolean) {
|
override fun log(reducedLog: Boolean) {
|
||||||
|
@ -1,129 +0,0 @@
|
|||||||
/*
|
|
||||||
* Minosoft
|
|
||||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.bixilon.minosoft.protocol.packets.s2c.play;
|
|
||||||
|
|
||||||
import de.bixilon.minosoft.data.inventory.ItemStack;
|
|
||||||
import de.bixilon.minosoft.data.player.advancements.Advancement;
|
|
||||||
import de.bixilon.minosoft.data.player.advancements.AdvancementDisplay;
|
|
||||||
import de.bixilon.minosoft.data.player.advancements.AdvancementProgress;
|
|
||||||
import de.bixilon.minosoft.data.player.advancements.CriterionProgress;
|
|
||||||
import de.bixilon.minosoft.data.text.ChatComponent;
|
|
||||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection;
|
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket;
|
|
||||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer;
|
|
||||||
import de.bixilon.minosoft.util.BitByte;
|
|
||||||
import de.bixilon.minosoft.util.logging.Log;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public class PacketAdvancements implements PlayS2CPacket {
|
|
||||||
private final HashMap<String, Advancement> advancements = new HashMap<>();
|
|
||||||
private final HashMap<String, AdvancementProgress> progresses = new HashMap<>();
|
|
||||||
private final boolean reset;
|
|
||||||
private final String[] toRemove;
|
|
||||||
|
|
||||||
public PacketAdvancements(PlayInByteBuffer buffer) {
|
|
||||||
this.reset = buffer.readBoolean();
|
|
||||||
int length = buffer.readVarInt();
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
String advancementKey = buffer.readString();
|
|
||||||
|
|
||||||
String parentName = null;
|
|
||||||
if (buffer.readBoolean()) {
|
|
||||||
parentName = buffer.readString();
|
|
||||||
}
|
|
||||||
AdvancementDisplay display = null;
|
|
||||||
if (buffer.readBoolean()) {
|
|
||||||
ChatComponent title = buffer.readChatComponent();
|
|
||||||
ChatComponent description = buffer.readChatComponent();
|
|
||||||
ItemStack icon = buffer.readItemStack();
|
|
||||||
AdvancementDisplay.AdvancementFrameTypes frameType = AdvancementDisplay.AdvancementFrameTypes.byId(buffer.readVarInt());
|
|
||||||
int flags = buffer.readInt();
|
|
||||||
String backgroundTexture = null;
|
|
||||||
if (BitByte.isBitMask(flags, 0x01)) {
|
|
||||||
backgroundTexture = buffer.readString();
|
|
||||||
}
|
|
||||||
float x = buffer.readFloat();
|
|
||||||
float y = buffer.readFloat();
|
|
||||||
display = new AdvancementDisplay(title, description, icon, frameType, flags, backgroundTexture, x, y);
|
|
||||||
}
|
|
||||||
int criteriaCount = buffer.readVarInt();
|
|
||||||
ArrayList<String> criteria = new ArrayList<>();
|
|
||||||
for (int ii = 0; ii < criteriaCount; ii++) {
|
|
||||||
criteria.add(buffer.readString());
|
|
||||||
}
|
|
||||||
int requirementsCount = buffer.readVarInt();
|
|
||||||
ArrayList<String[]> requirements = new ArrayList<>();
|
|
||||||
for (int ii = 0; ii < requirementsCount; ii++) {
|
|
||||||
String[] requirement = new String[buffer.readVarInt()];
|
|
||||||
for (int iii = 0; iii < requirement.length; iii++) {
|
|
||||||
requirement[iii] = buffer.readString();
|
|
||||||
}
|
|
||||||
requirements.add(requirement);
|
|
||||||
}
|
|
||||||
this.advancements.put(advancementKey, new Advancement(parentName, display, criteria, requirements));
|
|
||||||
}
|
|
||||||
this.toRemove = new String[buffer.readVarInt()];
|
|
||||||
for (int i = 0; i < this.toRemove.length; i++) {
|
|
||||||
this.toRemove[i] = buffer.readString();
|
|
||||||
}
|
|
||||||
int progressesLength = buffer.readVarInt();
|
|
||||||
for (int i = 0; i < progressesLength; i++) {
|
|
||||||
HashMap<String, CriterionProgress> progress = new HashMap<>();
|
|
||||||
String progressName = buffer.readString();
|
|
||||||
int criterionLength = buffer.readVarInt();
|
|
||||||
for (int ii = 0; ii < criterionLength; ii++) {
|
|
||||||
String criterionName = buffer.readString();
|
|
||||||
boolean archived = buffer.readBoolean();
|
|
||||||
Long archiveTime = null;
|
|
||||||
if (archived) {
|
|
||||||
archiveTime = buffer.readLong();
|
|
||||||
}
|
|
||||||
CriterionProgress criterionProgress = new CriterionProgress(archived, archiveTime);
|
|
||||||
progress.put(criterionName, criterionProgress);
|
|
||||||
}
|
|
||||||
this.progresses.put(progressName, new AdvancementProgress(progress));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void log(boolean reducedLog) {
|
|
||||||
Log.protocol(String.format("[IN] Receiving advancements (reset=%s, advancements=%s, progresses=%s)", this.reset, this.advancements.size(), this.progresses.size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isReset() {
|
|
||||||
return this.reset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashMap<String, Advancement> getAdvancements() {
|
|
||||||
return this.advancements;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashMap<String, AdvancementProgress> getProgresses() {
|
|
||||||
return this.progresses;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(@NotNull PlayConnection connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void check(@NotNull PlayConnection connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* Minosoft
|
|
||||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.bixilon.minosoft.protocol.packets.s2c.play;
|
|
||||||
|
|
||||||
import de.bixilon.minosoft.data.commands.CommandNode;
|
|
||||||
import de.bixilon.minosoft.data.commands.CommandRootNode;
|
|
||||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection;
|
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket;
|
|
||||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer;
|
|
||||||
import de.bixilon.minosoft.util.logging.Log;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public class PacketDeclareCommands implements PlayS2CPacket {
|
|
||||||
private final CommandRootNode rootNode;
|
|
||||||
|
|
||||||
public PacketDeclareCommands(PlayInByteBuffer buffer) {
|
|
||||||
CommandNode[] nodes = buffer.readCommandNodeArray();
|
|
||||||
this.rootNode = (CommandRootNode) nodes[buffer.readVarInt()];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayConnection connection) {
|
|
||||||
connection.setCommandRootNode(getRootNode());
|
|
||||||
}
|
|
||||||
|
|
||||||
public CommandRootNode getRootNode() {
|
|
||||||
return this.rootNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void log(boolean reducedLog) {
|
|
||||||
Log.protocol("Received declare commands packets");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void check(@NotNull PlayConnection connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
* Minosoft
|
|
||||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.bixilon.minosoft.protocol.packets.s2c.play;
|
|
||||||
|
|
||||||
import de.bixilon.minosoft.data.registries.ResourceLocation;
|
|
||||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection;
|
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket;
|
|
||||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer;
|
|
||||||
import de.bixilon.minosoft.util.logging.Log;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public class PacketSelectAdvancementTab implements PlayS2CPacket {
|
|
||||||
private AdvancementTabs tab;
|
|
||||||
|
|
||||||
public PacketSelectAdvancementTab(PlayInByteBuffer buffer) {
|
|
||||||
if (buffer.readBoolean()) {
|
|
||||||
this.tab = AdvancementTabs.VALUES.get(buffer.readResourceLocation());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void log(boolean reducedLog) {
|
|
||||||
Log.protocol(String.format("[IN] Received select advancement tab (tab=%s)", this.tab));
|
|
||||||
}
|
|
||||||
|
|
||||||
public AdvancementTabs getTab() {
|
|
||||||
return this.tab;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(@NotNull PlayConnection connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void check(@NotNull PlayConnection connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum AdvancementTabs {
|
|
||||||
STORY(new ResourceLocation("story/root")),
|
|
||||||
NETHER(new ResourceLocation("nether/root")),
|
|
||||||
END(new ResourceLocation("end/root")),
|
|
||||||
ADVENTURE(new ResourceLocation("adventure/root")),
|
|
||||||
HUSBANDRY(new ResourceLocation("husbandry/root"));
|
|
||||||
|
|
||||||
public static final HashMap<ResourceLocation, AdvancementTabs> VALUES = new HashMap<>();
|
|
||||||
|
|
||||||
static {
|
|
||||||
for (AdvancementTabs tab : values()) {
|
|
||||||
VALUES.put(tab.resourceLocation, tab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private final ResourceLocation resourceLocation;
|
|
||||||
|
|
||||||
AdvancementTabs(ResourceLocation resourceLocation) {
|
|
||||||
this.resourceLocation = resourceLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResourceLocation getResourceLocation() {
|
|
||||||
return this.resourceLocation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Minosoft
|
||||||
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.bixilon.minosoft.protocol.packets.s2c.play.advancement
|
||||||
|
|
||||||
|
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
||||||
|
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||||
|
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||||
|
import de.bixilon.minosoft.util.logging.Log
|
||||||
|
import de.bixilon.minosoft.util.logging.LogLevels
|
||||||
|
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||||
|
|
||||||
|
@LoadPacket
|
||||||
|
class AdvancementTabS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||||
|
val tab = buffer.readPlayOptional { readResourceLocation() }
|
||||||
|
|
||||||
|
|
||||||
|
override fun log(reducedLog: Boolean) {
|
||||||
|
Log.log(LogMessageType.NETWORK_PACKETS_IN, LogLevels.VERBOSE) { "Advancement tab (tab=$tab)" }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* Minosoft
|
||||||
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.bixilon.minosoft.protocol.packets.s2c.play.advancement
|
||||||
|
|
||||||
|
import de.bixilon.minosoft.advancements.Advancement
|
||||||
|
import de.bixilon.minosoft.advancements.AdvancementDisplay
|
||||||
|
import de.bixilon.minosoft.advancements.AdvancementFrames
|
||||||
|
import de.bixilon.minosoft.advancements.AdvancementProgress
|
||||||
|
import de.bixilon.minosoft.protocol.packets.factory.LoadPacket
|
||||||
|
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||||
|
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||||
|
import de.bixilon.minosoft.util.BitByte.isBit
|
||||||
|
import de.bixilon.minosoft.util.logging.Log
|
||||||
|
import de.bixilon.minosoft.util.logging.LogLevels
|
||||||
|
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||||
|
|
||||||
|
@LoadPacket
|
||||||
|
class AdvancementsS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||||
|
val reset = buffer.readBoolean()
|
||||||
|
val advancements: Map<String, Advancement?>
|
||||||
|
val progress: Map<String, Set<AdvancementProgress>>
|
||||||
|
|
||||||
|
init {
|
||||||
|
val advancements: MutableMap<String, Advancement?> = mutableMapOf()
|
||||||
|
for (i in 0 until buffer.readVarInt()) {
|
||||||
|
val key = buffer.readString()
|
||||||
|
val parent = buffer.readOptional { readString() }
|
||||||
|
val display = buffer.readPlayOptional { readDisplay() }
|
||||||
|
val criteria = buffer.readStringArray().toSet()
|
||||||
|
val requirements = buffer.readArray { buffer.readStringArray().toSet() }.toSet()
|
||||||
|
|
||||||
|
advancements[key] = Advancement(
|
||||||
|
parent = parent,
|
||||||
|
display = display,
|
||||||
|
criteria = criteria,
|
||||||
|
requirements = requirements,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
for (remove in buffer.readStringArray()) {
|
||||||
|
advancements[remove] = null
|
||||||
|
}
|
||||||
|
this.advancements = advancements
|
||||||
|
|
||||||
|
val progress: MutableMap<String, Set<AdvancementProgress>> = mutableMapOf()
|
||||||
|
for (i in 0 until buffer.readVarInt()) {
|
||||||
|
val name = buffer.readString()
|
||||||
|
val criteria: MutableSet<AdvancementProgress> = mutableSetOf()
|
||||||
|
for (ii in 0 until buffer.readVarInt()) {
|
||||||
|
val criterion = buffer.readString()
|
||||||
|
val archiveTime = buffer.readOptional { readLong() }
|
||||||
|
criteria += AdvancementProgress(
|
||||||
|
criterion = criterion,
|
||||||
|
archiveTime = archiveTime,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
progress[name] = criteria
|
||||||
|
}
|
||||||
|
this.progress = progress
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun log(reducedLog: Boolean) {
|
||||||
|
Log.log(LogMessageType.NETWORK_PACKETS_IN, LogLevels.VERBOSE) { "Advancements (reset=$reset, advancements=$advancements, progress=$progress)" }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun PlayInByteBuffer.readDisplay(): AdvancementDisplay {
|
||||||
|
val title = readChatComponent()
|
||||||
|
val description = readChatComponent()
|
||||||
|
val icon = readItemStack()
|
||||||
|
val frame = AdvancementFrames[readVarInt()]
|
||||||
|
val flags = readInt()
|
||||||
|
val background = if (flags.isBit(0)) readString() else null
|
||||||
|
val position = readVec2f()
|
||||||
|
|
||||||
|
return AdvancementDisplay(
|
||||||
|
title = title,
|
||||||
|
description = description,
|
||||||
|
icon = icon,
|
||||||
|
frame = frame,
|
||||||
|
background = background,
|
||||||
|
position = position,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020 Moritz Zwerger
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -13,10 +13,6 @@
|
|||||||
package de.bixilon.minosoft.protocol.protocol
|
package de.bixilon.minosoft.protocol.protocol
|
||||||
|
|
||||||
import de.bixilon.kutil.uuid.UUIDUtil.toUUID
|
import de.bixilon.kutil.uuid.UUIDUtil.toUUID
|
||||||
import de.bixilon.minosoft.data.commands.CommandArgumentNode
|
|
||||||
import de.bixilon.minosoft.data.commands.CommandLiteralNode
|
|
||||||
import de.bixilon.minosoft.data.commands.CommandNode
|
|
||||||
import de.bixilon.minosoft.data.commands.CommandRootNode
|
|
||||||
import de.bixilon.minosoft.data.direction.Directions
|
import de.bixilon.minosoft.data.direction.Directions
|
||||||
import de.bixilon.minosoft.data.entities.Poses
|
import de.bixilon.minosoft.data.entities.Poses
|
||||||
import de.bixilon.minosoft.data.registries.ResourceLocation
|
import de.bixilon.minosoft.data.registries.ResourceLocation
|
||||||
@ -25,6 +21,7 @@ import de.bixilon.minosoft.data.text.ChatComponent
|
|||||||
import de.bixilon.minosoft.util.Util
|
import de.bixilon.minosoft.util.Util
|
||||||
import de.bixilon.minosoft.util.json.Jackson
|
import de.bixilon.minosoft.util.json.Jackson
|
||||||
import de.bixilon.minosoft.util.nbt.tag.NBTTagTypes
|
import de.bixilon.minosoft.util.nbt.tag.NBTTagTypes
|
||||||
|
import glm_.vec2.Vec2
|
||||||
import glm_.vec2.Vec2i
|
import glm_.vec2.Vec2i
|
||||||
import glm_.vec3.Vec3
|
import glm_.vec3.Vec3
|
||||||
import glm_.vec3.Vec3d
|
import glm_.vec3.Vec3d
|
||||||
@ -299,14 +296,18 @@ open class InByteBuffer {
|
|||||||
return (readByte() * ProtocolDefinition.ANGLE_CALCULATION_CONSTANT).toInt()
|
return (readByte() * ProtocolDefinition.ANGLE_CALCULATION_CONSTANT).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun readVec3d(): Vec3d {
|
fun readVec2f(): Vec2 {
|
||||||
return Vec3d(readDouble(), readDouble(), readDouble())
|
return Vec2(readFloat(), readFloat())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun readVec3f(): Vec3 {
|
fun readVec3f(): Vec3 {
|
||||||
return Vec3(readFloat(), readFloat(), readFloat())
|
return Vec3(readFloat(), readFloat(), readFloat())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun readVec3d(): Vec3d {
|
||||||
|
return Vec3d(readDouble(), readDouble(), readDouble())
|
||||||
|
}
|
||||||
|
|
||||||
fun readByteBlockPosition(): Vec3i {
|
fun readByteBlockPosition(): Vec3i {
|
||||||
return Vec3i(readInt(), readByte(), readInt())
|
return Vec3i(readInt(), readByte(), readInt())
|
||||||
}
|
}
|
||||||
@ -323,39 +324,6 @@ open class InByteBuffer {
|
|||||||
return ResourceLocation.getResourceLocation(readString())
|
return ResourceLocation.getResourceLocation(readString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun readCommandNode(): CommandNode {
|
|
||||||
val flags = readByte().toInt()
|
|
||||||
return when (CommandNode.NodeTypes.byId(flags and 0x03)!!) {
|
|
||||||
CommandNode.NodeTypes.ROOT -> CommandRootNode(flags, this)
|
|
||||||
CommandNode.NodeTypes.LITERAL -> CommandLiteralNode(flags, this)
|
|
||||||
CommandNode.NodeTypes.ARGUMENT -> CommandArgumentNode(flags, this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@JvmOverloads
|
|
||||||
fun readCommandNodeArray(length: Int = readVarInt()): Array<CommandNode> {
|
|
||||||
val nodes = readArray(length) { readCommandNode() }
|
|
||||||
for (node in nodes) {
|
|
||||||
if (node.redirectNodeId != -1) {
|
|
||||||
node.redirectNode = nodes[node.redirectNodeId]
|
|
||||||
}
|
|
||||||
|
|
||||||
for (childId in node.childrenIds) {
|
|
||||||
when (val child = nodes[childId]) {
|
|
||||||
is CommandArgumentNode -> {
|
|
||||||
node.argumentsChildren.add(child)
|
|
||||||
}
|
|
||||||
is CommandLiteralNode -> {
|
|
||||||
node.literalChildren[child.name] = child
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nodes
|
|
||||||
}
|
|
||||||
|
|
||||||
fun readChunkPosition(): Vec2i {
|
fun readChunkPosition(): Vec2i {
|
||||||
return Vec2i(readInt(), readInt())
|
return Vec2i(readInt(), readInt())
|
||||||
}
|
}
|
||||||
@ -443,9 +411,9 @@ open class InByteBuffer {
|
|||||||
return mapOf(*(readArray(length) { readTag(idResolver) }))
|
return mapOf(*(readArray(length) { readTag(idResolver) }))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T> readOptional(reader: () -> T): T? {
|
fun <T> readOptional(reader: InByteBuffer.() -> T): T? {
|
||||||
return if (readBoolean()) {
|
return if (readBoolean()) {
|
||||||
reader()
|
reader(this)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
@ -240,4 +240,12 @@ class PlayInByteBuffer : InByteBuffer {
|
|||||||
textures = textures,
|
textures = textures,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun <T> readPlayOptional(reader: PlayInByteBuffer.() -> T): T? {
|
||||||
|
return if (readBoolean()) {
|
||||||
|
reader(this)
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020 Moritz Zwerger
|
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -32,9 +32,9 @@ public class CommandSendChat extends Command {
|
|||||||
// command
|
// command
|
||||||
String command = message.substring(1);
|
String command = message.substring(1);
|
||||||
try {
|
try {
|
||||||
CommandRootNode rootNode = connection.getCommandRootNode();
|
CommandRootNode rootNode = connection.getCommandRoot();
|
||||||
if (rootNode != null) {
|
if (rootNode != null) {
|
||||||
connection.getCommandRootNode().parse(connection, command);
|
connection.getCommandRoot().parse(connection, command);
|
||||||
}
|
}
|
||||||
} catch (CommandParseException e) {
|
} catch (CommandParseException e) {
|
||||||
printError("Command \"%s\" is invalid, %s: %s", command, e.getClass().getSimpleName(), e.getMessage());
|
printError("Command \"%s\" is invalid, %s: %s", command, e.getClass().getSimpleName(), e.getMessage());
|
||||||
|
@ -1623,7 +1623,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["confirm_teleport", "chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "position", "position_rotation", "rotation", "ground_change", "move_vehicle", "steer_boat", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item"],
|
"c2s": ["confirm_teleport", "chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "position", "position_rotation", "rotation", "ground_change", "move_vehicle", "steer_boat", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "named_sound", "kick", "entity_status", "explosion", "unload_chunk", "compression_threshold", "game_event", "heartbeat", "chunk", "world_event", "particle", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "move_vehicle", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "entity_passenger", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "sound_event", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "named_sound", "kick", "entity_status", "explosion", "unload_chunk", "compression", "game_event", "heartbeat", "chunk", "world_event", "particle", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "move_vehicle", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "entity_passenger", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "sound_event", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1632,7 +1632,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "move_vehicle", "position", "position_rotation", "rotation", "ground_change", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item", "steer_boat", "confirm_teleport"],
|
"c2s": ["chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "move_vehicle", "position", "position_rotation", "rotation", "ground_change", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item", "steer_boat", "confirm_teleport"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "kick", "entity_status", "explosion", "unload_chunk", "compression_threshold", "game_event", "heartbeat", "chunk", "world_event", "particle", "named_sound", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_passenger", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "kick", "entity_status", "explosion", "unload_chunk", "compression", "game_event", "heartbeat", "chunk", "world_event", "particle", "named_sound", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_passenger", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1645,7 +1645,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "move_vehicle", "position", "position_rotation", "rotation", "ground_change", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item", "steer_boat"],
|
"c2s": ["chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "move_vehicle", "position", "position_rotation", "rotation", "ground_change", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item", "steer_boat"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "kick", "entity_status", "explosion", "unload_chunk", "compression_threshold", "game_event", "heartbeat", "chunk", "world_event", "particle", "named_sound", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_passenger", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "kick", "entity_status", "explosion", "unload_chunk", "compression", "game_event", "heartbeat", "chunk", "world_event", "particle", "named_sound", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_passenger", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1690,7 +1690,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "position", "position_rotation", "rotation", "ground_change", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item"],
|
"c2s": ["chat_suggestions", "chat_message", "client_action", "settings", "container_action", "container_button", "container_click", "close_container", "plugin", "entity_interact", "heartbeat", "position", "position_rotation", "rotation", "ground_change", "toggle_fly", "player_action", "entity_action", "steer_vehicle", "resourcepack", "hotbar_slot", "item_stack_create", "sign_text", "swing_arm", "entity_spectate", "block_interact", "use_item"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "kick", "entity_status", "explosion", "unload_chunk", "compression_threshold", "game_event", "heartbeat", "chunk", "world_event", "particle", "named_sound", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
"entity_object_spawn", "entity_experience_orb", "global_entity_spawn", "entity_mob_spawn", "entity_painting", "entity_player", "entity_animation", "statistics", "block_break_animation", "block_data", "block_action", "block", "bossbar", "difficulty", "chat_suggestions", "chat_message", "blocks", "container_action", "close_container", "open_container", "container_items", "container_properties", "container_item", "item_cooldown", "plugin", "kick", "entity_status", "explosion", "unload_chunk", "compression", "game_event", "heartbeat", "chunk", "world_event", "particle", "named_sound", "initialize", "map", "relative_move", "movement_rotation", "rotation", "empty_move", "sign_editor", "player_abilities", "combat_event", "tab_list", "position_rotation", "entity_sleep", "entity_destroy", "entity_remove_effect", "resourcepack", "respawn", "head_rotation", "world_border", "camera", "hotbar_slot", "objective_position", "entity_data", "entity_attach", "velocity", "entity_equipment", "experience", "health", "objective", "teams", "scoreboard_score", "compass_position", "time", "title", "sign_text", "tab_list_text", "entity_collect", "teleport", "entity_attributes", "entity_effect"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1715,7 +1715,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "use_item", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "use_item", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "unload_chunk", "blocks", "block_action", "block_break_animation", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold", "tab_list_text", "resourcepack", "bossbar", "item_cooldown"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "unload_chunk", "blocks", "block_action", "block_break_animation", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression", "tab_list_text", "resourcepack", "bossbar", "item_cooldown"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1728,7 +1728,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "use_item", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "use_item", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold", "tab_list_text", "resourcepack", "bossbar", "item_cooldown"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression", "tab_list_text", "resourcepack", "bossbar", "item_cooldown"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1777,7 +1777,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "use_item", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "use_item", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold", "tab_list_text", "resourcepack", "bossbar"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression", "tab_list_text", "resourcepack", "bossbar"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1843,7 +1843,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold", "tab_list_text", "resourcepack", "nbt_response"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression", "tab_list_text", "resourcepack", "nbt_response"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1852,7 +1852,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate", "resourcepack"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold", "tab_list_text", "resourcepack"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression", "tab_list_text", "resourcepack"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1873,7 +1873,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold", "tab_list_text"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression", "tab_list_text"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1882,7 +1882,7 @@
|
|||||||
"packets": {
|
"packets": {
|
||||||
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate"],
|
"c2s": ["heartbeat", "chat_message", "entity_interact", "ground_change", "position", "rotation", "position_rotation", "player_action", "block_interact", "hotbar_slot", "swing_arm", "entity_action", "steer_vehicle", "close_container", "container_click", "container_action", "item_stack_create", "container_button", "sign_text", "toggle_fly", "chat_suggestions", "settings", "client_action", "plugin", "entity_spectate"],
|
||||||
"s2c": [
|
"s2c": [
|
||||||
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression_threshold"
|
"heartbeat", "initialize", "chat_message", "time", "entity_equipment", "compass_position", "health", "respawn", "position_rotation", "hotbar_slot", "entity_sleep", "entity_animation", "entity_player", "entity_collect", "entity_object_spawn", "entity_mob_spawn", "entity_painting", "entity_experience_orb", "velocity", "entity_destroy", "empty_move", "relative_move", "rotation", "movement_rotation", "teleport", "head_rotation", "entity_status", "entity_attach", "entity_data", "entity_effect", "entity_remove_effect", "experience", "entity_attributes", "chunk", "blocks", "block", "block_action", "block_break_animation", "chunks", "explosion", "world_event", "named_sound", "particle", "game_event", "global_entity_spawn", "open_container", "close_container", "container_item", "container_items", "container_properties", "container_action", "sign_text", "map", "block_data", "sign_editor", "statistics", "tab_list", "player_abilities", "chat_suggestions", "objective", "scoreboard_score", "objective_position", "teams", "plugin", "kick", "difficulty", "combat_event", "camera", "world_border", "title", "compression"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user