Skip to content

Commit

Permalink
Fixed an oversight where recipe keybinds wouldn't work in SI pages.
Browse files Browse the repository at this point in the history
Bumped version.
  • Loading branch information
MartinSVK12 committed Apr 2, 2024
1 parent 9742945 commit 40dda8a
Show file tree
Hide file tree
Showing 16 changed files with 376 additions and 27 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ dependencies {
implementation project(path: ":catalyst:multiblocks",configuration: "namedElements")
implementation project(path: ":catalyst:effects",configuration: "namedElements")

//implementation project(path: ":dragonfly",configuration: "namedElements")
modImplementation files("libs/dragonfly-1.4.7-7.1-test.2.jar") //"DragonFly:dragonfly:${project.dragonfly_version}"
modImplementation "DragonFly:dragonfly:${project.dragonfly_version}"
modImplementation "BTWaila:btwaila:${project.btwaila_version}"
modImplementation "TerrainAPI:terrainapi:${project.terrain_api_version}"
//modImplementation "retrostorage:retrostorage:1.3.0"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ loader_version=0.15.6-babric.4-bta
# Mods
halplibe_version=3.5.1
modmenu_version=2.0.4
dragonfly_version=1.4.6-7.1
dragonfly_version=1.4.7-7.1
btwaila_version=1.0.9-7.1
terrain_api_version=1.4.2-7.1
terrain_api_version=1.4.4-7.1

# Mod
mod_version=0.5.2
mod_version=0.6.0
mod_group=sunsetsatellite
mod_name=signalindustries
Binary file removed libs/dragonfly-1.4.7-7.1-test.2.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiRenderItem;
import net.minecraft.client.gui.GuiTooltip;
import net.minecraft.client.gui.guidebook.GuidebookPage;
import net.minecraft.client.gui.guidebook.GuidebookSection;
import net.minecraft.client.gui.guidebook.*;
import net.minecraft.client.gui.guidebook.search.SearchPage;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.core.achievement.AchievementList;
import net.minecraft.core.achievement.stat.StatList;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.gamemode.Gamemode;
Expand Down Expand Up @@ -141,6 +142,40 @@ protected void renderBackground(RenderEngine re, int x, int y) {
}
}

@Override
public void keyTyped(char c, int key, int x, int y, int mouseX, int mouseY) {
super.keyTyped(c, key, x, y, mouseX, mouseY);
if(mc.gameSettings.keyShowRecipe.isKeyboardKey(key)){
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null){
if(hoveringSlot.hasStack()){
String query = "r:"+hoveringSlot.getStack().getDisplayName()+"!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
} else if (mc.gameSettings.keyShowUsage.isKeyboardKey(key)) {
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null) {
if (hoveringSlot.hasStack()) {
String query = "u:" + hoveringSlot.getStack().getDisplayName() + "!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
}
}

@Override
protected void renderOverlay(RenderEngine re, FontRenderer fr, int x, int y, int mouseX, int mouseY, float partialTicks) {
super.renderOverlay(re, fr, x, y, mouseX, mouseY, partialTicks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiRenderItem;
import net.minecraft.client.gui.GuiTooltip;
import net.minecraft.client.gui.guidebook.GuidebookPage;
import net.minecraft.client.gui.guidebook.GuidebookSection;
import net.minecraft.client.gui.guidebook.*;
import net.minecraft.client.gui.guidebook.search.SearchPage;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.core.achievement.AchievementList;
import net.minecraft.core.achievement.stat.StatList;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.gamemode.Gamemode;
Expand Down Expand Up @@ -125,6 +126,40 @@ protected void renderForeground(RenderEngine re, FontRenderer fr, int x, int y,
}
}

@Override
public void keyTyped(char c, int key, int x, int y, int mouseX, int mouseY) {
super.keyTyped(c, key, x, y, mouseX, mouseY);
if(mc.gameSettings.keyShowRecipe.isKeyboardKey(key)){
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null){
if(hoveringSlot.hasStack()){
String query = "r:"+hoveringSlot.getStack().getDisplayName()+"!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
} else if (mc.gameSettings.keyShowUsage.isKeyboardKey(key)) {
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null) {
if (hoveringSlot.hasStack()) {
String query = "u:" + hoveringSlot.getStack().getDisplayName() + "!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
}
}

public boolean getIsMouseOverSlot(final Slot slot, int x, int y, int mouseX, int mouseY)
{
return mouseX >= x+slot.xDisplayPosition - 1 && mouseX < x+slot.xDisplayPosition + 16 + 1 && mouseY >= y+slot.yDisplayPosition - 1 && mouseY < y+slot.yDisplayPosition + 16 + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiRenderItem;
import net.minecraft.client.gui.GuiTooltip;
import net.minecraft.client.gui.guidebook.GuidebookPage;
import net.minecraft.client.gui.guidebook.GuidebookSection;
import net.minecraft.client.gui.guidebook.*;
import net.minecraft.client.gui.guidebook.search.SearchPage;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.core.achievement.AchievementList;
import net.minecraft.core.achievement.stat.StatList;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.gamemode.Gamemode;
Expand Down Expand Up @@ -137,6 +138,40 @@ protected void renderBackground(RenderEngine re, int x, int y) {
}
}

@Override
public void keyTyped(char c, int key, int x, int y, int mouseX, int mouseY) {
super.keyTyped(c, key, x, y, mouseX, mouseY);
if(mc.gameSettings.keyShowRecipe.isKeyboardKey(key)){
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null){
if(hoveringSlot.hasStack()){
String query = "r:"+hoveringSlot.getStack().getDisplayName()+"!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
} else if (mc.gameSettings.keyShowUsage.isKeyboardKey(key)) {
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null) {
if (hoveringSlot.hasStack()) {
String query = "u:" + hoveringSlot.getStack().getDisplayName() + "!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
}
}

@Override
protected void renderOverlay(RenderEngine re, FontRenderer fr, int x, int y, int mouseX, int mouseY, float partialTicks) {
super.renderOverlay(re, fr, x, y, mouseX, mouseY, partialTicks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiRenderItem;
import net.minecraft.client.gui.GuiTooltip;
import net.minecraft.client.gui.guidebook.GuidebookPage;
import net.minecraft.client.gui.guidebook.GuidebookSection;
import net.minecraft.client.gui.guidebook.*;
import net.minecraft.client.gui.guidebook.search.SearchPage;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.core.achievement.AchievementList;
import net.minecraft.core.achievement.stat.StatList;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.gamemode.Gamemode;
Expand Down Expand Up @@ -141,6 +142,40 @@ protected void renderBackground(RenderEngine re, int x, int y) {
}
}

@Override
public void keyTyped(char c, int key, int x, int y, int mouseX, int mouseY) {
super.keyTyped(c, key, x, y, mouseX, mouseY);
if(mc.gameSettings.keyShowRecipe.isKeyboardKey(key)){
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null){
if(hoveringSlot.hasStack()){
String query = "r:"+hoveringSlot.getStack().getDisplayName()+"!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
} else if (mc.gameSettings.keyShowUsage.isKeyboardKey(key)) {
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null) {
if (hoveringSlot.hasStack()) {
String query = "u:" + hoveringSlot.getStack().getDisplayName() + "!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
}
}

@Override
protected void renderOverlay(RenderEngine re, FontRenderer fr, int x, int y, int mouseX, int mouseY, float partialTicks) {
super.renderOverlay(re, fr, x, y, mouseX, mouseY, partialTicks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiRenderItem;
import net.minecraft.client.gui.GuiTooltip;
import net.minecraft.client.gui.guidebook.GuidebookPage;
import net.minecraft.client.gui.guidebook.GuidebookSection;
import net.minecraft.client.gui.guidebook.*;
import net.minecraft.client.gui.guidebook.search.SearchPage;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.core.achievement.AchievementList;
import net.minecraft.core.achievement.stat.StatList;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.gamemode.Gamemode;
Expand Down Expand Up @@ -151,6 +152,40 @@ protected void renderBackground(RenderEngine re, int x, int y) {
}
}

@Override
public void keyTyped(char c, int key, int x, int y, int mouseX, int mouseY) {
super.keyTyped(c, key, x, y, mouseX, mouseY);
if(mc.gameSettings.keyShowRecipe.isKeyboardKey(key)){
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null){
if(hoveringSlot.hasStack()){
String query = "r:"+hoveringSlot.getStack().getDisplayName()+"!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
} else if (mc.gameSettings.keyShowUsage.isKeyboardKey(key)) {
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null) {
if (hoveringSlot.hasStack()) {
String query = "u:" + hoveringSlot.getStack().getDisplayName() + "!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
}
}

@Override
protected void renderOverlay(RenderEngine re, FontRenderer fr, int x, int y, int mouseX, int mouseY, float partialTicks) {
super.renderOverlay(re, fr, x, y, mouseX, mouseY, partialTicks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiRenderItem;
import net.minecraft.client.gui.GuiTooltip;
import net.minecraft.client.gui.guidebook.GuidebookPage;
import net.minecraft.client.gui.guidebook.GuidebookSection;
import net.minecraft.client.gui.guidebook.*;
import net.minecraft.client.gui.guidebook.search.SearchPage;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.RenderEngine;
import net.minecraft.core.achievement.AchievementList;
import net.minecraft.core.achievement.stat.StatList;
import net.minecraft.core.block.Block;
import net.minecraft.core.data.registry.recipe.RecipeSymbol;
import net.minecraft.core.data.registry.recipe.SearchQuery;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.gamemode.Gamemode;
Expand Down Expand Up @@ -135,6 +136,40 @@ protected void renderBackground(RenderEngine re, int x, int y) {
}
}

@Override
public void keyTyped(char c, int key, int x, int y, int mouseX, int mouseY) {
super.keyTyped(c, key, x, y, mouseX, mouseY);
if(mc.gameSettings.keyShowRecipe.isKeyboardKey(key)){
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null){
if(hoveringSlot.hasStack()){
String query = "r:"+hoveringSlot.getStack().getDisplayName()+"!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
} else if (mc.gameSettings.keyShowUsage.isKeyboardKey(key)) {
SlotGuidebook hoveringSlot= null;
for (SlotGuidebook slot : slots) {
if(getIsMouseOverSlot(slot,x,y,mouseX,mouseY)) hoveringSlot = slot;
}
if(hoveringSlot != null) {
if (hoveringSlot.hasStack()) {
String query = "u:" + hoveringSlot.getStack().getDisplayName() + "!";
PageManager.searchQuery = SearchQuery.resolve(query);
SearchPage.searchField.setText(query);
GuiGuidebook.getPageManager().updatePages();
GuiGuidebook.getPageManager().setCurrentPage(GuiGuidebook.getPageManager().getSectionIndex(GuidebookSections.CRAFTING), true);
}
}
}
}

@Override
protected void renderOverlay(RenderEngine re, FontRenderer fr, int x, int y, int mouseX, int mouseY, float partialTicks) {
super.renderOverlay(re, fr, x, y, mouseX, mouseY, partialTicks);
Expand Down
Loading

0 comments on commit 40dda8a

Please sign in to comment.