Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/interface/setup_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function setupSettings() {
updateStreamerModeNotification();
}});
new Setting('classroom_mode', {value: false, requires_restart: true});
new Setting('cdn_mirror', {value: false});
new Setting('cdn_mirror', {value: false, condition: () => settings.custom_cdn.value == '',requires_restart: true});
new Setting('custom_cdn', {value: '', type: 'text', requires_restart: true});
new Setting('recovery_save_interval', {value: 30, type: 'number', min: 0, onChange() {
clearTimeout(AutoBackup.loop_timeout);
AutoBackup.backupProjectLoop(false);
Expand Down
4 changes: 2 additions & 2 deletions js/plugin_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Plugins = {
/**
* The currently used path to the plugin API
*/
api_path: settings.cdn_mirror.value ? 'https://blckbn.ch/cdn/plugins' : 'https://cdn.jsdelivr.net/gh/JannisX11/blockbench-plugins/plugins',
api_path: settings.custom_cdn.value || (settings.cdn_mirror.value ? 'https://blckbn.ch/cdn/plugins' : 'https://cdn.jsdelivr.net/gh/JannisX11/blockbench-plugins/plugins'),
path: '',
/**
* Dev reload all side-loaded plugins
Expand Down Expand Up @@ -1023,7 +1023,7 @@ Plugins.loading_promise = new Promise((resolve, reject) => {
resolve();
Plugins.loading_promise = null;

if (settings.cdn_mirror.value == false && navigator.onLine) {
if (!settings.custom_cdn.value && settings.cdn_mirror.value == false && navigator.onLine) {
settings.cdn_mirror.set(true);
console.log('Switching to plugin CDN mirror. Restart to apply.');
}
Expand Down
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,8 @@
"settings.classroom_mode.desc": "Restricts functionality such as installing plugins and removes links to social media",
"settings.cdn_mirror": "Use CDN Mirror",
"settings.cdn_mirror.desc": "Use the mirror CDN to download plugins. The mirror receives updates faster and works in some regions where the default does not work.",
"settings.custom_cdn": "Custom CDN",
"settings.custom_cdn.desc": "Specify a custom CDN URL to download plugins from.",
"settings.recovery_save_interval": "Recovery Point Save Interval",
"settings.recovery_save_interval.desc": "Blockbench regularly saves the open project in the background to recover in case of a computer crash. Set the interval in seconds. Set to 0 to disable saving.",

Expand Down