Skip to content

Commit

Permalink
Fixed a bug and updated project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed May 23, 2022
1 parent d7b9eab commit 5e7b3aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Forge Semantic Versioning](https://mcforge.readthed
## [Unreleased]
- Nothing new.

## [1.18.2-3.1.0.1] - 2022/05/23
- Fixed client-server interactions and small bug fix.

## [1.18.2-3.1.0.0] - 2022/05/22
- Fixed crash when this mod is put only on server.
- Fixed client-server compatibility.
Expand Down Expand Up @@ -40,6 +43,7 @@ and this project adheres to [Forge Semantic Versioning](https://mcforge.readthed
- Added creative tab with all vertical slabs.

[Unreleased]: https://github.com/Nyphet/just-vertical-slabs
[1.18.2-3.1.0.1]: https://github.com/Nyphet/just-vertical-slabs/releases/tag/v1.18.2-3.1.0.1
[1.18.2-3.1.0.0]: https://github.com/Nyphet/just-vertical-slabs/releases/tag/v1.18.2-3.1.0.0
[1.18.2-3.0.0.0]: https://github.com/Nyphet/just-vertical-slabs/releases/tag/v1.18.2-3.0.0.0
[1.18.2-2.0.0.0]: https://github.com/Nyphet/just-vertical-slabs/releases/tag/v1.18.2-2.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
}
apply plugin: 'net.minecraftforge.gradle'

version = '1.18.2-3.1.0.0'
version = '1.18.2-3.1.0.1'
group = 'crystalspider.justverticalslabs'
archivesBaseName = 'justverticalslabs'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ public static class MapsManager {
@Nullable
public static volatile ImmutableMap<Item, BlockState> slabStateMap;

/**
* Contains all {@link BlockState} of Vertical Slab Items already added into the search tree to prevent adding duplicates.
*/
private static final HashMap<BlockState, Boolean> inSearchTree = new HashMap<BlockState, Boolean>();

/**
* {@link RecipeManager} to use in {@link #computeMaps()}.
*/
Expand All @@ -284,11 +289,17 @@ public static void setFallbackRecipeManager(RecipeManager recipeManager) {
* Adds all Vertical Vlabs to the search tree if not already present.
*/
public static void addToSearchTree() {
int intialSize = inSearchTree.size();
MutableSearchTree<ItemStack> creativeSearchTree = Minecraft.getInstance().getSearchTree(SearchRegistry.CREATIVE_NAMES);
for(BlockState referredSlabState : MapsManager.slabStateMap.values()) {
creativeSearchTree.add(VerticalSlabUtils.getVerticalSlabItem(referredSlabState, VerticalSlabUtils.isTranslucent(referredSlabState)));
if (!inSearchTree.containsKey(referredSlabState)) {
creativeSearchTree.add(VerticalSlabUtils.getVerticalSlabItem(referredSlabState, VerticalSlabUtils.isTranslucent(referredSlabState)));
inSearchTree.put(referredSlabState, true);
}
}
if (intialSize != inSearchTree.size()) {
creativeSearchTree.refresh();
}
creativeSearchTree.refresh();
}

/**
Expand Down
5 changes: 3 additions & 2 deletions updates.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/just-vertical-slabs/files",
"1.18.2": {
"1.18.2-3.1.0.1": "",
"1.18.2-3.1.0.0": "https://www.curseforge.com/minecraft/mc-mods/just-vertical-slabs/files/3801259",
"1.18.2-3.0.0.0": "https://www.curseforge.com/minecraft/mc-mods/just-vertical-slabs/files/3793049",
"1.18.2-2.0.0.0": "https://www.curseforge.com/minecraft/mc-mods/just-vertical-slabs/files/3786215",
"1.18.2-1.0.0.0": "https://www.curseforge.com/minecraft/mc-mods/just-vertical-slabs/files/3785696"
},
"promos": {
"1.18.2-latest": "1.18.2-3.1.0.0",
"1.18.2-recommended": "1.18.2-3.1.0.0"
"1.18.2-latest": "1.18.2-3.1.0.1",
"1.18.2-recommended": "1.18.2-3.1.0.1"
}
}

0 comments on commit 5e7b3aa

Please sign in to comment.