Skip to content

Commit

Permalink
Updated to 1.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
brisingraerowing committed Oct 28, 2018
1 parent 1f8150d commit 12ec3fb
Show file tree
Hide file tree
Showing 23 changed files with 88 additions and 71 deletions.
38 changes: 19 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
Expand Down Expand Up @@ -40,7 +40,7 @@ minecraft {
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20161220"
mappings = "snapshot_20171003"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

if (project.hasProperty("signature"))
Expand All @@ -50,7 +50,7 @@ minecraft {
dependencies {
deobfProvided "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"

compile files('libs/mystcraft.jar')
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
Expand Down Expand Up @@ -96,19 +96,19 @@ processResources {
}

// https://gist.github.com/matthewprenger/9b2da059b89433a01c1c
task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf { project.hasProperty('keyStore') }

if (!project.hasProperty('keyStore')) { // This shouldn't be possible, but onlyIf isn't working properly :/
throw new StopExecutionException()
}

keyStore = project.keyStore // This needs to be a path to the keystore file
alias = project.keyStoreAlias
storePass = project.keyStorePass
keyPass = project.keyStoreKeyPass
inputFile = jar.archivePath
outputFile = jar.archivePath
}

build.dependsOn signJar
//task signJar(type: SignJar, dependsOn: reobfJar) {
// onlyIf { project.hasProperty('keyStore') }

//if (!project.hasProperty('keyStore')) { // This shouldn't be possible, but onlyIf isn't working properly :/
//throw new StopExecutionException()
//}

//keyStore = project.keyStore // This needs to be a path to the keystore file
// alias = project.keyStoreAlias
// storePass = project.keyStorePass
// keyPass = project.keyStoreKeyPass
// inputFile = jar.archivePath
// outputFile = jar.archivePath
//}

//build.dependsOn signJar
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraft_version=1.11.2
forge_version=13.20.1.2386
jei_version=4.5.0.294
minecraft_version=1.12.2
forge_version=14.23.5.2772
jei_version=4.12.1.217

super_number=1
major_number=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.xcompwiz.mystcraft.api.MystObjects;
import me.heldplayer.mystcraft_jei.util.Integration;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ingredients.VanillaTypes;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.tuple.Pair;
Expand Down Expand Up @@ -125,7 +126,7 @@ public static void setDescriptions(@Nonnull IModRegistry registry) {
.map((stack) -> Pair.of(Integration.getMystItem(stack.getLeft()), stack.getRight()))
.filter((stack) -> stack.getLeft() != null && stack.getLeft() != Items.AIR)
.map((stack) -> new ItemStack(stack.getLeft(), 1, stack.getRight()))
.collect(Collectors.toList()), ItemStack.class, descriptions);
.collect(Collectors.toList()), VanillaTypes.ITEM, descriptions);

// Link panels
// Symbol pages
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/heldplayer/mystcraft_jei/JEIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@mezz.jei.api.JEIPlugin
public class JEIPlugin extends BlankModPlugin {
private IIngredientRegistry ingredientRegistry;
public IIngredientRegistry ingredientRegistry;

@Override
public void registerItemSubtypes(@Nonnull ISubtypeRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void registerEventHandlers() {
@Override
@Nonnull
public IDrawableTextfield createTextField(int width, int height) {
return new DrawableTextField(FMLClientHandler.instance().getClient().fontRendererObj, width, height);
return new DrawableTextField(FMLClientHandler.instance().getClient().fontRenderer, width, height);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void addRecipesButton(@Nonnull GuiContainer screen, int posX, int
try {
List<GuiLabel> labelList = (List<GuiLabel>) LABEL_LIST.get(screen);
labelList.removeIf(label -> label instanceof DrawableRecipesButton);
labelList.add(new DrawableRecipesButton(screen.mc.fontRendererObj, MystcraftJEI.proxy.getRecipeIcon(), -99, screen.getGuiLeft() + posX, screen.getGuiTop() + posY));
labelList.add(new DrawableRecipesButton(screen.mc.fontRenderer, MystcraftJEI.proxy.getRecipeIcon(), -99, screen.getGuiLeft() + posX, screen.getGuiTop() + posY));
} catch (IllegalAccessException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void draw(@Nonnull Minecraft minecraft) {

@Override
public void draw(@Nonnull Minecraft minecraft, int xOffset, int yOffset) {
this.textField.xPosition = xOffset;
this.textField.yPosition = yOffset;
this.textField.x = xOffset;
this.textField.y = yOffset;
this.textField.drawTextBox();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
Expand All @@ -18,7 +19,7 @@ private PageRenderer() {
}

@SideOnly(Side.CLIENT)
public static void renderPage(@Nonnull Minecraft minecraft, @Nonnull String symbol, float posX, float posY, float zLevel, float width, float height) {
public static void renderPage(@Nonnull Minecraft minecraft, @Nonnull ResourceLocation symbol, float posX, float posY, float zLevel, float width, float height) {
minecraft.getTextureManager().bindTexture(Assets.BOOK_PAGE_LEFT);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
drawTexturedModalRect(posX, posY, width, height, zLevel, 0.609375F, 0.0F, 0.7265625F, 0.15625F);
Expand Down Expand Up @@ -51,7 +52,7 @@ private static void drawGradientRect(float left, float top, float right, float b
GlStateManager.shadeModel(GL11.GL_SMOOTH);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
BufferBuilder vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
vertexbuffer.pos(right, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
vertexbuffer.pos(left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
Expand All @@ -67,7 +68,7 @@ private static void drawGradientRect(float left, float top, float right, float b
@SideOnly(Side.CLIENT)
private static void drawTexturedModalRect(float posX, float posY, float width, float height, float zLevel, float uStart, float vStart, float uEnd, float vEnd) {
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
BufferBuilder vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexbuffer.pos(posX, posY + height, zLevel).tex(uStart, vEnd).endVertex();
vertexbuffer.pos(posX + width, posY + height, zLevel).tex(uEnd, vEnd).endVertex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import mezz.jei.api.recipe.IRecipeCategory;
import net.minecraft.util.ResourceLocation;

import javax.annotation.Nonnull;

public class BookBinderRecipeCategory extends BlankRecipeCategory<BookBinderRecipes.AwareRecipeWrapper> {
public class BookBinderRecipeCategory implements IRecipeCategory<BookBinderRecipes.AwareRecipeWrapper> {
public static final int SLOT_LEATHER = 0;
public static final int SLOT_RESULT = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import me.heldplayer.mystcraft_jei.util.Integration;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
Expand All @@ -27,7 +29,7 @@ public static Collection<AwareRecipeWrapper> getRecipes() {
return Collections.singletonList(new AgeWrite());
}

public abstract static class AwareRecipeWrapper extends BlankRecipeWrapper {
public abstract static class AwareRecipeWrapper implements IRecipeWrapper {
protected IDrawableTextfield textField;

public void setTextField(IDrawableTextfield textField) {
Expand Down Expand Up @@ -55,8 +57,8 @@ public void getIngredients(@Nonnull IIngredients ingredients) {
Item descriptiveBook = Integration.getMystItem(MystObjects.Items.descriptive_book);
outputStacks.add(descriptiveBook == null ? Collections.emptyList() : Collections.singletonList(new ItemStack(descriptiveBook)));

ingredients.setInputLists(ItemStack.class, inputStacks);
ingredients.setOutputLists(ItemStack.class, outputStacks);
ingredients.setInputLists(VanillaTypes.ITEM, inputStacks);
ingredients.setOutputLists(VanillaTypes.ITEM, outputStacks);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;

import javax.annotation.Nonnull;

public class InkMixerRecipeCategory extends BlankRecipeCategory<IRecipeWrapper> {
public class InkMixerRecipeCategory implements IRecipeCategory<IRecipeWrapper> {
public static final int SLOT_TANK_INPUT = 0;
public static final int SLOT_TANK_OUTPUT = 1;
public static final int SLOT_PAPER = 2;
Expand All @@ -36,7 +37,7 @@ public InkMixerRecipeCategory(@Nonnull IGuiHelper guiHelper) {
ResourceLocation location = new ResourceLocation("mystcraft", "gui/inkmixer.png");
this.background = guiHelper.createDrawable(location, 5, 11, width, height);
this.tankOverlay = guiHelper.createDrawable(location, 54, 16, 67, 66);
this.iconDrop = guiHelper.createDrawable(Assets.ICONS_EXTRA, 0, 0, 18, 10, Assets.ICONS_EXTRA_WIDTH, Assets.ICONS_EXTRA_HEIGHT);
this.iconDrop = guiHelper.drawableBuilder(Assets.ICONS_EXTRA, 0, 0, 18, 10).setTextureSize(Assets.ICONS_EXTRA_WIDTH, Assets.ICONS_EXTRA_HEIGHT).build();
this.title = Util.translate("mystcraft-jei.category.ink_mixer");
}

Expand Down Expand Up @@ -83,10 +84,10 @@ public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapp
recipe.setDropIcon(this.iconDrop);
}

if (ingredients.getInputs(FluidStack.class).size() > 0) {
if (ingredients.getInputs(VanillaTypes.FLUID).size() > 0) {
guiFluidStacks.init(TANK_INK, true, 49, 5, 67, 66, 1000, false, tankOverlay);
}
if (ingredients.getOutputs(FluidStack.class).size() > 0) {
if (ingredients.getOutputs(VanillaTypes.FLUID).size() > 0) {
guiFluidStacks.init(TANK_INK, false, 49, 5, 67, 66, 1000, false, tankOverlay);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import me.heldplayer.mystcraft_jei.integration.mystcraft.MystItemFactory;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
Expand Down Expand Up @@ -120,9 +121,9 @@ public void getIngredients(@Nonnull IIngredients ingredients) {
List<List<FluidStack>> inputFluids = new ArrayList<>();
inputFluids.add(Collections.singletonList(FluidRegistry.getFluidStack(MystObjects.Fluids.black_ink, 1000)));

ingredients.setInputLists(ItemStack.class, inputStacks);
ingredients.setInputLists(FluidStack.class, inputFluids);
ingredients.setOutputLists(ItemStack.class, outputStacks);
ingredients.setInputLists(VanillaTypes.ITEM, inputStacks);
ingredients.setInputLists(VanillaTypes.FLUID, inputFluids);
ingredients.setOutputLists(VanillaTypes.ITEM, outputStacks);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import me.heldplayer.mystcraft_jei.util.Integration;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.Item;
Expand All @@ -25,7 +26,7 @@ public static Collection<IRecipeWrapper> getRecipes(@Nonnull IModRegistry modReg
Set<String> validInks = Integration.getValidInks();

return Stream.concat(
modRegistry.getIngredientRegistry().getIngredients(ItemStack.class).stream()
modRegistry.getIngredientRegistry().getAllIngredients(VanillaTypes.ITEM).stream()
.map((stack) -> Pair.of(stack, FluidUtil.getFluidContained(stack)))
.filter((stacks) -> stacks.getRight() != null)
.filter((stacks) -> stacks.getRight().amount == 1000)
Expand All @@ -48,7 +49,7 @@ public static Collection<IRecipeWrapper> getRecipes(@Nonnull IModRegistry modReg
).collect(Collectors.toList());
}

private static class InkFill extends BlankRecipeWrapper {
private static class InkFill implements IRecipeWrapper {

private final ItemStack inputItem;
private final ItemStack outputItem;
Expand All @@ -72,9 +73,9 @@ public void getIngredients(@Nonnull IIngredients ingredients) {
List<List<FluidStack>> outputFluids = new ArrayList<>();
outputFluids.add(Collections.singletonList(this.fluid));

ingredients.setInputLists(ItemStack.class, inputStacks);
ingredients.setOutputLists(FluidStack.class, outputFluids);
ingredients.setOutputLists(ItemStack.class, outputStacks);
ingredients.setInputLists(VanillaTypes.ITEM, inputStacks);
ingredients.setOutputLists(VanillaTypes.FLUID, outputFluids);
ingredients.setOutputLists(VanillaTypes.ITEM, outputStacks);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.heldplayer.mystcraft_jei.integration.mystcraft.MystItemFactory;
import me.heldplayer.mystcraft_jei.util.Integration;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
Expand All @@ -26,7 +27,7 @@ public void getIngredients(@Nonnull IIngredients ingredients) {
NBTTagCompound tag = pageStack.getTagCompound();
resultStack.setTagCompound(tag == null ? null : tag.copy());

ingredients.setInputs(ItemStack.class, Lists.newArrayList(new ItemStack(Items.LEATHER), pageStack));
ingredients.setOutput(ItemStack.class, resultStack);
ingredients.setInputs(VanillaTypes.ITEM, Lists.newArrayList(new ItemStack(Items.LEATHER), pageStack));
ingredients.setOutput(VanillaTypes.ITEM, resultStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.BlankRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
Expand Down Expand Up @@ -75,10 +76,10 @@ public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull WritingDeskR
guiItemStacks.init(SLOT_TANK_OUTPUT, false, 144, 52);
guiItemStacks.set(ingredients);

if (ingredients.getInputs(FluidStack.class).size() > 0) {
if (ingredients.getInputs(VanillaTypes.FLUID).size() > 0) {
guiFluidStacks.init(TANK_INK, true, 126, 1, 14, 68, 1000, false, null);
}
if (ingredients.getOutputs(FluidStack.class).size() > 0) {
if (ingredients.getOutputs(VanillaTypes.FLUID).size() > 0) {
guiFluidStacks.init(TANK_INK, false, 126, 1, 14, 68, 1000, false, null);
}

Expand Down
Loading

0 comments on commit 12ec3fb

Please sign in to comment.