Compare commits

..

No commits in common. "f4c7ea060522d02436da93fd6a0bbb30ab115ec7" and "08112ea11cbbb4dd6768ba2f8b3d47fa22ff9136" have entirely different histories.

10 changed files with 105 additions and 74 deletions

View file

@ -10,7 +10,7 @@ game_version=1.16.5
forge_version=36.2.2
# Parchment (Mappings)
parchment_version=2021.10.17
parchment_version=2021.08.08
# Other mods
jei_version=1.16.4:7.6.1.71

View file

@ -7,10 +7,8 @@
*
* © 2015-2017 Ellpeck
*/
/*
@API(owner = ActuallyAdditionsAPI.MOD_ID, apiVersion = ActuallyAdditionsAPI.API_VERSION, provides = ActuallyAdditionsAPI.API_ID)
package de.ellpeck.actuallyadditions.api;
import net.minecraftforge.fml.common.API;
*/
import net.minecraftforge.fml.common.API;

View file

@ -12,8 +12,8 @@ package de.ellpeck.actuallyadditions.mod.blocks.render;
import com.mojang.blaze3d.matrix.MatrixStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEmpowerer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
@ -56,7 +56,7 @@ public class RenderEmpowerer extends TileEntityRenderer<TileEntityEmpowerer> {
matrices.popPose();
}
/*
int index = tile.recipeForRenderIndex;
if (index >= 0 && ActuallyAdditionsAPI.EMPOWERER_RECIPES.size() > index) {
EmpowererRecipe recipe = ActuallyAdditionsAPI.EMPOWERER_RECIPES.get(index);
@ -69,7 +69,5 @@ public class RenderEmpowerer extends TileEntityRenderer<TileEntityEmpowerer> {
}
}
}
*/
}
}

View file

@ -30,6 +30,8 @@ import de.ellpeck.actuallyadditions.mod.booklet.page.*;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.crafting.*;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.gen.AAWorldGen;
import de.ellpeck.actuallyadditions.mod.gen.WorldGenLushCaves;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats;
import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting;
@ -45,7 +47,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
@ -151,10 +152,10 @@ public final class InitBooklet {
//Miscellaneous
new BookletChapter("worms", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyItems.WORM.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.WORM.get())), new PagePicture(2, "page_worms", 145)).setImportant();
new BookletChapter("lushCaves", ActuallyAdditionsAPI.entryMisc, new ItemStack(Blocks.STONE), new PageTextOnly(1), new PagePicture(2, "page_lush_caves", 0).setNoText());
new BookletChapter("crystalClusters", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyBlocks.EMERADIC_CRYSTAL_CLUSTER.get()), new PageTextOnly(1).addItemsToPage(WorldGenLushCaves.CRYSTAL_CLUSTERS), new PageCrafting(2, MiscCrafting.RECIPES_CRYSTAL_SHARDS).setNoText(), new PageCrafting(3, MiscCrafting.RECIPES_CRYSTAL_SHARDS_BACK).setNoText()).setSpecial();
new BookletChapter("crystalClusters", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyBlocks.CRYSTAL_CLUSTER_EMERALD.get()), new PageTextOnly(1).addItemsToPage(WorldGenLushCaves.CRYSTAL_CLUSTERS), new PageCrafting(2, MiscCrafting.RECIPES_CRYSTAL_SHARDS).setNoText(), new PageCrafting(3, MiscCrafting.RECIPES_CRYSTAL_SHARDS_BACK).setNoText()).setSpecial();
new BookletChapter("banners", ActuallyAdditionsAPI.entryMisc, new ItemStack(Items.BLUE_BANNER, 1), new PageTextOnly(1));
new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyBlocks.ETHETIC_GREEN_BLOCK.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeGreenWall).setNoText());
chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyItems.BLACK_QUARTZ.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("<lowest>", AAWorldGen.QUARTZ_MIN).addTextReplacement("<highest>", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.itemBlackQuartz.get())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText());
chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyItems.itemBlackQuartz.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("<lowest>", AAWorldGen.QUARTZ_MIN).addTextReplacement("<highest>", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(ActuallyItems.itemBlackQuartz.get())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText());
// new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setWildcard()).setSpecial();
new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(ActuallyItems.TINY_COAL.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText());
ArrayList<BookletPage> lampPages = new ArrayList<>();
@ -204,7 +205,9 @@ public final class InitBooklet {
new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.INPUTTER_ADVANCED.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial();
new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.XP_SOLIDIFIER.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(ActuallyItems.SOLIDIFIED_EXPERIENCE.get())), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setImportant();
new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.GREENHOUSE_GLASS.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass));
// new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText());
new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.FEEDER.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText());
// new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemFertilizer.get())), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageTextOnly(3).addItemsToPage(new ItemStack(InitItems.itemMisc.get(), 1, TheMiscItems.MASHED_FOOD.ordinal())));
new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.blockGiantChest.get()), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade), new PageCrafting(6, ItemCrafting.recipeSmallToMediumCrateUpgrade), new PageCrafting(7, ItemCrafting.recipeMediumToLargeCrateUpgrade));
new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyBlocks.RANGED_COLLECTOR.get()), new PageTextOnly(1).addTextReplacement("<range>", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText());
@ -229,7 +232,7 @@ public final class InitBooklet {
list.add(new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText());
}
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.CRUSHER_DOUBLE.get()), list.toArray(new IBookletPage[0]));
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.GRINDER_DOUBLE.get()), list.toArray(new IBookletPage[0]));
new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.POWERED_FURNACE.get()), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("<rf>", TileEntityPoweredFurnace.ENERGY_USE));
new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.LAVA_FACTORY_CONTROLLER.get()), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText());
new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(ActuallyBlocks.ENERGIZER.get()), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator));
@ -268,6 +271,7 @@ public final class InitBooklet {
potionRingPages.add(new PageCrafting(potionRingPages.size() + 1, recipe).setNoText());
}
new BookletChapter("potionRings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(ActuallyItems.POTION_RING.get()), potionRingPages.toArray(new BookletPage[potionRingPages.size()]));
new BookletChapter("spawnerChanger", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(ActuallyItems.SPAWNER_CHANGER.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeSpawnerChanger).setNoText());
new BookletChapter("itemFilter", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(ActuallyItems.FILTER.get()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFilter).setNoText()).setImportant();
//RF Using Items
@ -289,9 +293,9 @@ public final class InitBooklet {
chaptersIntroduction[10] = new BookletChapter("trialsIntro", ActuallyAdditionsAPI.entryTrials, new ItemStack(Items.GOLD_INGOT), new PageTextOnly(1), new PageTextOnly(2)).setSpecial();
new BookletChapterTrials("crystalProduction", new ItemStack(ActuallyItems.EMERADIC_CRYSTAL.get()), false);
new BookletChapterTrials("leatherProduction", new ItemStack(Items.LEATHER), false);
new BookletChapterTrials("crystalOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidCrystalOil, FluidAttributes.BUCKET_VOLUME)), false);
new BookletChapterTrials("crystalOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidCrystalOil, Fluid.BUCKET_VOLUME)), false);
new BookletChapterTrials("autoDisenchanter", new ItemStack(ActuallyItems.DISENCHANTING_LENS.get()), false);
new BookletChapterTrials("empoweredOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidEmpoweredOil, FluidAttributes.BUCKET_VOLUME)), false);
new BookletChapterTrials("empoweredOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidEmpoweredOil, Fluid.BUCKET_VOLUME)), false);
new BookletChapterTrials("mobFarm", new ItemStack(Items.ROTTEN_FLESH), false);
new BookletChapterTrials("empowererAutomation", new ItemStack(ActuallyBlocks.EMPOWERER.get()), false);
}

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.booklet.gui;
import com.mojang.blaze3d.matrix.MatrixStack;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
@ -19,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.booklet.button.EntryButton;
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials;
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -66,11 +64,11 @@ public class GuiEntry extends GuiBooklet {
}
@Override
public void drawScreenPre(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
super.drawScreenPre(matrices, mouseX, mouseY, partialTicks);
public void drawScreenPre(int mouseX, int mouseY, float partialTicks) {
super.drawScreenPre(mouseX, mouseY, partialTicks);
String name = this.entry.getLocalizedName();
this.font.draw(matrices, name, this.guiLeft + this.xSize / 2 - this.font.width(name) / 2, this.guiTop - 1, 0xFFFFFF);
this.fontRenderer.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, this.guiTop - 1, 0xFFFFFF, true);
for (int i = 0; i < 2; i++) {
String pageStrg = "Page " + (this.entryPage * 2 + i + 1) + "/" + this.pageAmount * 2;
@ -85,7 +83,7 @@ public class GuiEntry extends GuiBooklet {
if (this.hasSearchBar() && this.searchText != null) {
this.searchField.setValue(this.searchText);
if (this.focusSearch) {
this.searchField.setFocus(true);
this.searchField.setFocused(true);
}
}
@ -102,9 +100,9 @@ public class GuiEntry extends GuiBooklet {
}
}
}
/*
@Override
protected void actionPerformed(Button button) throws IOException {
protected void actionPerformed(GuiButton button) throws IOException {
if (button instanceof EntryButton) {
int actualId = button.id + this.entryPage * BUTTONS_PER_PAGE * 2;
@ -113,7 +111,7 @@ public class GuiEntry extends GuiBooklet {
if (chapter != null) {
IBookletPage[] pages = chapter.getAllPages();
if (pages != null && pages.length > 0) {
this.minecraft.setScreen(BookletUtils.createPageGui(this.previousScreen, this, pages[0]));
this.mc.displayGuiScreen(BookletUtils.createPageGui(this.previousScreen, this, pages[0]));
}
}
}
@ -122,8 +120,6 @@ public class GuiEntry extends GuiBooklet {
}
}
*/
@Override
public void addOrModifyItemRenderer(ItemStack renderedStack, int x, int y, float scale, boolean shouldTryTransfer) {
@ -136,7 +132,7 @@ public class GuiEntry extends GuiBooklet {
@Override
public void onPageLeftButtonPressed() {
this.minecraft.setScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage - 1, this.searchText, this.searchField.isFocused()));
this.mc.displayGuiScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage - 1, this.searchText, this.searchField.isFocused()));
}
@Override
@ -146,7 +142,7 @@ public class GuiEntry extends GuiBooklet {
@Override
public void onPageRightButtonPressed() {
this.minecraft.setScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage + 1, this.searchText, this.searchField.isFocused()));
this.mc.displayGuiScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage + 1, this.searchText, this.searchField.isFocused()));
}
@Override
@ -156,8 +152,8 @@ public class GuiEntry extends GuiBooklet {
@Override
public void onBackButtonPressed() {
if (!hasShiftDown()) {
this.minecraft.setScreen(this.parentPage);
if (!isShiftKeyDown()) {
this.mc.displayGuiScreen(this.parentPage);
} else {
super.onBackButtonPressed();
}

View file

@ -10,12 +10,12 @@
package de.ellpeck.actuallyadditions.mod.booklet.gui;
import com.mojang.blaze3d.matrix.MatrixStack;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet;
import de.ellpeck.actuallyadditions.mod.booklet.button.EntryButton;
import de.ellpeck.actuallyadditions.mod.config.GuiConfiguration;
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
import de.ellpeck.actuallyadditions.mod.inventory.gui.TexturedButton;
@ -81,7 +81,7 @@ public class GuiMainPage extends GuiBooklet {
String usedQuote = QUOTES[this.getMinecraft().level.random.nextInt(QUOTES.length)];
String[] quoteSplit = usedQuote.split("@");
if (quoteSplit.length == 2) {
//this.quote = this.font.listFormattedStringToWidth(quoteSplit[0], 120); //TODO wut
this.quote = this.font.listFormattedStringToWidth(quoteSplit[0], 120);
this.quoteGuy = quoteSplit[1];
}
@ -134,14 +134,14 @@ public class GuiMainPage extends GuiBooklet {
List<String> configText = new ArrayList<>();
configText.add(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".configButton.name"));
//configText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".configButton.desc", ActuallyAdditions.NAME).replaceAll("\\\\n", "\n"), 200)); //TODO wut
configText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".configButton.desc", ActuallyAdditions.NAME).replaceAll("\\\\n", "\n"), 200));
this.configButton = new TexturedButton(RES_LOC_GADGETS, this.guiLeft + 16, this.guiTop + this.ySize - 30, 188, 14, 16, 16, configText, btn -> {
});
this.addButton(this.configButton);
List<String> achievementText = new ArrayList<>();
achievementText.add(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".achievementButton.name"));
//achievementText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".achievementButton.desc", ActuallyAdditions.NAME), 200)); //TODO wut
achievementText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".achievementButton.desc", ActuallyAdditions.NAME), 200));
//this.achievementButton = new TexturedButton(RES_LOC_GADGETS, -389, this.guiLeft+36, this.guiTop+this.ySize-30, 204, 14, 16, 16, achievementText);
//this.addButton(this.achievementButton);
@ -149,7 +149,7 @@ public class GuiMainPage extends GuiBooklet {
if (!data.didBookTutorial) {
this.showTutorial = true;
//this.tutorialButton = new GuiButton(666666, this.guiLeft + 140 / 2 - 50, this.guiTop + 146, 100, 20, "Please click me <3");
this.tutorialButton = new GuiButton(666666, this.guiLeft + 140 / 2 - 50, this.guiTop + 146, 100, 20, "Please click me <3");
this.addButton(this.tutorialButton);
this.configButton.visible = false;
@ -166,7 +166,7 @@ public class GuiMainPage extends GuiBooklet {
}
}
}
/*
@Override
protected void actionPerformed(GuiButton button) throws IOException {
if (button instanceof EntryButton) {
@ -182,7 +182,6 @@ public class GuiMainPage extends GuiBooklet {
GuiScreen achievements = new GuiAAAchievements(this, this.getMinecraft().player.getStatFileWriter());
this.getMinecraft().displayGuiScreen(achievements);
}*/
/*
else if (button == this.configButton) {
GuiScreen config = new GuiConfiguration(this);
this.getMinecraft().setScreen(config);
@ -207,18 +206,18 @@ public class GuiMainPage extends GuiBooklet {
super.actionPerformed(button);
}
}
*/
@Override
public void drawScreenPre(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
super.drawScreenPre(stack, mouseX, mouseY, partialTicks);
public void drawScreenPre(int mouseX, int mouseY, float partialTicks) {
super.drawScreenPre(mouseX, mouseY, partialTicks);
String strg = TextFormatting.DARK_GREEN + StringUtil.localize(this.bookletName);
this.font.draw(stack, strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 19, 0);
this.font.draw(strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 19, 0);
strg = TextFormatting.DARK_GREEN + StringUtil.localize("info." + ActuallyAdditions.MODID + ".booklet.manualName.2");
this.font.draw(stack, strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 19 + this.font.lineHeight, 0);
this.font.draw(strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 19 + this.font.lineHeight, 0);
strg = TextFormatting.GOLD + TextFormatting.ITALIC.toString() + this.bookletEdition;
this.font.draw(stack, strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 40, 0);
this.font.draw(strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 40, 0);
if (this.showTutorial) {
String text = TextFormatting.BLUE + "It looks like this is the first time you are using this manual. \nIf you click the button below, some useful bookmarks will be stored at the bottom of the GUI. You should definitely check them out to get started with " + ActuallyAdditions.NAME + "! \nIf you don't want this, shift-click the button.";

View file

@ -10,9 +10,7 @@
package de.ellpeck.actuallyadditions.mod.booklet.gui;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter;
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
@ -87,7 +85,7 @@ public class GuiPage extends GuiBooklet {
}
}
}
/*
@Override
public void actionPerformed(GuiButton button) throws IOException {
if (button == this.buttonViewOnline) {
@ -111,7 +109,7 @@ public class GuiPage extends GuiBooklet {
}
}
}
*/
@Override
public void init() {
this.itemDisplays.clear();
@ -148,8 +146,8 @@ public class GuiPage extends GuiBooklet {
}
@Override
public void tick() {
super.tick();
public void updateScreen() {
super.updateScreen();
for (int i = 0; i < this.pages.length; i++) {
IBookletPage page = this.pages[i];
@ -162,13 +160,13 @@ public class GuiPage extends GuiBooklet {
}
@Override
public void drawScreenPre(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
super.drawScreenPre(stack, mouseX, mouseY, partialTicks);
public void drawScreenPre(int mouseX, int mouseY, float partialTicks) {
super.drawScreenPre(mouseX, mouseY, partialTicks);
if (this.pages[0] != null) {
IBookletChapter chapter = this.pages[0].getChapter();
String name = chapter.getLocalizedName();
this.font.draw(stack, name, this.guiLeft + this.xSize / 2 - this.font.width(name) / 2, this.guiTop - 1, 0xFFFFFF);
this.fontRenderer.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, this.guiTop - 1, 0xFFFFFF, true);
}
for (int i = 0; i < this.pages.length; i++) {
@ -178,7 +176,7 @@ public class GuiPage extends GuiBooklet {
String pageStrg = "Page " + (chapter.getPageIndex(this.pages[i]) + 1) + "/" + chapter.getAllPages().length;
this.renderScaledAsciiString(pageStrg, this.guiLeft + 25 + i * 136, this.guiTop + this.ySize - 7, 0xFFFFFF, false, this.getLargeFontSize());
RenderSystem.color3f(1f, 1f, 1f);
GlStateManager.color1arg(1F, 1F, 1F);
page.drawScreenPre(this, this.guiLeft + 6 + i * 142, this.guiTop + 7, mouseX, mouseY, partialTicks);
}
}
@ -188,13 +186,13 @@ public class GuiPage extends GuiBooklet {
}
@Override
public void drawScreenPost(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
super.drawScreenPost(stack, mouseX, mouseY, partialTicks);
public void drawScreenPost(int mouseX, int mouseY, float partialTicks) {
super.drawScreenPost(mouseX, mouseY, partialTicks);
for (int i = 0; i < this.pages.length; i++) {
IBookletPage page = this.pages[i];
if (page != null) {
RenderSystem.color3f(1F, 1F, 1F);
GlStateManager.color1arg(1F, 1F, 1F);
page.drawScreenPost(this, this.guiLeft + 6 + i * 142, this.guiTop + 7, mouseX, mouseY, partialTicks);
}
}
@ -237,7 +235,7 @@ public class GuiPage extends GuiBooklet {
int pageNumToOpen = chapter.getPageIndex(page) - 1;
if (pageNumToOpen >= 0 && pageNumToOpen < pages.length) {
this.minecraft.setScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
this.mc.displayGuiScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
}
}
}
@ -267,7 +265,7 @@ public class GuiPage extends GuiBooklet {
int pageNumToOpen = chapter.getPageIndex(page) + 1;
if (pageNumToOpen >= 0 && pageNumToOpen < pages.length) {
this.minecraft.setScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
this.mc.displayGuiScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
}
}
}
@ -280,8 +278,8 @@ public class GuiPage extends GuiBooklet {
@Override
public void onBackButtonPressed() {
if (!hasShiftDown()) {
this.minecraft.setScreen(this.parentPage);
if (!isShiftKeyDown()) {
this.mc.displayGuiScreen(this.parentPage);
} else {
super.onBackButtonPressed();
}

View file

@ -11,9 +11,9 @@
package de.ellpeck.actuallyadditions.mod.booklet.page;
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet;
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;

View file

@ -20,7 +20,6 @@ import de.ellpeck.actuallyadditions.mod.material.ArmorMaterials;
import de.ellpeck.actuallyadditions.mod.material.ToolMaterials;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTier;
import net.minecraft.item.Items;
import net.minecraftforge.fml.RegistryObject;
@ -46,18 +45,8 @@ public final class ActuallyItems {
public static final RegistryObject<Item> COIL = ITEMS.register("coil", ItemBase::new);
public static final RegistryObject<Item> COIL_ADVANCED = ITEMS.register("coil_advanced", ItemBase::new);
public static final RegistryObject<Item> RICE_DOUGH = ITEMS.register("rice_dough", ItemBase::new);
public static final RegistryObject<Item> TINY_COAL = ITEMS.register("tiny_coal", () -> new ItemBase() {
@Override
public int getBurnTime(ItemStack stack) {
return 200;
}
});
public static final RegistryObject<Item> TINY_CHARCOAL = ITEMS.register("tiny_charcoal", () -> new ItemBase() {
@Override
public int getBurnTime(ItemStack stack) {
return 200;
}
});
public static final RegistryObject<Item> TINY_COAL = ITEMS.register("tiny_coal", ItemBase::new);
public static final RegistryObject<Item> TINY_CHARCOAL = ITEMS.register("tiny_charcoal", ItemBase::new);
public static final RegistryObject<Item> RICE_SLIME = ITEMS.register("rice_slime", ItemBase::new);
public static final RegistryObject<Item> CUP = ITEMS.register("cup", ItemBase::new);
public static final RegistryObject<Item> BAT_WING = ITEMS.register("bat_wing", ItemBase::new);

View file

@ -0,0 +1,49 @@
/*
* This file ("FluidStateMapper.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.util;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fluids.Fluid;
/**
* (Excerpted from Tinkers' Construct with permission, thanks guys!)
*/
@OnlyIn(Dist.CLIENT)
public class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition {
public final Fluid fluid;
public final ModelResourceLocation location;
public FluidStateMapper(Fluid fluid) {
this.fluid = fluid;
this.location = new ModelResourceLocation(new ResourceLocation(ActuallyAdditions.MODID, "fluids"), fluid.getName());
}
@Override
protected ModelResourceLocation getModelResourceLocation(BlockState state) {
return this.location;
}
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return this.location;
}
}