Skip to content

Commit

Permalink
Merge pull request #3 from Arminias/BTW-CE
Browse files Browse the repository at this point in the history
Added compatibility with fabric intermediary mappings
  • Loading branch information
Joel-Paul committed Mar 4, 2022
2 parents 6eeed63 + 88539cd commit aebebac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/net/minecraft/src/CraftGuide_Vanilla.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ else if(screen instanceof GuiContainer)
{
int x = Mouse.getX() * screen.width / mc.displayWidth;
int y = screen.height - (Mouse.getY() * screen.height / mc.displayHeight) - 1;
int left = (Integer)CommonUtilities.getPrivateValue(GuiContainer.class, (GuiContainer)screen, "e", "n", "field_74198_m", "guiLeft");
int top = (Integer)CommonUtilities.getPrivateValue(GuiContainer.class, (GuiContainer)screen, "o", "field_74197_n", "guiTop");
int left = (Integer)CommonUtilities.getPrivateValue(GuiContainer.class, (GuiContainer)screen, "e", "n", "field_74198_m", "guiLeft", "field_1350");
int top = (Integer)CommonUtilities.getPrivateValue(GuiContainer.class, (GuiContainer)screen, "o", "field_74197_n", "guiTop", "field_1351");
openRecipe((GuiContainer)screen, x - left, y - top);
}
catch(IllegalArgumentException e)
Expand Down
2 changes: 1 addition & 1 deletion src/uristqwerty/CraftGuide/CommonUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ else if(item instanceof ItemStack)
{
try
{
itemDamageField = getPrivateField(ItemStack.class, "itemDamage", "field_77991_e", "e");
itemDamageField = getPrivateField(ItemStack.class, "itemDamage", "field_77991_e", "e", "field_4380");
}
catch(NoSuchFieldException e)
{
Expand Down
8 changes: 4 additions & 4 deletions src/uristqwerty/CraftGuide/RecipeGeneratorImplementation.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ public Object[] getCraftingRecipe(IRecipe recipe, boolean allowSmallGrid)
{
if(recipe instanceof ShapedRecipes)
{
int width = (Integer)CommonUtilities.getPrivateValue(ShapedRecipes.class, (ShapedRecipes)recipe, "b", "recipeWidth", "field_77576_b");
int height = (Integer)CommonUtilities.getPrivateValue(ShapedRecipes.class, (ShapedRecipes)recipe, "c", "recipeHeight", "field_77577_c");
Object[] items = (Object[])CommonUtilities.getPrivateValue(ShapedRecipes.class, (ShapedRecipes)recipe, "d", "recipeItems", "field_77574_d");
int width = (Integer)CommonUtilities.getPrivateValue(ShapedRecipes.class, (ShapedRecipes)recipe, "b", "recipeWidth", "field_77576_b", "field_4438");
int height = (Integer)CommonUtilities.getPrivateValue(ShapedRecipes.class, (ShapedRecipes)recipe, "c", "recipeHeight", "field_77577_c", "field_4439");
Object[] items = (Object[])CommonUtilities.getPrivateValue(ShapedRecipes.class, (ShapedRecipes)recipe, "d", "recipeItems", "field_77574_d", "field_4440");

if(allowSmallGrid && width < 3 && height < 3)
{
Expand All @@ -171,7 +171,7 @@ public Object[] getCraftingRecipe(IRecipe recipe, boolean allowSmallGrid)
}
else if(recipe instanceof ShapelessRecipes)
{
List items = (List)CommonUtilities.getPrivateValue(ShapelessRecipes.class, (ShapelessRecipes)recipe, "b", "recipeItems", "field_77579_b");
List items = (List)CommonUtilities.getPrivateValue(ShapelessRecipes.class, (ShapelessRecipes)recipe, "b", "recipeItems", "field_77579_b", "field_4443");
return getCraftingShapelessRecipe(items, ((ShapelessRecipes)recipe).getRecipeOutput());
}
else if(forgeExt != null && forgeExt.matchesType(recipe))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ITexturePack getSelectedTexturePack()

try
{
TexturePackList texturePackList = (TexturePackList)CommonUtilities.getPrivateValue(RenderEngine.class, renderEngine, "g", "texturePack", "field_78366_k");
TexturePackList texturePackList = (TexturePackList)CommonUtilities.getPrivateValue(RenderEngine.class, renderEngine, "g", "texturePack", "field_78366_k", "field_1981");
return texturePackList.getSelectedTexturePack();
}
catch(SecurityException e)
Expand Down Expand Up @@ -75,7 +75,7 @@ public void stopTessellating()
{
try
{
isDrawing = CommonUtilities.getPrivateField(Tessellator.class, "z", "isDrawing", "field_78415_z");
isDrawing = CommonUtilities.getPrivateField(Tessellator.class, "z", "isDrawing", "field_78415_z", "field_1970");
}
catch(NoSuchFieldException e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/uristqwerty/gui_craftguide/minecraft/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void initJarTextures()
Method getTexture;
try
{
getTexture = CommonUtilities.getPrivateMethod(RenderEngine.class, new String[]{"f", "getTexture", "func_78341_b"}, String.class);
getTexture = CommonUtilities.getPrivateMethod(RenderEngine.class, new String[]{"f", "getTexture", "func_78341_b", "method_1428"}, String.class);
image.texID = (Integer)getTexture.invoke(Minecraft.getMinecraft().renderEngine, entry.getKey());
}
catch(NoSuchMethodException e)
Expand Down

0 comments on commit aebebac

Please sign in to comment.