fixed JEI coordinates and names being incorrect

This commit is contained in:
Ell 2022-09-30 15:39:20 +02:00
parent 6e33514b17
commit c41f26649e
4 changed files with 16 additions and 16 deletions

View file

@ -34,7 +34,7 @@ public class AltarCategory implements IRecipeCategory<AltarRecipe> {
@Override @Override
public Component getTitle() { public Component getTitle() {
return Component.translatable("container." + JEINaturesAuraPlugin.ALTAR + ".name"); return Component.translatable("container." + JEINaturesAuraPlugin.ALTAR.getUid() + ".name");
} }
@Override @Override
@ -49,9 +49,9 @@ public class AltarCategory implements IRecipeCategory<AltarRecipe> {
@Override @Override
public void setRecipe(IRecipeLayoutBuilder builder, AltarRecipe recipe, IFocusGroup focuses) { public void setRecipe(IRecipeLayoutBuilder builder, AltarRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.INPUT, 0, 18).addItemStacks(Arrays.asList(recipe.input.getItems())); builder.addSlot(RecipeIngredientRole.INPUT, 1, 19).addItemStacks(Arrays.asList(recipe.input.getItems()));
builder.addSlot(RecipeIngredientRole.OUTPUT, 80, 18).addItemStack(recipe.output); builder.addSlot(RecipeIngredientRole.OUTPUT, 81, 19).addItemStack(recipe.output);
builder.addSlot(RecipeIngredientRole.CATALYST, 26, 18).addItemStacks(recipe.catalyst == Ingredient.EMPTY ? Collections.singletonList(this.altar) : Arrays.asList(recipe.catalyst.getItems())); builder.addSlot(RecipeIngredientRole.CATALYST, 27, 19).addItemStacks(recipe.catalyst == Ingredient.EMPTY ? Collections.singletonList(this.altar) : Arrays.asList(recipe.catalyst.getItems()));
builder.addSlot(RecipeIngredientRole.CATALYST, 51, 18).addItemStack(recipe.requiredType != null ? recipe.getDimensionBottle() : ItemStack.EMPTY); builder.addSlot(RecipeIngredientRole.CATALYST, 52, 19).addItemStack(recipe.requiredType != null ? recipe.getDimensionBottle() : ItemStack.EMPTY);
} }
} }

View file

@ -87,7 +87,7 @@ public class AnimalSpawnerCategory implements IRecipeCategory<AnimalSpawnerRecip
@Override @Override
public Component getTitle() { public Component getTitle() {
return Component.translatable("container." + JEINaturesAuraPlugin.SPAWNER + ".name"); return Component.translatable("container." + JEINaturesAuraPlugin.SPAWNER.getUid() + ".name");
} }
@Override @Override
@ -103,7 +103,7 @@ public class AnimalSpawnerCategory implements IRecipeCategory<AnimalSpawnerRecip
@Override @Override
public void setRecipe(IRecipeLayoutBuilder builder, AnimalSpawnerRecipe recipe, IFocusGroup focuses) { public void setRecipe(IRecipeLayoutBuilder builder, AnimalSpawnerRecipe recipe, IFocusGroup focuses) {
for (var i = 0; i < recipe.ingredients.length; i++) for (var i = 0; i < recipe.ingredients.length; i++)
builder.addSlot(RecipeIngredientRole.INPUT, i * 18, 68).addItemStacks(Arrays.asList(recipe.ingredients[i].getItems())); builder.addSlot(RecipeIngredientRole.INPUT, i * 18 + 1, 69).addItemStacks(Arrays.asList(recipe.ingredients[i].getItems()));
builder.addInvisibleIngredients(RecipeIngredientRole.OUTPUT).addItemStack(new ItemStack(ForgeSpawnEggItem.fromEntityType(recipe.entity))); builder.addInvisibleIngredients(RecipeIngredientRole.OUTPUT).addItemStack(new ItemStack(ForgeSpawnEggItem.fromEntityType(recipe.entity)));
} }
@ -118,7 +118,7 @@ public class AnimalSpawnerCategory implements IRecipeCategory<AnimalSpawnerRecip
matrixStack.pushPose(); matrixStack.pushPose();
var size = Math.max(1F, Math.max(recipe.entity.getWidth(), recipe.entity.getHeight())); var size = Math.max(1F, Math.max(recipe.entity.getWidth(), recipe.entity.getHeight()));
AnimalSpawnerCategory.renderEntity(matrixStack, 35, 55, 100F / size * 0.4F, 40, size * 0.5F, (LivingEntity) entity); AnimalSpawnerCategory.renderEntity(matrixStack, 36, 56, 100F / size * 0.4F, 40, size * 0.5F, (LivingEntity) entity);
matrixStack.popPose(); matrixStack.popPose();
var name = recipe.entity.getDescription().getString(); var name = recipe.entity.getDescription().getString();

View file

@ -29,7 +29,7 @@ public class OfferingCategory implements IRecipeCategory<OfferingRecipe> {
@Override @Override
public Component getTitle() { public Component getTitle() {
return Component.translatable("container." + JEINaturesAuraPlugin.OFFERING + ".name"); return Component.translatable("container." + JEINaturesAuraPlugin.OFFERING.getUid() + ".name");
} }
@Override @Override
@ -44,8 +44,8 @@ public class OfferingCategory implements IRecipeCategory<OfferingRecipe> {
@Override @Override
public void setRecipe(IRecipeLayoutBuilder builder, OfferingRecipe recipe, IFocusGroup focuses) { public void setRecipe(IRecipeLayoutBuilder builder, OfferingRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.INPUT, 0, 14).addItemStacks(Arrays.asList(recipe.input.getItems())); builder.addSlot(RecipeIngredientRole.INPUT, 1, 15).addItemStacks(Arrays.asList(recipe.input.getItems()));
builder.addSlot(RecipeIngredientRole.OUTPUT, 65, 14).addItemStack(recipe.output); builder.addSlot(RecipeIngredientRole.OUTPUT, 66, 15).addItemStack(recipe.output);
builder.addSlot(RecipeIngredientRole.INPUT, 27, 0).addItemStacks(Arrays.asList(recipe.startItem.getItems())); builder.addSlot(RecipeIngredientRole.INPUT, 28, 1).addItemStacks(Arrays.asList(recipe.startItem.getItems()));
} }
} }

View file

@ -29,7 +29,7 @@ public class TreeRitualCategory implements IRecipeCategory<TreeRitualRecipe> {
@Override @Override
public Component getTitle() { public Component getTitle() {
return Component.translatable("container." + JEINaturesAuraPlugin.TREE_RITUAL + ".name"); return Component.translatable("container." + JEINaturesAuraPlugin.TREE_RITUAL.getUid() + ".name");
} }
@Override @Override
@ -44,12 +44,12 @@ public class TreeRitualCategory implements IRecipeCategory<TreeRitualRecipe> {
@Override @Override
public void setRecipe(IRecipeLayoutBuilder builder, TreeRitualRecipe recipe, IFocusGroup focuses) { public void setRecipe(IRecipeLayoutBuilder builder, TreeRitualRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.CATALYST, 34, 34).addItemStacks(Arrays.asList(recipe.saplingType.getItems())); builder.addSlot(RecipeIngredientRole.CATALYST, 35, 35).addItemStacks(Arrays.asList(recipe.saplingType.getItems()));
builder.addSlot(RecipeIngredientRole.OUTPUT, 124, 34).addItemStack(recipe.result); builder.addSlot(RecipeIngredientRole.OUTPUT, 125, 35).addItemStack(recipe.result);
var positions = new int[][]{{35, 1}, {35, 69}, {1, 35}, {69, 35}, {12, 12}, {58, 58}, {58, 12}, {12, 58}}; var positions = new int[][]{{35, 1}, {35, 69}, {1, 35}, {69, 35}, {12, 12}, {58, 58}, {58, 12}, {12, 58}};
for (var i = 0; i < recipe.ingredients.length; i++) for (var i = 0; i < recipe.ingredients.length; i++)
builder.addSlot(RecipeIngredientRole.INPUT, positions[i][0] - 1, positions[i][1] - 1).addItemStacks(Arrays.asList(recipe.ingredients[i].getItems())); builder.addSlot(RecipeIngredientRole.INPUT, positions[i][0], positions[i][1]).addItemStacks(Arrays.asList(recipe.ingredients[i].getItems()));
} }
} }