Skip to content

Commit

Permalink
Provide backwards compat for mods that use the internals of CreativeI…
Browse files Browse the repository at this point in the history
…nventoryScreenMixin
  • Loading branch information
Su5eD committed Nov 18, 2023
1 parent 52cc178 commit 9801bf5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.fabricmc.fabric.mixin.itemgroup.client;

import org.spongepowered.asm.mixin.Mixin;

import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.item.ItemGroup;

@Mixin(value = CreativeInventoryScreen.class, priority = 100)
public abstract class CreativeInventoryScreenMixin {
private static int fabric_currentPage = -1;

private void fabric_updateSelection() {
}

private boolean fabric_isGroupVisible(ItemGroup tab) {
return true;
}

private static int fabric_getPage() {
return -1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"required": true,
"package": "net.fabricmc.fabric.mixin.itemgroup.client",
"compatibilityLevel": "JAVA_17",
"client": [
"CreativeInventoryScreenMixin"
],
"injectors": {
"defaultRequire": 1
}
}
4 changes: 4 additions & 0 deletions fabric-item-group-api-v1/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
},
"description": "An API for adding custom item groups.",
"mixins": [
{
"config": "fabric-item-group-api-v1.client.mixins.json",
"environment": "client"
}
],
"accessWidener": "fabric-item-group-api-v1.accesswidener",
"custom": {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ fabric-client-tags-api-v1-version=1.1.1
loom.platform=forge
forge_version=1.20.1-47.1.3
pack_format=15
forgified_version=1.9.32
forgified_version=1.9.33
forge_fabric_loader_version=2.5.2+0.14.21+1.20.1

0 comments on commit 9801bf5

Please sign in to comment.