Remove casting from block mappings

This commit is contained in:
Camotoy 2024-06-24 16:25:12 -04:00
parent ca2312c7f6
commit 835ba9e24f
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 3 additions and 4 deletions

View file

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

View file

@ -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.inventory.ItemData;
import org.cloudburstmc.protocol.bedrock.packet.*;
import org.cloudburstmc.protocol.common.DefinitionRegistry;
import org.cloudburstmc.protocol.common.util.OptionalBoolean;
import org.geysermc.api.util.BedrockPlatform;
import org.geysermc.api.util.InputMode;
@ -1466,7 +1465,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
private void startGame() {
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);
StartGamePacket startGamePacket = new StartGamePacket();