BackSlot

BackSlot

3M Downloads

Draw slots relative to inventory and not the entire screen

Cynosphere opened this issue ยท 1 comments

commented

if (this.recipeBook.isOpen()) {
scaledWidth = scaledWidth + 154;
}
RenderSystem.setShaderTexture(0, BACK_TEXTURE);
DrawableHelper.drawTexture(matrices, scaledWidth / 2 - 12 + beltSlot_x, scaledHeight / 2 - 58 + beltSlot_y, 0.0F, 0.0F, 18, 18, 18, 18);
RenderSystem.setShaderTexture(0, BACK_TEXTURE);
DrawableHelper.drawTexture(matrices, scaledWidth / 2 - 12 + backSlot_x, scaledHeight / 2 - 40 + backSlot_y, 0.0F, 0.0F, 18, 18, 18, 18);

This can be simplified by using this.x and this.y

There is also RecipeBookWidget.findLeftEdge so you don't have to hardcode and assume nothing will modify the position of the recipe book.

Slots will break with both Better Recipe Book and Scout (Cynosphere-mc/Scout#20) due to the recipe book position being hardcoded.

commented

Changed with 794e1d5