mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
more errors.
This commit is contained in:
parent
08112ea11c
commit
e0c049f900
10 changed files with 68 additions and 97 deletions
|
@ -10,7 +10,7 @@ game_version=1.16.5
|
||||||
forge_version=36.2.2
|
forge_version=36.2.2
|
||||||
|
|
||||||
# Parchment (Mappings)
|
# Parchment (Mappings)
|
||||||
parchment_version=2021.08.08
|
parchment_version=2021.10.17
|
||||||
|
|
||||||
# Other mods
|
# Other mods
|
||||||
jei_version=1.16.4:7.6.1.71
|
jei_version=1.16.4:7.6.1.71
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
*
|
*
|
||||||
* © 2015-2017 Ellpeck
|
* © 2015-2017 Ellpeck
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
@API(owner = ActuallyAdditionsAPI.MOD_ID, apiVersion = ActuallyAdditionsAPI.API_VERSION, provides = ActuallyAdditionsAPI.API_ID)
|
@API(owner = ActuallyAdditionsAPI.MOD_ID, apiVersion = ActuallyAdditionsAPI.API_VERSION, provides = ActuallyAdditionsAPI.API_ID)
|
||||||
package de.ellpeck.actuallyadditions.api;
|
package de.ellpeck.actuallyadditions.api;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.API;
|
import net.minecraftforge.fml.common.API;
|
||||||
|
|
||||||
|
*/
|
|
@ -12,8 +12,8 @@ package de.ellpeck.actuallyadditions.mod.blocks.render;
|
||||||
|
|
||||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||||
import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe;
|
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
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.tile.TileEntityEmpowerer;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||||
|
@ -56,7 +56,7 @@ public class RenderEmpowerer extends TileEntityRenderer<TileEntityEmpowerer> {
|
||||||
|
|
||||||
matrices.popPose();
|
matrices.popPose();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int index = tile.recipeForRenderIndex;
|
int index = tile.recipeForRenderIndex;
|
||||||
if (index >= 0 && ActuallyAdditionsAPI.EMPOWERER_RECIPES.size() > index) {
|
if (index >= 0 && ActuallyAdditionsAPI.EMPOWERER_RECIPES.size() > index) {
|
||||||
EmpowererRecipe recipe = ActuallyAdditionsAPI.EMPOWERER_RECIPES.get(index);
|
EmpowererRecipe recipe = ActuallyAdditionsAPI.EMPOWERER_RECIPES.get(index);
|
||||||
|
@ -69,5 +69,7 @@ public class RenderEmpowerer extends TileEntityRenderer<TileEntityEmpowerer> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@ import de.ellpeck.actuallyadditions.mod.booklet.page.*;
|
||||||
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
|
||||||
import de.ellpeck.actuallyadditions.mod.crafting.*;
|
import de.ellpeck.actuallyadditions.mod.crafting.*;
|
||||||
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
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.ActuallyItems;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats;
|
import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats;
|
||||||
import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting;
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensDisenchanting;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.booklet.gui;
|
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.IBookletChapter;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
||||||
|
@ -18,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.button.EntryButton;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials;
|
import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
|
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
@ -64,11 +66,11 @@ public class GuiEntry extends GuiBooklet {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreenPre(int mouseX, int mouseY, float partialTicks) {
|
public void drawScreenPre(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.drawScreenPre(mouseX, mouseY, partialTicks);
|
super.drawScreenPre(matrices, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
String name = this.entry.getLocalizedName();
|
String name = this.entry.getLocalizedName();
|
||||||
this.fontRenderer.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, this.guiTop - 1, 0xFFFFFF, true);
|
this.font.draw(matrices, name, this.guiLeft + this.xSize / 2 - this.font.width(name) / 2, this.guiTop - 1, 0xFFFFFF);
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
String pageStrg = "Page " + (this.entryPage * 2 + i + 1) + "/" + this.pageAmount * 2;
|
String pageStrg = "Page " + (this.entryPage * 2 + i + 1) + "/" + this.pageAmount * 2;
|
||||||
|
@ -83,7 +85,7 @@ public class GuiEntry extends GuiBooklet {
|
||||||
if (this.hasSearchBar() && this.searchText != null) {
|
if (this.hasSearchBar() && this.searchText != null) {
|
||||||
this.searchField.setValue(this.searchText);
|
this.searchField.setValue(this.searchText);
|
||||||
if (this.focusSearch) {
|
if (this.focusSearch) {
|
||||||
this.searchField.setFocused(true);
|
this.searchField.setFocus(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,9 +102,9 @@ public class GuiEntry extends GuiBooklet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
protected void actionPerformed(GuiButton button) throws IOException {
|
protected void actionPerformed(Button button) throws IOException {
|
||||||
if (button instanceof EntryButton) {
|
if (button instanceof EntryButton) {
|
||||||
int actualId = button.id + this.entryPage * BUTTONS_PER_PAGE * 2;
|
int actualId = button.id + this.entryPage * BUTTONS_PER_PAGE * 2;
|
||||||
|
|
||||||
|
@ -111,7 +113,7 @@ public class GuiEntry extends GuiBooklet {
|
||||||
if (chapter != null) {
|
if (chapter != null) {
|
||||||
IBookletPage[] pages = chapter.getAllPages();
|
IBookletPage[] pages = chapter.getAllPages();
|
||||||
if (pages != null && pages.length > 0) {
|
if (pages != null && pages.length > 0) {
|
||||||
this.mc.displayGuiScreen(BookletUtils.createPageGui(this.previousScreen, this, pages[0]));
|
this.minecraft.setScreen(BookletUtils.createPageGui(this.previousScreen, this, pages[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,6 +122,8 @@ public class GuiEntry extends GuiBooklet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addOrModifyItemRenderer(ItemStack renderedStack, int x, int y, float scale, boolean shouldTryTransfer) {
|
public void addOrModifyItemRenderer(ItemStack renderedStack, int x, int y, float scale, boolean shouldTryTransfer) {
|
||||||
|
|
||||||
|
@ -132,7 +136,7 @@ public class GuiEntry extends GuiBooklet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageLeftButtonPressed() {
|
public void onPageLeftButtonPressed() {
|
||||||
this.mc.displayGuiScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage - 1, this.searchText, this.searchField.isFocused()));
|
this.minecraft.setScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage - 1, this.searchText, this.searchField.isFocused()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -142,7 +146,7 @@ public class GuiEntry extends GuiBooklet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageRightButtonPressed() {
|
public void onPageRightButtonPressed() {
|
||||||
this.mc.displayGuiScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage + 1, this.searchText, this.searchField.isFocused()));
|
this.minecraft.setScreen(new GuiEntry(this.previousScreen, this.parentPage, this.entry, this.entryPage + 1, this.searchText, this.searchField.isFocused()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -152,8 +156,8 @@ public class GuiEntry extends GuiBooklet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackButtonPressed() {
|
public void onBackButtonPressed() {
|
||||||
if (!isShiftKeyDown()) {
|
if (!hasShiftDown()) {
|
||||||
this.mc.displayGuiScreen(this.parentPage);
|
this.minecraft.setScreen(this.parentPage);
|
||||||
} else {
|
} else {
|
||||||
super.onBackButtonPressed();
|
super.onBackButtonPressed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.booklet.gui;
|
package de.ellpeck.actuallyadditions.mod.booklet.gui;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry;
|
||||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet;
|
import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.button.EntryButton;
|
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;
|
||||||
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
|
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
|
||||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.TexturedButton;
|
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 usedQuote = QUOTES[this.getMinecraft().level.random.nextInt(QUOTES.length)];
|
||||||
String[] quoteSplit = usedQuote.split("@");
|
String[] quoteSplit = usedQuote.split("@");
|
||||||
if (quoteSplit.length == 2) {
|
if (quoteSplit.length == 2) {
|
||||||
this.quote = this.font.listFormattedStringToWidth(quoteSplit[0], 120);
|
//this.quote = this.font.listFormattedStringToWidth(quoteSplit[0], 120); //TODO wut
|
||||||
this.quoteGuy = quoteSplit[1];
|
this.quoteGuy = quoteSplit[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,14 +134,14 @@ public class GuiMainPage extends GuiBooklet {
|
||||||
|
|
||||||
List<String> configText = new ArrayList<>();
|
List<String> configText = new ArrayList<>();
|
||||||
configText.add(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".configButton.name"));
|
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));
|
//configText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".configButton.desc", ActuallyAdditions.NAME).replaceAll("\\\\n", "\n"), 200)); //TODO wut
|
||||||
this.configButton = new TexturedButton(RES_LOC_GADGETS, this.guiLeft + 16, this.guiTop + this.ySize - 30, 188, 14, 16, 16, configText, btn -> {
|
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);
|
this.addButton(this.configButton);
|
||||||
|
|
||||||
List<String> achievementText = new ArrayList<>();
|
List<String> achievementText = new ArrayList<>();
|
||||||
achievementText.add(TextFormatting.GOLD + StringUtil.localize("booklet." + ActuallyAdditions.MODID + ".achievementButton.name"));
|
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));
|
//achievementText.addAll(this.font.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet." + ActuallyAdditions.MODID + ".achievementButton.desc", ActuallyAdditions.NAME), 200)); //TODO wut
|
||||||
//this.achievementButton = new TexturedButton(RES_LOC_GADGETS, -389, this.guiLeft+36, this.guiTop+this.ySize-30, 204, 14, 16, 16, achievementText);
|
//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);
|
//this.addButton(this.achievementButton);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ public class GuiMainPage extends GuiBooklet {
|
||||||
if (!data.didBookTutorial) {
|
if (!data.didBookTutorial) {
|
||||||
this.showTutorial = true;
|
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.addButton(this.tutorialButton);
|
||||||
|
|
||||||
this.configButton.visible = false;
|
this.configButton.visible = false;
|
||||||
|
@ -166,7 +166,7 @@ public class GuiMainPage extends GuiBooklet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
protected void actionPerformed(GuiButton button) throws IOException {
|
protected void actionPerformed(GuiButton button) throws IOException {
|
||||||
if (button instanceof EntryButton) {
|
if (button instanceof EntryButton) {
|
||||||
|
@ -182,6 +182,7 @@ public class GuiMainPage extends GuiBooklet {
|
||||||
GuiScreen achievements = new GuiAAAchievements(this, this.getMinecraft().player.getStatFileWriter());
|
GuiScreen achievements = new GuiAAAchievements(this, this.getMinecraft().player.getStatFileWriter());
|
||||||
this.getMinecraft().displayGuiScreen(achievements);
|
this.getMinecraft().displayGuiScreen(achievements);
|
||||||
}*/
|
}*/
|
||||||
|
/*
|
||||||
else if (button == this.configButton) {
|
else if (button == this.configButton) {
|
||||||
GuiScreen config = new GuiConfiguration(this);
|
GuiScreen config = new GuiConfiguration(this);
|
||||||
this.getMinecraft().setScreen(config);
|
this.getMinecraft().setScreen(config);
|
||||||
|
@ -206,18 +207,18 @@ public class GuiMainPage extends GuiBooklet {
|
||||||
super.actionPerformed(button);
|
super.actionPerformed(button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void drawScreenPre(int mouseX, int mouseY, float partialTicks) {
|
public void drawScreenPre(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.drawScreenPre(mouseX, mouseY, partialTicks);
|
super.drawScreenPre(stack, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
String strg = TextFormatting.DARK_GREEN + StringUtil.localize(this.bookletName);
|
String strg = TextFormatting.DARK_GREEN + StringUtil.localize(this.bookletName);
|
||||||
this.font.draw(strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 19, 0);
|
this.font.draw(stack, 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");
|
strg = TextFormatting.DARK_GREEN + StringUtil.localize("info." + ActuallyAdditions.MODID + ".booklet.manualName.2");
|
||||||
this.font.draw(strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 19 + this.font.lineHeight, 0);
|
this.font.draw(stack, 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;
|
strg = TextFormatting.GOLD + TextFormatting.ITALIC.toString() + this.bookletEdition;
|
||||||
this.font.draw(strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 40, 0);
|
this.font.draw(stack, strg, this.guiLeft + 72 - this.font.width(strg) / 2 - 3, this.guiTop + 40, 0);
|
||||||
|
|
||||||
if (this.showTutorial) {
|
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.";
|
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.";
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.mod.booklet.gui;
|
package de.ellpeck.actuallyadditions.mod.booklet.gui;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
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.IBookletChapter;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
|
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
|
||||||
|
@ -85,7 +87,7 @@ public class GuiPage extends GuiBooklet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button) throws IOException {
|
public void actionPerformed(GuiButton button) throws IOException {
|
||||||
if (button == this.buttonViewOnline) {
|
if (button == this.buttonViewOnline) {
|
||||||
|
@ -109,7 +111,7 @@ public class GuiPage extends GuiBooklet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
this.itemDisplays.clear();
|
this.itemDisplays.clear();
|
||||||
|
@ -146,8 +148,8 @@ public class GuiPage extends GuiBooklet {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateScreen() {
|
public void tick() {
|
||||||
super.updateScreen();
|
super.tick();
|
||||||
|
|
||||||
for (int i = 0; i < this.pages.length; i++) {
|
for (int i = 0; i < this.pages.length; i++) {
|
||||||
IBookletPage page = this.pages[i];
|
IBookletPage page = this.pages[i];
|
||||||
|
@ -160,13 +162,13 @@ public class GuiPage extends GuiBooklet {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreenPre(int mouseX, int mouseY, float partialTicks) {
|
public void drawScreenPre(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.drawScreenPre(mouseX, mouseY, partialTicks);
|
super.drawScreenPre(stack, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
if (this.pages[0] != null) {
|
if (this.pages[0] != null) {
|
||||||
IBookletChapter chapter = this.pages[0].getChapter();
|
IBookletChapter chapter = this.pages[0].getChapter();
|
||||||
String name = chapter.getLocalizedName();
|
String name = chapter.getLocalizedName();
|
||||||
this.fontRenderer.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, this.guiTop - 1, 0xFFFFFF, true);
|
this.font.draw(stack, name, this.guiLeft + this.xSize / 2 - this.font.width(name) / 2, this.guiTop - 1, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < this.pages.length; i++) {
|
for (int i = 0; i < this.pages.length; i++) {
|
||||||
|
@ -176,7 +178,7 @@ public class GuiPage extends GuiBooklet {
|
||||||
String pageStrg = "Page " + (chapter.getPageIndex(this.pages[i]) + 1) + "/" + chapter.getAllPages().length;
|
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());
|
this.renderScaledAsciiString(pageStrg, this.guiLeft + 25 + i * 136, this.guiTop + this.ySize - 7, 0xFFFFFF, false, this.getLargeFontSize());
|
||||||
|
|
||||||
GlStateManager.color1arg(1F, 1F, 1F);
|
RenderSystem.color3f(1f, 1f, 1f);
|
||||||
page.drawScreenPre(this, this.guiLeft + 6 + i * 142, this.guiTop + 7, mouseX, mouseY, partialTicks);
|
page.drawScreenPre(this, this.guiLeft + 6 + i * 142, this.guiTop + 7, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,13 +188,13 @@ public class GuiPage extends GuiBooklet {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreenPost(int mouseX, int mouseY, float partialTicks) {
|
public void drawScreenPost(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.drawScreenPost(mouseX, mouseY, partialTicks);
|
super.drawScreenPost(stack, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
for (int i = 0; i < this.pages.length; i++) {
|
for (int i = 0; i < this.pages.length; i++) {
|
||||||
IBookletPage page = this.pages[i];
|
IBookletPage page = this.pages[i];
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
GlStateManager.color1arg(1F, 1F, 1F);
|
RenderSystem.color3f(1F, 1F, 1F);
|
||||||
page.drawScreenPost(this, this.guiLeft + 6 + i * 142, this.guiTop + 7, mouseX, mouseY, partialTicks);
|
page.drawScreenPost(this, this.guiLeft + 6 + i * 142, this.guiTop + 7, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,7 +237,7 @@ public class GuiPage extends GuiBooklet {
|
||||||
|
|
||||||
int pageNumToOpen = chapter.getPageIndex(page) - 1;
|
int pageNumToOpen = chapter.getPageIndex(page) - 1;
|
||||||
if (pageNumToOpen >= 0 && pageNumToOpen < pages.length) {
|
if (pageNumToOpen >= 0 && pageNumToOpen < pages.length) {
|
||||||
this.mc.displayGuiScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
|
this.minecraft.setScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,7 +267,7 @@ public class GuiPage extends GuiBooklet {
|
||||||
|
|
||||||
int pageNumToOpen = chapter.getPageIndex(page) + 1;
|
int pageNumToOpen = chapter.getPageIndex(page) + 1;
|
||||||
if (pageNumToOpen >= 0 && pageNumToOpen < pages.length) {
|
if (pageNumToOpen >= 0 && pageNumToOpen < pages.length) {
|
||||||
this.mc.displayGuiScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
|
this.minecraft.setScreen(BookletUtils.createPageGui(this.previousScreen, this.parentPage, pages[pageNumToOpen]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,8 +280,8 @@ public class GuiPage extends GuiBooklet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackButtonPressed() {
|
public void onBackButtonPressed() {
|
||||||
if (!isShiftKeyDown()) {
|
if (!hasShiftDown()) {
|
||||||
this.mc.displayGuiScreen(this.parentPage);
|
this.minecraft.setScreen(this.parentPage);
|
||||||
} else {
|
} else {
|
||||||
super.onBackButtonPressed();
|
super.onBackButtonPressed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
package de.ellpeck.actuallyadditions.mod.booklet.page;
|
package de.ellpeck.actuallyadditions.mod.booklet.page;
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.api.booklet.internal.GuiBookletBase;
|
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.ActuallyAdditions;
|
||||||
import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet;
|
import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
|
|
@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.mod.material.ArmorMaterials;
|
||||||
import de.ellpeck.actuallyadditions.mod.material.ToolMaterials;
|
import de.ellpeck.actuallyadditions.mod.material.ToolMaterials;
|
||||||
import net.minecraft.inventory.EquipmentSlotType;
|
import net.minecraft.inventory.EquipmentSlotType;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.ItemTier;
|
import net.minecraft.item.ItemTier;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
import net.minecraftforge.fml.RegistryObject;
|
import net.minecraftforge.fml.RegistryObject;
|
||||||
|
@ -45,8 +46,18 @@ public final class ActuallyItems {
|
||||||
public static final RegistryObject<Item> COIL = ITEMS.register("coil", ItemBase::new);
|
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> 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> RICE_DOUGH = ITEMS.register("rice_dough", ItemBase::new);
|
||||||
public static final RegistryObject<Item> TINY_COAL = ITEMS.register("tiny_coal", ItemBase::new);
|
public static final RegistryObject<Item> TINY_COAL = ITEMS.register("tiny_coal", () -> new ItemBase() {
|
||||||
public static final RegistryObject<Item> TINY_CHARCOAL = ITEMS.register("tiny_charcoal", ItemBase::new);
|
@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> RICE_SLIME = ITEMS.register("rice_slime", 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> CUP = ITEMS.register("cup", ItemBase::new);
|
||||||
public static final RegistryObject<Item> BAT_WING = ITEMS.register("bat_wing", ItemBase::new);
|
public static final RegistryObject<Item> BAT_WING = ITEMS.register("bat_wing", ItemBase::new);
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
/*
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue