Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite version detection #2

Open
MMK21Hub opened this issue May 12, 2020 · 0 comments
Open

Rewrite version detection #2

MMK21Hub opened this issue May 12, 2020 · 0 comments
Assignees
Labels
BetterBlingEdit Issues for the BetterBlingEdit branch task A patch that is being worked on

Comments

@MMK21Hub
Copy link
Owner

MMK21Hub commented May 12, 2020

BlingEdit's current version detection works but is not a great solution. It leaves errors in the console and does not work for every version.

BetterBlingEdit's version detection:

It uses the data_version value in player NBT. This supports every major version, minor version, pre-release and snapshot. It also doesn't leave errors in the console. This also helps future-proofing, as we can add features that require newer mechanics while maintaining support for older versions of Minecraft.

Todo

New version detection

Add new scores on load. Line 252 of blingedit:reset would become:


## BETTER BLINGEDIT
scoreboard objectives add dataVer dummy
scoreboard objectives add clientVer dummy
scoreboard players set $BBlingEdit clientVer 0

Add chkclient function:

execute store result score $BBlingEdit dataVer run data get entity @p DataVersion
# 1.13.x:
execute if score $BBlingEdit dataVer matches 1444...1900 run scoreboard players set $BBlingEdit clientVer 13
# 1.14.x:
execute if score $BBlingEdit dataVer matches 1901...1976 run scoreboard players set $BBlingEdit clientVer 14 
# 1.15.x:
execute if score $BBlingEdit dataVer matches 2200...2230 run scoreboard players set $BBlingEdit clientVer 15
# Other:
execute if score $BBlingEdit clientVer matches 0 run scoreboard players set $BBlingEdit clientVer 0

Update BlingEdit options

Lines 1-3 of blingedit:interface/en/options_2_bottom would become:

execute if score $BBlingEdit clientVer matches 13 run tellraw @s ["",{"text":"Client Version:                     1.13.x","color":"white"}]
execute if score $BBlingEdit clientVer matches 14 run tellraw @s ["",{"text":"Client Version:                     1.14.x","color":"white"}]
execute if score $BBlingEdit clientVer matches 15 run tellraw @s ["",{"text":"Client Version:                     1.15.x","color":"white"}]
execute if score $BBlingEdit clientVer matches 0 run tellraw @s ["",{"text":"Client Version:                     Unsupported!","color":"white"}]
@MMK21Hub MMK21Hub added the task A patch that is being worked on label May 12, 2020
@MMK21Hub MMK21Hub self-assigned this May 12, 2020
@MMK21Hub MMK21Hub added this to To do in BetterBlingEdit v1.0 May 12, 2020
@MMK21Hub MMK21Hub added the BetterBlingEdit Issues for the BetterBlingEdit branch label May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BetterBlingEdit Issues for the BetterBlingEdit branch task A patch that is being worked on
Projects
Development

No branches or pull requests

1 participant