mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
Fix modded ItemGroups not showing, also updated mappings
This commit is contained in:
parent
56f586a0fc
commit
2cbdd032eb
6 changed files with 16 additions and 17 deletions
build.gradle
fabric-events-interaction-v0
fabric-item-groups-v0
|
@ -12,9 +12,9 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.5.0"
|
||||
static def baseVersion = "0.5.1"
|
||||
static def mcVersion = "20w10a"
|
||||
static def yarnVersion = "+build.1"
|
||||
static def yarnVersion = "+build.7"
|
||||
}
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-events-interaction-v0"
|
||||
version = getSubprojectVersion(project, "0.2.9")
|
||||
version = getSubprojectVersion(project, "0.2.10")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -68,7 +68,7 @@ public abstract class MixinMinecraftClient {
|
|||
// I don't like that we clone vanilla logic here, but it's our best bet for now.
|
||||
PlayerInventory playerInventory = client.player.inventory;
|
||||
|
||||
if (client.player.abilities.creativeMode && Screen.method_25441() && client.crosshairTarget.getType() == HitResult.Type.BLOCK) {
|
||||
if (client.player.abilities.creativeMode && Screen.hasControlDown() && client.crosshairTarget.getType() == HitResult.Type.BLOCK) {
|
||||
BlockEntity be = client.world.getBlockEntity(((BlockHitResult) client.crosshairTarget).getBlockPos());
|
||||
|
||||
if (be != null) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-item-groups-v0"
|
||||
version = getSubprojectVersion(project, "0.1.7")
|
||||
version = getSubprojectVersion(project, "0.1.8")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -52,19 +52,19 @@ public class FabricCreativeGuiComponents {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void method_25394(int mouseX, int mouseY, float float_1) {
|
||||
this.field_22764 = extensions.fabric_isButtonVisible(type);
|
||||
this.field_22763 = extensions.fabric_isButtonEnabled(type);
|
||||
public void render(int mouseX, int mouseY, float float_1) {
|
||||
this.visible = extensions.fabric_isButtonVisible(type);
|
||||
this.active = extensions.fabric_isButtonEnabled(type);
|
||||
|
||||
if (this.field_22764) {
|
||||
if (this.visible) {
|
||||
MinecraftClient minecraftClient = MinecraftClient.getInstance();
|
||||
minecraftClient.getTextureManager().bindTexture(BUTTON_TEX);
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.color4f(1F, 1F, 1F, 1F);
|
||||
this.method_25302(this.field_22760, this.field_22761, (type == Type.NEXT ? 12 : 0), (field_22763 ? 0 : 12), 12, 12);
|
||||
this.blit(this.x, this.y, (type == Type.NEXT ? 12 : 0), (active ? 0 : 12), 12, 12);
|
||||
|
||||
if (mouseX >= this.field_22760 && mouseY >= this.field_22761 && mouseX < this.field_22760 + this.field_22758 && mouseY < this.field_22761 + this.field_22759) {
|
||||
gui.method_25424(I18n.translate("fabric.gui.creativeTabPage", extensions.fabric_currentPage() + 1, ((ItemGroup.GROUPS.length - 12) / 9) + 2), mouseX, mouseY);
|
||||
if (mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height) {
|
||||
gui.renderTooltip(I18n.translate("fabric.gui.creativeTabPage", extensions.fabric_currentPage() + 1, ((ItemGroup.GROUPS.length - 12) / 9) + 2), mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
import net.minecraft.container.Container;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.text.Text;
|
||||
|
@ -116,15 +115,15 @@ public abstract class MixinCreativePlayerInventoryGui extends AbstractInventoryS
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"), remap = false)
|
||||
private void init(PlayerEntity playerEntity, CallbackInfo info) {
|
||||
@Inject(method = "init", at = @At("RETURN"))
|
||||
private void init(CallbackInfo info) {
|
||||
fabric_updateSelection();
|
||||
|
||||
int xpos = x + 170;
|
||||
int ypos = y + 4;
|
||||
|
||||
method_25411(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos + 10, ypos, FabricCreativeGuiComponents.Type.NEXT, this));
|
||||
method_25411(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos, ypos, FabricCreativeGuiComponents.Type.PREVIOUS, this));
|
||||
addButton(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos + 10, ypos, FabricCreativeGuiComponents.Type.NEXT, this));
|
||||
addButton(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos, ypos, FabricCreativeGuiComponents.Type.PREVIOUS, this));
|
||||
}
|
||||
|
||||
@Inject(method = "setSelectedTab", at = @At("HEAD"), cancellable = true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue