Skip to content

Commit

Permalink
Added Alpha v1.0.4 and v1.0.5. Note that, for now adding obtainabilit…
Browse files Browse the repository at this point in the history
…y situations like being able to only obtain block/items in winter mode is pain in unacceptable, due to code repetition. This should be fixed later.
  • Loading branch information
Matriks404 committed Jan 21, 2024
1 parent 230117d commit 460a502
Show file tree
Hide file tree
Showing 10 changed files with 353 additions and 1 deletion.
1 change: 1 addition & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $color-default-message: black;
$color-unobtainable: #c00000;
$color-migratable: #006c00;
$color-obtainable-by-notch: #eaee57;
$color-obtainable-in-winter-mode: #00f3f3;
$color-removed: #006c00;

// High contrast style variables
Expand Down
10 changes: 10 additions & 0 deletions scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ p {
color: $color-obtainable-by-notch;
}

#info-obtainable-in-winter-mode {
display: none;

color: $color-obtainable-in-winter-mode;
}

#info-unknown-renders {
display: none;

Expand Down Expand Up @@ -246,6 +252,10 @@ p {
color: $color-obtainable-by-notch;
}

.id-obtainable-in-winter-mode {
color: $color-obtainable-in-winter-mode;
}

.id-removed {
color: $color-removed;
}
Expand Down
304 changes: 304 additions & 0 deletions site/ids.json

Large diffs are not rendered by default.

Binary file added site/images/blocks/alpha/grass_v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/images/blocks/alpha/ice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/images/blocks/alpha/snow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/images/blocks/alpha/snow_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/images/items/snowball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@

<div id="exclude-obtainable-by-notch-setting">
<input type="checkbox" id="exclude-obtainable-by-notch" name="exclude-obtainable-by-notch" />
<label for="exclude-obtainable-by-notch">Exclude blocks/items obtainable only by Notch</label>
<label for="exclude-obtainable-by-notch">Exclude blocks/items obtainable by Notch</label>
</div>

<div id="exclude-obtainable-in-winter-mode-setting">
<input type="checkbox" id="exclude-obtainable-in-winter-mode" name="exclude-obtainable-in-winter-mode" />
<label for="exclude-obtainable-in-winter-mode">Exclude blocks/items obtainable in winter mode</label>
</div>

<div id="display-air-block-setting">
Expand Down Expand Up @@ -111,6 +116,11 @@
<p>unless the player is named "Notch".</p>
</div>

<div id="info-obtainable-in-winter-mode">
<p>Data values colored in light blue cannot be legitimately obtained,</p>
<p>unless player plays on "Winter Mode" map type.</p>
</div>

<div id="info-removed">
<p>Data values colored in green are removed from the game,</p>
<p>but still available with cheats/server commands.</p>
Expand Down
27 changes: 27 additions & 0 deletions site/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ function loadEntries(entries, el, entriesName, hasUnknownIds) {
var excludeUnobtainable = document.getElementById('exclude-unobtainable').checked;
var excludeMigratable = document.getElementById('exclude-migratable').checked;
var excludeObtainableByNotch = document.getElementById('exclude-obtainable-by-notch').checked
var excludeObtainableInWinterMode = document.getElementById('exclude-obtainable-in-winter-mode').checked
var displayAirBlock = document.getElementById('display-air-block').checked;

Object.keys(entries).forEach(function (id) {
Expand All @@ -134,6 +135,10 @@ function loadEntries(entries, el, entriesName, hasUnknownIds) {
return;
}

if (excludeObtainableInWinterMode && entry.isObtainableInWinterMode) {
return;
}

if (!displayAirBlock && id == "0") {
return;
}
Expand All @@ -152,6 +157,8 @@ function loadEntries(entries, el, entriesName, hasUnknownIds) {
idElement.className += ' id-migratable';
} else if (entry.isObtainableByNotch) {
idElement.className += ' id-obtainable-by-notch';
} else if (entry.isObtainableInWinterMode) {
idElement.className += ' id-obtainable-in-winter-mode';
} else if (entry.isRemoved) {
idElement.className += ' id-removed';
}
Expand Down Expand Up @@ -204,6 +211,7 @@ function doEntriesContainEntryType(entries, type) {
var excludeUnobtainable = document.getElementById('exclude-unobtainable').checked;
var excludeMigratable = document.getElementById('exclude-migratable').checked;
var excludeObtainableByNotch = document.getElementById('exclude-obtainable-by-notch').checked;
var excludeObtainableInWinterMode = document.getElementById('exclude-obtainable-in-winter-mode').checked;
var countAirBlock = document.getElementById('display-air-block').checked;

return Object.keys(entries).some(function (id) {
Expand All @@ -221,6 +229,10 @@ function doEntriesContainEntryType(entries, type) {
return false;
}

if (excludeObtainableInWinterMode && entry.isObtainableInWinterMode) {
return false;
}

if (!countAirBlock && id == "0") {
return false;
}
Expand Down Expand Up @@ -314,11 +326,13 @@ function loadCurrentVersion() {
var infoUnobtainableElement = document.getElementById('info-unobtainable');
var infoMigratableElement = document.getElementById('info-migratable');
var infoObtainableByNotchElement = document.getElementById('info-obtainable-by-notch');
var infoObtainableInWinterModeElement = document.getElementById('info-obtainable-in-winter-mode');
var infoRemovedElement = document.getElementById('info-removed');

checkEntries(blocks, infoUnobtainableElement, "isUnobtainable");
checkEntries(blocks, infoMigratableElement, "isObtainableByMigration");
checkEntries(blocks, infoObtainableByNotchElement, "isObtainableByNotch");
checkEntries(blocks, infoObtainableInWinterModeElement, "isObtainableInWinterMode");
checkEntries(blocks, infoRemovedElement, "isRemoved");

loadEntries(blocks, blocksContentElement, "blocks", version.hasUnknownBlockIds);
Expand Down Expand Up @@ -350,6 +364,10 @@ function loadCurrentVersion() {
checkEntries(items, infoObtainableByNotchElement, "isObtainableByNotch");
}

if (infoObtainableInWinterModeElement.style.display == "none") {
checkEntries(items, infoObtainableInWinterModeElement, "isObtainableInWinterMode");
}

if (infoRemovedElement.style.display == "none") {
checkEntries(items, infoRemovedElement, "isRemoved");
}
Expand Down Expand Up @@ -396,6 +414,9 @@ function reloadCheckboxes() {

var excludeObtainableByNotchCheckbox = document.getElementById('exclude-obtainable-by-notch');
excludeObtainableByNotchCheckbox.disabled = "disabled";

var excludeObtainableInWinterModeCheckbox = document.getElementById('exclude-obtainable-in-winter-mode');
excludeObtainableInWinterModeCheckbox.disabled = "disabled";
}

function reloadVersionList() {
Expand Down Expand Up @@ -449,11 +470,13 @@ document.addEventListener('DOMContentLoaded', function () {
var excludeUnobtainable = document.getElementById('exclude-unobtainable').checked;
var excludeMigratableCheckbox = document.getElementById('exclude-migratable');
var excludeObtainableByNotchCheckbox = document.getElementById('exclude-obtainable-by-notch');
var excludeObtainableInWinterModeCheckbox = document.getElementById('exclude-obtainable-in-winter-mode');
var displayAirCheckbox = document.getElementById('display-air-block');

if (excludeUnobtainable) {
excludeMigratableCheckbox.disabled = "";
excludeObtainableByNotchCheckbox.disabled = "";
excludeObtainableInWinterModeCheckbox.disabled = "";

displayAirCheckbox.checked = false;
displayAirCheckbox.disabled = "disabled";
Expand All @@ -464,11 +487,15 @@ document.addEventListener('DOMContentLoaded', function () {
excludeObtainableByNotchCheckbox.checked = false;
excludeObtainableByNotchCheckbox.disabled = "disabled";

excludeObtainableInWinterModeCheckbox.checked = false;
excludeObtainableInWinterModeCheckbox.disabled = "disabled";

displayAirCheckbox.disabled = "";
}
});

document.getElementById('exclude-migratable').addEventListener('change', updateSettingsStatus);
document.getElementById('exclude-obtainable-by-notch').addEventListener('change', updateSettingsStatus);
document.getElementById('exclude-obtainable-in-winter-mode').addEventListener('change', updateSettingsStatus);
document.getElementById('display-air-block').addEventListener('change', updateSettingsStatus);
});

0 comments on commit 460a502

Please sign in to comment.