Skip to content

Commit

Permalink
web: Fix protocol lookup path
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat committed Jan 8, 2025
1 parent 338742d commit ab4787c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions loadProtocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,16 @@ function eqs (compareTo, k) {
}, compareTo + ' == ' + k[0])
}

window.require = window.require || require

function loadProtocol (version) {
const data = require('minecraft-data')(version)
if (data.proto) {
$j('#protocolTable').html(`<html-view src="protocol/${data.proto}"><a href="protocol/${data.proto}">Click here</a></html-view>`)
console.log('Load Protocol', version, data?.version)
if (data.protocolYaml?.length) {
const v = version.replace('bedrock_', '')
$j('#protocolTable').html(`<html-view src="protocol/${data.type}/${v}"><a href="protocol/${data.type}/${v}">Click here</a></html-view>`)
} else {
const comments = require('minecraft-data')(version).protocolComments
const comments = data.protocolComments
$j('#protocolTable').html(protocolToString(data, comments))
}
}
Expand Down

0 comments on commit ab4787c

Please sign in to comment.