no impl dep, woo
This commit is contained in:
parent
1f113fbbdd
commit
c4bb2730cb
4 changed files with 24 additions and 32 deletions
|
@ -1,7 +1,7 @@
|
||||||
package at.petrak.hexcasting.fabric.interop.emi;
|
package at.petrak.hexcasting.fabric.interop.emi;
|
||||||
|
|
||||||
import dev.emi.emi.EmiRenderHelper;
|
|
||||||
import dev.emi.emi.api.recipe.EmiRecipe;
|
import dev.emi.emi.api.recipe.EmiRecipe;
|
||||||
|
import dev.emi.emi.api.render.EmiTexture;
|
||||||
import dev.emi.emi.api.stack.EmiIngredient;
|
import dev.emi.emi.api.stack.EmiIngredient;
|
||||||
import dev.emi.emi.api.stack.EmiStack;
|
import dev.emi.emi.api.stack.EmiStack;
|
||||||
import dev.emi.emi.api.widget.WidgetHolder;
|
import dev.emi.emi.api.widget.WidgetHolder;
|
||||||
|
@ -62,8 +62,8 @@ public abstract class EmiVillagerRecipe implements EmiRecipe {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWidgets(WidgetHolder widgets) {
|
public void addWidgets(WidgetHolder widgets) {
|
||||||
widgets.addTexture(EmiRenderHelper.WIDGETS, 27, 3, 13, 13, 82, 0);
|
widgets.addTexture(EmiTexture.PLUS, 27, 3);
|
||||||
widgets.addTexture(EmiRenderHelper.WIDGETS, 75, 1, 24, 17, 44, 0);
|
widgets.addTexture(EmiTexture.EMPTY_ARROW, 75, 1);
|
||||||
widgets.addSlot(this.input, 0, 0);
|
widgets.addSlot(this.input, 0, 0);
|
||||||
widgets.addSlot(this.catalyst, 49, 0).catalyst(this.isCatalyst);
|
widgets.addSlot(this.catalyst, 49, 0).catalyst(this.isCatalyst);
|
||||||
widgets.addSlot(this.result, 107, 0).recipeContext(this);
|
widgets.addSlot(this.result, 107, 0).recipeContext(this);
|
||||||
|
|
|
@ -5,13 +5,12 @@ import at.petrak.hexcasting.common.recipe.BrainsweepRecipe;
|
||||||
import at.petrak.hexcasting.common.recipe.HexRecipeSerializers;
|
import at.petrak.hexcasting.common.recipe.HexRecipeSerializers;
|
||||||
import at.petrak.hexcasting.common.recipe.ingredient.VillagerIngredient;
|
import at.petrak.hexcasting.common.recipe.ingredient.VillagerIngredient;
|
||||||
import at.petrak.hexcasting.mixin.accessor.AccessorPoiType;
|
import at.petrak.hexcasting.mixin.accessor.AccessorPoiType;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
|
||||||
import dev.emi.emi.api.EmiPlugin;
|
import dev.emi.emi.api.EmiPlugin;
|
||||||
import dev.emi.emi.api.EmiRegistry;
|
import dev.emi.emi.api.EmiRegistry;
|
||||||
import dev.emi.emi.api.recipe.EmiRecipeCategory;
|
import dev.emi.emi.api.recipe.EmiRecipeCategory;
|
||||||
|
import dev.emi.emi.api.render.EmiTexture;
|
||||||
import dev.emi.emi.api.stack.EmiIngredient;
|
import dev.emi.emi.api.stack.EmiIngredient;
|
||||||
import dev.emi.emi.api.stack.EmiStack;
|
import dev.emi.emi.api.stack.EmiStack;
|
||||||
import net.minecraft.client.gui.GuiComponent;
|
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.ai.village.poi.PoiType;
|
import net.minecraft.world.entity.ai.village.poi.PoiType;
|
||||||
|
@ -37,22 +36,16 @@ public class HexEMIPlugin implements EmiPlugin {
|
||||||
private static final ResourceLocation SIMPLIFIED_ICON_PROFESSION = modLoc("textures/gui/villager_profession.png");
|
private static final ResourceLocation SIMPLIFIED_ICON_PROFESSION = modLoc("textures/gui/villager_profession.png");
|
||||||
|
|
||||||
public static final EmiRecipeCategory BRAINSWEEP = new EmiRecipeCategory(BRAINSWEEP_ID,
|
public static final EmiRecipeCategory BRAINSWEEP = new EmiRecipeCategory(BRAINSWEEP_ID,
|
||||||
new PatternRendererEMI(BRAINSWEEP_ID, 16, 16), (matrices, x, y, delta) -> {
|
new PatternRendererEMI(BRAINSWEEP_ID, 16, 16),
|
||||||
RenderSystem.setShaderTexture(0, SIMPLIFIED_ICON_BRAINSWEEP);
|
new EmiTexture(SIMPLIFIED_ICON_BRAINSWEEP, 0, 0, 16, 16, 16, 16, 16, 16));
|
||||||
GuiComponent.blit(matrices, x, y, 0, 0, 16, 16, 16, 16);
|
|
||||||
});
|
|
||||||
|
|
||||||
public static final EmiRecipeCategory VILLAGER_LEVELING = new EmiRecipeCategory(VILLAGER_LEVELING_ID,
|
public static final EmiRecipeCategory VILLAGER_LEVELING = new EmiRecipeCategory(VILLAGER_LEVELING_ID,
|
||||||
EmiStack.of(Items.EMERALD), (matrices, x, y, delta) -> {
|
EmiStack.of(Items.EMERALD),
|
||||||
RenderSystem.setShaderTexture(0, SIMPLIFIED_ICON_LEVELING);
|
new EmiTexture(SIMPLIFIED_ICON_LEVELING, 0, 0, 16, 16, 16, 16, 16, 16));
|
||||||
GuiComponent.blit(matrices, x, y, 0, 0, 16, 16, 16, 16);
|
|
||||||
});
|
|
||||||
|
|
||||||
public static final EmiRecipeCategory VILLAGER_PROFESSION = new EmiRecipeCategory(VILLAGER_PROFESSION_ID,
|
public static final EmiRecipeCategory VILLAGER_PROFESSION = new EmiRecipeCategory(VILLAGER_PROFESSION_ID,
|
||||||
EmiStack.of(Blocks.GRINDSTONE), (matrices, x, y, delta) -> {
|
EmiStack.of(Blocks.LECTERN),
|
||||||
RenderSystem.setShaderTexture(0, SIMPLIFIED_ICON_PROFESSION);
|
new EmiTexture(SIMPLIFIED_ICON_PROFESSION, 0, 0, 16, 16, 16, 16, 16, 16));
|
||||||
GuiComponent.blit(matrices, x, y, 0, 0, 16, 16, 16, 16);
|
|
||||||
});
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void register(EmiRegistry registry) {
|
public void register(EmiRegistry registry) {
|
||||||
|
|
|
@ -6,13 +6,13 @@ import at.petrak.hexcasting.interop.utils.PatternDrawingUtil;
|
||||||
import at.petrak.hexcasting.interop.utils.PatternEntry;
|
import at.petrak.hexcasting.interop.utils.PatternEntry;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.datafixers.util.Pair;
|
import com.mojang.datafixers.util.Pair;
|
||||||
import dev.emi.emi.api.recipe.EmiRecipeCategory;
|
import dev.emi.emi.api.render.EmiRenderable;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.phys.Vec2;
|
import net.minecraft.world.phys.Vec2;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PatternRendererEMI implements EmiRecipeCategory.Renderer {
|
public class PatternRendererEMI implements EmiRenderable {
|
||||||
|
|
||||||
private final long startTime = System.currentTimeMillis();
|
private final long startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ package at.petrak.hexcasting.fabric.interop.emi;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import dev.emi.emi.EmiRenderHelper;
|
import dev.emi.emi.api.render.EmiRender;
|
||||||
import dev.emi.emi.api.EmiRender;
|
import dev.emi.emi.api.render.EmiTexture;
|
||||||
import dev.emi.emi.api.stack.EmiIngredient;
|
import dev.emi.emi.api.stack.EmiIngredient;
|
||||||
import dev.emi.emi.api.widget.Bounds;
|
import dev.emi.emi.api.widget.Bounds;
|
||||||
import dev.emi.emi.api.widget.SlotWidget;
|
import dev.emi.emi.api.widget.SlotWidget;
|
||||||
|
@ -46,11 +46,10 @@ public class TheCoolerSlotWidget extends SlotWidget {
|
||||||
RenderSystem.setShaderTexture(0, this.textureId);
|
RenderSystem.setShaderTexture(0, this.textureId);
|
||||||
GuiComponent.blit(poseStack, bounds.x(), bounds.y(), width, height, (float)this.u, (float)this.v, width, height, 256, 256);
|
GuiComponent.blit(poseStack, bounds.x(), bounds.y(), width, height, (float)this.u, (float)this.v, width, height, 256, 256);
|
||||||
} else {
|
} else {
|
||||||
RenderSystem.setShaderTexture(0, EmiRenderHelper.WIDGETS);
|
|
||||||
if (this.output) {
|
if (this.output) {
|
||||||
GuiComponent.blit(poseStack, bounds.x(), bounds.y(), 26, 26, 18.0F, 0.0F, 26, 26, 256, 256);
|
EmiTexture.LARGE_SLOT.render(poseStack, bounds.x(), bounds.y(), delta);
|
||||||
} else {
|
} else {
|
||||||
GuiComponent.blit(poseStack, bounds.x(), bounds.y(), 18, 18, 0.0F, 0.0F, 18, 18, 256, 256);
|
EmiTexture.SLOT.render(poseStack, bounds.x(), bounds.y(), delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue