3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-16 04:50:07 +01:00

Remove casting from block mappings

Dieser Commit ist enthalten in:
Camotoy 2024-06-24 16:25:12 -04:00
Ursprung ca2312c7f6
Commit 835ba9e24f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 3 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -44,7 +44,7 @@ import java.util.Set;
@Builder @Builder
@Value @Value
public class BlockMappings implements DefinitionRegistry<GeyserBedrockBlock> { public class BlockMappings implements DefinitionRegistry<BlockDefinition> {
GeyserBedrockBlock bedrockAir; GeyserBedrockBlock bedrockAir;
BlockDefinition bedrockWater; BlockDefinition bedrockWater;
BlockDefinition bedrockMovingBlock; BlockDefinition bedrockMovingBlock;
@ -134,7 +134,7 @@ public class BlockMappings implements DefinitionRegistry<GeyserBedrockBlock> {
} }
@Override @Override
public boolean isRegistered(GeyserBedrockBlock bedrockBlock) { public boolean isRegistered(BlockDefinition bedrockBlock) {
return getDefinition(bedrockBlock.getRuntimeId()) == bedrockBlock; return getDefinition(bedrockBlock.getRuntimeId()) == bedrockBlock;
} }
} }

Datei anzeigen

@ -57,7 +57,6 @@ import org.cloudburstmc.protocol.bedrock.data.command.SoftEnumUpdateType;
import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag; import org.cloudburstmc.protocol.bedrock.data.entity.EntityFlag;
import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData; import org.cloudburstmc.protocol.bedrock.data.inventory.ItemData;
import org.cloudburstmc.protocol.bedrock.packet.*; import org.cloudburstmc.protocol.bedrock.packet.*;
import org.cloudburstmc.protocol.common.DefinitionRegistry;
import org.cloudburstmc.protocol.common.util.OptionalBoolean; import org.cloudburstmc.protocol.common.util.OptionalBoolean;
import org.geysermc.api.util.BedrockPlatform; import org.geysermc.api.util.BedrockPlatform;
import org.geysermc.api.util.InputMode; import org.geysermc.api.util.InputMode;
@ -1466,7 +1465,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
private void startGame() { private void startGame() {
this.upstream.getCodecHelper().setItemDefinitions(this.itemMappings); this.upstream.getCodecHelper().setItemDefinitions(this.itemMappings);
this.upstream.getCodecHelper().setBlockDefinitions((DefinitionRegistry) this.blockMappings); //FIXME this.upstream.getCodecHelper().setBlockDefinitions(this.blockMappings);
this.upstream.getCodecHelper().setCameraPresetDefinitions(CameraDefinitions.CAMERA_DEFINITIONS); this.upstream.getCodecHelper().setCameraPresetDefinitions(CameraDefinitions.CAMERA_DEFINITIONS);
StartGamePacket startGamePacket = new StartGamePacket(); StartGamePacket startGamePacket = new StartGamePacket();