diff --git a/Changelog.txt b/Changelog.txt index a59f037..8f3d28e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,6 +2,23 @@ Version 1.1.9-Pre: Changed the Soul Corruption storing mechanic. It's fixing issues and unpracticalities ^-^. It also means that players' corruptions will be reset to 0. Fixing some stuff that would kick players when hitting mobs with an empty hand. +Fixed it so much that the mods now runs again server side! +Fixed an issue that would add an empty NBT tag to some items, causing issues with their stacking. +You now get a free claimed chunk in the SN dimension, unless you turn the config for it off. +You now need to have an Ethereal Manifestation in your inventory if you want the item/ritual to have its representation in the SN Dim. +Abandonned trying to make my own book system. I'll just try and fix Waslie's. +Fixed a bug with the free chunk assignment. -- Removed the automatic chunk assignment. It's not useful anymore. +Added 7 different types of Ethereal Blocks. Fuun! +Updated to Blood Magic 1.3.0b-3. I didn't test the fix, but it shouldn't be crashing with it anymore. +Fixed the Ritual Representations. Now they work perfectly! +Fixed the Altar Diviner algorithm. +Added a Teleposition Sigil! +Fixed a derp with one of the API tiles. +Added a Transposition Sigil, with its very own blacklist! +Fixed a huuuge dupe bug with the filler and FZ barrels -_-. +The Altar Manipulator is now finally in! Recipes, entries n' everything :D. +Switched to Guide-API. +Added silly april's fool fish :3 Version 1.1.9-Alpha3: Finalized the Soul Network Manifestation system. I need now to give it a bit of fluff and couple of kicks in the butts, but it's close. diff --git a/build.gradle b/build.gradle index 3153754..d4fa114 100644 --- a/build.gradle +++ b/build.gradle @@ -33,6 +33,9 @@ if (new File(projectDir, '.git').exists()) { minecraft { version = "${mc_version}-${forge_version}" runDir = "run" + + replace "@VERSION@", project.version + replaceIn "Sanguimancy.java" if (project.hasProperty('mappings_version')) mappings = project.mappings_version @@ -63,11 +66,16 @@ repositories { name 'CB Repo' url "http://chickenbones.net/maven/" } + maven { + name 'TehNut Repo' + url "http://tehnut.info/maven/" + } } dependencies { compile "mcp.mobius.waila:Waila:1.5.5_1.7.10" compile "codechicken:NotEnoughItems:1.7.10-1.0.3.64:dev" + compile "info.amerifrance.guideapi:Guide-API:${mc_version}-${guideapi_version}:deobf" compile fileTree(dir: 'libs', include: '*.jar') } diff --git a/gradle.properties b/gradle.properties index be5afac..0df2134 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,7 @@ mod_name=Sanguimancy package_group=com.tombenpotter.sanguimancy mc_version=1.7.10 +guideapi_version=1.0-8 forge_version=10.13.2.1236 -mod_version=1.1.9Pre \ No newline at end of file +mod_version=1.1.9 \ No newline at end of file diff --git a/libs/BloodMagic-1.7.10-1.3.0a-1-deobf.jar b/libs/BloodMagic-1.7.10-1.3.1Beta1-11-deobf.jar similarity index 62% rename from libs/BloodMagic-1.7.10-1.3.0a-1-deobf.jar rename to libs/BloodMagic-1.7.10-1.3.1Beta1-11-deobf.jar index b355c8f..592659b 100644 Binary files a/libs/BloodMagic-1.7.10-1.3.0a-1-deobf.jar and b/libs/BloodMagic-1.7.10-1.3.1Beta1-11-deobf.jar differ diff --git a/libs/BloodMagic-1.7.10-1.3.0a-1-sources.jar b/libs/BloodMagic-1.7.10-1.3.1Beta1-11-sources.jar similarity index 64% rename from libs/BloodMagic-1.7.10-1.3.0a-1-sources.jar rename to libs/BloodMagic-1.7.10-1.3.1Beta1-11-sources.jar index 848f289..d8558bc 100644 Binary files a/libs/BloodMagic-1.7.10-1.3.0a-1-sources.jar and b/libs/BloodMagic-1.7.10-1.3.1Beta1-11-sources.jar differ diff --git a/src/main/java/tombenpotter/sanguimancy/Sanguimancy.java b/src/main/java/tombenpotter/sanguimancy/Sanguimancy.java index df8dbef..f678324 100644 --- a/src/main/java/tombenpotter/sanguimancy/Sanguimancy.java +++ b/src/main/java/tombenpotter/sanguimancy/Sanguimancy.java @@ -4,10 +4,7 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.NetworkRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @@ -16,6 +13,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import tombenpotter.sanguimancy.compat.computercraft.PeripheralProvider; +import tombenpotter.sanguimancy.compat.waila.WailaCompatRegistry; import tombenpotter.sanguimancy.network.PacketHandler; import tombenpotter.sanguimancy.proxies.CommonProxy; import tombenpotter.sanguimancy.registry.*; @@ -23,6 +21,7 @@ import tombenpotter.sanguimancy.util.EventHandler; import tombenpotter.sanguimancy.util.RandomUtils; import tombenpotter.sanguimancy.util.enums.ModList; +import tombenpotter.sanguimancy.util.teleporting.TeleportingQueue; @Mod(modid = Sanguimancy.modid, name = Sanguimancy.name, version = Sanguimancy.version, dependencies = Sanguimancy.depend, guiFactory = "tombenpotter.sanguimancy.client.gui.ConfigGuiFactory") public class Sanguimancy { @@ -32,9 +31,9 @@ public class Sanguimancy { public static final String texturePath = "sanguimancy"; public static final String clientProxy = "tombenpotter.sanguimancy.proxies.ClientProxy"; public static final String commonProxy = "tombenpotter.sanguimancy.proxies.CommonProxy"; - public static final String depend = "required-after:AWWayofTime;" + "after:BloodUtils;" + "after:Waila"; + public static final String depend = "required-after:AWWayofTime;" + "required-after:guideapi;" + "after:Waila"; public static final String channel = "Sanguimancy"; - public static final String version = "1.1.9"; + public static final String version = "@VERSION@"; public static boolean isTTLoaded = false; public static Logger logger = LogManager.getLogger(Sanguimancy.name); public static CreativeTabs tabSanguimancy = new CreativeTabs("tab" + Sanguimancy.modid) { @@ -75,25 +74,37 @@ public void load(FMLInitializationEvent event) { proxy.load(); RitualRegistry.registerRituals(); RecipesRegistry.registerAltarRecipes(); + RecipesRegistry.registerAlchemyRecipes(); + RecipesRegistry.registerBindingRecipes(); PotionsRegistry.registerPotions(); FMLCommonHandler.instance().bus().register(new EventHandler()); MinecraftForge.EVENT_BUS.register(new EventHandler()); + FMLCommonHandler.instance().bus().register(TeleportingQueue.getInstance()); PacketHandler.registerPackets(); - if (Loader.isModLoaded("Waila")) { - FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaCorruptionCrystallizer.register"); - FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaAltarDiviner.register"); - FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaAltarEmitter.register"); - FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaBloodTank.register"); - } + if (Loader.isModLoaded("Waila")) WailaCompatRegistry.register(); NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy); } + @Mod.EventHandler + public void imcCallback(FMLInterModComms.IMCEvent event) { + for (final FMLInterModComms.IMCMessage imcMessage : event.getMessages()) { + MessageRegistry.registerMessage(imcMessage.key, imcMessage); + } + } + @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { RecipesRegistry.registerCustomModRecipes(); - GuideRegistry.createCategories(); + SanguimancyGuide.registerGuide(); proxy.postLoad(); isTTLoaded = Loader.isModLoaded("ThaumicTinkerer"); + } + + @Mod.EventHandler + public void serverStarting(FMLServerStartingEvent event) { RandomUtils.setLogToPlank(); + RandomUtils.setOreLumpList(); + RandomUtils.setTranspositionBlockBlacklist(); + RandomUtils.setTeleposerBlacklist(); } -} \ No newline at end of file +} diff --git a/src/main/java/tombenpotter/sanguimancy/api/block/BlockCamouflage.java b/src/main/java/tombenpotter/sanguimancy/api/block/BlockCamouflage.java new file mode 100644 index 0000000..2483f9a --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/block/BlockCamouflage.java @@ -0,0 +1,124 @@ +package tombenpotter.sanguimancy.api.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.api.tile.TileCamouflage; + +public class BlockCamouflage extends BlockContainer { + + public BlockCamouflage(Material material) { + super(material); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemBlock) { + Block block = Block.getBlockFromItem(player.getHeldItem().getItem()); + if (block instanceof BlockCamouflage) return false; + if (!block.isNormalCube()) return false; + } + if (player.getHeldItem() != null && player.getHeldItem().getItem() == Items.water_bucket) { + tile.block = Block.getIdFromBlock(Blocks.air); + tile.metadata = 0; + world.setBlockMetadataWithNotify(x, y, z, 0, 3); + world.markBlockForUpdate(x, y, z); + return true; + } else if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemBlock) { + ItemBlock itemBlock = (ItemBlock) player.getHeldItem().getItem(); + tile.block = Block.getIdFromBlock(Block.getBlockFromItem(itemBlock)); + tile.metadata = player.getHeldItem().getItemDamage(); + world.setBlockMetadataWithNotify(x, y, z, player.getHeldItem().getItemDamage(), 3); + world.markBlockForUpdate(x, y, z); + return true; + } + return true; + } + + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return false; + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) { + TileCamouflage tile = (TileCamouflage) access.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) { + return Block.getBlockById(tile.block).getIcon(side, tile.metadata); + } else return super.getIcon(access, x, y, z, side); + } + + @Override + public boolean canPlaceTorchOnTop(World world, int x, int y, int z) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) { + return Block.getBlockById(tile.block).canPlaceTorchOnTop(world, x, y, z); + } else return true; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileCamouflage(); + } + + @Override + public Item getItem(World world, int x, int y, int z) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) { + return new ItemStack(Block.getBlockById(tile.block), 1, tile.metadata).getItem(); + } else return super.getItem(world, x, y, z); + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) { + return new ItemStack(Block.getBlockById(tile.block), 1, tile.metadata); + } else return super.getPickBlock(target, world, x, y, z, player); + } + + @Override + public int getDamageValue(World world, int x, int y, int z) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) return tile.metadata; + else return super.getDamageValue(world, x, y, z); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) { + return Block.getBlockById(tile.block).getLightValue(); + } else return super.getLightValue(world, x, y, z); + } + + @SideOnly(Side.CLIENT) + @Override + public int colorMultiplier(IBlockAccess access, int x, int y, int z) { + TileCamouflage tile = (TileCamouflage) access.getTileEntity(x, y, z); + if (Block.getBlockById(tile.block) != Blocks.air) { + return Block.getBlockById(tile.block).colorMultiplier(access, x, y, z); + } else return super.colorMultiplier(access, x, y, z); + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess access, int x, int y, int z) { + return false; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/BUApi.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/BUApi.java deleted file mode 100644 index 88df75e..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/BUApi.java +++ /dev/null @@ -1,4 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api; - -public class BUApi { -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiCategories.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiCategories.java deleted file mode 100644 index 4840141..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiCategories.java +++ /dev/null @@ -1,86 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.classes.guide; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.elements.ElementCategory; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Category; -import tombenpotter.sanguimancy.api.bloodutils.api.registries.EntryRegistry; - -public class GuiCategories extends GuiScreen { - private static final ResourceLocation gui = new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/front.png"); - int gwidth = 192; - int gheight = 192; - int x, y; - ElementCategory[] categories = new ElementCategory[EntryRegistry.categories.size()]; - EntityPlayer player; - - public GuiCategories(EntityPlayer player) { - this.player = player; - } - - @Override - public void initGui() { - super.initGui(); - x = (this.width / 2) - (gwidth / 2); - y = (this.height / 2) - (gheight / 2); - this.buttonList.clear(); - - int pX = x - 1; - int pY = y + 12; - - int iWidth = 20; - int iHeight = 20; - for (int i = 0; i < EntryRegistry.categories.size(); i++) { - Category category = EntryRegistry.categories.get(i); - this.categories[i] = new ElementCategory(category, pX, pY + (i * iHeight) - 2, iWidth, iHeight, this.player); - } - } - - @Override - public void drawScreen(int mX, int mY, float f1) { - super.drawScreen(mX, mY, f1); - int fHeight = Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; - - GL11.glColor4f(1F, 1F, 1F, 1F); - this.mc.renderEngine.bindTexture(gui); - drawTexturedModalRect(x, y, 0, 0, gwidth, gheight); - - /** Title */ - String str = "Categories"; - this.drawCenteredString(fontRendererObj, str, this.x + gwidth / 2, y - 10, 0x336666); - - /**Credit ;D**/ - String cre = "Powered by wasliebob"; - this.drawCenteredString(fontRendererObj, cre, this.x + gwidth / 2, y - 20, 0x336666); - - for (int i = 0; i < EntryRegistry.categories.size(); i++) { - ElementCategory category = this.categories[i]; - category.drawElement(); - - if (category.isMouseInElement(mX, mY)) { - category.onMouseEnter(mX, mY); - } - } - } - - @Override - public void mouseClicked(int mX, int mY, int type) { - super.mouseClicked(mX, mY, type); - - for (int i = 0; i < EntryRegistry.categories.size(); i++) { - ElementCategory category = this.categories[i]; - if (category.isMouseInElement(mX, mY)) { - category.onMouseClick(mX, mY, type); - } - } - } - - @Override - public boolean doesGuiPauseGame() { - return false; - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiEntry.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiEntry.java deleted file mode 100644 index 636094b..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiEntry.java +++ /dev/null @@ -1,139 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.classes.guide; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.buttons.ButtonNext; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Category; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Entry; -import tombenpotter.sanguimancy.api.bloodutils.api.entries.IEntry; -import tombenpotter.sanguimancy.api.bloodutils.api.registries.EntryRegistry; - -public class GuiEntry extends GuiScreen { - private static final ResourceLocation gui = new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/guide.png"); - int gwidth = 192; - int gheight = 192; - int prevPage; - int left, top; - String key; - int currPage = 1; - GuiButton next, prev, back; - EntityPlayer player; - Category category; - - public GuiEntry(String key, EntityPlayer player, Category category) { - this.key = key; - this.player = player; - this.category = category; - } - - public GuiEntry(String key, EntityPlayer player, Category category, int currPage) { - this.key = key; - this.player = player; - this.category = category; - this.currPage = currPage; - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() { - super.initGui(); - left = (this.width / 2) - (gwidth / 2); - top = (this.height / 2) - (gheight / 2); - this.buttonList.clear(); - int k = (this.width - this.gwidth) / 2; - - this.buttonList.add(next = new ButtonNext(500, k + 120, top + 160, true)); - this.buttonList.add(prev = new ButtonNext(501, k + 38, top + 160, false)); - - Entry e = EntryRegistry.entries.get(this.category).get(this.key); - IEntry entry = e.entry[this.currPage - 1]; - if (entry != null) - entry.initGui(gwidth, gheight, left, top, player, this.buttonList); - } - - @Override - public void drawScreen(int mX, int mY, float f1) { - GL11.glColor4f(1F, 1F, 1F, 1F); - this.mc.renderEngine.bindTexture(gui); - drawTexturedModalRect(left, top, 0, 0, gwidth, gheight); - Entry e = EntryRegistry.entries.get(this.category).get(this.key); - - /** Title */ - String str = e.name; - this.drawCenteredString(fontRendererObj, str, this.left + gwidth / 2, top - 15, 0x336666); - - /** Current Page */ - this.drawCenteredString(fontRendererObj, (currPage) + "/" + (e.entry.length), this.left + gwidth / 2, top + 160, 0x336666); - - IEntry entry = e.entry[currPage - 1]; - if (entry != null) { - entry.draw(this, gwidth, gheight, left, top, player, e.name, currPage, mX, mY); - } - super.drawScreen(mX, mY, f1); - } - - @Override - public void mouseClicked(int mX, int mY, int type) { - super.mouseClicked(mX, mY, type); - - if (type == 1) - mc.displayGuiScreen(new GuiIndex(this.category, this.player)); - } - - @Override - public void keyTyped(char c, int i) { - super.keyTyped(c, i); - - if (Keyboard.getEventKeyState()) { - if (i == 14) { - mc.displayGuiScreen(new GuiIndex(this.category, this.player)); - - return; - } - } - } - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - protected void actionPerformed(GuiButton button) { - int id = button.id; - int maxPages = EntryRegistry.entries.get(this.category).get(this.key).entry.length; - - if (id == 500) { - if (currPage < maxPages) { - currPage++; - initGui(); - } - } else if (id == 501) { - if (currPage > 1) { - currPage--; - initGui(); - } - } else { - Entry e = EntryRegistry.entries.get(this.category).get(this.key); - IEntry entry = e.entry[this.currPage]; - if (entry != null) - entry.actionPerformed(button); - } - } - - @Override - public void onGuiClosed() { - ItemStack held = player.getHeldItem(); - if (held.hasTagCompound()) { - held.getTagCompound().setString("CATEGORY", this.category.name); - held.getTagCompound().setString("KEY", this.key); - held.getTagCompound().setInteger("PAGE", this.currPage); - } - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiIndex.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiIndex.java deleted file mode 100644 index 2ef0630..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/GuiIndex.java +++ /dev/null @@ -1,216 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.classes.guide; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.buttons.ButtonNext; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.buttons.ButtonPage; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.elements.ElementCategory; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Category; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Entry; -import tombenpotter.sanguimancy.api.bloodutils.api.registries.EntryRegistry; - -import java.util.HashMap; - -public class GuiIndex extends GuiScreen { - public GuiIndex(Category category, EntityPlayer player) { - this.category = category; - this.player = player; - } - - public GuiIndex(Category category, EntityPlayer player, int currPage) { - this.category = category; - this.player = player; - this.currPage = currPage; - } - - private static final ResourceLocation gui = new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/guide.png"); - GuiButton prev, next, back; - - Category category; - EntityPlayer player; - - ElementCategory[] categories = new ElementCategory[EntryRegistry.categories.size()]; - - int gwidth = 192; - int gheight = 192; - int left, top; - int currPage = 0; - - @SuppressWarnings("unchecked") - @Override - public void initGui() { - super.initGui(); - left = (this.width / 2) - (gwidth / 2); - top = (this.height / 2) - (gheight / 2); - this.buttonList.clear(); - - populate(); - drawCategories(); - - int k = (this.width - this.gwidth) / 2; - this.buttonList.add(next = new ButtonNext(500, k + 120, top + 160, true)); - this.buttonList.add(prev = new ButtonNext(501, k + 38, top + 160, false)); - } - - public void drawCategories() { - int pX = left - 1; - int pY = top + 12; - - int iWidth = 20; - int iHeight = 20; - for (int i = 0; i < EntryRegistry.categories.size(); i++) { - Category category = EntryRegistry.categories.get(i); - this.categories[i] = new ElementCategory(category, pX, pY + (i * iHeight) - 2, iWidth, iHeight, this.player); - } - } - - @SuppressWarnings("unchecked") - public void populate() { - this.buttonList.clear(); - - HashMap entries = EntryRegistry.entries.get(this.category); - int x, y; - - if (entries != null && !entries.isEmpty()) { - int j = 0; - Entry[] entryList = EntryRegistry.getEntriesInOrderForCategory(category); - for (int i = 0; i < entryList.length; i++) { - Entry entry = entryList[i]; - if (entry != null && entry.indexPage == this.currPage) { - x = this.left + gwidth / 2 - 75; - y = (top + 15) + (10 * j); - buttonList.add(new ButtonPage(j, x, y, 110, 10, "")); - j++; - } - } - } - - int k = (this.width - this.gwidth) / 2; - - this.buttonList.add(next = new ButtonNext(500, k + 120, top + 160, true)); - this.buttonList.add(prev = new ButtonNext(501, k + 38, top + 160, false)); - } - - @Override - public void drawScreen(int mX, int mY, float f1) { - GL11.glColor4f(1F, 1F, 1F, 1F); - this.mc.renderEngine.bindTexture(gui); - drawTexturedModalRect(left, top, 0, 0, gwidth, gheight); - - /** Title */ - String str = category.name; - this.drawCenteredString(fontRendererObj, str, this.left + gwidth / 2, top - 15, 0x336666); - - /** Current Page */ - if (this.category != null && EntryRegistry.maxEntries.containsKey(this.category)) { - int size = EntryRegistry.maxEntries.get(this.category); - this.drawCenteredString(fontRendererObj, (currPage + 1) + "/" + (size + 1), this.left + gwidth / 2, top + 160, 0x336666); - registerButtons(); - } - - for (int i = 0; i < EntryRegistry.categories.size(); i++) { - ElementCategory category = this.categories[i]; - category.drawElement(); - - if (category.isMouseInElement(mX, mY)) { - category.onMouseEnter(mX, mY); - } - } - super.drawScreen(mX, mY, f1); - } - - public void registerButtons() { - HashMap entries = EntryRegistry.entries.get(this.category); - - if (entries != null && !entries.isEmpty()) { - Entry[] entryList = EntryRegistry.getEntriesInOrderForCategory(category); - int j = 0; - for (int i = 0; i < entryList.length; i++) { - Entry entry = entryList[i]; - - if (entry != null && entry.indexPage == this.currPage) { - String title = entry.name; - if (title != null && buttonList.get(j) != null && buttonList.get(j) instanceof ButtonPage) { - ButtonPage button = (ButtonPage) buttonList.get(j); - button.displayString = title; - j++; - } - } - } - } - } - - @Override - public void mouseClicked(int mX, int mY, int type) { - super.mouseClicked(mX, mY, type); - - if (type == 1) - mc.displayGuiScreen(new GuiCategories(this.player)); - - for (int i = 0; i < EntryRegistry.categories.size(); i++) { - ElementCategory category = this.categories[i]; - if (category.isMouseInElement(mX, mY)) { - category.onMouseClick(mX, mY, type); - } - } - } - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - protected void actionPerformed(GuiButton button) { - int id = button.id; - int size; - if (EntryRegistry.maxEntries.containsKey(this.category)) - size = EntryRegistry.maxEntries.get(this.category); - else - size = 1; - if (id == 500) { - if (currPage + 1 < size + 1) { - currPage++; - populate(); - registerButtons(); - } - } else if (id == 501) { - if (currPage > 0) { - currPage--; - populate(); - registerButtons(); - } - } else { - mc.displayGuiScreen(new GuiEntry(button.displayString, player, category)); - } - } - - @Override - public void keyTyped(char c, int i) { - super.keyTyped(c, i); - - if (Keyboard.getEventKeyState()) { - if (i == 14) { - mc.displayGuiScreen(new GuiCategories(this.player)); - - return; - } - } - } - - @Override - public void onGuiClosed() { - ItemStack held = player.getHeldItem(); - if (held.hasTagCompound()) { - held.getTagCompound().setString("CATEGORY", this.category.name); - held.getTagCompound().setString("KEY", "0"); - held.getTagCompound().setInteger("PAGE", this.currPage); - } - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/buttons/ButtonNext.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/buttons/ButtonNext.java deleted file mode 100644 index 2b3a70b..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/buttons/ButtonNext.java +++ /dev/null @@ -1,38 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.buttons; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import tombenpotter.sanguimancy.Sanguimancy; - -public class ButtonNext extends GuiButton { - private final boolean field_146151_o; - - public ButtonNext(int id, int x, int y, boolean p_i1079_4_) { - super(id, x, y, 23, 13, ""); - this.field_146151_o = p_i1079_4_; - } - - public void drawButton(Minecraft mc, int p_146112_2_, int p_146112_3_) { - if (this.visible) { - boolean flag = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height; - GL11.glEnable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.getTextureManager().bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/guide.png")); - int k = 0; - int l = 192; - - if (flag) { - k += 23; - } - - if (!this.field_146151_o) { - l += 13; - } - - this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13); - GL11.glDisable(GL11.GL_BLEND); - } - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/buttons/ButtonPage.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/buttons/ButtonPage.java deleted file mode 100644 index 8c0fe98..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/buttons/ButtonPage.java +++ /dev/null @@ -1,34 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.buttons; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; - -import java.awt.*; - -public class ButtonPage extends GuiButton { - - int gwidth = 170; - int gheight = 180; - - public ButtonPage(int id, int xPos, int yPos, int width, int height, String string) { - super(id, xPos, yPos, width, height, string); - } - - @Override - public void drawButton(Minecraft mc, int x, int y) { - field_146123_n = x >= xPosition && y >= yPosition && x < xPosition + width && y < yPosition + height; - int state = getHoverState(field_146123_n); - x = this.xPosition + width / 2 - 30; - y = this.yPosition + (height - 6) / 2; - mc.fontRenderer.setUnicodeFlag(true); - mc.fontRenderer.drawString(displayString, x + (state == 2 ? 5 : 0), y, calcColor(state)); - mc.fontRenderer.setUnicodeFlag(false); - } - - public int calcColor(int state) { - if (state == 2) - return new Color(155, 155, 155).getRGB(); - else - return new Color(55, 55, 55).getRGB(); - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/elements/ElementCategory.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/elements/ElementCategory.java deleted file mode 100644 index f752179..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/classes/guide/elements/ElementCategory.java +++ /dev/null @@ -1,54 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.elements; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiIndex; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Category; -import tombenpotter.sanguimancy.api.bloodutils.api.helpers.GuiHelper; -import tombenpotter.sanguimancy.api.bloodutils.api.interfaces.IEntryElement; - -public class ElementCategory extends GuiScreen implements IEntryElement { - public Category category; - public EntityPlayer player; - public int x; - public int y; - public int width; - public int height; - - public ElementCategory(Category category, int x, int y, int width, int height, EntityPlayer player) { - this.category = category; - this.player = player; - - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - - @Override - public void drawElement() { - IIcon icon = category.iconStack.getIconIndex(); - Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/tab.png")); - GuiHelper.drawIconWithoutColor(x - 1, y - 1, width + 2, height + 2, 0); - GuiHelper.drawItemStack(category.iconStack, x + 3, y + 2); - } - - @Override - public boolean isMouseInElement(int mX, int mY) { - return GuiHelper.isMouseBetween(mX, mY, x, y, width, height); - } - - @Override - public void onMouseEnter(int mX, int mY) { - Minecraft.getMinecraft().fontRenderer.drawString(this.category.name, mX + 6, mY, 0); - } - - @Override - public void onMouseClick(int mX, int mY, int type) { - Minecraft.getMinecraft().displayGuiScreen(new GuiIndex(this.category, this.player)); - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/compact/Category.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/compact/Category.java deleted file mode 100644 index 0bfa0c3..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/compact/Category.java +++ /dev/null @@ -1,13 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.compact; - -import net.minecraft.item.ItemStack; - -public class Category { - public String name; - public ItemStack iconStack; - - public Category(String name, ItemStack iconStack) { - this.name = name; - this.iconStack = iconStack; - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/compact/Entry.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/compact/Entry.java deleted file mode 100644 index 8722497..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/compact/Entry.java +++ /dev/null @@ -1,23 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.compact; - -import tombenpotter.sanguimancy.api.bloodutils.api.entries.IEntry; - -import java.util.ArrayList; - -public class Entry { - public IEntry[] entry; - public String name; - public int indexPage; - - public Entry(IEntry[] entry, String name, int indexPage) { - this.entry = entry; - this.name = name; - this.indexPage = indexPage - 1; - } - - public Entry(ArrayList entry, String name, int indexPage) { - this.entry = entry.toArray(new IEntry[entry.size()]); - this.name = name; - this.indexPage = indexPage - 1; - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryAltarRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryAltarRecipe.java deleted file mode 100644 index 5456f9b..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryAltarRecipe.java +++ /dev/null @@ -1,118 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -public class EntryAltarRecipe extends EntryBase { - public AltarRecipe recipes; - public ItemStack input; - public ItemStack output; - public int essence; - public ArrayList icons = new ArrayList(); - - public EntryAltarRecipe(AltarRecipe recipes) { - this.recipes = recipes; - populate(recipes); - } - - public void populate(AltarRecipe recipe) { - this.input = recipe.requiredItem; - this.output = recipe.result; - this.essence = recipe.liquidRequired; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x, y; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - renderOverlay(entry, width, height, left, top); - - x = left + width / 2 - (65 - 45); - y = (height / 2 - 36) + (18 * (4 - 3)); - drawIcon(this.input, x, y); - - /** Result */ - x = left + width / 2 - (65 - (48 + 48) - 5); - y = (height / 2 - 36) + (18 * (4 - 3)); - drawIcon(this.output, x, y); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - - for (ItemIcon icon : icons) { - if (icon.stack != null) - icon.onMouseBetween(mX, mY); - } - } - - public void drawIcon(ItemStack stack, int x, int y) { - RenderItem ri = new RenderItem(); - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - - icons.add(new ItemIcon(stack, x, y)); - } - - public void renderOverlay(GuiEntry entry, int width, int height, int left, int top) { - TextureManager tm = Minecraft.getMinecraft().getTextureManager(); - tm.bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/altar.png")); - entry.drawTexturedModalRect(left, (height / 2 - 36) + (18 * 0) - 17, 0, 0, width, height); - } - - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } - - static class ItemIcon { - public ItemStack stack; - public int x, y; - - public ItemIcon(ItemStack stack, int x, int y) { - this.stack = stack; - this.x = x; - this.y = y; - } - - public void onMouseBetween(int mX, int mY) { - int xSize = x + 16; - int ySize = y + 16; - - - if (mX > x && mX < xSize && mY > y && mY < ySize) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - if (stack != null && stack.getDisplayName() != null) - Minecraft.getMinecraft().fontRenderer.drawString(stack.getDisplayName(), mX + 6, mY, new Color(139, 137, 137).getRGB()); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - } - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryBase.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryBase.java deleted file mode 100644 index b93de84..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryBase.java +++ /dev/null @@ -1,4 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -public abstract class EntryBase implements IEntry { -} diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryBloodCleanserRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryBloodCleanserRecipe.java deleted file mode 100644 index d2433db..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryBloodCleanserRecipe.java +++ /dev/null @@ -1,132 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; -import tombenpotter.sanguimancy.recipes.RecipeBloodCleanser; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -public class EntryBloodCleanserRecipe extends EntryBase { - - public RecipeBloodCleanser recipe; - public ItemStack input, output; - public int time, bloodRequired; - public ArrayList icons = new ArrayList(); - - public EntryBloodCleanserRecipe(RecipeBloodCleanser recipe) { - this.recipe = recipe; - populate(recipe); - } - - public void populate(RecipeBloodCleanser recipe) { - this.input = recipe.fInput; - this.output = recipe.fOutput; - this.time = 200; - this.bloodRequired = 1000; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - Minecraft.getMinecraft().fontRenderer.drawSplitString(StatCollector.translateToLocal("compat.nei.corrupted.infusion.time") + ": " + String.valueOf(time) + " ticks", left + width / 2 - 58, top + 15, 110, 0); - Minecraft.getMinecraft().fontRenderer.drawSplitString(StatCollector.translateToLocal("compat.nei.blood.required") + ": " + String.valueOf(bloodRequired) + "mB", left + width / 2 - 58, top + 35, 110, 0); - - - int x, y; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - renderOverlay(entry, width, height, left, top); - - x = left + width / 2 - (65 - 45); - y = (height / 2 - 36) + (18 * (4 - 3)); - - drawIcon(input, x, y); - - /** Result */ - x = left + width / 2 - (65 - (48 + 48) - 5); - y = (height / 2 - 36) + (18 * (4 - 3)); - drawIcon(this.output, x, y); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - - for (ItemIcon icon : icons) { - if (icon.stack != null) - icon.onMouseBetween(mX, mY); - } - } - - public void drawIcon(ItemStack stack, int x, int y) { - RenderItem ri = new RenderItem(); - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - - icons.add(new ItemIcon(stack, x, y)); - } - - public void renderOverlay(GuiEntry entry, int width, int height, int left, int top) { - TextureManager tm = Minecraft.getMinecraft().getTextureManager(); - tm.bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/corruptedInfusion.png")); - entry.drawTexturedModalRect(left, (height / 2 - 36) + (18 * 0) - 17, 0, 0, width, height); - } - - @SuppressWarnings("rawtypes") - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } - - public static class ItemIcon { - public ItemStack stack; - public int x, y; - - public ItemIcon(ItemStack stack, int x, int y) { - this.stack = stack; - this.x = x; - this.y = y; - } - - public void onMouseBetween(int mX, int mY) { - int xSize = x + 16; - int ySize = y + 16; - - - if (mX > x && mX < xSize && mY > y && mY < ySize) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - if (stack != null && stack.getDisplayName() != null && !stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).isEmpty()) { - Minecraft.getMinecraft().fontRenderer.drawString(stack.getDisplayName(), mX + 6, mY, new Color(100, 100, 100).getRGB()); - int addY = 10; - for (int i = 1; i < stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).size(); i++) { - Minecraft.getMinecraft().fontRenderer.drawString(String.valueOf(stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).get(i)), mX + 6, mY + addY, new Color(139, 137, 137).getRGB()); - addY = addY + 10; - } - } - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - } - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryCorruptionRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryCorruptionRecipe.java deleted file mode 100644 index 51c9009..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryCorruptionRecipe.java +++ /dev/null @@ -1,137 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; -import tombenpotter.sanguimancy.recipes.RecipeCorruptedInfusion; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -public class EntryCorruptionRecipe extends EntryBase { - - public RecipeCorruptedInfusion recipe; - public ItemStack input[], output; - public int time, minimumCorruption; - public boolean exactAmountAndNbt; - public ArrayList icons = new ArrayList(); - - public EntryCorruptionRecipe(RecipeCorruptedInfusion recipe) { - this.recipe = recipe; - populate(recipe); - } - - public void populate(RecipeCorruptedInfusion recipe) { - this.input = recipe.fInput; - this.output = recipe.fOutput; - this.time = recipe.fTime; - this.minimumCorruption = recipe.fMiniumCorruption; - this.exactAmountAndNbt = recipe.fExactAmountandNbt; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - Minecraft.getMinecraft().fontRenderer.drawSplitString(StatCollector.translateToLocal("compat.nei.corrupted.infusion.time") + ": " + String.valueOf(time), left + width / 2 - 58, top + 15, 110, 0); - Minecraft.getMinecraft().fontRenderer.drawSplitString(StatCollector.translateToLocal("compat.nei.corrupted.infusion.minimum.corruption") + ": " + String.valueOf(minimumCorruption), left + width / 2 - 58, top + 35, 110, 0); - Minecraft.getMinecraft().fontRenderer.drawSplitString(StatCollector.translateToLocal("compat.nei.corrupted.infusion.minimum.exact") + ": " + String.valueOf(exactAmountAndNbt), left + width / 2 - 58, top + 25, 110, 0); - - - int x, y; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - renderOverlay(entry, width, height, left, top); - - x = left + width / 2 - (65 - 45); - y = (height / 2 - 36) + (18 * (4 - 3)) - 10; - for (int i = 0; i < input.length; i++) { - y += 10; - drawIcon(input[i], x, y); - } - - /** Result */ - x = left + width / 2 - (65 - (48 + 48) - 5); - y = (height / 2 - 36) + (18 * (4 - 3)); - drawIcon(this.output, x, y); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - - for (ItemIcon icon : icons) { - if (icon.stack != null) - icon.onMouseBetween(mX, mY); - } - } - - public void drawIcon(ItemStack stack, int x, int y) { - RenderItem ri = new RenderItem(); - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - - icons.add(new ItemIcon(stack, x, y)); - } - - public void renderOverlay(GuiEntry entry, int width, int height, int left, int top) { - TextureManager tm = Minecraft.getMinecraft().getTextureManager(); - tm.bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/corruptedInfusion.png")); - entry.drawTexturedModalRect(left, (height / 2 - 36) + (18 * 0) - 17, 0, 0, width, height); - } - - @SuppressWarnings("rawtypes") - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } - - public static class ItemIcon { - public ItemStack stack; - public int x, y; - - public ItemIcon(ItemStack stack, int x, int y) { - this.stack = stack; - this.x = x; - this.y = y; - } - - public void onMouseBetween(int mX, int mY) { - int xSize = x + 16; - int ySize = y + 16; - - - if (mX > x && mX < xSize && mY > y && mY < ySize) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - if (stack != null && stack.getDisplayName() != null && !stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).isEmpty()) { - Minecraft.getMinecraft().fontRenderer.drawString(stack.getDisplayName(), mX + 6, mY, new Color(100, 100, 100).getRGB()); - int addY = 10; - for (int i = 1; i < stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).size(); i++) { - Minecraft.getMinecraft().fontRenderer.drawString(String.valueOf(stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).get(i)), mX + 6, mY + addY, new Color(139, 137, 137).getRGB()); - addY = addY + 10; - } - } - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - } - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryCraftingRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryCraftingRecipe.java deleted file mode 100644 index 98ccb03..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryCraftingRecipe.java +++ /dev/null @@ -1,204 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.item.crafting.ShapedRecipes; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.oredict.ShapedOreRecipe; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -public class EntryCraftingRecipe extends EntryBase { - public IRecipe recipes; - public ItemStack[] recipe; - public ItemStack output; - public ArrayList icons = new ArrayList(); - - public EntryCraftingRecipe(IRecipe recipes) { - this.recipes = recipes; - populate(recipes); - } - - @SuppressWarnings("unchecked") - public void populate(IRecipe recipe) { - if (recipe instanceof ShapedRecipes) { - ShapedRecipes rec = (ShapedRecipes) recipe; - if (rec != null && rec.recipeItems != null && rec.recipeItems.length > 0) { - this.recipe = rec.recipeItems; - this.output = rec.getRecipeOutput(); - } - } else if (recipe instanceof ShapedOreRecipe) { - ShapedOreRecipe rec = (ShapedOreRecipe) recipe; - this.recipe = new ItemStack[rec.getInput().length]; - ; - for (int i = 0; i < rec.getInput().length; i++) { - ItemStack s = null; - if (rec.getInput()[i] instanceof ItemStack) { - s = (ItemStack) rec.getInput()[i]; - } else { - s = ((ArrayList) rec.getInput()[i]).get(0); - } - this.recipe[i] = s; - this.output = rec.getRecipeOutput(); - } - } else if (recipe instanceof ShapedBloodOrbRecipe) { - ShapedBloodOrbRecipe rec = (ShapedBloodOrbRecipe) recipe; - this.recipe = new ItemStack[rec.getInput().length]; - ; - for (int i = 0; i < rec.getInput().length; i++) { - ItemStack s = null; - if (rec.getInput()[i] instanceof ItemStack) { - s = (ItemStack) rec.getInput()[i]; - } else if (rec.getInput()[i] instanceof Object) { - s = new ItemStack(ModItems.masterBloodOrb); - } else { - s = ((ArrayList) rec.getInput()[i]).get(0); - } - this.recipe[i] = s; - this.output = rec.getRecipeOutput(); - } - } - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x, y; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - renderOverlay(entry, width, height, left, top); - - /** Row 1 */ - x = (left + width / 2) - (65 - 31); - y = (height / 2 - 18) + (18 * 0); - drawIcon(0, x, y); - - x = left + width / 2 - (65 - 48) + 1; - y = (height / 2 - 18) + (18 * (3 - 3)); - drawIcon(1, x, y); - - x = left + width / 2 - (65 - (48 + 16) - 3); - y = (height / 2 - 18) + (18 * (6 - 6)); - drawIcon(2, x, y); - - /** Row 2 */ - x = (left + width / 2) - (65 - 31); - y = (height / 2 - 18) + (18 * 1); - drawIcon(3, x, y); - - x = left + width / 2 - (65 - 48) + 1; - y = (height / 2 - 18) + (18 * (4 - 3)); - drawIcon(4, x, y); - - x = left + width / 2 - (65 - (48 + 16) - 3); - y = (height / 2 - 18) + (18 * (7 - 6)); - drawIcon(5, x, y); - - /** Row 3 */ - x = (left + width / 2) - (65 - 31); - y = (height / 2 - 18) + (18 * 2); - drawIcon(6, x, y); - - x = left + width / 2 - (65 - 48) + 1; - y = (height / 2 - 18) + (18 * (5 - 3)); - drawIcon(7, x, y); - - x = left + width / 2 - (65 - (48 + 16) - 3); - y = (height / 2 - 18) + (18 * (8 - 6)); - drawIcon(8, x, y); - - /** Result */ - x = left + width / 2 - (65 - (48 + 48) - 5); - y = (height / 2 - 18) + (18 * (4 - 3)); - drawIcon(this.output, x, y); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - - for (ItemIcon icon : icons) { - if (icon.stack != null) - icon.onMouseBetween(mX, mY); - } - } - - public void drawIcon(int entry, int x, int y) { - RenderItem ri = new RenderItem(); - if (recipe != null && recipe.length > 0 && entry < recipe.length && recipe[entry] != null) { - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), recipe[entry], x, y); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), recipe[entry], x, y); - icons.add(new ItemIcon(recipe[entry], x, y)); - } - } - - public void drawIcon(ItemStack stack, int x, int y) { - RenderItem ri = new RenderItem(); - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - icons.add(new ItemIcon(stack, x, y)); - } - - public void renderOverlay(GuiEntry entry, int width, int height, int left, int top) { - TextureManager tm = Minecraft.getMinecraft().getTextureManager(); - tm.bindTexture(new ResourceLocation(Sanguimancy.texturePath +":textures/gui/guide/crafting.png")); - entry.drawTexturedModalRect(left, (height / 2 - 18) + (18 * 0) - 17, 0, 0, width, height); - } - - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } - - static class ItemIcon { - public ItemStack stack; - public int x, y; - - public ItemIcon(ItemStack stack, int x, int y) { - this.stack = stack; - this.x = x; - this.y = y; - } - - public void onMouseBetween(int mX, int mY) { - int xSize = x + 16; - int ySize = y + 16; - - if (mX > x && mX < xSize && mY > y && mY < ySize) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - if (stack != null && stack.getDisplayName() != null && !stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).isEmpty()) { - Minecraft.getMinecraft().fontRenderer.drawString(stack.getDisplayName(), mX + 6, mY, new Color(100, 100, 100).getRGB()); - int addY = 10; - for (int i = 1; i < stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).size(); i++) { - Minecraft.getMinecraft().fontRenderer.drawString(String.valueOf(stack.getTooltip(Minecraft.getMinecraft().thePlayer, false).get(i)), mX + 6, mY + addY, new Color(139, 137, 137).getRGB()); - addY = addY + 10; - } - } - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - } - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryImage.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryImage.java deleted file mode 100644 index e815631..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryImage.java +++ /dev/null @@ -1,69 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; -import tombenpotter.sanguimancy.api.bloodutils.api.helpers.GuiHelper; - -import java.util.List; - -public class EntryImage extends EntryBase { - public ResourceLocation resource; - public int iconWidth; - public int iconHeight; - public String entryName; - - public EntryImage(String resource, int iconWidth, int iconHeight) { - this.resource = new ResourceLocation(resource); - this.iconWidth = iconWidth; - this.iconHeight = iconHeight; - } - - public EntryImage(String resource, int iconWidth, int iconHeight, String entryName) { - this.resource = new ResourceLocation(resource); - this.iconWidth = iconWidth; - this.iconHeight = iconHeight; - this.entryName = entryName; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - drawImage(entry, width, height, left, top, player, key, page, mX, mY); - drawText(entry, width, height, left, top, player, key, page, mX, mY); - } - - public void drawImage(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x = left + width / 2 - 60; - int y = top + 10; - Minecraft.getMinecraft().getTextureManager().bindTexture(this.resource); - GuiHelper.drawScaledIconWithoutColor(x, y, this.iconWidth, this.iconHeight, 0); - } - - public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x, y; - - if (this.entryName == null) - this.entryName = key; - - String s = StatCollector.translateToLocal("guide.Sanguimancy.entry." + this.entryName); - x = left + width / 2 - 58; - y = (top + 15) + 65; - - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); - Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0); - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); - - } - - @SuppressWarnings("rawtypes") - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryItemText.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryItemText.java deleted file mode 100644 index 94dda83..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryItemText.java +++ /dev/null @@ -1,96 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; - -import java.util.List; - -public class EntryItemText extends EntryBase { - public ItemStack stack; - public String entryName; - public boolean isUnloc; - - public EntryItemText(ItemStack stack) { - this.stack = stack; - } - - public EntryItemText(ItemStack stack, String entryName) { - this.stack = stack; - this.entryName = entryName; - this.isUnloc = true; - } - - public EntryItemText(ItemStack stack, String entryName, boolean unloc) { - this.stack = stack; - this.entryName = entryName; - this.isUnloc = false; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - drawText(entry, width, height, left, top, player, key, page, mX, mY); - drawBlock(entry, width, height, left, top, player, key, page, mX, mY); - } - - public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x, y; - - if (this.entryName == null) - this.entryName = key; - - String s; - if (isUnloc) s = StatCollector.translateToLocal("guide.Sanguimancy.entry." + this.entryName + "." + page); - else s = this.entryName; - - x = left + width / 2 - 58; - y = (top + 15); - - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); - Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0); - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); - - } - - public void drawBlock(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - - RenderItem ri = new RenderItem(); - GL11.glPushMatrix(); - - GL11.glScaled(3, 3, 1); - - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (3 * left / 4) + 2, top + 10); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (3 * left / 4) + 2, top + 10); - - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (left / 4) + 2, top + 10); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (left / 4) + 2, top + 10); - - RenderHelper.disableStandardItemLighting(); - - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - } - - @SuppressWarnings("rawtypes") - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryRitualInfo.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryRitualInfo.java deleted file mode 100644 index dc5a849..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryRitualInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; - -import java.util.List; - -public class EntryRitualInfo extends EntryBase { - public int cost; - - public EntryRitualInfo(int cost) { - - this.cost = cost; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x, y; - x = left + width / 2 - 58; - y = (top + 15); - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); - Minecraft.getMinecraft().fontRenderer.drawString("Cost: " + this.cost + " LP", x, y, 0); - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); - } - - @SuppressWarnings("rawtypes") - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryText.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryText.java deleted file mode 100644 index d46129c..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/EntryText.java +++ /dev/null @@ -1,53 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.StatCollector; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; - -import java.util.List; - -public class EntryText extends EntryBase { - public String entryName; - public boolean isUnloc; - - public EntryText() { - } - - public EntryText(String entryName) { - this.entryName = entryName; - } - - public EntryText(String entryName, boolean unloc) { - this.entryName = entryName; - this.isUnloc = unloc; - } - - @Override - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY) { - int x, y; - - if (this.entryName == null) this.entryName = key; - - String s; - if (isUnloc) s = StatCollector.translateToLocal("guide.Sanguimancy.entry." + this.entryName + "." + page); - else s = this.entryName; - - x = left + width / 2 - 58; - y = (top + 15); - - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); - Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0); - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); - } - - @SuppressWarnings("rawtypes") - @Override - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList) { - } - - @Override - public void actionPerformed(GuiButton button) { - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/IEntry.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/IEntry.java deleted file mode 100644 index 711472e..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/entries/IEntry.java +++ /dev/null @@ -1,24 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.entries; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import tombenpotter.sanguimancy.api.bloodutils.api.classes.guide.GuiEntry; - -import java.util.List; - -public interface IEntry { - /** - * This get's called in GuiEntry, you can do whatever you want here (images, recipes, icons, text, combination of them) - * - * @param width - * @param height - * @param left - * @param top - * @param player The player who has the book open - */ - public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY); - - public void initGui(int width, int height, int left, int top, EntityPlayer player, List buttonList); - - public void actionPerformed(GuiButton button); -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/enums/EnumType.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/enums/EnumType.java deleted file mode 100644 index e0f48db..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/enums/EnumType.java +++ /dev/null @@ -1,5 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.enums; - -public enum EnumType { - BLOCK, ITEM; -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/helpers/GuiHelper.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/helpers/GuiHelper.java deleted file mode 100644 index 2ceeafd..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/helpers/GuiHelper.java +++ /dev/null @@ -1,119 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.helpers; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; -import tombenpotter.sanguimancy.api.bloodutils.api.enums.EnumType; - -public class GuiHelper { - - public static boolean isMouseBetween(int mouseX, int mouseY, int x, int y, int width, int height) { - int xSize = x + width; - int ySize = y + height; - - return (mouseX > x && mouseX < xSize && mouseY > y && mouseY < ySize); - } - - public static void renderIcon(int x, int y, int width, int height, IIcon icon, EnumType type) { - if (type == EnumType.BLOCK) - Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - else if (type == EnumType.ITEM) - Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationItemsTexture); - - int zLevel = 0; - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - - Tessellator t = Tessellator.instance; - t.startDrawingQuads(); - t.addVertexWithUV((double) (x + 0), (double) (y + height), (double) zLevel, (double) icon.getMinU(), (double) icon.getMaxV()); - t.addVertexWithUV((double) (x + width), (double) (y + height), (double) zLevel, (double) icon.getMaxU(), (double) icon.getMaxV()); - t.addVertexWithUV((double) (x + width), (double) (y + 0), (double) zLevel, (double) icon.getMaxU(), (double) icon.getMinV()); - t.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) zLevel, (double) icon.getMinU(), (double) icon.getMinV()); - t.draw(); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - } - - public static void drawScaledIconWithoutColor(int x, int y, int width, int height, float zLevel) { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - GL11.glScaled(0.13D, 0.13D, 0.13D); - GL11.glTranslated(x + 900, y + 250, 0); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - - Tessellator t = Tessellator.instance; - t.startDrawingQuads(); - t.addVertexWithUV(x + 0, y + height, zLevel, 0D, 1D); - t.addVertexWithUV(x + width, y + height, zLevel, 1D, 1D); - t.addVertexWithUV(x + width, y + 0, zLevel, 1D, 0D); - t.addVertexWithUV(x + 0, y + 0, zLevel, 0D, 0D); - t.draw(); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - } - - public static void drawIconWithoutColor(int x, int y, int width, int height, float zLevel) { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - - Tessellator t = Tessellator.instance; - t.startDrawingQuads(); - t.addVertexWithUV(x + 0, y + height, zLevel, 0D, 1D); - t.addVertexWithUV(x + width, y + height, zLevel, 1D, 1D); - t.addVertexWithUV(x + width, y + 0, zLevel, 1D, 0D); - t.addVertexWithUV(x + 0, y + 0, zLevel, 0D, 0D); - t.draw(); - - RenderHelper.disableStandardItemLighting(); - - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glPopMatrix(); - } - - public static void drawItemStack(ItemStack stack, int x, int y) { - RenderItem ri = new RenderItem(); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1F, 1F, 1F, 1F); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_DEPTH_TEST); - ri.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, x, y); - RenderHelper.disableStandardItemLighting(); - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/helpers/OreDictionaryHelper.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/helpers/OreDictionaryHelper.java deleted file mode 100644 index 74555f4..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/helpers/OreDictionaryHelper.java +++ /dev/null @@ -1,16 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.helpers; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class OreDictionaryHelper { - public static boolean entryExists(String material) { - return OreDictionary.getOres(material).size() > 0; - } - - public static ItemStack getItemStack(String material, int entry) { - if (entryExists(material)) - return OreDictionary.getOres(material).get(entry); - return null; - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/interfaces/IEntryElement.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/interfaces/IEntryElement.java deleted file mode 100644 index e418e34..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/interfaces/IEntryElement.java +++ /dev/null @@ -1,36 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.interfaces; - -/** - * Copied from WaslieCore, to make it no longer require it in the API. (https://github.com/wasliebob/WaslieCore/blob/master/src/main/java/wasliecore/interfaces/IElement.java) - */ -public interface IEntryElement { - /** - * In here you need to draw the element - */ - public void drawElement(); - - /** - * @param mX Mouse X Position - * @param mY Mouse Y Position - * @return is the mouse in a element - */ - public boolean isMouseInElement(int mX, int mY); - - /** - * This get's called when you enter the element - * - * @param mX Mouse X Position - * @param mY Mouse Y Position - */ - - public void onMouseEnter(int mX, int mY); - - /** - * This get's called when you click within the element - * - * @param mX Mouse X Position - * @param mY Mouse Y Position - * @param type Type of click (right, left, scroll) - */ - public void onMouseClick(int mX, int mY, int type); -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/package-info.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/package-info.java deleted file mode 100644 index ab4b1b4..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -@API(owner = "Sanguimancy", apiVersion = "1.0.9", provides = "Sanguimancy|API") package tombenpotter.sanguimancy.api.bloodutils.api; -//@API(owner = "BloodUtils", apiVersion = "1.0c", provides = "BloodUtils|API") package tombenpotter.sanguimancy.api.bloodutils.api; - -/* -This is present to give credit to the one who deserves it. -Wasliebob made the whole GUI Api. -This package here is just some copy pasting of his code, and a couple of modifications so that the code fitted what I wanted it to do. -So, here you go: All credit for this goes to Wasliebob, and thanks again for letting me butcher your work. - */ - -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/registries/EntryRegistry.java b/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/registries/EntryRegistry.java deleted file mode 100644 index b7707eb..0000000 --- a/src/main/java/tombenpotter/sanguimancy/api/bloodutils/api/registries/EntryRegistry.java +++ /dev/null @@ -1,50 +0,0 @@ -package tombenpotter.sanguimancy.api.bloodutils.api.registries; - -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Category; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Entry; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -public class EntryRegistry { - public static ArrayList categories = new ArrayList(); - public static HashMap categoryMap = new HashMap(); - public static int categoryCount = 0; - public static HashMap> entries = new HashMap>(); - public static HashMap maxEntries = new HashMap(); - public static HashMap> entryOrder = new HashMap(); - - public static void registerCategories(Category category) { - categories.add(category); - categoryMap.put(category.name, category); - entryOrder.put(category, new ArrayList()); - categoryCount++; - } - - public static void registerEntry(Category category, HashMap entryMap, Entry entry) { - entryMap.put(entry.name, entry); - entries.put(category, entryMap); - entryOrder.get(category).add(entry.name); - if (maxEntries.containsKey(category) && entry.indexPage > maxEntries.get(category)) - maxEntries.put(category, entry.indexPage); - else if (!maxEntries.containsKey(category)) - maxEntries.put(category, 0); - } - - public static Entry[] getEntriesInOrderForCategory(Category category) { - HashMap entries = EntryRegistry.entries.get(category); - List nameList = entryOrder.get(category); - ArrayList list = new ArrayList(); - for (String str : nameList) { - list.add(entries.get(str)); - } - Object[] entriesList = list.toArray(); - Entry[] entryList = new Entry[entriesList.length]; - for (int i = 0; i < entriesList.length; i++) { - entryList[i] = (Entry) (entriesList[i]); - } - return entryList; - } - -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/guide/PageAltarRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/guide/PageAltarRecipe.java new file mode 100644 index 0000000..5e9da18 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/guide/PageAltarRecipe.java @@ -0,0 +1,70 @@ +package tombenpotter.sanguimancy.api.guide; + + +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.base.PageBase; +import amerifrance.guideapi.api.util.GuiHelper; +import amerifrance.guideapi.gui.GuiBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import tombenpotter.sanguimancy.Sanguimancy; + +public class PageAltarRecipe extends PageBase { + + public ItemStack input; + public ItemStack output; + public int tier; + public int bloodRequired; + + public PageAltarRecipe(AltarRecipe recipe) { + this.input = recipe.getRequiredItem(); + this.output = recipe.getResult(); + this.tier = recipe.getMinTier(); + this.bloodRequired = recipe.getLiquidRequired(); + } + + @Override + @SideOnly(Side.CLIENT) + public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { + + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/altar.png")); + guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104); + + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.altar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); + + int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7); + int inputY = (1 * 20) + (guiTop + guiBase.ySize / 5); + GuiHelper.drawItemStack(input, inputX, inputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) { + guiBase.renderToolTip(input, mouseX, mouseY); + } + + if (output == null) { + output = new ItemStack(Blocks.fire); + } + int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7); + int outputY = (1 * 20) + (guiTop + guiBase.xSize / 5); + GuiHelper.drawItemStack(output, outputX, outputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { + guiBase.renderToolTip(output, outputX, outputY); + } + + if (output.getItem() == Item.getItemFromBlock(Blocks.fire)) { + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D); + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); + guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0); + } + guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.tier"), String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0); + guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.altar.bloodRequired"), String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/api/guide/PageCorruptionRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/guide/PageCorruptionRecipe.java new file mode 100644 index 0000000..fad4a28 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/guide/PageCorruptionRecipe.java @@ -0,0 +1,73 @@ +package tombenpotter.sanguimancy.api.guide; + +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.base.PageBase; +import amerifrance.guideapi.api.util.GuiHelper; +import amerifrance.guideapi.gui.GuiBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.recipes.RecipeCorruptedInfusion; + +public class PageCorruptionRecipe extends PageBase { + + public ItemStack[] input; + public ItemStack output; + public int minimumCorruption; + public int duration; + + public PageCorruptionRecipe(RecipeCorruptedInfusion recipe) { + this.input = recipe.fInput; + this.output = recipe.fOutput; + this.minimumCorruption = recipe.fMiniumCorruption; + this.duration = recipe.fTime; + } + + @Override + @SideOnly(Side.CLIENT) + public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { + + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/gui/guide/altar.png")); + guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 150, 60); + + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.corrupted"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); + + int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7); + int inputY = (1 * 20) + (guiTop + guiBase.ySize / 5); + for (int i = 0; i < input.length; i++) { + if (input[i] != null) { + GuiHelper.drawItemStack(input[i], inputX, inputY + 7 * i); + if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY + 7 * i, 15, 15)) { + guiBase.renderToolTip(input[i], mouseX, mouseY); + } + } + } + + if (output == null) { + output = new ItemStack(Blocks.fire); + } + int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7); + int outputY = (1 * 20) + (guiTop + guiBase.xSize / 5); + GuiHelper.drawItemStack(output, outputX, outputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { + guiBase.renderToolTip(output, outputX, outputY); + } + + if (output.getItem() == Item.getItemFromBlock(Blocks.fire)) { + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D); + guiBase.drawCenteredString(fontRenderer, String.valueOf(minimumCorruption), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); + guiBase.drawCenteredString(fontRenderer, String.valueOf(duration), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0); + } + guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.corruption.minCorruption"), String.valueOf(minimumCorruption)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0); + guiBase.drawCenteredString(fontRenderer, String.format(StatCollector.translateToLocal("text.recipe.corruption.duration"), String.valueOf(duration)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/api/guide/PageOrbRecipe.java b/src/main/java/tombenpotter/sanguimancy/api/guide/PageOrbRecipe.java new file mode 100644 index 0000000..a0ffb1c --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/guide/PageOrbRecipe.java @@ -0,0 +1,77 @@ +package tombenpotter.sanguimancy.api.guide; + +import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; +import amerifrance.guideapi.ModInformation; +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.util.GuiHelper; +import amerifrance.guideapi.gui.GuiBase; +import amerifrance.guideapi.pages.PageIRecipe; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import tombenpotter.sanguimancy.util.RandomUtils; + +import java.util.ArrayList; + +public class PageOrbRecipe extends PageIRecipe { + + /** + * @param recipe - Recipe to draw + */ + public PageOrbRecipe(IRecipe recipe) { + super(recipe); + } + + @Override + @SideOnly(Side.CLIENT) + public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) { + + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModInformation.GUITEXLOC + "recipe_elements.png")); + guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65); + + guiBase.drawCenteredString(fontRenderer, StatCollector.translateToLocal("text.recipe.shapedOrb"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0); + ShapedBloodOrbRecipe shapedBloodOrbRecipe = (ShapedBloodOrbRecipe) recipe; + int width = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 4); + int height = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 5); + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int stackX = (x + 1) * 20 + (guiLeft + guiBase.xSize / 7); + int stackY = (y + 1) * 20 + (guiTop + guiBase.ySize / 5); + Object component = shapedBloodOrbRecipe.getInput()[y * width + x]; + if (component != null) { + if (component instanceof ItemStack) { + GuiHelper.drawItemStack((ItemStack) component, stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip((ItemStack) component, stackX, stackY); + } + } else if (component instanceof Integer) { + GuiHelper.drawItemStack(RandomUtils.getOrbForLevel((Integer) component), stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip(RandomUtils.getOrbForLevel((Integer) component), stackX, stackY); + } + } else { + if (((ArrayList) component).isEmpty()) return; + GuiHelper.drawItemStack(((ArrayList) component).get(0), stackX, stackY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) { + guiBase.renderToolTip(((ArrayList) component).get(0), stackX, stackY); + } + } + } + } + } + int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7); + int outputY = (2 * 20) + (guiTop + guiBase.xSize / 5); + GuiHelper.drawItemStack(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY); + if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) { + guiBase.renderToolTip(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY); + } + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/api/objects/BlockPostition.java b/src/main/java/tombenpotter/sanguimancy/api/objects/BlockPostition.java index c357cc4..c0c2ef4 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/objects/BlockPostition.java +++ b/src/main/java/tombenpotter/sanguimancy/api/objects/BlockPostition.java @@ -7,11 +7,11 @@ public class BlockPostition { - public double x; - public double y; - public double z; + public int x; + public int y; + public int z; - public BlockPostition(double posX, double posY, double posZ) { + public BlockPostition(int posX, int posY, int posZ) { x = posX; y = posY; z = posZ; @@ -24,9 +24,9 @@ public BlockPostition(TileEntity tile) { } public static BlockPostition readFromNBT(NBTTagCompound tag) { - return new BlockPostition(tag.getCompoundTag("BlockPostition").getDouble("posX"), - tag.getCompoundTag("BlockPostition").getDouble("posY"), - tag.getCompoundTag("BlockPostition").getDouble("posZ")); + return new BlockPostition(tag.getCompoundTag("BlockPostition").getInteger("posX"), + tag.getCompoundTag("BlockPostition").getInteger("posY"), + tag.getCompoundTag("BlockPostition").getInteger("posZ")); } @Override @@ -40,17 +40,22 @@ public int hashCode() { } public Block getBlock(World world) { - return world.getBlock((int) x, (int) y, (int) z); + return world.getBlock(x, y, z); } public TileEntity getTile(World world) { - return world.getTileEntity((int) x, (int) y, (int) z); + return world.getTileEntity(x, y, z); } public NBTTagCompound writeToNBT(NBTTagCompound tag) { - tag.getCompoundTag("BlockPostition").setDouble("posX", x); - tag.getCompoundTag("BlockPostition").setDouble("posY", y); - tag.getCompoundTag("BlockPostition").setDouble("posZ", z); + tag.getCompoundTag("BlockPostition").setInteger("posX", x); + tag.getCompoundTag("BlockPostition").setInteger("posY", y); + tag.getCompoundTag("BlockPostition").setInteger("posZ", z); return tag; } + + @Override + public String toString() { + return "BlockPostition {x= " + x + ", y= " + y + ", z= " + z + '}'; + } } diff --git a/src/main/java/tombenpotter/sanguimancy/api/ICustomNBTTag.java b/src/main/java/tombenpotter/sanguimancy/api/objects/ICustomNBTTag.java similarity index 79% rename from src/main/java/tombenpotter/sanguimancy/api/ICustomNBTTag.java rename to src/main/java/tombenpotter/sanguimancy/api/objects/ICustomNBTTag.java index 3865be2..a151bce 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/ICustomNBTTag.java +++ b/src/main/java/tombenpotter/sanguimancy/api/objects/ICustomNBTTag.java @@ -1,4 +1,4 @@ -package tombenpotter.sanguimancy.api; +package tombenpotter.sanguimancy.api.objects; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/tombenpotter/sanguimancy/api/objects/MapKey.java b/src/main/java/tombenpotter/sanguimancy/api/objects/MapKey.java index b2d2fca..9c19f52 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/objects/MapKey.java +++ b/src/main/java/tombenpotter/sanguimancy/api/objects/MapKey.java @@ -16,6 +16,16 @@ public MapKey(FluidStack stack) { hashcode = stack.getFluid().hashCode(); } + public static MapKey getKey(ItemStack stack) { + if (stack == null || stack.getItem() == null) return null; + return new MapKey(stack); + } + + public static MapKey getKey(FluidStack stack) { + if (stack == null) return null; + return new MapKey(stack); + } + @Override public boolean equals(Object o) { if (o instanceof MapKey) @@ -27,14 +37,4 @@ public boolean equals(Object o) { public int hashCode() { return hashcode; } - - public static MapKey getKey(ItemStack stack) { - if (stack == null || stack.getItem() == null) return null; - return new MapKey(stack); - } - - public static MapKey getKey(FluidStack stack) { - if (stack == null) return null; - return new MapKey(stack); - } } \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/Timer.java b/src/main/java/tombenpotter/sanguimancy/api/objects/Timer.java similarity index 86% rename from src/main/java/tombenpotter/sanguimancy/api/Timer.java rename to src/main/java/tombenpotter/sanguimancy/api/objects/Timer.java index 0868e89..6103760 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/Timer.java +++ b/src/main/java/tombenpotter/sanguimancy/api/objects/Timer.java @@ -1,4 +1,4 @@ -package tombenpotter.sanguimancy.api; +package tombenpotter.sanguimancy.api.objects; public class Timer { private int reset; diff --git a/src/main/java/tombenpotter/sanguimancy/api/package-info.java b/src/main/java/tombenpotter/sanguimancy/api/package-info.java new file mode 100644 index 0000000..6fd9b57 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/package-info.java @@ -0,0 +1,3 @@ +@API(owner = "Sanguimancy", apiVersion = "@VERSION@", provides = "Sanguimancy|API") package tombenpotter.sanguimancy.api; + +import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/api/EnumSNType.java b/src/main/java/tombenpotter/sanguimancy/api/snManifestation/EnumSNType.java similarity index 63% rename from src/main/java/tombenpotter/sanguimancy/api/EnumSNType.java rename to src/main/java/tombenpotter/sanguimancy/api/snManifestation/EnumSNType.java index 6f09c86..15b2226 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/EnumSNType.java +++ b/src/main/java/tombenpotter/sanguimancy/api/snManifestation/EnumSNType.java @@ -1,4 +1,4 @@ -package tombenpotter.sanguimancy.api; +package tombenpotter.sanguimancy.api.snManifestation; public enum EnumSNType { ITEM, diff --git a/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNComponent.java b/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNComponent.java index f8fe977..f45a145 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNComponent.java +++ b/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNComponent.java @@ -3,6 +3,8 @@ import tombenpotter.sanguimancy.api.objects.BlockPostition; import tombenpotter.sanguimancy.api.objects.BoolAndBlockPosList; +import java.util.ArrayList; + public interface ISNComponent { public BoolAndBlockPosList getAdjacentComponents(BlockPostition orignalPosition, BoolAndBlockPosList blockPosList); @@ -14,4 +16,6 @@ public interface ISNComponent { public boolean isSNKnot(); public void onNetworkUpdate(BlockPostition originalPosition); + + public ArrayList getSNKnots(); } diff --git a/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNPart.java b/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNPart.java index 287a346..bf7d3e7 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNPart.java +++ b/src/main/java/tombenpotter/sanguimancy/api/snManifestation/ISNPart.java @@ -1,7 +1,6 @@ package tombenpotter.sanguimancy.api.snManifestation; import tombenpotter.sanguimancy.api.objects.BlockPostition; -import tombenpotter.sanguimancy.api.EnumSNType; import java.util.ArrayList; diff --git a/src/main/java/tombenpotter/sanguimancy/api/soulCorruption/SoulCorruptionHelper.java b/src/main/java/tombenpotter/sanguimancy/api/soulCorruption/SoulCorruptionHelper.java index c176859..399dc71 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/soulCorruption/SoulCorruptionHelper.java +++ b/src/main/java/tombenpotter/sanguimancy/api/soulCorruption/SoulCorruptionHelper.java @@ -1,6 +1,7 @@ package tombenpotter.sanguimancy.api.soulCorruption; -import net.minecraft.client.Minecraft; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.passive.EntityAnimal; @@ -71,9 +72,9 @@ public static void decrementCorruption(String ownerName) { removeCorruption(ownerName, 1); } + @SideOnly(Side.CLIENT) public static int getClientPlayerCorruption() { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - return player.getEntityData().getInteger(Sanguimancy.modid + ":SC"); + return Sanguimancy.proxy.getClientPlayer().getEntityData().getInteger(Sanguimancy.modid + ":SC"); } public static void spawnChickenFollower(EntityPlayer player) { @@ -180,11 +181,13 @@ public static void spawnIllusion(EntityPlayer player) { } public static void loseHeart(EntityPlayer player) { - if (player.worldObj.rand.nextInt(750) == 0) { - int level = player.worldObj.rand.nextInt(5); - player.addPotionEffect(new PotionEffect(PotionsRegistry.potionRemoveHeart.id, 1200, level, false)); - if (!player.worldObj.isRemote && ConfigHandler.messagesWhenCorruptionEffect) { - MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(String.format(StatCollector.translateToLocal("chat.Sanguimancy.loose.heart"), player.getDisplayName()))); + if (!player.capabilities.isCreativeMode) { + if (player.worldObj.rand.nextInt(750) == 0) { + int level = player.worldObj.rand.nextInt(5); + player.addPotionEffect(new PotionEffect(PotionsRegistry.potionRemoveHeart.id, 1200, level, false)); + if (!player.worldObj.isRemote && ConfigHandler.messagesWhenCorruptionEffect) { + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(String.format(StatCollector.translateToLocal("chat.Sanguimancy.loose.heart"), player.getDisplayName()))); + } } } } diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/IBoundTile.java b/src/main/java/tombenpotter/sanguimancy/api/tile/IBoundTile.java new file mode 100644 index 0000000..4212a21 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/IBoundTile.java @@ -0,0 +1,14 @@ +package tombenpotter.sanguimancy.api.tile; + +import java.util.ArrayList; + +public interface IBoundTile { + + public ArrayList getOwnersList(); + + public void setOwnersList(ArrayList ownersList); + + public void addOwnerToList(String ownerName); + + public void removeOwnerFromList(String ownerName); +} diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBase.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBase.java index 103c4cd..e4dc8f8 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBase.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBase.java @@ -5,32 +5,32 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; public class TileBase extends TileEntity implements ICustomNBTTag { - public NBTTagCompound custoomNBTTag; + public NBTTagCompound customNBTTag; @Override public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); } @Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); - tagCompound.setTag("customNBTTag", custoomNBTTag); + tagCompound.setTag("customNBTTag", customNBTTag); } @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseInventory.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseInventory.java index cd6a5b2..e5f6c03 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseInventory.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseInventory.java @@ -9,7 +9,6 @@ public abstract class TileBaseInventory extends TileBase implements IInventory { public ItemStack[] slots; public int inventoryStackLimit = 64; - public NBTTagCompound custoomNBTTag; @Override public int getSizeInventory() { @@ -85,7 +84,6 @@ public void readFromNBT(NBTTagCompound tagCompound) { for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); byte b0 = nbttagcompound1.getByte("Slot"); - if (b0 >= 0 && b0 < this.slots.length) { this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNBranch.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNBranch.java index 62876e9..657c95b 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNBranch.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNBranch.java @@ -4,7 +4,7 @@ import net.minecraftforge.common.util.ForgeDirection; import tombenpotter.sanguimancy.api.objects.BlockPostition; import tombenpotter.sanguimancy.api.objects.BoolAndBlockPosList; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; import tombenpotter.sanguimancy.api.objects.SNKNotBoolean; import tombenpotter.sanguimancy.api.snManifestation.ISNBranch; import tombenpotter.sanguimancy.api.snManifestation.ISNComponent; @@ -69,6 +69,7 @@ public BlockPostition[] getAdjacentISNComponents() { return adjacentBranches; } + @Override public ArrayList getSNKnots() { ArrayList list = new ArrayList(); HashMap map = getComponentsInNetwork().hashMap; diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNKnot.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNKnot.java index a067095..b6664c6 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNKnot.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNKnot.java @@ -4,7 +4,7 @@ import net.minecraftforge.common.util.ForgeDirection; import tombenpotter.sanguimancy.api.objects.BlockPostition; import tombenpotter.sanguimancy.api.objects.BoolAndBlockPosList; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; import tombenpotter.sanguimancy.api.objects.SNKNotBoolean; import tombenpotter.sanguimancy.api.snManifestation.ISNComponent; import tombenpotter.sanguimancy.api.snManifestation.ISNKnot; @@ -76,4 +76,14 @@ public BlockPostition[] getAdjacentISNComponents() { } return adjacentBranches; } + + @Override + public ArrayList getSNKnots() { + ArrayList list = new ArrayList(); + HashMap map = getComponentsInNetwork().hashMap; + for (BlockPostition postition : map.keySet()) { + if (map.get(postition).isSNKnotActive && map.get(postition).isSNKnot) list.add(postition); + } + return list; + } } diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNPart.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNPart.java index 2ba0264..8e73c80 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNPart.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSNPart.java @@ -4,7 +4,7 @@ import net.minecraftforge.common.util.ForgeDirection; import tombenpotter.sanguimancy.api.objects.BlockPostition; import tombenpotter.sanguimancy.api.objects.BoolAndBlockPosList; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; import tombenpotter.sanguimancy.api.objects.SNKNotBoolean; import tombenpotter.sanguimancy.api.snManifestation.ISNComponent; import tombenpotter.sanguimancy.api.snManifestation.ISNKnot; @@ -28,8 +28,8 @@ public ArrayList getSNKnots() { @Override public BoolAndBlockPosList getComponentsInNetwork() { BoolAndBlockPosList blockPosList = new BoolAndBlockPosList(); - for (BlockPostition postition : getAdjacentISNComponents()) { - if (postition != null) { + if (getAdjacentISNComponents() != null) { + for (BlockPostition postition : getAdjacentISNComponents()) { if (postition != null) { if (!blockPosList.hashMap.containsKey(postition) && postition.getTile(worldObj) != null && postition.getTile(worldObj) instanceof ISNKnot) { ISNKnot knot = (ISNKnot) postition.getTile(worldObj); diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSidedInventory.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSidedInventory.java index 5006d83..4a9301e 100644 --- a/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSidedInventory.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileBaseSidedInventory.java @@ -1,25 +1,6 @@ package tombenpotter.sanguimancy.api.tile; import net.minecraft.inventory.ISidedInventory; -import net.minecraftforge.common.util.ForgeDirection; public abstract class TileBaseSidedInventory extends TileBaseInventory implements ISidedInventory { - - @Override - public int[] getAccessibleSlotsFromSide(int var1) { - ForgeDirection dir = ForgeDirection.getOrientation(var1); - switch (dir) { - case DOWN: - return new int[]{0}; - case UP: - return new int[]{6}; - case NORTH: - case SOUTH: - case EAST: - case WEST: - return new int[]{1, 2, 3, 4, 5}; - default: - return new int[]{}; - } - } } diff --git a/src/main/java/tombenpotter/sanguimancy/api/tile/TileCamouflage.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileCamouflage.java new file mode 100644 index 0000000..ee1a004 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileCamouflage.java @@ -0,0 +1,32 @@ +package tombenpotter.sanguimancy.api.tile; + +import net.minecraft.nbt.NBTTagCompound; + +public class TileCamouflage extends TileBase { + + public int block = 0; + public int metadata = 0; + + public TileCamouflage() { + customNBTTag = new NBTTagCompound(); + } + + @Override + public boolean canUpdate() { + return false; + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + this.block = tagCompound.getInteger("blockID"); + this.metadata = tagCompound.getInteger("metadata"); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + tagCompound.setInteger("blockID", this.block); + tagCompound.setInteger("metadata", this.metadata); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileComputerBase.java b/src/main/java/tombenpotter/sanguimancy/api/tile/TileComputerBase.java similarity index 98% rename from src/main/java/tombenpotter/sanguimancy/tile/TileComputerBase.java rename to src/main/java/tombenpotter/sanguimancy/api/tile/TileComputerBase.java index 177a5b6..e6255a8 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileComputerBase.java +++ b/src/main/java/tombenpotter/sanguimancy/api/tile/TileComputerBase.java @@ -1,4 +1,4 @@ -package tombenpotter.sanguimancy.tile; +package tombenpotter.sanguimancy.api.tile; import cpw.mods.fml.common.Optional; import dan200.computercraft.api.lua.ILuaContext; @@ -12,8 +12,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import tombenpotter.sanguimancy.api.ICustomNBTTag; -import tombenpotter.sanguimancy.api.Timer; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.Timer; import tombenpotter.sanguimancy.compat.lua.events.LuaEvent; import tombenpotter.sanguimancy.compat.lua.methods.LuaMethod; import tombenpotter.sanguimancy.util.enums.ModList; diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockAltarManipulator.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockAltarManipulator.java new file mode 100644 index 0000000..7be4321 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockAltarManipulator.java @@ -0,0 +1,70 @@ +package tombenpotter.sanguimancy.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.tile.TileAltarManipulator; +import tombenpotter.sanguimancy.util.RandomUtils; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; + +public class BlockAltarManipulator extends BlockContainer { + + public BlockAltarManipulator(Material material) { + super(material); + setHardness(5.0F); + setCreativeTab(Sanguimancy.tabSanguimancy); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileAltarManipulator(); + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { + RandomUtils.dropItems(world, x, y, z); + world.removeTileEntity(x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + TileAltarManipulator tile = (TileAltarManipulator) world.getTileEntity(x, y, z); + if (player.getHeldItem() == null && tile.getStackInSlot(2) != null) { + ItemStack stack = tile.getStackInSlot(2); + tile.setInventorySlotContents(2, null); + player.inventory.addItemStackToInventory(stack); + world.markBlockForUpdate(x, y, z); + return true; + } else if (player.getHeldItem() != null && player.getHeldItem().isItemEqual(SanguimancyItemStacks.sanguineShifter) && tile.getStackInSlot(2) == null) { + ItemStack stack = player.getHeldItem().copy(); + stack.stackSize = 1; + tile.setInventorySlotContents(2, stack); + tile.sideToOutput = side; + if (!player.capabilities.isCreativeMode) player.inventory.consumeInventoryItem(stack.getItem()); + world.markBlockForUpdate(x, y, z); + return true; + } + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockBloodTank.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockBloodTank.java index c62e860..1bd8c9d 100644 --- a/src/main/java/tombenpotter/sanguimancy/blocks/BlockBloodTank.java +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockBloodTank.java @@ -5,8 +5,10 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -20,10 +22,12 @@ import tombenpotter.sanguimancy.util.RandomUtils; import java.util.ArrayList; +import java.util.List; public class BlockBloodTank extends BlockContainer { public static int renderId = 10000; + public static int[] capacities = {16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65336, 131072, 262144, 524288}; public BlockBloodTank(Material material) { super(material); @@ -32,8 +36,8 @@ public BlockBloodTank(Material material) { } @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileBloodTank(); + public TileEntity createNewTileEntity(World world, int metadata) { + return new TileBloodTank(capacities[metadata]); } @SideOnly(Side.CLIENT) @@ -71,7 +75,7 @@ public ArrayList getDrops(World world, int x, int y, int z, int metad ArrayList list = new ArrayList(); if (world.getTileEntity(x, y, z) instanceof TileBloodTank) { TileBloodTank tile = (TileBloodTank) world.getTileEntity(x, y, z); - ItemStack drop = new ItemStack(this); + ItemStack drop = new ItemStack(this, 1, metadata); NBTTagCompound tag = new NBTTagCompound(); tile.writeToNBT(tag); drop.stackTagCompound = tag; @@ -149,4 +153,11 @@ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { } return getIcon(side, meta); } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item id, CreativeTabs tab, List list) { + for (int i = 0; i <= 15; i++) { + list.add(new ItemStack(id, 1, i)); + } + } } diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockDimensionalPortal.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockDimensionalPortal.java index 2bd25ba..7eb9a44 100644 --- a/src/main/java/tombenpotter/sanguimancy/blocks/BlockDimensionalPortal.java +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockDimensionalPortal.java @@ -13,9 +13,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import tombenpotter.sanguimancy.tile.TileDimensionalPortal; -import tombenpotter.sanguimancy.util.PortalLocation; -import tombenpotter.sanguimancy.util.TeleportingUtils; import tombenpotter.sanguimancy.util.singletons.LocationsHandler; +import tombenpotter.sanguimancy.util.teleporting.PortalLocation; +import tombenpotter.sanguimancy.util.teleporting.TeleportingQueue; import java.util.ArrayList; import java.util.Random; @@ -72,16 +72,16 @@ public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity e if (linkedLocations.get(0).equals(new PortalLocation(tile.masterStoneX, tile.masterStoneY + 1, tile.masterStoneZ, world.provider.dimensionId))) { PortalLocation linkedLocation = linkedLocations.get(1); if (linkedLocation.dimension == world.provider.dimensionId) { - TeleportingUtils.teleportEntitySameDim(linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); + TeleportingQueue.getInstance().teleportSameDim(linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); } else { - TeleportingUtils.teleportEntityToDim(world, linkedLocation.dimension, linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); + TeleportingQueue.getInstance().teleportToDim(world, linkedLocation.dimension, linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); } } else if (linkedLocations.get(1).equals(new PortalLocation(tile.masterStoneX, tile.masterStoneY + 1, tile.masterStoneZ, world.provider.dimensionId))) { PortalLocation linkedLocation = linkedLocations.get(0); if (linkedLocation.dimension == world.provider.dimensionId) { - TeleportingUtils.teleportEntitySameDim(linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); + TeleportingQueue.getInstance().teleportSameDim(linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); } else { - TeleportingUtils.teleportEntityToDim(world, linkedLocation.dimension, linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); + TeleportingQueue.getInstance().teleportToDim(world, linkedLocation.dimension, linkedLocation.x, linkedLocation.y, linkedLocation.z, entity, masterRitualStone.getOwner()); } } } diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEthereal.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEthereal.java new file mode 100644 index 0000000..e169b65 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEthereal.java @@ -0,0 +1,60 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.api.block.BlockCamouflage; +import tombenpotter.sanguimancy.entity.EntityChickenMinion; + +import java.util.List; + +public class BlockEthereal extends BlockCamouflage { + + public BlockEthereal(Material material) { + super(material); + setHardness(5.0F); + setCreativeTab(Sanguimancy.tabSanguimancy); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":EtherealBlock"); + } + + @Override + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity entity) { + if (entity != null && ((entity instanceof EntityPlayer && !entity.isSneaking()) || entity instanceof EntityChickenMinion)) { + return; + } else { + super.addCollisionBoxesToList(world, x, y, z, mask, list, entity); + } + } + + @Override + public boolean getBlocksMovement(IBlockAccess access, int x, int y, int z) { + return false; + } + + @Override + public boolean isNormalCube() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getMobilityFlag() { + return 2; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBound.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBound.java new file mode 100644 index 0000000..c9be478 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBound.java @@ -0,0 +1,44 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.tile.TileCamouflageBound; + +public class BlockEtherealBound extends BlockEthereal { + + public BlockEtherealBound(Material material) { + super(material); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":BoundEtherealBlock"); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack stack) { + if (entityLivingBase instanceof EntityPlayer) { + TileCamouflageBound tile = (TileCamouflageBound) world.getTileEntity(x, y, z); + tile.addOwnerToList(entityLivingBase.getCommandSenderName()); + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileCamouflageBound(); + } + + @Override + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBoundCorrupted.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBoundCorrupted.java new file mode 100644 index 0000000..4641f29 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBoundCorrupted.java @@ -0,0 +1,53 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.tile.TileCamouflageBound; + +public class BlockEtherealBoundCorrupted extends BlockEtherealCorrupted { + + public BlockEtherealBoundCorrupted(Material material) { + super(material); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":BoundEtherealCorruptedBlock"); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack stack) { + if (entityLivingBase instanceof EntityPlayer) { + TileCamouflageBound tile = (TileCamouflageBound) world.getTileEntity(x, y, z); + tile.addOwnerToList(entityLivingBase.getCommandSenderName()); + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileCamouflageBound(); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + TileCamouflageBound tile = (TileCamouflageBound) world.getTileEntity(x, y, z); + if (!tile.getOwnersList().contains(player.getCommandSenderName())) { + return false; + } + return super.onBlockActivated(world, x, y, z, player, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); + } + + @Override + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBoundToggled.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBoundToggled.java new file mode 100644 index 0000000..d7aaff5 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealBoundToggled.java @@ -0,0 +1,44 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.tile.TileCamouflageBound; + +public class BlockEtherealBoundToggled extends BlockEtherealToggled { + + public BlockEtherealBoundToggled(Material material) { + super(material); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":BoundEtherealToggledBlock"); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack stack) { + if (entityLivingBase instanceof EntityPlayer) { + TileCamouflageBound tile = (TileCamouflageBound) world.getTileEntity(x, y, z); + tile.addOwnerToList(entityLivingBase.getCommandSenderName()); + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileCamouflageBound(); + } + + @Override + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealCorrupted.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealCorrupted.java new file mode 100644 index 0000000..a75ecf0 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealCorrupted.java @@ -0,0 +1,87 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.api.block.BlockCamouflage; +import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; +import tombenpotter.sanguimancy.api.tile.TileCamouflage; +import tombenpotter.sanguimancy.entity.EntityChickenMinion; + +import java.util.List; + +public class BlockEtherealCorrupted extends BlockCamouflage { + + public BlockEtherealCorrupted(Material material) { + super(material); + setHardness(5.0F); + setCreativeTab(Sanguimancy.tabSanguimancy); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":EtherealCorruptedBlock"); + } + + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (!world.isRemote && player.getHeldItem() == null) { + if (!player.isSneaking()) { + tile.getCustomNBTTag().setInteger("MinimumCorruption", tile.getCustomNBTTag().getInteger("MinimumCorruption") + 1); + } else if (player.isSneaking() && tile.getCustomNBTTag().getInteger("MinimumCorruption") - 1 >= 0) { + tile.getCustomNBTTag().setInteger("MinimumCorruption", tile.getCustomNBTTag().getInteger("MinimumCorruption") - 1); + } + player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("compat.nei.corrupted.infusion.minimum.corruption") + ": " + String.valueOf(tile.getCustomNBTTag().getInteger("MinimumCorruption")))); + } + return super.onBlockActivated(world, x, y, z, player, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); + } + + @Override + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity entity) { + if (entity instanceof EntityChickenMinion) return; + + if (entity != null && ((entity instanceof EntityPlayer && !entity.isSneaking()))) { + EntityPlayer player = (EntityPlayer) entity; + TileCamouflage tile = (TileCamouflage) world.getTileEntity(x, y, z); + if (SoulCorruptionHelper.isCorruptionOver(player.getDisplayName(), tile.getCustomNBTTag().getInteger("MinimumCorruption"))) { + return; + } else { + super.addCollisionBoxesToList(world, x, y, z, mask, list, entity); + } + } else { + super.addCollisionBoxesToList(world, x, y, z, mask, list, entity); + } + } + + @Override + public boolean getBlocksMovement(IBlockAccess access, int x, int y, int z) { + return false; + } + + @Override + public boolean isNormalCube() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getMobilityFlag() { + return 2; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealPersonal.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealPersonal.java new file mode 100644 index 0000000..3903eeb --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealPersonal.java @@ -0,0 +1,48 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.entity.EntityChickenMinion; +import tombenpotter.sanguimancy.tile.TileCamouflageBound; + +import java.util.List; + +public class BlockEtherealPersonal extends BlockEtherealBound { + + public BlockEtherealPersonal(Material material) { + super(material); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":PersonalEtherealBlock"); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack stack) { + if (entityLivingBase instanceof EntityPlayer) { + TileCamouflageBound tile = (TileCamouflageBound) world.getTileEntity(x, y, z); + tile.addOwnerToList(entityLivingBase.getCommandSenderName()); + } + } + + @Override + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity entity) { + if (entity != null && ((entity instanceof EntityPlayer && !entity.isSneaking()) || entity instanceof EntityChickenMinion)) { + TileCamouflageBound tile = (TileCamouflageBound) world.getTileEntity(x, y, z); + if (tile.getOwnersList().contains(entity.getCommandSenderName())) return; + } else { + super.addCollisionBoxesToList(world, x, y, z, mask, list, entity); + } + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealToggled.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealToggled.java new file mode 100644 index 0000000..42dbd6b --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockEtherealToggled.java @@ -0,0 +1,63 @@ +package tombenpotter.sanguimancy.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.api.block.BlockCamouflage; + +import java.util.List; + +public class BlockEtherealToggled extends BlockCamouflage { + + public BlockEtherealToggled(Material material) { + super(material); + setHardness(5.0F); + setCreativeTab(Sanguimancy.tabSanguimancy); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":EtherealToggledBlock"); + } + + @Override + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity entity) { + if (world.getStrongestIndirectPower(x, y, z) > 0 || world.getBlockPowerInput(x, y, z) > 0 || entity.isSneaking()) { + super.addCollisionBoxesToList(world, x, y, z, mask, list, entity); + } else { + return; + } + } + + @Override + public boolean getBlocksMovement(IBlockAccess access, int x, int y, int z) { + return false; + } + + @Override + public boolean isNormalCube() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getMobilityFlag() { + return 2; + } + + @Override + public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) { + return true; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockItemSNPart.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockItemSNPart.java index 8003e34..9efbc2c 100644 --- a/src/main/java/tombenpotter/sanguimancy/blocks/BlockItemSNPart.java +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockItemSNPart.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.objects.BlockPostition; @@ -93,4 +94,10 @@ public void onNeighborBlockChange(World world, int x, int y, int z, Block neighb } } } + + @Override + public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) { + return true; + } + } diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockRitualSNPart.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockRitualSNPart.java index 8957c50..5147c33 100644 --- a/src/main/java/tombenpotter/sanguimancy/blocks/BlockRitualSNPart.java +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockRitualSNPart.java @@ -6,8 +6,10 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.objects.BlockPostition; @@ -28,7 +30,7 @@ public BlockRitualSNPart(Material material) { @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister ir) { - this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":SNRitualPart"); + this.blockIcon = ir.registerIcon(Sanguimancy.texturePath + ":RitualRepresentation"); } @Override @@ -36,6 +38,26 @@ public TileEntity createNewTileEntity(World world, int p_149915_2_) { return new TileRitualSNPart(); } + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int quantityDropped(Random p_149745_1_) { + return 0; + } + @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return null; @@ -51,4 +73,20 @@ public void onNeighborBlockChange(World world, int x, int y, int z, Block neighb } } } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileRitualSNPart) { + TileRitualSNPart tile = (TileRitualSNPart) world.getTileEntity(x, y, z); + if (tile.onBlockRightClicked(player, player.getHeldItem())) { + return true; + } + } + return super.onBlockActivated(world, x, y, z, player, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); + } + + @Override + public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) { + return true; + } } diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/BlockSacrificeTransfer.java b/src/main/java/tombenpotter/sanguimancy/blocks/BlockSacrificeTransfer.java index 416921a..9da2365 100644 --- a/src/main/java/tombenpotter/sanguimancy/blocks/BlockSacrificeTransfer.java +++ b/src/main/java/tombenpotter/sanguimancy/blocks/BlockSacrificeTransfer.java @@ -23,6 +23,7 @@ import tombenpotter.sanguimancy.items.ItemPlayerSacrificer; import tombenpotter.sanguimancy.tile.TileSacrificeTransfer; import tombenpotter.sanguimancy.util.RandomUtils; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; import java.util.Random; @@ -79,7 +80,7 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p public void onEntityWalking(World world, int x, int y, int z, Entity entity) { if (!world.isRemote) { TileSacrificeTransfer tile = (TileSacrificeTransfer) world.getTileEntity(x, y, z); - if (entity instanceof EntityPlayer && tile.slots[0] != null && (tile.slots[0].isItemEqual(RandomUtils.SanguimancyItemStacks.focusedPlayerSacrificer) || tile.slots[0].isItemEqual(RandomUtils.SanguimancyItemStacks.wayToDie))) { + if (entity instanceof EntityPlayer && tile.slots[0] != null && (tile.slots[0].isItemEqual(SanguimancyItemStacks.focusedPlayerSacrificer) || tile.slots[0].isItemEqual(SanguimancyItemStacks.wayToDie))) { ItemStack stack = tile.slots[0]; EntityPlayer player = (EntityPlayer) entity; RandomUtils.checkAndSetCompound(stack); diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockAltarManipulator.java b/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockAltarManipulator.java new file mode 100644 index 0000000..8c6f8d5 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockAltarManipulator.java @@ -0,0 +1,28 @@ +package tombenpotter.sanguimancy.blocks.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +import java.util.List; + +public class ItemBlockAltarManipulator extends ItemBlock { + + public ItemBlockAltarManipulator(Block block) { + super(block); + } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean p_77624_4_) { + if (!GuiScreen.isShiftKeyDown()) + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); + else { + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.place.top")); + } + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodCleanser.java b/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodCleanser.java new file mode 100644 index 0000000..d3d2d0b --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodCleanser.java @@ -0,0 +1,23 @@ +package tombenpotter.sanguimancy.blocks.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + +import java.util.List; + +public class ItemBlockBloodCleanser extends ItemBlock { + + public ItemBlockBloodCleanser(Block block) { + super(block); + } + + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean p_77624_4_) { + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.evil.toaster")); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodTank.java b/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodTank.java index 8e983aa..6466697 100644 --- a/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodTank.java +++ b/src/main/java/tombenpotter/sanguimancy/blocks/items/ItemBlockBloodTank.java @@ -12,6 +12,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; +import tombenpotter.sanguimancy.blocks.BlockBloodTank; import tombenpotter.sanguimancy.util.RandomUtils; import java.util.List; @@ -20,16 +21,18 @@ public class ItemBlockBloodTank extends ItemBlock implements IFluidContainerItem public ItemBlockBloodTank(Block block) { super(block); + setHasSubtypes(true); } @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean p_77624_4_) { - if (stack.hasTagCompound()) { - if (!GuiScreen.isShiftKeyDown()) - list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); - else { + if (!GuiScreen.isShiftKeyDown()) + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); + else { + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.capacity") + ": " + String.valueOf(getCapacity(stack)) + "mB"); + if (stack.hasTagCompound()) { NBTTagCompound tag = stack.stackTagCompound.getCompoundTag("tank"); - if (stack.hasTagCompound() && tag.getString("FluidName") != "") { + if (tag.getString("FluidName") != "") { list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.fluid") + ": " + RandomUtils.capitalizeFirstLetter(tag.getString("FluidName"))); list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.amount") + ": " + tag.getInteger("Amount") + "/" + getCapacity(stack) + "mB"); } @@ -57,10 +60,7 @@ public FluidStack getFluid(ItemStack stack) { @Override public int getCapacity(ItemStack container) { - if (container.hasTagCompound() && container.stackTagCompound.hasKey("capacity")) { - return container.stackTagCompound.getInteger("capacity"); - } - return 16 * FluidContainerRegistry.BUCKET_VOLUME; + return BlockBloodTank.capacities[container.getItemDamage()] * FluidContainerRegistry.BUCKET_VOLUME; } @Override @@ -109,4 +109,9 @@ public FluidStack drain(ItemStack stack, int maxDrain, boolean doDrain) { fluid.amount = drainAmount; return fluid; } + + @Override + public int getMetadata(int meta) { + return meta; + } } diff --git a/src/main/java/tombenpotter/sanguimancy/client/model/ModelInterface.java b/src/main/java/tombenpotter/sanguimancy/client/model/ModelHollowCube.java similarity index 98% rename from src/main/java/tombenpotter/sanguimancy/client/model/ModelInterface.java rename to src/main/java/tombenpotter/sanguimancy/client/model/ModelHollowCube.java index 05d4240..92fb864 100644 --- a/src/main/java/tombenpotter/sanguimancy/client/model/ModelInterface.java +++ b/src/main/java/tombenpotter/sanguimancy/client/model/ModelHollowCube.java @@ -4,7 +4,7 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelInterface extends ModelBase { +public class ModelHollowCube extends ModelBase { //fields ModelRenderer topBarA; @@ -20,7 +20,7 @@ public class ModelInterface extends ModelBase { ModelRenderer bottomBarC; ModelRenderer bottomBarD; - public ModelInterface() { + public ModelHollowCube() { textureWidth = 64; textureHeight = 32; diff --git a/src/main/java/tombenpotter/sanguimancy/client/render/RenderAltarManipulator.java b/src/main/java/tombenpotter/sanguimancy/client/render/RenderAltarManipulator.java new file mode 100644 index 0000000..f59a339 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/client/render/RenderAltarManipulator.java @@ -0,0 +1,150 @@ +package tombenpotter.sanguimancy.client.render; + +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.GL11; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.client.model.ModelHollowCube; +import tombenpotter.sanguimancy.tile.TileAltarManipulator; + +public class RenderAltarManipulator extends TileEntitySpecialRenderer implements IItemRenderer { + + public static final ResourceLocation texture = new ResourceLocation(Sanguimancy.texturePath + ":textures/blocks/AltarManipulator.png"); + private final RenderItem customRenderItem; + public ModelHollowCube model = new ModelHollowCube(); + + public RenderAltarManipulator() { + customRenderItem = new RenderItem() { + @Override + public boolean shouldBob() { + return false; + } + }; + customRenderItem.setRenderManager(RenderManager.instance); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) { + renderModel((TileAltarManipulator) tileEntity, x, y, z); + if (tileEntity instanceof TileAltarManipulator) { + TileAltarManipulator tile = (TileAltarManipulator) tileEntity; + GL11.glPushMatrix(); + if (tile.getStackInSlot(1) != null) { + float scaleFactor = getGhostItemScaleFactor(tile.getStackInSlot(1)); + float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + EntityItem ghostEntityItem = new EntityItem(tile.getWorldObj()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tile.getStackInSlot(1)); + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + } else { + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + } + GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); + GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); + customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0); + } + GL11.glPopMatrix(); + } + } + + + public void renderModel(TileAltarManipulator tile, double x, double y, double z) { + float scale = 0.1F; + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.0F, (float) z + 0.5F); + GL11.glScalef(scale, scale, scale); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); + GL11.glRotatef(180F, 90.0F, 0.0F, 90.0F); + model.renderAll(); + GL11.glPopMatrix(); + } + + private float getGhostItemScaleFactor(ItemStack itemStack) { + float scaleFactor = 1.0F; + + if (itemStack != null) { + if (itemStack.getItem() instanceof ItemBlock) { + switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1)) { + case 1: + return 0.90F; + + case 2: + return 0.90F; + + case 3: + return 0.90F; + + case 4: + return 0.90F; + + case 5: + return 0.80F; + + default: + return 0.90F; + } + } else { + switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1)) { + case 1: + return 0.65F; + + case 2: + return 0.65F; + + case 3: + return 0.65F; + + case 4: + return 0.65F; + + default: + return 0.65F; + } + } + } + return scaleFactor; + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + GL11.glPushMatrix(); + GL11.glScalef(-1F, -1F, 1F); + switch (type) { + case ENTITY: + case INVENTORY: + GL11.glTranslatef(0, -0.5F, 0); + break; + case EQUIPPED: + GL11.glTranslatef(-0.5F, -1F, 0.5F); + break; + case EQUIPPED_FIRST_PERSON: + GL11.glTranslatef(-0.3F, -1.1F, 0.5F); + break; + default: + } + Minecraft.getMinecraft().renderEngine.bindTexture(RenderBloodInterface.texture); + model.render(null, 0, 0, 0, 0, 0, 0.0625F); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/client/render/RenderBloodInterface.java b/src/main/java/tombenpotter/sanguimancy/client/render/RenderBloodInterface.java index 138142b..9f61604 100644 --- a/src/main/java/tombenpotter/sanguimancy/client/render/RenderBloodInterface.java +++ b/src/main/java/tombenpotter/sanguimancy/client/render/RenderBloodInterface.java @@ -13,14 +13,14 @@ import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.client.model.ModelInterface; +import tombenpotter.sanguimancy.client.model.ModelHollowCube; import tombenpotter.sanguimancy.tile.TileBloodInterface; public class RenderBloodInterface extends TileEntitySpecialRenderer implements IItemRenderer { public static final ResourceLocation texture = new ResourceLocation(Sanguimancy.texturePath + ":textures/blocks/BloodInterface.png"); private final RenderItem customRenderItem; - private ModelInterface model = new ModelInterface(); + private ModelHollowCube model = new ModelHollowCube(); public RenderBloodInterface() { customRenderItem = new RenderItem() { diff --git a/src/main/java/tombenpotter/sanguimancy/client/render/RenderBoundItem.java b/src/main/java/tombenpotter/sanguimancy/client/render/RenderBoundItem.java index 7878882..69aa126 100644 --- a/src/main/java/tombenpotter/sanguimancy/client/render/RenderBoundItem.java +++ b/src/main/java/tombenpotter/sanguimancy/client/render/RenderBoundItem.java @@ -20,7 +20,7 @@ import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.client.model.ModelCube; import tombenpotter.sanguimancy.tile.TileItemSNPart; -import tombenpotter.sanguimancy.util.RandomUtils; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; public class RenderBoundItem extends TileEntitySpecialRenderer implements IItemRenderer { @@ -161,7 +161,6 @@ private float getGhostItemScaleFactor(ItemStack itemStack) { @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; } @@ -174,22 +173,22 @@ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRe public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case ENTITY: { //item entity - if (item.getItem() == RandomUtils.SanguimancyItemStacks.boundItem.getItem()) + if (item.getItem() == SanguimancyItemStacks.boundItem.getItem()) render(0.5F, 15F, -0.5F, 0.1F); return; } case EQUIPPED: { //third person in hand - if (item.getItem() == RandomUtils.SanguimancyItemStacks.boundItem.getItem()) + if (item.getItem() == SanguimancyItemStacks.boundItem.getItem()) render(2F, 15F, 5F, 0.1F); return; } case EQUIPPED_FIRST_PERSON: { //first person in hand - if (item.getItem() == RandomUtils.SanguimancyItemStacks.boundItem.getItem()) + if (item.getItem() == SanguimancyItemStacks.boundItem.getItem()) render(1F, 19F, 7F, 0.1F); return; } case INVENTORY: { //the item in inventories - if (item.getItem() == RandomUtils.SanguimancyItemStacks.boundItem.getItem()) + if (item.getItem() == SanguimancyItemStacks.boundItem.getItem()) render(-0.01F, 10F, 0.0F, 0.1F); return; } diff --git a/src/main/java/tombenpotter/sanguimancy/client/render/RenderCorruptionCrystallizer.java b/src/main/java/tombenpotter/sanguimancy/client/render/RenderCorruptionCrystallizer.java index eaa5082..7026dfb 100644 --- a/src/main/java/tombenpotter/sanguimancy/client/render/RenderCorruptionCrystallizer.java +++ b/src/main/java/tombenpotter/sanguimancy/client/render/RenderCorruptionCrystallizer.java @@ -11,7 +11,7 @@ import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.client.model.ModelCorruptionCrystallizer; import tombenpotter.sanguimancy.tile.TileCorruptionCrystallizer; -import tombenpotter.sanguimancy.util.RandomUtils; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; public class RenderCorruptionCrystallizer extends TileEntitySpecialRenderer implements IItemRenderer { @@ -54,22 +54,22 @@ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRe public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case ENTITY: { //item entity - if (item.getItem() == RandomUtils.SanguimancyItemStacks.corruptionCrystallizer.getItem()) + if (item.getItem() == SanguimancyItemStacks.corruptionCrystallizer.getItem()) render(0.5F, 13F, -0.5F, 0.09F); return; } case EQUIPPED: { //third person in hand - if (item.getItem() == RandomUtils.SanguimancyItemStacks.corruptionCrystallizer.getItem()) + if (item.getItem() == SanguimancyItemStacks.corruptionCrystallizer.getItem()) render(2F, 15F, 5F, 0.10F); return; } case EQUIPPED_FIRST_PERSON: { //first person in hand - if (item.getItem() == RandomUtils.SanguimancyItemStacks.corruptionCrystallizer.getItem()) + if (item.getItem() == SanguimancyItemStacks.corruptionCrystallizer.getItem()) render(1F, 19F, 7F, 0.08F); return; } case INVENTORY: { //the item in inventories - if (item.getItem() == RandomUtils.SanguimancyItemStacks.corruptionCrystallizer.getItem()) + if (item.getItem() == SanguimancyItemStacks.corruptionCrystallizer.getItem()) render(-0.01F, 9F, 0.0F, 0.11F); return; } diff --git a/src/main/java/tombenpotter/sanguimancy/client/render/RenderRitualRepresentation.java b/src/main/java/tombenpotter/sanguimancy/client/render/RenderRitualRepresentation.java new file mode 100644 index 0000000..74a4148 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/client/render/RenderRitualRepresentation.java @@ -0,0 +1,133 @@ +package tombenpotter.sanguimancy.client.render; + +import WayofTime.alchemicalWizardry.ModItems; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.GL11; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.client.model.ModelCube; +import tombenpotter.sanguimancy.tile.TileRitualSNPart; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; + +public class RenderRitualRepresentation extends TileEntitySpecialRenderer implements IItemRenderer { + + public ModelCube model = new ModelCube(); + public ResourceLocation texture = new ResourceLocation(Sanguimancy.texturePath + ":textures/blocks/RitualRepresentation.png"); + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) { + renderModel((TileRitualSNPart) tileEntity, x, y, z); + if (tileEntity instanceof TileRitualSNPart) { + TileRitualSNPart tile = (TileRitualSNPart) tileEntity; + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player.getHeldItem() != null && player.getHeldItem().isItemEqual(new ItemStack(ModItems.itemSeerSigil))) { + renderNameTag(tile, x, y, z); + } + } + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + case ENTITY: { //item entity + if (item.getItem() == SanguimancyItemStacks.ritualRepresentation.getItem()) + render(0.5F, 15F, -0.5F, 0.1F); + return; + } + case EQUIPPED: { //third person in hand + if (item.getItem() == SanguimancyItemStacks.ritualRepresentation.getItem()) + render(2F, 15F, 5F, 0.1F); + return; + } + case EQUIPPED_FIRST_PERSON: { //first person in hand + if (item.getItem() == SanguimancyItemStacks.ritualRepresentation.getItem()) + render(1F, 19F, 7F, 0.1F); + return; + } + case INVENTORY: { //the item in inventories + if (item.getItem() == SanguimancyItemStacks.ritualRepresentation.getItem()) + render(-0.01F, 10F, 0.0F, 0.1F); + return; + } + default: + return; + } + } + + private void render(float x, float y, float z, float size) { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); + GL11.glPushMatrix(); // start + GL11.glScalef(size, size, size); + GL11.glTranslatef(x, y, z); // size + GL11.glRotatef(180, 1, 0, 0); + GL11.glRotatef(-90, 0, 1, 0); + model.renderAll(); + GL11.glPopMatrix(); // end + } + + public void renderModel(TileRitualSNPart tile, double x, double y, double z) { + float scale = 0.1F; + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5f, (float) y - 0.5F, (float) z + 0.5f); + GL11.glScalef(scale, scale, scale); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); + model.renderAll(); + GL11.glPopMatrix(); + } + + public void renderNameTag(TileRitualSNPart tile, double x, double y, double z) { + float f = 1.6F; + float f1 = 0.016666668F * f; + String s = "x: " + String.valueOf(tile.xRitual) + " y: " + String.valueOf(tile.yRitual) + " z: " + String.valueOf(tile.zRitual); + RenderManager manager = RenderManager.instance; + FontRenderer fontrenderer = manager.getFontRenderer(); + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-manager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(manager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-f1, -f1, f1); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + int i = fontrenderer.getStringWidth(s) / 2; + tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + tessellator.addVertex((double) (-i - 1), -1.0D, 0.0D); + tessellator.addVertex((double) (-i - 1), 8.0D, 0.0D); + tessellator.addVertex((double) (i + 1), 8.0D, 0.0D); + tessellator.addVertex((double) (i + 1), -1.0D, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 0xFFFFFF); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/compat/computercraft/PeripheralProvider.java b/src/main/java/tombenpotter/sanguimancy/compat/computercraft/PeripheralProvider.java index 3bddba9..d64cbf4 100644 --- a/src/main/java/tombenpotter/sanguimancy/compat/computercraft/PeripheralProvider.java +++ b/src/main/java/tombenpotter/sanguimancy/compat/computercraft/PeripheralProvider.java @@ -6,7 +6,7 @@ import dan200.computercraft.api.peripheral.IPeripheralProvider; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import tombenpotter.sanguimancy.tile.TileComputerBase; +import tombenpotter.sanguimancy.api.tile.TileComputerBase; import tombenpotter.sanguimancy.util.enums.ModList; @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheralProvider", modid = ModList.Names.COMPUTERCRAFT) diff --git a/src/main/java/tombenpotter/sanguimancy/compat/lua/events/LuaEvent.java b/src/main/java/tombenpotter/sanguimancy/compat/lua/events/LuaEvent.java index 691a6c9..5fb1954 100644 --- a/src/main/java/tombenpotter/sanguimancy/compat/lua/events/LuaEvent.java +++ b/src/main/java/tombenpotter/sanguimancy/compat/lua/events/LuaEvent.java @@ -4,7 +4,7 @@ import dan200.computercraft.api.peripheral.IComputerAccess; import li.cil.oc.api.machine.Context; import net.minecraft.tileentity.TileEntity; -import tombenpotter.sanguimancy.tile.TileComputerBase; +import tombenpotter.sanguimancy.api.tile.TileComputerBase; import tombenpotter.sanguimancy.util.enums.ModList; public abstract class LuaEvent { diff --git a/src/main/java/tombenpotter/sanguimancy/compat/waila/WailaCompatRegistry.java b/src/main/java/tombenpotter/sanguimancy/compat/waila/WailaCompatRegistry.java new file mode 100644 index 0000000..4de59c9 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/compat/waila/WailaCompatRegistry.java @@ -0,0 +1,13 @@ +package tombenpotter.sanguimancy.compat.waila; + +import cpw.mods.fml.common.event.FMLInterModComms; + +public class WailaCompatRegistry { + + public static void register() { + FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaCorruptionCrystallizer.register"); + FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaAltarDiviner.register"); + FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaAltarEmitter.register"); + FMLInterModComms.sendMessage("Waila", "register", "tombenpotter.sanguimancy.compat.waila.WailaBloodTank.register"); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemCorruptedDemonShard.java b/src/main/java/tombenpotter/sanguimancy/items/ItemCorruptedDemonShard.java deleted file mode 100644 index 13893f4..0000000 --- a/src/main/java/tombenpotter/sanguimancy/items/ItemCorruptedDemonShard.java +++ /dev/null @@ -1,44 +0,0 @@ -package tombenpotter.sanguimancy.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.util.ConfigHandler; -import tombenpotter.sanguimancy.util.TeleportingUtils; - -public class ItemCorruptedDemonShard extends Item { - - public ItemCorruptedDemonShard() { - setCreativeTab(Sanguimancy.tabSanguimancy); - setUnlocalizedName(Sanguimancy.modid + ".corruptedDemonShard"); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister ri) { - this.itemIcon = ri.registerIcon(Sanguimancy.texturePath + ":CorruptedDemonShard"); - } - - @Override - //TODO: Remove that testing code and find a right way to change dimensions - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (!world.isRemote) { - if (player.worldObj.provider.dimensionId != 0) { - ChunkCoordinates chunkCoords = MinecraftServer.getServer().worldServerForDimension(0).getSpawnPoint(); - chunkCoords.posY = MinecraftServer.getServer().worldServerForDimension(0).getTopSolidOrLiquidBlock(chunkCoords.posX, chunkCoords.posZ); - TeleportingUtils.teleportEntityToDim(world, 0, chunkCoords.posX, chunkCoords.posY, chunkCoords.posZ, player, player.getCommandSenderName()); - } else { - int dimID = ConfigHandler.snDimID; - ChunkCoordinates chunkCoords = MinecraftServer.getServer().worldServerForDimension(dimID).getSpawnPoint(); - TeleportingUtils.teleportEntityToDim(world, dimID, chunkCoords.posX, 6, chunkCoords.posZ, player, player.getCommandSenderName()); - } - } - return stack; - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemCorruptedMineral.java b/src/main/java/tombenpotter/sanguimancy/items/ItemCorruptedMineral.java deleted file mode 100644 index 1cd90b2..0000000 --- a/src/main/java/tombenpotter/sanguimancy/items/ItemCorruptedMineral.java +++ /dev/null @@ -1,20 +0,0 @@ -package tombenpotter.sanguimancy.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import tombenpotter.sanguimancy.Sanguimancy; - -public class ItemCorruptedMineral extends Item { - - public ItemCorruptedMineral() { - setCreativeTab(Sanguimancy.tabSanguimancy); - setUnlocalizedName(Sanguimancy.modid + ".corruptedMineral"); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister ri) { - this.itemIcon = ri.registerIcon(Sanguimancy.texturePath + ":CorruptedMineral"); - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemImbuedStick.java b/src/main/java/tombenpotter/sanguimancy/items/ItemImbuedStick.java deleted file mode 100644 index 6dc05eb..0000000 --- a/src/main/java/tombenpotter/sanguimancy/items/ItemImbuedStick.java +++ /dev/null @@ -1,20 +0,0 @@ -package tombenpotter.sanguimancy.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import tombenpotter.sanguimancy.Sanguimancy; - -public class ItemImbuedStick extends Item { - - public ItemImbuedStick() { - setCreativeTab(Sanguimancy.tabSanguimancy); - setUnlocalizedName(Sanguimancy.modid + ".imbuedStick"); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister ri) { - this.itemIcon = ri.registerIcon(Sanguimancy.texturePath + ":ImbuedStick"); - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemOreLump.java b/src/main/java/tombenpotter/sanguimancy/items/ItemOreLump.java index fadf738..6ad49e6 100644 --- a/src/main/java/tombenpotter/sanguimancy/items/ItemOreLump.java +++ b/src/main/java/tombenpotter/sanguimancy/items/ItemOreLump.java @@ -8,9 +8,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; -import net.minecraftforge.oredict.OreDictionary; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.util.RandomUtils; @@ -33,39 +33,43 @@ public void registerIcons(IIconRegister ri) { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { - if (!GuiScreen.isShiftKeyDown()) { - list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); - } else { - if (stack.hasTagCompound()) { - list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.ore") + ": " + stack.stackTagCompound.getString("ore")); - } else { - list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.any")); - } + NBTTagCompound tag = stack.stackTagCompound; + + if (tag == null) + stack.setTagCompound(new NBTTagCompound()); + + String oreName = stack.stackTagCompound.getString("ore"); + + if (!oreName.equals("")) { + if (!GuiScreen.isShiftKeyDown()) + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); + else + list.add(String.format(StatCollector.translateToLocal("info.Sanguimancy.tooltip.ore"), RandomUtils.capitalizeFirstLetter(oreName))); } } @SideOnly(Side.CLIENT) @Override + @SuppressWarnings("unchecked") public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) { - for (String ore : OreDictionary.getOreNames()) { - if (ore.startsWith("ore")) { - String output = ore.substring(3); - if (!OreDictionary.getOres(ore).isEmpty() && !OreDictionary.getOres("ingot" + output).isEmpty()) { - ItemStack stack = new ItemStack(this); - RandomUtils.checkAndSetCompound(stack); - stack.stackTagCompound.setString("ore", output); - list.add(stack); - } - } - } + for (ItemStack stack : RandomUtils.oreLumpList) list.add(stack); } @Override public String getItemStackDisplayName(ItemStack stack) { - if (stack.hasTagCompound()) { - return RandomUtils.capitalizeFirstLetter(stack.stackTagCompound.getString("ore")) + " " + super.getItemStackDisplayName(stack); - } else return super.getItemStackDisplayName(stack); + NBTTagCompound tag = stack.stackTagCompound; + + if (tag == null) + stack.setTagCompound(new NBTTagCompound()); + + String oreName = stack.stackTagCompound.getString("ore"); + + if (!oreName.equals("")) + return String.format(StatCollector.translateToLocal("item.Sanguimancy.oreLump.name"), RandomUtils.capitalizeFirstLetter(oreName)); + else + return StatCollector.translateToLocal("info.Sanguimancy.tooltip.any"); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemPlayerGuide.java b/src/main/java/tombenpotter/sanguimancy/items/ItemPlayerGuide.java deleted file mode 100644 index 72b61f1..0000000 --- a/src/main/java/tombenpotter/sanguimancy/items/ItemPlayerGuide.java +++ /dev/null @@ -1,50 +0,0 @@ -package tombenpotter.sanguimancy.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.util.RandomUtils; - -import java.util.List; - -public class ItemPlayerGuide extends Item { - - //All the GUI code comes from Wasliebob's API. I suck at GUIs. - public ItemPlayerGuide() { - setCreativeTab(Sanguimancy.tabSanguimancy); - setUnlocalizedName(Sanguimancy.modid + ".playerGuide"); - setTextureName(Sanguimancy.texturePath + ":PlayerGuide"); - setMaxStackSize(1); - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - player.openGui(Sanguimancy.instance, 1, world, (int) player.posX, (int) player.posY, (int) player.posZ); - return stack; - } - - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { - super.onUpdate(stack, world, entity, par4, par5); - RandomUtils.checkAndSetCompound(stack); - } - - @Override - public void onCreated(ItemStack stack, World world, EntityPlayer player) { - super.onCreated(stack, world, player); - RandomUtils.checkAndSetCompound(stack); - } - - @SideOnly(Side.CLIENT) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean simulate) { - list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.book.author")); - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemResource.java b/src/main/java/tombenpotter/sanguimancy/items/ItemResource.java new file mode 100644 index 0000000..85658ea --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/items/ItemResource.java @@ -0,0 +1,58 @@ +package tombenpotter.sanguimancy.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import tombenpotter.sanguimancy.Sanguimancy; + +import java.util.ArrayList; +import java.util.List; + +public class ItemResource extends Item { + + public IIcon[] icon = new IIcon[50]; + ArrayList namesList = new ArrayList(); + + public ItemResource() { + setCreativeTab(Sanguimancy.tabSanguimancy); + setUnlocalizedName(Sanguimancy.modid + ".resource"); + setHasSubtypes(true); + + namesList.add(0, "corruptedDemonShard"); + namesList.add(1, "corruptedMineral"); + namesList.add(2, "imbuedStick"); + namesList.add(3, "etherealManifestation"); + namesList.add(4, "manipulatorUpgrade"); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ri) { + this.icon[0] = ri.registerIcon(Sanguimancy.texturePath + ":CorruptedDemonShard"); + this.icon[1] = ri.registerIcon(Sanguimancy.texturePath + ":CorruptedMineral"); + this.icon[2] = ri.registerIcon(Sanguimancy.texturePath + ":ImbuedStick"); + this.icon[3] = ri.registerIcon(Sanguimancy.texturePath + ":EtherealManifestation"); + this.icon[4] = ri.registerIcon(Sanguimancy.texturePath + ":ManipulatorUpgrade"); + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + String name = namesList.get(stack.getItemDamage()); + return getUnlocalizedName() + "." + name; + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + return this.icon[meta]; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) { + for (int i = 0; i < namesList.size(); i++) { + list.add(new ItemStack(this, 1, i)); + } + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemSoulTransporter.java b/src/main/java/tombenpotter/sanguimancy/items/ItemSoulTransporter.java new file mode 100644 index 0000000..abccd3c --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/items/ItemSoulTransporter.java @@ -0,0 +1,57 @@ +package tombenpotter.sanguimancy.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.util.ConfigHandler; +import tombenpotter.sanguimancy.util.singletons.ClaimedChunks; +import tombenpotter.sanguimancy.util.teleporting.TeleportingQueue; + +public class ItemSoulTransporter extends Item { + + public ItemSoulTransporter() { + setCreativeTab(Sanguimancy.tabSanguimancy); + setUnlocalizedName(Sanguimancy.modid + ".soulTransporter"); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ri) { + this.itemIcon = ri.registerIcon(Sanguimancy.texturePath + ":SoulTransporter"); + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + if (!world.isRemote) { + if (player.worldObj.provider.dimensionId != 0) { + ChunkCoordinates chunkCoords = MinecraftServer.getServer().worldServerForDimension(0).getSpawnPoint(); + chunkCoords.posY = MinecraftServer.getServer().worldServerForDimension(0).getTopSolidOrLiquidBlock(chunkCoords.posX, chunkCoords.posZ); + TeleportingQueue.getInstance().teleportToDim(world, 0, chunkCoords.posX, chunkCoords.posY, chunkCoords.posZ, player, player.getCommandSenderName()); + } else { + int dimID = ConfigHandler.snDimID; + int x; + int z; + if (ClaimedChunks.getClaimedChunks().getLinkedChunks(player.getCommandSenderName()) == null || ClaimedChunks.getClaimedChunks().getLinkedChunks(player.getCommandSenderName()).isEmpty()) { + return stack; + } + if (ClaimedChunks.getClaimedChunks().getLinkedChunks(player.getCommandSenderName()).get(0) != null) { + x = ClaimedChunks.getClaimedChunks().getLinkedChunks(player.getCommandSenderName()).get(0).getCenterXPos(); + z = ClaimedChunks.getClaimedChunks().getLinkedChunks(player.getCommandSenderName()).get(0).getCenterZPos(); + } else { + ChunkCoordinates chunkCoords = MinecraftServer.getServer().worldServerForDimension(dimID).getSpawnPoint(); + x = chunkCoords.posX; + z = chunkCoords.posZ; + } + TeleportingQueue.getInstance().teleportToDim(world, dimID, x, 6, z, player, player.getCommandSenderName()); + } + player.inventory.consumeInventoryItem(this); + } + return stack; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemTelepositionSigil.java b/src/main/java/tombenpotter/sanguimancy/items/ItemTelepositionSigil.java new file mode 100644 index 0000000..75cb579 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/items/ItemTelepositionSigil.java @@ -0,0 +1,84 @@ +package tombenpotter.sanguimancy.items; + +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.util.RandomUtils; +import tombenpotter.sanguimancy.util.teleporting.TeleportingQueue; + +import java.util.List; + +public class ItemTelepositionSigil extends Item { + + public ItemTelepositionSigil() { + this.maxStackSize = 1; + setCreativeTab(Sanguimancy.tabSanguimancy); + setUnlocalizedName(Sanguimancy.modid + ".telepositionSigil"); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ri) { + this.itemIcon = ri.registerIcon(Sanguimancy.texturePath + ":TelepositionSigil"); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + if (stack.stackTagCompound != null) { + if (!GuiScreen.isShiftKeyDown()) { + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.teleposition.sigil.pun")); + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); + } else { + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.teleposition.sigil.pun")); + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.coordinates") + ": " + stack.stackTagCompound.getInteger("blockX") + ", " + stack.stackTagCompound.getInteger("blockZ") + ", " + stack.stackTagCompound.getInteger("blockZ")); + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.bound.dimension") + ": " + getDimensionID(stack.stackTagCompound)); + } + } + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + RandomUtils.checkAndSetCompound(stack); + EnergyItems.checkAndSetItemOwner(stack, player); + int x = stack.stackTagCompound.getInteger("blockX"); + int y = stack.stackTagCompound.getInteger("blockY"); + int z = stack.stackTagCompound.getInteger("blockZ"); + if (!world.isRemote) { + if (world.provider.dimensionId == getDimensionID(stack.stackTagCompound)) { + TeleportingQueue.getInstance().teleportSameDim(x, y + 1, z, player, RandomUtils.getItemOwner(stack)); + } else { + TeleportingQueue.getInstance().teleportToDim(world, getDimensionID(stack.stackTagCompound), x, y + 1, z, player, RandomUtils.getItemOwner(stack)); + } + } + return stack; + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + if (!world.isRemote && player.isSneaking()) { + RandomUtils.checkAndSetCompound(stack); + EnergyItems.checkAndSetItemOwner(stack, player); + if (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TETeleposer) { + stack.stackTagCompound.setInteger("blockX", x); + stack.stackTagCompound.setInteger("blockY", y); + stack.stackTagCompound.setInteger("blockZ", z); + stack.stackTagCompound.setInteger("dimensionId", world.provider.dimensionId); + return true; + } + } + return false; + } + + public int getDimensionID(NBTTagCompound tag) { + return tag.getInteger("dimensionId"); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/items/ItemTranspositionSigil.java b/src/main/java/tombenpotter/sanguimancy/items/ItemTranspositionSigil.java new file mode 100644 index 0000000..8e5d3d1 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/items/ItemTranspositionSigil.java @@ -0,0 +1,127 @@ +package tombenpotter.sanguimancy.items; + +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.util.ConfigHandler; +import tombenpotter.sanguimancy.util.RandomUtils; + +import java.util.List; + +public class ItemTranspositionSigil extends EnergyItems { + + public ItemTranspositionSigil() { + this.maxStackSize = 1; + setCreativeTab(Sanguimancy.tabSanguimancy); + setUnlocalizedName(Sanguimancy.modid + ".transpositionSigil"); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ri) { + this.itemIcon = ri.registerIcon(Sanguimancy.texturePath + ":TranspositionSigil"); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + if (stack.stackTagCompound != null) { + if (!GuiScreen.isShiftKeyDown()) { + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.transposition.sigil.pun")); + list.add(StatCollector.translateToLocal("info.Sanguimancy.tooltip.shift.info")); + } else { + if (stack.stackTagCompound.getInteger("blockId") != 0) { + String name = new ItemStack(Block.getBlockById(stack.stackTagCompound.getInteger("blockId")), 1, stack.stackTagCompound.getInteger("metadata")).getDisplayName(); + list.add(StatCollector.translateToLocal("compat.waila.content") + ": " + name); + } + } + } + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + RandomUtils.checkAndSetCompound(stack); + EnergyItems.checkAndSetItemOwner(stack, player); + if (player.isSneaking() && stack.stackTagCompound.getInteger("blockId") == 0) { + EntityLightningBolt lightningBolt = new EntityLightningBolt(world, x, y, z); + lightningBolt.getEntityData().setBoolean("isTranspositionSigilBolt", true); + world.spawnEntityInWorld(lightningBolt); + } + if (!world.isRemote) { + if (player.isSneaking() && stack.stackTagCompound.getInteger("blockId") == 0 && !RandomUtils.transpositionBlockBlacklist.contains(world.getBlock(x, y, z))) { + int cost = ConfigHandler.transpositionSigilCost; + if (world.getBlock(x, y, z).getPlayerRelativeBlockHardness(player, world, x, y, z) >= 0 && world.getBlock(x, y, z).getBlockHardness(world, x, y, z) >= 0) { + NBTTagCompound tileNBTTag = new NBTTagCompound(); + int blockId = Block.getIdFromBlock(world.getBlock(x, y, z)); + stack.stackTagCompound.setInteger("blockId", blockId); + int metadata = world.getBlockMetadata(x, y, z); + stack.stackTagCompound.setInteger("metadata", metadata); + if (world.getTileEntity(x, y, z) != null) { + TileEntity tile = world.getTileEntity(x, y, z); + tile.writeToNBT(tileNBTTag); + cost = cost * 5; + if (world.getTileEntity(x, y, z) instanceof TileEntityMobSpawner) cost = cost * 4; + } + stack.stackTagCompound.setTag("TileNBTTag", tileNBTTag); + world.removeTileEntity(x, y, z); + world.setBlockToAir(x, y, z); + EnergyItems.syphonBatteries(stack, player, cost); + Sanguimancy.proxy.addColoredFlameEffects(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0, 255, 72, 0); + return true; + } + } else { + Block block = world.getBlock(x, y, z); + Block blockToPlace = Block.getBlockById(stack.stackTagCompound.getInteger("blockId")); + int metadata = stack.stackTagCompound.getInteger("metadata"); + + if (blockToPlace != Blocks.air) { + if (block == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) { + side = 1; + } else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(world, x, y, z)) { + if (side == 0) --y; + if (side == 1) ++y; + if (side == 2) --z; + if (side == 3) ++z; + if (side == 4) --x; + if (side == 5) ++x; + } + if (block.canPlaceBlockOnSide(world, x, y, z, side)) { + EntityLightningBolt lightningBolt = new EntityLightningBolt(world, x, y, z); + lightningBolt.getEntityData().setBoolean("isTranspositionSigilBolt", true); + world.spawnEntityInWorld(lightningBolt); + if (!world.isRemote) { + world.setBlock(x, y, z, blockToPlace, metadata, 3); + if (stack.stackTagCompound.getCompoundTag("TileNBTTag") != null && blockToPlace.hasTileEntity(metadata)) { + TileEntity tile = TileEntity.createAndLoadEntity(stack.stackTagCompound.getCompoundTag("TileNBTTag")); + tile.xCoord = x; + tile.yCoord = y; + tile.zCoord = z; + world.setTileEntity(x, y, z, tile); + world.markBlockForUpdate(x, y, z); + tile.markDirty(); + } + stack.stackTagCompound.setInteger("blockId", 0); + stack.stackTagCompound.setInteger("metadata", 0); + blockToPlace.onBlockPlacedBy(world, x, y, z, player, new ItemStack(blockToPlace)); + blockToPlace.onPostBlockPlaced(world, x, y, z, metadata); + world.markBlockForUpdate(x, y, z); + } + } + } + return true; + } + } + return false; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedAxe.java b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedAxe.java index 0436f49..2b52228 100644 --- a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedAxe.java +++ b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedAxe.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; +import net.minecraft.block.BlockLeavesBase; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; @@ -16,6 +17,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; @@ -23,12 +25,14 @@ import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.objects.MapKey; import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; +import tombenpotter.sanguimancy.util.ConfigHandler; import tombenpotter.sanguimancy.util.RandomUtils; import java.util.List; public class ItemCorruptedAxe extends ItemAxe { - public int minimumCorruption = 200; + public int minimumCorruption = ConfigHandler.minimumToolCorruption; + public IIcon leafDecay, headHunter, refine; public ItemCorruptedAxe(ToolMaterial material) { super(material); @@ -41,8 +45,18 @@ public ItemCorruptedAxe(ToolMaterial material) { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { - super.registerIcons(ir); - //TODO: Add an icon and a different overlay for every mode. + this.itemIcon = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedAxe"); + this.leafDecay = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedAxe_LeafDecay"); + this.headHunter = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedAxe_HeadHunter"); + this.refine = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedAxe_Refine"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + if (getToolMode(stack) == 1) return leafDecay; + else if (getToolMode(stack) == 2) return headHunter; + else if (getToolMode(stack) == 3) return refine; + else return this.itemIcon; } @Override @@ -60,7 +74,7 @@ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x for (int i = -5; i <= 5; i++) { for (int j = -5; j <= 5; j++) { for (int k = -5; k <= 5; k++) { - if (world.getBlock(i, j, k).isLeaves(world, i, j, k)) { + if (world.getBlock(i, j, k) instanceof BlockLeavesBase) { RandomUtils.dropBlockDropsWithFortune(world, block, i, j, k, metadata, 0); world.setBlockToAir(i, j, k); } @@ -90,7 +104,9 @@ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x EntityPlayer player = (EntityPlayer) entityLivingBase; EnergyItems.syphonBatteries(stack, player, lpConsumption); if (getToolMode(stack) != 0) { - SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + if (world.rand.nextInt(20) == 0) { + SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + } } } } @@ -180,8 +196,10 @@ public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingB if (attacker instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) attacker; EnergyItems.syphonBatteries(stack, player, 100); - if (getToolMode(stack) != 0) { - SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + if (getToolMode(stack) == 2) { + if (player.worldObj.rand.nextInt(20) == 0) { + SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + } } return true; } @@ -214,7 +232,9 @@ public void onEntityDrop(LivingDropsEvent event) { EntityPlayer player = (EntityPlayer) event.source.getEntity(); if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemCorruptedAxe) { int corruption = SoulCorruptionHelper.getCorruptionLevel(RandomUtils.getItemOwner(player.getHeldItem())); - if (player.worldObj.rand.nextInt(50 * (minimumCorruption / corruption)) == 0 && getSkullDrop(event.entityLiving) != null) { + int chance = 100 * (minimumCorruption / corruption); + if (chance < 1) chance = 1; + if (player.worldObj.rand.nextInt(chance) == 0 && getSkullDrop(event.entityLiving) != null) { RandomUtils.dropItemStackInWorld(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, getSkullDrop(event.entityLiving).copy()); } } diff --git a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedPickaxe.java b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedPickaxe.java index f039089..2953448 100644 --- a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedPickaxe.java +++ b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedPickaxe.java @@ -12,17 +12,20 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; +import tombenpotter.sanguimancy.util.ConfigHandler; import tombenpotter.sanguimancy.util.RandomUtils; import java.util.List; public class ItemCorruptedPickaxe extends ItemPickaxe implements IBindable { - public final int minimumCorruption = 200; + public int minimumCorruption = ConfigHandler.minimumToolCorruption; + public IIcon silkTouch, fortuneI, fortuneII, fortuneIII, autosmelt; public ItemCorruptedPickaxe(ToolMaterial material) { super(material); @@ -34,8 +37,23 @@ public ItemCorruptedPickaxe(ToolMaterial material) { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { - super.registerIcons(ir); - //TODO: Add an icon and a different overlay for every mode. + this.itemIcon = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedPickaxe"); + this.silkTouch = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedPickaxe_SilkTouch"); + this.fortuneI = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedPickaxe_FortuneI"); + this.fortuneII = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedPickaxe_FortuneII"); + this.fortuneIII = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedPickaxe_FortuneIII"); + this.autosmelt = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedPickaxe_AutoSmelt"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + RandomUtils.checkAndSetCompound(stack); + if (getToolMode(stack) == 1) return silkTouch; + else if (getToolMode(stack) == 2) return fortuneI; + else if (getToolMode(stack) == 3) return fortuneII; + else if (getToolMode(stack) == 4) return fortuneIII; + else if (getToolMode(stack) == 5) return autosmelt; + else return this.itemIcon; } @Override @@ -73,7 +91,9 @@ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x EntityPlayer player = (EntityPlayer) entityLivingBase; EnergyItems.syphonBatteries(stack, player, lpConsumption); if (getToolMode(stack) != 0) { - SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + if (world.rand.nextInt(20) == 0) { + SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + } } } } diff --git a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedShovel.java b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedShovel.java index 59a3074..4121cb8 100644 --- a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedShovel.java +++ b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedShovel.java @@ -15,6 +15,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -26,7 +27,9 @@ import tombenpotter.sanguimancy.api.objects.BlockAndMetadata; import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; import tombenpotter.sanguimancy.registry.ItemsRegistry; +import tombenpotter.sanguimancy.util.ConfigHandler; import tombenpotter.sanguimancy.util.RandomUtils; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; import java.util.ArrayList; import java.util.HashMap; @@ -34,7 +37,8 @@ public class ItemCorruptedShovel extends ItemSpade { - public int minimumCorruption = 200; + public int minimumCorruption = ConfigHandler.minimumToolCorruption; + public IIcon breakingDown, goldDigger, transmutation; private HashMap breakdownBlocks = new HashMap(); private HashMap transmuteBlocks = new HashMap(); @@ -51,8 +55,18 @@ public ItemCorruptedShovel(ToolMaterial material) { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { - super.registerIcons(ir); - //TODO: Add an icon and a different overlay for every mode. + this.itemIcon = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedShovel"); + this.breakingDown = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedShovel_BreakDown"); + this.goldDigger = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedShovel_GoldDigger"); + this.transmutation = ir.registerIcon(Sanguimancy.texturePath + ":CorruptedShovel_Transmute"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + if (getToolMode(stack) == 1) return breakingDown; + else if (getToolMode(stack) == 2) return goldDigger; + else if (getToolMode(stack) == 3) return transmutation; + else return this.itemIcon; } @Override @@ -82,7 +96,9 @@ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x EntityPlayer player = (EntityPlayer) entityLivingBase; EnergyItems.syphonBatteries(stack, player, lpConsumption); if (getToolMode(stack) != 0) { - SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + if (world.rand.nextInt(20) == 0) { + SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + } } } } @@ -231,14 +247,14 @@ public void onBlockBrokenByCorruptedShovel(BlockEvent.BreakEvent event) { Block block = event.block; int metadata = event.blockMetadata; ItemStack stack = event.getPlayer().getHeldItem(); - int toolMode = getToolMode(stack); EntityPlayer player = event.getPlayer(); World world = event.world; int x = event.x; int y = event.y; int z = event.z; - if (stack != null && stack.isItemEqual(RandomUtils.SanguimancyItemStacks.corruptedShovel)) { + if (stack != null && stack.isItemEqual(SanguimancyItemStacks.corruptedShovel)) { int lpConsumption = 10; + int toolMode = getToolMode(stack); if (toolMode == 1) { lpConsumption = lpConsumption * 5; if (breakdownBlocks.containsKey(new BlockAndMetadata(block, metadata))) { @@ -264,7 +280,9 @@ public void onBlockBrokenByCorruptedShovel(BlockEvent.BreakEvent event) { } EnergyItems.syphonBatteries(stack, player, lpConsumption); if (getToolMode(stack) != 0) { - SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + if (world.rand.nextInt(20) == 0) { + SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + } } } } diff --git a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedSword.java b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedSword.java index 19ee9e0..6557627 100644 --- a/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedSword.java +++ b/src/main/java/tombenpotter/sanguimancy/items/corrupted/ItemCorruptedSword.java @@ -22,6 +22,7 @@ import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; import tombenpotter.sanguimancy.registry.PotionsRegistry; +import tombenpotter.sanguimancy.util.ConfigHandler; import tombenpotter.sanguimancy.util.RandomUtils; import java.util.List; @@ -29,7 +30,7 @@ public class ItemCorruptedSword extends Item { public float baseDamage; - public int minimumCorruption = 200; + public int minimumCorruption = ConfigHandler.minimumToolCorruption; public IIcon activated; public ItemCorruptedSword(int damage) { @@ -88,7 +89,9 @@ public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingB if (amplifier > 15) amplifier = 15; targetPlayer.addPotionEffect(new PotionEffect(PotionsRegistry.potionRemoveHeart.id, 1200, amplifier, false)); attackerPlayer.addPotionEffect(new PotionEffect(PotionsRegistry.potionAddHeart.id, 1200, amplifier, false)); - SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + if (attackerPlayer.worldObj.rand.nextInt(20) == 0) { + SoulCorruptionHelper.incrementCorruption(RandomUtils.getItemOwner(stack)); + } EnergyItems.syphonBatteries(stack, attackerPlayer, 50 * amplifier); } EnergyItems.syphonBatteries(stack, attackerPlayer, 10); diff --git a/src/main/java/tombenpotter/sanguimancy/network/PacketHandler.java b/src/main/java/tombenpotter/sanguimancy/network/PacketHandler.java index bb771cf..007a86c 100644 --- a/src/main/java/tombenpotter/sanguimancy/network/PacketHandler.java +++ b/src/main/java/tombenpotter/sanguimancy/network/PacketHandler.java @@ -16,4 +16,4 @@ public static void registerPackets() { INSTANCE.registerMessage(BloodInterfaceUpdateMessageHandler.class, PacketBloodInterfaceUpdate.class, 0, Side.CLIENT); INSTANCE.registerMessage(SyncCorruptionMessageHandler.class, PacketSyncCorruption.class, 1, Side.CLIENT); } -} +} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/network/handlers/BloodInterfaceUpdateMessageHandler.java b/src/main/java/tombenpotter/sanguimancy/network/handlers/BloodInterfaceUpdateMessageHandler.java index 17c799d..1455dcc 100644 --- a/src/main/java/tombenpotter/sanguimancy/network/handlers/BloodInterfaceUpdateMessageHandler.java +++ b/src/main/java/tombenpotter/sanguimancy/network/handlers/BloodInterfaceUpdateMessageHandler.java @@ -1,6 +1,5 @@ package tombenpotter.sanguimancy.network.handlers; -import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; @@ -8,15 +7,16 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import tombenpotter.sanguimancy.network.packets.PacketBloodInterfaceUpdate; +import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.network.MessageHelper; +import tombenpotter.sanguimancy.network.packets.PacketBloodInterfaceUpdate; import tombenpotter.sanguimancy.tile.TileBloodInterface; public class BloodInterfaceUpdateMessageHandler implements IMessageHandler { @Override public IMessage onMessage(PacketBloodInterfaceUpdate message, MessageContext ctx) { - TileEntity tileEntity = FMLClientHandler.instance().getClient().theWorld.getTileEntity(message.posX, message.posY, message.posZ); + TileEntity tileEntity = Sanguimancy.proxy.getClientPlayer().worldObj.getTileEntity(message.posX, message.posY, message.posZ); if (tileEntity instanceof TileBloodInterface) { ItemStack stack = null; if (message.itemID != -1) { diff --git a/src/main/java/tombenpotter/sanguimancy/network/handlers/SyncCorruptionMessageHandler.java b/src/main/java/tombenpotter/sanguimancy/network/handlers/SyncCorruptionMessageHandler.java index 7676735..2fdb79f 100644 --- a/src/main/java/tombenpotter/sanguimancy/network/handlers/SyncCorruptionMessageHandler.java +++ b/src/main/java/tombenpotter/sanguimancy/network/handlers/SyncCorruptionMessageHandler.java @@ -3,7 +3,6 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.network.packets.PacketSyncCorruption; @@ -12,7 +11,7 @@ public class SyncCorruptionMessageHandler implements IMessageHandler getRecipes(ItemStack input) { public static boolean isRecipeValid(ItemStack input) { RecipeBloodCleanser recipe = getRecipe(input); - if (recipe.fInput.isItemEqual(input) && recipe.fOutput != null && recipe.fInput.stackTagCompound.equals(input.stackTagCompound)) { - return true; - } + if (recipe != null) + if (recipe.fInput.isItemEqual(input) && recipe.fOutput != null && recipe.fInput.stackTagCompound.equals(input.stackTagCompound)) { + return true; + } return false; } diff --git a/src/main/java/tombenpotter/sanguimancy/registry/BlocksRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/BlocksRegistry.java index 113e2b8..43b9c2e 100644 --- a/src/main/java/tombenpotter/sanguimancy/registry/BlocksRegistry.java +++ b/src/main/java/tombenpotter/sanguimancy/registry/BlocksRegistry.java @@ -6,10 +6,7 @@ import net.minecraft.block.material.Material; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.blocks.*; -import tombenpotter.sanguimancy.blocks.items.ItemBlockAltarDiviner; -import tombenpotter.sanguimancy.blocks.items.ItemBlockAltarEmitter; -import tombenpotter.sanguimancy.blocks.items.ItemBlockBloodTank; -import tombenpotter.sanguimancy.blocks.items.ItemBlockIllusion; +import tombenpotter.sanguimancy.blocks.items.*; public class BlocksRegistry { @@ -26,12 +23,19 @@ public class BlocksRegistry { public static Block bloodstoneSlab; public static Block largeBloodstoneSlab; public static Block bloodInterface; - public static Block simpleKnot; public static Block toggleKnot; public static Block simpleBranch; public static Block boundItem; public static Block ritualRepresentation; + public static Block etherealBlock; + public static Block etherealCorruptedBlock; + public static Block etherealToggledBlock; + public static Block etherealBoundBlock; + public static Block etherealBoundCorruptedBlock; + public static Block etherealBoundToggledBlock; + public static Block etherealPersonalBlock; + public static Block altarManipulator; public static void registerBlocks() { altarDiviner = new BlockAltarDiviner(Material.iron); @@ -50,7 +54,7 @@ public static void registerBlocks() { GameRegistry.registerBlock(corruptionCrystallizer, "BlockCorruptionCrystallizer").setBlockName(Sanguimancy.modid + ".corruptionCrystallizer"); lumpCleaner = new BlockLumpCleaner(Material.iron); - GameRegistry.registerBlock(lumpCleaner, "BlockLumpCleaner").setBlockName(Sanguimancy.modid + ".lumpCleaner"); + GameRegistry.registerBlock(lumpCleaner, ItemBlockBloodCleanser.class, "BlockLumpCleaner").setBlockName(Sanguimancy.modid + ".lumpCleaner"); bloodTank = new BlockBloodTank(Material.iron); GameRegistry.registerBlock(bloodTank, ItemBlockBloodTank.class, "BlockBloodTank").setBlockName(Sanguimancy.modid + ".bloodTank"); @@ -87,5 +91,29 @@ public static void registerBlocks() { ritualRepresentation = new BlockRitualSNPart(Material.iron); GameRegistry.registerBlock(ritualRepresentation, "BlockRitualRepresentation").setBlockName(Sanguimancy.modid + ".ritualRepresentation"); + + etherealBlock = new BlockEthereal(Material.iron); + GameRegistry.registerBlock(etherealBlock, "BlockEthereal").setBlockName(Sanguimancy.modid + ".etherealBlock"); + + etherealCorruptedBlock = new BlockEtherealCorrupted(Material.iron); + GameRegistry.registerBlock(etherealCorruptedBlock, "BlockEtherealCorrupted").setBlockName(Sanguimancy.modid + ".etherealCorruptedBlock"); + + etherealToggledBlock = new BlockEtherealToggled(Material.iron); + GameRegistry.registerBlock(etherealToggledBlock, "BlockEtehrealToggled").setBlockName(Sanguimancy.modid + ".etherealToggledBlock"); + + etherealBoundBlock = new BlockEtherealBound(Material.iron); + GameRegistry.registerBlock(etherealBoundBlock, "BlockEtherealBound").setBlockName(Sanguimancy.modid + ".etherealBoundBlock"); + + etherealBoundCorruptedBlock = new BlockEtherealBoundCorrupted(Material.iron); + GameRegistry.registerBlock(etherealBoundCorruptedBlock, "BlockEtherealBoundCorrupted").setBlockName(Sanguimancy.modid + ".etherealBoundCorruptedBlock"); + + etherealBoundToggledBlock = new BlockEtherealBoundToggled(Material.iron); + GameRegistry.registerBlock(etherealBoundToggledBlock, "BlockEtherealBoundToggled").setBlockName(Sanguimancy.modid + ".etherealBoundToggledBlock"); + + etherealPersonalBlock = new BlockEtherealPersonal(Material.iron); + GameRegistry.registerBlock(etherealPersonalBlock, "BlockEtherealPersonal").setBlockName(Sanguimancy.modid + ".etherealPersonalBlock"); + + altarManipulator = new BlockAltarManipulator(Material.iron); + GameRegistry.registerBlock(altarManipulator, ItemBlockAltarManipulator.class, "BlockAltarManipulator").setBlockName(Sanguimancy.modid + ".altarManipulator"); } } diff --git a/src/main/java/tombenpotter/sanguimancy/registry/GuideRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/GuideRegistry.java deleted file mode 100644 index db492b9..0000000 --- a/src/main/java/tombenpotter/sanguimancy/registry/GuideRegistry.java +++ /dev/null @@ -1,286 +0,0 @@ -package tombenpotter.sanguimancy.registry; - -import WayofTime.alchemicalWizardry.ModBlocks; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Category; -import tombenpotter.sanguimancy.api.bloodutils.api.compact.Entry; -import tombenpotter.sanguimancy.api.bloodutils.api.entries.*; -import tombenpotter.sanguimancy.api.bloodutils.api.registries.EntryRegistry; -import tombenpotter.sanguimancy.recipes.RecipeBloodCleanser; -import tombenpotter.sanguimancy.recipes.RecipeCorruptedInfusion; -import tombenpotter.sanguimancy.util.RandomUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -public class GuideRegistry { - public static HashMap lore = new HashMap(); - public static HashMap items = new HashMap(); - public static HashMap blocks = new HashMap(); - public static HashMap rituals = new HashMap(); - - public static Category categorySanguimancyLore, categorySanguimancyItems, categorySanguimancyBlocks, categorySanguimancyRituals; - - public static Entry playerSacrificers, soulCorruptionReader, bloodAmulet, chunkClaimer, craftingItems, corruptionCatalyst, oreLump, wand, corruptedAxe, corruptedPickaxe, corruptedShovel, corruptedSword; - public static Entry altarEmitter, altarDiviner, soulTransferrer, corruptionCrystallizer, bloodInterface, decorativeBlocks, bloodTank, manifestations, bloodCleanser; - public static Entry drillOfTheDead, vulcanosFrigius, greatDeletion, enlightenment, timberman, filler, portal, pump; - public static Entry sacrificeMagic, soulCorruption, soulProtection, corruptionApplications; - - public static void createCategories() { - categorySanguimancyLore = new Category(StatCollector.translateToLocal("guide.Sanguimancy.category.lore"), RandomUtils.SanguimancyItemStacks.attunnedPlayerSacrificer); - EntryRegistry.registerCategories(categorySanguimancyLore); - categorySanguimancyItems = new Category(StatCollector.translateToLocal("guide.Sanguimancy.category.items"), RandomUtils.SanguimancyItemStacks.corruptedSword); - EntryRegistry.registerCategories(categorySanguimancyItems); - categorySanguimancyBlocks = new Category(StatCollector.translateToLocal("guide.Sanguimancy.category.blocks"), RandomUtils.SanguimancyItemStacks.lumpCleaner); - EntryRegistry.registerCategories(categorySanguimancyBlocks); - categorySanguimancyRituals = new Category(StatCollector.translateToLocal("guide.Sanguimancy.category.rituals"), new ItemStack(ModBlocks.blockMasterStone)); - EntryRegistry.registerCategories(categorySanguimancyRituals); - } - - public static void createEntries() { - createLoreEntries(); - createItemEntries(); - createBlockEntries(); - createRitualEntries(); - } - - public static void createItemEntries() { - ArrayList bloodAmuletEntries = new ArrayList(); - bloodAmuletEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.bloodAmulet", RandomUtils.SanguimancyItemStacks.bloodAmulet)); - bloodAmuletEntries.add(new EntryCraftingRecipe(RecipesRegistry.bloodAmulet)); - bloodAmulet = new Entry(bloodAmuletEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.bloodAmulet.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, bloodAmulet); - - ArrayList chunkClaimerEntries = new ArrayList(); - chunkClaimerEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.chunkClaimer", RandomUtils.SanguimancyItemStacks.chunkClaimer)); - chunkClaimerEntries.add(new EntryCraftingRecipe(RecipesRegistry.chunkClaimer)); - chunkClaimer = new Entry(chunkClaimerEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.chunkClaimer.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, chunkClaimer); - - ArrayList craftingItemsEntries = new ArrayList(); - craftingItemsEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.craftingItems")); - craftingItemsEntries.add(new EntryCorruptionRecipe(RecipesRegistry.corruptedDemonShard)); - craftingItemsEntries.add(new EntryBloodCleanserRecipe(RecipesRegistry.imbuedStick)); - craftingItemsEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptedMineral)); - craftingItems = new Entry(craftingItemsEntries, "\u00A79" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.craftingItems"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, craftingItems); - - ArrayList corruptionCatalystEntries = new ArrayList(); - corruptionCatalystEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptionCatalyst.1", RandomUtils.SanguimancyItemStacks.corruptionCatalist)); - corruptionCatalystEntries.add(new EntryAltarRecipe(RecipesRegistry.corruptionCatalyst)); - corruptionCatalystEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptionCatalyst.2")); - for (RecipeCorruptedInfusion r : RecipeCorruptedInfusion.getAllRecipes()) { - corruptionCatalystEntries.add(new EntryCorruptionRecipe(r)); - } - corruptionCatalyst = new Entry(corruptionCatalystEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.corruptionCatalist.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, corruptionCatalyst); - - ArrayList corruptionReaderEntries = new ArrayList(); - corruptionReaderEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptionReader", RandomUtils.SanguimancyItemStacks.corruptionReader)); - corruptionReaderEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptionReader)); - soulCorruptionReader = new Entry(corruptionReaderEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.soulCorruption.reader.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, soulCorruptionReader); - - ArrayList oreLumpEntries = new ArrayList(); - oreLumpEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.oreLump", RandomUtils.SanguimancyItemStacks.oreLump)); - for (RecipeCorruptedInfusion r : RecipesRegistry.oreLumpRecipes) { - oreLumpEntries.add(new EntryCorruptionRecipe(r)); - } - for (RecipeBloodCleanser r : RecipesRegistry.oreLumpCleansing) { - oreLumpEntries.add(new EntryBloodCleanserRecipe(r)); - } - oreLump = new Entry(oreLumpEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.oreLump.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, oreLump); - - ArrayList playerSacrificingStonesEntries = new ArrayList(); - playerSacrificingStonesEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.sacrificingStones.1", RandomUtils.SanguimancyItemStacks.unattunedPlayerSacrificer)); - playerSacrificingStonesEntries.add(new EntryCraftingRecipe(RecipesRegistry.unattunedPlayerSacrificer)); - playerSacrificingStonesEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.sacrificingStones.2", RandomUtils.SanguimancyItemStacks.attunnedPlayerSacrificer)); - playerSacrificingStonesEntries.add(new EntryAltarRecipe(RecipesRegistry.attunedPlayerSacrificer)); - playerSacrificingStonesEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.sacrificingStones.3", RandomUtils.SanguimancyItemStacks.focusedPlayerSacrificer)); - playerSacrificers = new Entry(playerSacrificingStonesEntries, "\u00A79" + StatCollector.translateToLocal("Player Sacrificing Stones"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, playerSacrificers); - - ArrayList wandEntries = new ArrayList(); - wandEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.wand", RandomUtils.SanguimancyItemStacks.wand)); - wandEntries.add(new EntryCraftingRecipe(RecipesRegistry.wand)); - wand = new Entry(wandEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.spellWand.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, wand); - - ArrayList corruptedAxeEntries = new ArrayList(); - corruptedAxeEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptedAxe", RandomUtils.SanguimancyItemStacks.corruptedAxe)); - corruptedAxeEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptedAxe)); - corruptedAxe = new Entry(corruptedAxeEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.corruptedAxe.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, corruptedAxe); - - ArrayList corruptedPickaxeEntries = new ArrayList(); - corruptedPickaxeEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptedPickaxe", RandomUtils.SanguimancyItemStacks.corruptedPickaxe)); - corruptedPickaxeEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptedPickaxe)); - corruptedPickaxe = new Entry(corruptedPickaxeEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.corruptedPickaxe.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, corruptedPickaxe); - - ArrayList corruptedShovelEntries = new ArrayList(); - corruptedShovelEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptedShovel", RandomUtils.SanguimancyItemStacks.corruptedShovel)); - corruptedShovelEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptedShovel)); - corruptedShovel = new Entry(corruptedShovelEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.corruptedShovel.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, corruptedShovel); - - ArrayList corruptedSwordEntries = new ArrayList(); - corruptedSwordEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptedSword", RandomUtils.SanguimancyItemStacks.corruptedSword)); - corruptedSwordEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptedSword)); - corruptedSword = new Entry(corruptedSwordEntries, "\u00A79" + StatCollector.translateToLocal("item.Sanguimancy.corruptedSword.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyItems, items, corruptedSword); - } - - public static void createBlockEntries() { - ArrayList altarDivinerEntries = new ArrayList(); - altarDivinerEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.altarDiviner", RandomUtils.SanguimancyItemStacks.altarDiviner)); - altarDivinerEntries.add(new EntryAltarRecipe(RecipesRegistry.altarDiviner)); - altarDiviner = new Entry(altarDivinerEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.altarDiviner.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, altarDiviner); - - ArrayList altarEmitterEntries = new ArrayList(); - altarEmitterEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.altarEmitter", RandomUtils.SanguimancyItemStacks.altarEmitter)); - altarEmitterEntries.add(new EntryCraftingRecipe(RecipesRegistry.altarEmitter)); - altarEmitter = new Entry(altarEmitterEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.altarEmitter.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, altarEmitter); - - ArrayList bloodInterfaceEntries = new ArrayList(); - bloodInterfaceEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.bloodInterface", RandomUtils.SanguimancyItemStacks.bloodInterface)); - bloodInterfaceEntries.add(new EntryCraftingRecipe(RecipesRegistry.bloodInterface)); - bloodInterface = new Entry(bloodInterfaceEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.interface.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, bloodInterface); - - ArrayList decorativeBlocksEntries = new ArrayList(); - decorativeBlocksEntries.add(new EntryCraftingRecipe(RecipesRegistry.bloodstoneSlab)); - decorativeBlocksEntries.add(new EntryCraftingRecipe(RecipesRegistry.largeBloodstoneSlab)); - decorativeBlocksEntries.add(new EntryCraftingRecipe(RecipesRegistry.bloodstoneStairs)); - decorativeBlocksEntries.add(new EntryCraftingRecipe(RecipesRegistry.largeBloodstoneStairs)); - decorativeBlocks = new Entry(decorativeBlocksEntries, "\u00A73" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.decorativeBlocks"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, decorativeBlocks); - - ArrayList bloodTankEntries = new ArrayList(); - bloodTankEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.bloodTank", RandomUtils.SanguimancyItemStacks.bloodTank)); - bloodTankEntries.add(new EntryCraftingRecipe(RecipesRegistry.bloodTank)); - bloodTank = new Entry(bloodTankEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.bloodTank.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, bloodTank); - - ArrayList corruptionCrystallizerEntries = new ArrayList(); - corruptionCrystallizerEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.corruptionCrystallizer", RandomUtils.SanguimancyItemStacks.corruptionCrystallizer)); - corruptionCrystallizerEntries.add(new EntryCraftingRecipe(RecipesRegistry.corruptionCrystallizer)); - corruptionCrystallizer = new Entry(corruptionCrystallizerEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.corruptionCrystallizer.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, corruptionCrystallizer); - - ArrayList manifestationsEntries = new ArrayList(); - manifestationsEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.itemManifestation", RandomUtils.SanguimancyItemStacks.boundItem)); - manifestationsEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.ritualManifestation", RandomUtils.SanguimancyItemStacks.ritualRepresentation)); - manifestationsEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.soulBranch", RandomUtils.SanguimancyItemStacks.simpleBranch)); - manifestationsEntries.add(new EntryCraftingRecipe(RecipesRegistry.simpleBranch)); - manifestationsEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.simpleKnot", RandomUtils.SanguimancyItemStacks.simpleKnot)); - manifestationsEntries.add(new EntryCraftingRecipe(RecipesRegistry.simpleKnot)); - manifestationsEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.toggledKnot", RandomUtils.SanguimancyItemStacks.toggleKnot)); - manifestationsEntries.add(new EntryCraftingRecipe(RecipesRegistry.toggledKnot)); - manifestations = new Entry(manifestationsEntries, "\u00A73" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.manifestations"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, manifestations); - - ArrayList bloodCleanserEntries = new ArrayList(); - bloodCleanserEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.bloodCleanser", RandomUtils.SanguimancyItemStacks.lumpCleaner)); - bloodCleanserEntries.add(new EntryCraftingRecipe(RecipesRegistry.lumpCleaner)); - for (RecipeBloodCleanser r : RecipeBloodCleanser.getAllRecipes()) { - bloodCleanserEntries.add(new EntryBloodCleanserRecipe(r)); - } - bloodCleanser = new Entry(bloodCleanserEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.lumpCleaner.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, bloodCleanser); - - ArrayList soulTransferrerEntries = new ArrayList(); - soulTransferrerEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.soulTransferrer", RandomUtils.SanguimancyItemStacks.sacrificeTransferrer)); - soulTransferrerEntries.add(new EntryCraftingRecipe(RecipesRegistry.sacrificeTransferrer)); - soulTransferrer = new Entry(soulTransferrerEntries, "\u00A73" + StatCollector.translateToLocal("tile.Sanguimancy.sacrificeTransfer.name"), 1); - EntryRegistry.registerEntry(categorySanguimancyBlocks, blocks, soulTransferrer); - } - - public static void createRitualEntries() { - - ArrayList drillOfTheDeadEntries = new ArrayList(); - drillOfTheDeadEntries.addAll(entriesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.drillOfTheDead"))); - drillOfTheDead = new Entry(drillOfTheDeadEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.drill.dead"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, drillOfTheDead); - - ArrayList timbermanEntries = new ArrayList(); - timbermanEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.timberman")); - timberman = new Entry(timbermanEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.feller"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, timberman); - - ArrayList enlightenmentEntries = new ArrayList(); - enlightenmentEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.enlightenment")); - enlightenment = new Entry(enlightenmentEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.illumination"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, enlightenment); - - ArrayList vulcanosFrigiusEntries = new ArrayList(); - vulcanosFrigiusEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.vulcanosFrigius")); - vulcanosFrigius = new Entry(vulcanosFrigiusEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.vulcanos.frigius"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, vulcanosFrigius); - - ArrayList fillerEntries = new ArrayList(); - fillerEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.filler")); - filler = new Entry(fillerEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.placer"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, filler); - - ArrayList portalEntries = new ArrayList(); - portalEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.portal.1")); - portalEntries.add(new EntryImage(Sanguimancy.texturePath + ":textures/screenshots/PortalExample.png", 854, 480, "portal.picture")); - portalEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.portal.2")); - portal = new Entry(portalEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.portal"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, portal); - - ArrayList greatDeletionEntries = new ArrayList(); - greatDeletionEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.greatDeletion")); - greatDeletion = new Entry(greatDeletionEntries, "\u00A71Ritual: " + StatCollector.translateToLocal("ritual.Sanguimancy.trash"), 1); - EntryRegistry.registerEntry(categorySanguimancyRituals, rituals, greatDeletion); - } - - public static void createLoreEntries() { - sacrificeMagic = new Entry(entriesForLongText("guide.Sanguimancy.entry.sacrificeMagic"), "\u00A74" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.sacrificeMagic"), 1); - EntryRegistry.registerEntry(categorySanguimancyLore, lore, sacrificeMagic); - - soulCorruption = new Entry(entriesForLongText("guide.Sanguimancy.entry.corruption"), "\u00A74" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.corruption"), 1); - EntryRegistry.registerEntry(categorySanguimancyLore, lore, soulCorruption); - - ArrayList protectionEntries = new ArrayList(); - protectionEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.protection.1")); - protectionEntries.add(new EntryImage(Sanguimancy.texturePath + ":textures/screenshots/CompleteCrystallizerMultiblock.png", 854, 480, "protection.picture.1")); - protectionEntries.add(new EntryImage(Sanguimancy.texturePath + ":textures/screenshots/CrystallizerMultiblock.png", 854, 480, "protection.picture.2")); - protectionEntries.add(new EntryImage(Sanguimancy.texturePath + ":textures/screenshots/WaterCrystallizerMultiblock.png", 854, 480, "protection.picture.3")); - protectionEntries.add(new EntryImage(Sanguimancy.texturePath + ":textures/screenshots/LavaCrystallizerMultiblock.png", 854, 480, "protection.picture.4")); - protectionEntries.addAll(entriesForLongText("guide.Sanguimancy.entry.protection.2")); - soulProtection = new Entry(protectionEntries, "\u00A74" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.protection"), 1); - EntryRegistry.registerEntry(categorySanguimancyLore, lore, soulProtection); - - corruptionApplications = new Entry(entriesForLongText("guide.Sanguimancy.entry.applications"), "\u00A74" + StatCollector.translateToLocal("guide.Sanguimancy.entryName.apllications"), 1); - EntryRegistry.registerEntry(categorySanguimancyLore, lore, corruptionApplications); - } - - public static ArrayList entriesForLongText(String string) { - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; - List list = fontRenderer.listFormattedStringToWidth(StatCollector.translateToLocal(string), 2100); - ArrayList entryTextArrayList = new ArrayList(); - for (String s : list) entryTextArrayList.add(new EntryText(s, false)); - return entryTextArrayList; - } - - public static ArrayList entriesForLongText(String string, ItemStack stack) { - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; - List list = fontRenderer.listFormattedStringToWidth(StatCollector.translateToLocal(string), 2100); - ArrayList entryTextArrayList = new ArrayList(); - for (int i = 0; i < list.size(); i++) { - if (i == 0) entryTextArrayList.add(new EntryItemText(stack, list.get(i), false)); - else entryTextArrayList.add(new EntryText(list.get(i), false)); - } - return entryTextArrayList; - } -} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/registry/ItemsRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/ItemsRegistry.java index 5a5a934..ab34dee 100644 --- a/src/main/java/tombenpotter/sanguimancy/registry/ItemsRegistry.java +++ b/src/main/java/tombenpotter/sanguimancy/registry/ItemsRegistry.java @@ -13,7 +13,6 @@ public class ItemsRegistry { public static Item playerSacrificer; public static Item soulCorruptionTest; - public static Item corruptedDemonShard; public static Item corruptionCatalyst; public static Item oreLump; public static Item bloodAmulet; @@ -23,9 +22,10 @@ public class ItemsRegistry { public static Item corruptedPickaxe; public static Item corruptedShovel; public static Item corruptedAxe; - public static Item playerGuide; - public static Item corruptedMineral; - public static Item imbuedStick; + public static Item resource; + public static Item soulTransporter; + public static Item telepositionSigil; + public static Item transpositionSigil; public static void registerItems() { playerSacrificer = new ItemPlayerSacrificer(); @@ -34,9 +34,6 @@ public static void registerItems() { soulCorruptionTest = new ItemSoulCorruptionTest(); GameRegistry.registerItem(soulCorruptionTest, "soulCorruptionTest"); - corruptedDemonShard = new ItemCorruptedDemonShard(); - GameRegistry.registerItem(corruptedDemonShard, "corruptedDemonShard"); - corruptionCatalyst = new ItemCorruptionCatalyst(); GameRegistry.registerItem(corruptionCatalyst, "corruptionCatalist"); @@ -64,13 +61,16 @@ public static void registerItems() { corruptedAxe = new ItemCorruptedAxe(RandomUtils.corruptedMaterial); GameRegistry.registerItem(corruptedAxe, "corruptedAxe"); - playerGuide = new ItemPlayerGuide(); - GameRegistry.registerItem(playerGuide, "playerGuide"); + resource = new ItemResource(); + GameRegistry.registerItem(resource, "resource"); + + soulTransporter = new ItemSoulTransporter(); + GameRegistry.registerItem(soulTransporter, "soulTransporter"); - corruptedMineral = new ItemCorruptedMineral(); - GameRegistry.registerItem(corruptedMineral, "corruptedMineral"); + telepositionSigil = new ItemTelepositionSigil(); + GameRegistry.registerItem(telepositionSigil, "telepositionSigil"); - imbuedStick = new ItemImbuedStick(); - GameRegistry.registerItem(imbuedStick, "imbuedStick"); + transpositionSigil = new ItemTranspositionSigil(); + GameRegistry.registerItem(transpositionSigil, "transpositionSigil"); } } diff --git a/src/main/java/tombenpotter/sanguimancy/registry/MessageRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/MessageRegistry.java new file mode 100644 index 0000000..8e56938 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/registry/MessageRegistry.java @@ -0,0 +1,20 @@ +package tombenpotter.sanguimancy.registry; + +import cpw.mods.fml.common.event.FMLInterModComms; +import net.minecraft.block.Block; +import tombenpotter.sanguimancy.util.RandomUtils; + +public class MessageRegistry { + public static boolean registerMessage(String key, FMLInterModComms.IMCMessage message) { + if (key.equals("transpositionBlacklist")) { + if (message.isStringMessage()) { + Block blacklist = Block.getBlockFromName(message.getStringValue()); + if (blacklist != null) { + RandomUtils.transpositionBlockBlacklist.add(blacklist); + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/registry/RecipesRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/RecipesRegistry.java index d259643..12e76b8 100644 --- a/src/main/java/tombenpotter/sanguimancy/registry/RecipesRegistry.java +++ b/src/main/java/tombenpotter/sanguimancy/registry/RecipesRegistry.java @@ -2,8 +2,10 @@ import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Blocks; @@ -12,11 +14,10 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.oredict.OreDictionary; import tombenpotter.sanguimancy.api.bloodutils.api.registries.RecipeRegistry; -import tombenpotter.sanguimancy.compat.computercraft.PeripheralProvider; import tombenpotter.sanguimancy.recipes.RecipeBloodCleanser; import tombenpotter.sanguimancy.recipes.RecipeCorruptedInfusion; import tombenpotter.sanguimancy.util.RandomUtils; -import tombenpotter.sanguimancy.util.enums.ModList; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; import java.util.ArrayList; @@ -24,56 +25,83 @@ public class RecipesRegistry { public static IRecipe altarEmitter, sacrificeTransferrer, corruptionReader, unattunedPlayerSacrificer, corruptionCrystallizer, bloodTank, lumpCleaner, bloodAmulet, bloodstoneStairs, largeBloodstoneStairs, bloodstoneSlab, largeBloodstoneSlab, chunkClaimer, wand, bloodInterface, simpleBranch, - simpleKnot, toggledKnot, corruptedMineral, corruptedSword, corruptedPickaxe, corruptedShovel, corruptedAxe; - public static AltarRecipe altarDiviner, attunedPlayerSacrificer, corruptionCatalyst; - public static RecipeCorruptedInfusion poisonousPotato, rottenFlesh, crackedStoneBricks, bonemeal, soulSand, corruptedDemonShard, cobblestone, gravel, sand, dirt; - public static RecipeBloodCleanser imbuedStick; + simpleKnot, toggledKnot, corruptedMineral, corruptedSword, corruptedPickaxe, corruptedShovel, corruptedAxe, toggledEtherealBlock, + personalEtherealBlock, soulTransporter, telepositionSigil, transpositionSigil, sanguineShifter, altarManipulator; + public static AltarRecipe altarDiviner, attunedPlayerSacrificer, corruptionCatalyst, imbuedStick, etherealManifestation; + public static RecipeCorruptedInfusion poisonousPotato, rottenFlesh, crackedStoneBricks, bonemeal, soulSand, corruptedDemonShard, cobblestone, gravel, + sand, dirt, corruptedEtherealBlock; public static ArrayList oreLumpRecipes = new ArrayList(); public static ArrayList oreLumpCleansing = new ArrayList(); public static void registerShapedRecipes() { - GameRegistry.addShapelessRecipe(RandomUtils.SanguimancyItemStacks.playerGuide, Items.book, ModItems.divinationSigil); - altarEmitter = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.altarEmitter, "XYX", "XZX", "XXX", 'X', Blocks.redstone_block, 'Y', Blocks.lever, 'Z', ModBlocks.blockAltar); - sacrificeTransferrer = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.sacrificeTransferrer, "XAX", "YZY", "XYX", 'X', new ItemStack(ModItems.demonicSlate), 'A', new ItemStack(ModItems.lavaCrystal), 'Y', new ItemStack(Items.diamond), 'Z', new ItemStack(Blocks.heavy_weighted_pressure_plate)); - corruptionReader = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.corruptionReader, "AXA", "ZYB", "AXA", 'X', Blocks.soul_sand, 'Y', new ItemStack(ModItems.divinationSigil), 'Z', new ItemStack(Items.skull, 1, 1), 'A', Blocks.nether_brick, 'B', Items.ender_eye); - bloodstoneStairs = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.bloodstoneStairs, "X ", "XX ", "XXX", 'X', ModBlocks.bloodStoneBrick); - largeBloodstoneStairs = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.largeBloodstoneStairs, "X ", "XX ", "XXX", 'X', ModBlocks.largeBloodStoneBrick); - bloodstoneSlab = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.bloodstoneSlab, "XXX", 'X', ModBlocks.bloodStoneBrick); - largeBloodstoneSlab = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.largeBloodstoneSlab, "XXX", 'X', ModBlocks.largeBloodStoneBrick); - GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.bloodStoneBrick), "X", "X", 'X', RandomUtils.SanguimancyItemStacks.bloodstoneSlab); - GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.largeBloodStoneBrick), "X", "X", 'X', RandomUtils.SanguimancyItemStacks.largeBloodstoneSlab); - chunkClaimer = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.chunkClaimer, " X ", "XYX", " X ", 'X', ModItems.demonicSlate, 'Y', RandomUtils.SanguimancyItemStacks.corruptedDemonShard); - wand = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.wand, "XYX", "XZX", "XZX", 'X', ModItems.reinforcedSlate, 'Y', ModItems.itemComplexSpellCrystal, 'Z', Items.stick); + altarEmitter = GameRegistry.addShapedRecipe(SanguimancyItemStacks.altarEmitter, "XYX", "XZX", "XXX", 'X', Blocks.redstone_block, 'Y', Blocks.lever, 'Z', ModBlocks.blockAltar); + sacrificeTransferrer = GameRegistry.addShapedRecipe(SanguimancyItemStacks.sacrificeTransferrer, "XAX", "YZY", "XYX", 'X', new ItemStack(ModItems.demonicSlate), 'A', new ItemStack(ModItems.lavaCrystal), 'Y', new ItemStack(Items.diamond), 'Z', new ItemStack(Blocks.heavy_weighted_pressure_plate)); + corruptionReader = GameRegistry.addShapedRecipe(SanguimancyItemStacks.corruptionReader, "AXA", "ZYB", "AXA", 'X', Blocks.soul_sand, 'Y', new ItemStack(ModItems.divinationSigil), 'Z', new ItemStack(Items.skull, 1, 1), 'A', Blocks.nether_brick, 'B', Items.ender_eye); + bloodstoneStairs = GameRegistry.addShapedRecipe(SanguimancyItemStacks.bloodstoneStairs, "X ", "XX ", "XXX", 'X', ModBlocks.bloodStoneBrick); + largeBloodstoneStairs = GameRegistry.addShapedRecipe(SanguimancyItemStacks.largeBloodstoneStairs, "X ", "XX ", "XXX", 'X', ModBlocks.largeBloodStoneBrick); + bloodstoneSlab = GameRegistry.addShapedRecipe(SanguimancyItemStacks.bloodstoneSlab, "XXX", 'X', ModBlocks.bloodStoneBrick); + largeBloodstoneSlab = GameRegistry.addShapedRecipe(SanguimancyItemStacks.largeBloodstoneSlab, "XXX", 'X', ModBlocks.largeBloodStoneBrick); + GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.bloodStoneBrick), "X", "X", 'X', SanguimancyItemStacks.bloodstoneSlab); + GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.largeBloodStoneBrick), "X", "X", 'X', SanguimancyItemStacks.largeBloodstoneSlab); + chunkClaimer = GameRegistry.addShapedRecipe(SanguimancyItemStacks.chunkClaimer, " X ", "XYX", " X ", 'X', ModItems.demonicSlate, 'Y', SanguimancyItemStacks.corruptedDemonShard); + wand = GameRegistry.addShapedRecipe(SanguimancyItemStacks.wand, "XYX", "XZX", "XZX", 'X', ModItems.reinforcedSlate, 'Y', ModItems.itemComplexSpellCrystal, 'Z', Items.stick); simpleBranch = GameRegistry.addShapedRecipe(new ItemStack(BlocksRegistry.simpleBranch, 8), "XYX", "Z Z", "XYX", 'X', ModItems.blankSlate, 'Y', ModItems.reinforcedSlate, 'Z', Blocks.glass); - simpleKnot = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.simpleKnot, " X ", "XYX", " X ", 'X', RandomUtils.SanguimancyItemStacks.simpleBranch, 'Y', ModItems.demonicSlate); - toggledKnot = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.toggleKnot, " X ", "XYX", " X ", 'X', Items.redstone, 'Y', RandomUtils.SanguimancyItemStacks.simpleKnot); - corruptedMineral = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.corruptedMineral, " X ", " Y ", "ZYA", 'X', new ItemStack(Items.skull, 1, 1), 'Y', Blocks.stone, 'Z', Items.diamond, 'A', Items.gold_ingot); - corruptedSword = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.corruptedSword, " X ", " X ", " Y ", 'X', RandomUtils.SanguimancyItemStacks.corruptedMineral, 'Y', RandomUtils.SanguimancyItemStacks.imbuedStick); - corruptedPickaxe = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.corruptedPickaxe, "XXX", " Y ", " Y ", 'X', RandomUtils.SanguimancyItemStacks.corruptedMineral, 'Y', RandomUtils.SanguimancyItemStacks.imbuedStick); - corruptedShovel = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.corruptedShovel, " X ", " Y ", " Y ", 'X', RandomUtils.SanguimancyItemStacks.corruptedMineral, 'Y', RandomUtils.SanguimancyItemStacks.imbuedStick); - corruptedAxe = GameRegistry.addShapedRecipe(RandomUtils.SanguimancyItemStacks.corruptedAxe, "XX ", "XY ", " Y ", 'X', RandomUtils.SanguimancyItemStacks.corruptedMineral, 'Y', RandomUtils.SanguimancyItemStacks.imbuedStick); + simpleKnot = GameRegistry.addShapedRecipe(SanguimancyItemStacks.simpleKnot, " X ", "XYX", " X ", 'X', SanguimancyItemStacks.simpleBranch, 'Y', ModItems.demonicSlate); + toggledKnot = GameRegistry.addShapedRecipe(SanguimancyItemStacks.toggleKnot, " X ", "XYX", " X ", 'X', Items.redstone, 'Y', SanguimancyItemStacks.simpleKnot); + corruptedMineral = GameRegistry.addShapedRecipe(SanguimancyItemStacks.corruptedMineral, " X ", " Y ", "ZYA", 'X', new ItemStack(Items.skull, 1, 1), 'Y', Blocks.stone, 'Z', Items.diamond, 'A', Items.gold_ingot); + corruptedSword = GameRegistry.addShapedRecipe(SanguimancyItemStacks.corruptedSword, " X ", " X ", " Y ", 'X', SanguimancyItemStacks.corruptedMineral, 'Y', SanguimancyItemStacks.imbuedStick); + corruptedPickaxe = GameRegistry.addShapedRecipe(SanguimancyItemStacks.corruptedPickaxe, "XXX", " Y ", " Y ", 'X', SanguimancyItemStacks.corruptedMineral, 'Y', SanguimancyItemStacks.imbuedStick); + corruptedShovel = GameRegistry.addShapedRecipe(SanguimancyItemStacks.corruptedShovel, " X ", " Y ", " Y ", 'X', SanguimancyItemStacks.corruptedMineral, 'Y', SanguimancyItemStacks.imbuedStick); + corruptedAxe = GameRegistry.addShapedRecipe(SanguimancyItemStacks.corruptedAxe, "XX ", "XY ", " Y ", 'X', SanguimancyItemStacks.corruptedMineral, 'Y', SanguimancyItemStacks.imbuedStick); + toggledEtherealBlock = GameRegistry.addShapedRecipe(new ItemStack(BlocksRegistry.etherealBoundBlock, 8), "XXX", "XYX", "XXX", 'Y', Blocks.redstone_block, 'X', SanguimancyItemStacks.etherealBlock); + personalEtherealBlock = GameRegistry.addShapedRecipe(new ItemStack(BlocksRegistry.etherealPersonalBlock, 8), "XXX", "XYX", "XXX", 'X', SanguimancyItemStacks.etherealBoundBlock, 'Y', Items.name_tag); + bloodInterface = GameRegistry.addShapedRecipe(SanguimancyItemStacks.bloodInterface, "XYX", "XZX", "XXX", 'X', Blocks.stone, 'Y', new ItemStack(ModBlocks.bloodRune, 1, 0), 'Z', new ItemStack(Blocks.unpowered_comparator)); } public static void registerAltarRecipes() { - AltarRecipeRegistry.registerAltarRecipe(RandomUtils.SanguimancyItemStacks.altarDiviner, new ItemStack(ModBlocks.blockAltar), 3, 3000, 10, 10, false); + AltarRecipeRegistry.registerAltarRecipe(SanguimancyItemStacks.altarDiviner, new ItemStack(ModBlocks.blockAltar), 3, 3000, 10, 10, false); altarDiviner = RecipeRegistry.getLatestAltarRecipe(); - AltarRecipeRegistry.registerAltarRecipe(RandomUtils.SanguimancyItemStacks.attunnedPlayerSacrificer, RandomUtils.SanguimancyItemStacks.unattunedPlayerSacrificer, 5, 30000, 10, 10, false); + AltarRecipeRegistry.registerAltarRecipe(SanguimancyItemStacks.attunnedPlayerSacrificer, SanguimancyItemStacks.unattunedPlayerSacrificer, 5, 30000, 10, 10, false); attunedPlayerSacrificer = RecipeRegistry.getLatestAltarRecipe(); - AltarRecipeRegistry.registerAltarRecipe(RandomUtils.SanguimancyItemStacks.corruptionCatalist, new ItemStack(Items.skull, 1, 1), 3, 3000, 10, 10, false); + AltarRecipeRegistry.registerAltarRecipe(SanguimancyItemStacks.corruptionCatalist, new ItemStack(Items.skull, 1, 1), 3, 3000, 10, 10, false); corruptionCatalyst = RecipeRegistry.getLatestAltarRecipe(); + AltarRecipeRegistry.registerAltarRecipe(SanguimancyItemStacks.imbuedStick, new ItemStack(Items.stick), 2, 3000, 10, 10, false); + imbuedStick = RecipeRegistry.getLatestAltarRecipe(); + AltarRecipeRegistry.registerAltarRecipe(SanguimancyItemStacks.etherealManifestation, SanguimancyItemStacks.corruptionCatalist, 4, 6000, 10, 10, false); + etherealManifestation = RecipeRegistry.getLatestAltarRecipe(); } public static void registerOrbRecipes() { - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(RandomUtils.SanguimancyItemStacks.unattunedPlayerSacrificer, "XYX", "YOY", "XYX", 'X', new ItemStack(ModItems.demonicSlate), 'Y', new ItemStack(ModBlocks.emptySocket), 'O', new ItemStack(ModItems.archmageBloodOrb))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.unattunedPlayerSacrificer, "XYX", "YOY", "XYX", 'X', new ItemStack(ModItems.demonicSlate), 'Y', new ItemStack(ModBlocks.emptySocket), 'O', new ItemStack(ModItems.archmageBloodOrb))); unattunedPlayerSacrificer = RecipeRegistry.getLatestCraftingRecipe(); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(RandomUtils.SanguimancyItemStacks.corruptionCrystallizer, "XYX", "ZAZ", "XBX", 'X', new ItemStack(Blocks.obsidian), 'Y', new ItemStack(ModBlocks.bloodSocket), 'Z', new ItemStack(Blocks.diamond_block), 'A', RandomUtils.SanguimancyItemStacks.corruptedDemonShard, 'B', new ItemStack(ModItems.archmageBloodOrb))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.corruptionCrystallizer, "XYX", "ZAZ", "XBX", 'X', new ItemStack(Blocks.obsidian), 'Y', new ItemStack(ModBlocks.bloodSocket), 'Z', new ItemStack(Blocks.diamond_block), 'A', SanguimancyItemStacks.corruptedDemonShard, 'B', new ItemStack(ModItems.archmageBloodOrb))); corruptionCrystallizer = RecipeRegistry.getLatestCraftingRecipe(); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(RandomUtils.SanguimancyItemStacks.bloodTank, "XZX", "AYA", "XZX", 'X', new ItemStack(Blocks.stained_glass, 1, 14), 'Y', new ItemStack(ModItems.apprenticeBloodOrb), 'Z', new ItemStack(Blocks.obsidian), 'A', new ItemStack(ModItems.blankSlate))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.bloodTank, "XZX", "AYA", "XZX", 'X', new ItemStack(Blocks.stained_glass, 1, 14), 'Y', new ItemStack(ModItems.apprenticeBloodOrb), 'Z', new ItemStack(Blocks.obsidian), 'A', new ItemStack(ModItems.blankSlate))); bloodTank = RecipeRegistry.getLatestCraftingRecipe(); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(RandomUtils.SanguimancyItemStacks.lumpCleaner, "XXX", "YZY", "ABA", 'X', RandomUtils.SanguimancyItemStacks.oreLump, 'Y', RandomUtils.SanguimancyItemStacks.bloodTank, 'Z', new ItemStack(ModItems.masterBloodOrb), 'A', new ItemStack(Blocks.iron_block), 'B', new ItemStack(Blocks.diamond_block))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.lumpCleaner, "XXX", "YZY", "ABA", 'X', SanguimancyItemStacks.oreLump, 'Y', SanguimancyItemStacks.bloodTank, 'Z', new ItemStack(ModItems.masterBloodOrb), 'A', new ItemStack(Blocks.iron_block), 'B', new ItemStack(Blocks.diamond_block))); lumpCleaner = RecipeRegistry.getLatestCraftingRecipe(); - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(RandomUtils.SanguimancyItemStacks.bloodAmulet, "XYX", "ZAZ", "BCB", 'X', new ItemStack(Items.string), 'Y', new ItemStack(Items.bucket), 'Z', new ItemStack(ModItems.demonicSlate), 'A', new ItemStack(Items.clock), 'B', RandomUtils.SanguimancyItemStacks.bloodTank, 'C', new ItemStack(ModItems.magicianBloodOrb))); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.bloodAmulet, "XYX", "ZAZ", "BCB", 'X', new ItemStack(Items.string), 'Y', new ItemStack(Items.bucket), 'Z', new ItemStack(ModItems.demonicSlate), 'A', new ItemStack(Items.clock), 'B', SanguimancyItemStacks.bloodTank, 'C', new ItemStack(ModItems.magicianBloodOrb))); bloodAmulet = RecipeRegistry.getLatestCraftingRecipe(); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.soulTransporter, "XYZ", "COC", "ACA", 'X', ModItems.divinationSigil, 'Y', ModItems.demonicSlate, 'Z', ModItems.itemSigilOfEnderSeverance, 'C', Blocks.soul_sand, 'A', ModBlocks.bloodSocket, 'O', new ItemStack(ModItems.apprenticeBloodOrb))); + soulTransporter = RecipeRegistry.getLatestCraftingRecipe(); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.telepositionSigil, "XSX", "YOY", "ZAZ", 'X', Items.ender_eye, 'S', ModItems.itemSigilOfEnderSeverance, 'Y', Items.ender_pearl, 'O', ModItems.magicianBloodOrb, 'Z', Blocks.end_stone, 'A', Blocks.obsidian)); + telepositionSigil = RecipeRegistry.getLatestCraftingRecipe(); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.transpositionSigil, "DAD", "MOM", "BOB", 'O', ModItems.masterBloodOrb, 'D', ModItems.aether, 'A', Items.diamond, 'M', SanguimancyItemStacks.corruptedMineral, 'B', ModItems.magicales)); + transpositionSigil = RecipeRegistry.getLatestCraftingRecipe(); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.sanguineShifter, "A", "O", "L", 'A', SanguimancyItemStacks.altarManipulator, 'O', ModItems.masterBloodOrb, 'L', Blocks.hopper)); + sanguineShifter = RecipeRegistry.getLatestCraftingRecipe(); + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(SanguimancyItemStacks.altarManipulator, "DED", "EOE", "DED", 'D', SanguimancyItemStacks.altarDiviner, 'E', SanguimancyItemStacks.altarEmitter, 'O', ModItems.magicianBloodOrb)); + altarManipulator = RecipeRegistry.getLatestCraftingRecipe(); + } + + public static void registerAlchemyRecipes() { + AlchemyRecipeRegistry.registerRecipe(new ItemStack(BlocksRegistry.etherealBlock, 32), 10, new ItemStack[]{new ItemStack(ModItems.baseAlchemyItems, 1, 3), new ItemStack(ModItems.aether), new ItemStack(ModItems.magicales), new ItemStack(ModItems.terrae), new ItemStack(ModItems.crystallos)}, 4); + } + + public static void registerBindingRecipes() { + BindingRegistry.registerRecipe(SanguimancyItemStacks.etherealBoundBlock, SanguimancyItemStacks.etherealBlock); + BindingRegistry.registerRecipe(SanguimancyItemStacks.etherealBoundCorruptedBlock, SanguimancyItemStacks.etherealCorruptedBlock); + BindingRegistry.registerRecipe(SanguimancyItemStacks.etherealBoundToggledBlock, SanguimancyItemStacks.etherealToggledBlock); } public static void registerCustomModRecipes() { @@ -82,7 +110,7 @@ public static void registerCustomModRecipes() { crackedStoneBricks = RecipeCorruptedInfusion.addRecipe(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stonebrick, 1, 0), 5, 50, false); bonemeal = RecipeCorruptedInfusion.addRecipe(new ItemStack(Items.dye, 6, 15), new ItemStack(Items.bone), 10, 70, false); soulSand = RecipeCorruptedInfusion.addRecipe(new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.sand), 10, 100, false); - corruptedDemonShard = RecipeCorruptedInfusion.addRecipe(RandomUtils.SanguimancyItemStacks.corruptedDemonShard, new ItemStack(ModItems.demonBloodShard), 50, 500, false); + corruptedDemonShard = RecipeCorruptedInfusion.addRecipe(SanguimancyItemStacks.corruptedDemonShard, new ItemStack(ModItems.demonBloodShard), 50, 500, false); cobblestone = RecipeCorruptedInfusion.addRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.stone), 5, 50, false); gravel = RecipeCorruptedInfusion.addRecipe(new ItemStack(Blocks.gravel), new ItemStack(Blocks.cobblestone), 5, 50, false); sand = RecipeCorruptedInfusion.addRecipe(new ItemStack(Blocks.sand), new ItemStack(Blocks.gravel), 5, 50, false); @@ -96,12 +124,14 @@ public static void registerCustomModRecipes() { ItemStack oreLump = new ItemStack(ItemsRegistry.oreLump, 2, 0); RandomUtils.checkAndSetCompound(oreLump); oreLump.stackTagCompound.setString("ore", output); - oreLumpRecipes.add(RecipeCorruptedInfusion.addRecipe(oreLump, OreDictionary.getOres(ore).get(i), 20, 200, false)); + oreLumpRecipes.add(RecipeCorruptedInfusion.addRecipe(oreLump, OreDictionary.getOres(ore).get(i), 20, 150, false)); } ItemStack input = new ItemStack(ItemsRegistry.oreLump, 1, 0); RandomUtils.checkAndSetCompound(input); input.stackTagCompound.setString("ore", output); oreLumpCleansing.add(RecipeBloodCleanser.addRecipe(input, OreDictionary.getOres("ingot" + output).get(0))); + //That doesn't work + //AltarRecipeRegistry.registerNBTAltarRecipe(OreDictionary.getOres("ingot" + output).get(0), input, 2, 1000, 10, 10, false); } } } @@ -112,19 +142,7 @@ public static void registerCustomModRecipes() { } } RecipeBloodCleanser.addRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.netherrack)); - imbuedStick = RecipeBloodCleanser.addRecipe(new ItemStack(Items.stick), RandomUtils.SanguimancyItemStacks.imbuedStick); - ItemStack stackInterface = new ItemStack(BlocksRegistry.bloodInterface); - ItemStack stackRune = new ItemStack(ModBlocks.bloodRune, 1, 0); - if (ModList.computercraft.isLoaded()) { - PeripheralProvider.register(); - ItemStack modem = GameRegistry.findItemStack(ModList.Names.COMPUTERCRAFT, "CC-Cable", 1); - modem.setItemDamage(1); - bloodInterface = GameRegistry.addShapedRecipe(stackInterface.copy(), "XYX", "XZX", "XXX", 'X', Blocks.stone, 'Y', stackRune, 'Z', modem); - } - if (ModList.opencomputers.isLoaded()) - bloodInterface = GameRegistry.addShapedRecipe(stackInterface.copy(), "XYX", "XZX", "XXX", 'X', Blocks.stone, 'Y', stackRune, 'Z', new ItemStack(GameRegistry.findBlock(ModList.Names.OPENCOMPUTERS, "adapter"))); - if (!(ModList.opencomputers.isLoaded() || ModList.computercraft.isLoaded())) - bloodInterface = GameRegistry.addShapedRecipe(stackInterface.copy(), "XYX", "XZX", "XXX", 'X', Blocks.stone, 'Y', stackRune, 'Z', new ItemStack(Blocks.unpowered_comparator)); + corruptedEtherealBlock = RecipeCorruptedInfusion.addRecipe(SanguimancyItemStacks.etherealCorruptedBlock, SanguimancyItemStacks.etherealBlock, 50, 100, false); } } \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/registry/RitualRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/RitualRegistry.java index 9ef96d2..a8c8a5a 100644 --- a/src/main/java/tombenpotter/sanguimancy/registry/RitualRegistry.java +++ b/src/main/java/tombenpotter/sanguimancy/registry/RitualRegistry.java @@ -8,13 +8,15 @@ import tombenpotter.sanguimancy.rituals.*; import tombenpotter.sanguimancy.util.ConfigHandler; +import java.util.ArrayList; + public class RitualRegistry { public static void registerRituals() { if (ConfigHandler.enableDrillOfTheDead) Rituals.registerRitual("drillOfTheDeadRitual", 2, 50000, new RitualEffectDrillOfTheDead(), StatCollector.translateToLocal("ritual.Sanguimancy.drill.dead")); if (ConfigHandler.enableVulcanosFrigius) - Rituals.registerRitual("vulcanosFrigiusRitual", 1, 250, new RitualEffectObsidian(), StatCollector.translateToLocal("ritual.Sanguimancy.vulcanos.frigius")); + Rituals.registerRitual("vulcanosFrigiusRitual", 1, 250, new RitualEffectCobble(), StatCollector.translateToLocal("ritual.Sanguimancy.vulcanos.frigius")); if (ConfigHandler.enableTrash) Rituals.registerRitual("trashRitual", 1, 50, new RitualEffectTrash(), StatCollector.translateToLocal("ritual.Sanguimancy.trash")); if (ConfigHandler.enableIllumination) @@ -31,6 +33,7 @@ public static void registerRituals() { } public static void addToWoSBlacklist() { + if (AlchemicalWizardry.wellBlacklist == null) AlchemicalWizardry.wellBlacklist = new ArrayList(); AlchemicalWizardry.wellBlacklist.add(EntityPlayerPointer.class); AlchemicalWizardry.wellBlacklist.add(EntityChickenMinion.class); } diff --git a/src/main/java/tombenpotter/sanguimancy/registry/SanguimancyGuide.java b/src/main/java/tombenpotter/sanguimancy/registry/SanguimancyGuide.java new file mode 100644 index 0000000..85763df --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/registry/SanguimancyGuide.java @@ -0,0 +1,303 @@ +package tombenpotter.sanguimancy.registry; + + +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.ModItems; +import amerifrance.guideapi.api.GuideRegistry; +import amerifrance.guideapi.api.abstraction.CategoryAbstract; +import amerifrance.guideapi.api.abstraction.EntryAbstract; +import amerifrance.guideapi.api.abstraction.IPage; +import amerifrance.guideapi.api.base.Book; +import amerifrance.guideapi.api.util.PageHelper; +import amerifrance.guideapi.categories.CategoryItemStack; +import amerifrance.guideapi.entries.EntryUniText; +import amerifrance.guideapi.pages.PageIRecipe; +import amerifrance.guideapi.pages.PageUnlocImage; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraftforge.oredict.ShapedOreRecipe; +import tombenpotter.sanguimancy.Sanguimancy; +import tombenpotter.sanguimancy.api.guide.PageAltarRecipe; +import tombenpotter.sanguimancy.api.guide.PageCorruptionRecipe; +import tombenpotter.sanguimancy.api.guide.PageOrbRecipe; +import tombenpotter.sanguimancy.recipes.RecipeCorruptedInfusion; +import tombenpotter.sanguimancy.util.ConfigHandler; +import tombenpotter.sanguimancy.util.SanguimancyItemStacks; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +public class SanguimancyGuide { + + public static Book sanguimancyGuide; + public static List categories = new ArrayList(); + + public static void registerGuide() { + createLoreEntries(); + createItemEntries(); + createRitualEntries(); + createBlockEntries(); + sanguimancyGuide = new Book(categories, "guide.Sanguimancy.book.title", "guide.Sanguimancy.welcomeMessage", "guide.Sanguimancy.book.name", new Color(190, 10, 0)); + GuideRegistry.registerBook(sanguimancyGuide); + GameRegistry.addRecipe(new ShapedOreRecipe(GuideRegistry.getItemStackForBook(sanguimancyGuide), "X", "Y", "O", 'X', "dyeBlack", 'O', ModItems.weakBloodOrb, 'Y', Items.writable_book)); + } + + public static void createLoreEntries() { + List entries = new ArrayList(); + + ArrayList sacrificeMagicPages = new ArrayList(); + sacrificeMagicPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.sacrificeMagic"))); + entries.add(new EntryUniText(sacrificeMagicPages, "guide.Sanguimancy.entryName.sacrificeMagic")); + + ArrayList soulCorruptionPages = new ArrayList(); + soulCorruptionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruption"))); + entries.add(new EntryUniText(soulCorruptionPages, "guide.Sanguimancy.entryName.corruption")); + + ArrayList protectionPages = new ArrayList(); + protectionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.protection.1"))); + protectionPages.add(new PageUnlocImage("protection.picture.1", new ResourceLocation(Sanguimancy.texturePath + ":textures/screenshots/CompleteCrystallizerMultiblock.png"), true)); + protectionPages.add(new PageUnlocImage("protection.picture.2", new ResourceLocation(Sanguimancy.texturePath + ":textures/screenshots/CrystallizerMultiblock.png"), true)); + protectionPages.add(new PageUnlocImage("protection.picture.3", new ResourceLocation(Sanguimancy.texturePath + ":textures/screenshots/WaterCrystallizerMultiblock.png"), true)); + protectionPages.add(new PageUnlocImage("protection.picture.4", new ResourceLocation(Sanguimancy.texturePath + ":textures/screenshots/LavaCrystallizerMultiblock.png"), true)); + protectionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.protection.2"))); + entries.add(new EntryUniText(protectionPages, "guide.Sanguimancy.entryName.protection")); + + ArrayList corruptionApplicationsPages = new ArrayList(); + corruptionApplicationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.applications"))); + entries.add(new EntryUniText(corruptionApplicationsPages, "guide.Sanguimancy.entryName.apllications")); + + categories.add(new CategoryItemStack(entries, "guide.Sanguimancy.category.lore", SanguimancyItemStacks.attunnedPlayerSacrificer)); + } + + public static void createItemEntries() { + List entries = new ArrayList(); + + ArrayList bloodAmuletPages = new ArrayList(); + bloodAmuletPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.bloodAmulet"), SanguimancyItemStacks.bloodAmulet)); + bloodAmuletPages.add(new PageOrbRecipe(RecipesRegistry.bloodAmulet)); + entries.add(new EntryUniText(bloodAmuletPages, "item.Sanguimancy.bloodAmulet.name")); + + ArrayList chunkClaimerPages = new ArrayList(); + chunkClaimerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.chunkClaimer"), SanguimancyItemStacks.chunkClaimer)); + chunkClaimerPages.add(new PageIRecipe(RecipesRegistry.chunkClaimer)); + entries.add(new EntryUniText(chunkClaimerPages, "item.Sanguimancy.chunkClaimer.name")); + + ArrayList craftingItemsPages = new ArrayList(); + craftingItemsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.craftingItems"))); + craftingItemsPages.add(new PageCorruptionRecipe(RecipesRegistry.corruptedDemonShard)); + craftingItemsPages.add(new PageAltarRecipe(RecipesRegistry.imbuedStick)); + craftingItemsPages.add(new PageIRecipe(RecipesRegistry.corruptedMineral)); + entries.add(new EntryUniText(craftingItemsPages, "guide.Sanguimancy.entryName.craftingItems")); + + ArrayList corruptionCatalystPages = new ArrayList(); + corruptionCatalystPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptionCatalyst.1"), SanguimancyItemStacks.corruptionCatalist)); + corruptionCatalystPages.add(new PageAltarRecipe(RecipesRegistry.corruptionCatalyst)); + corruptionCatalystPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptionCatalyst.2"))); + for (RecipeCorruptedInfusion r : RecipeCorruptedInfusion.getAllRecipes()) { + corruptionCatalystPages.add(new PageCorruptionRecipe(r)); + } + entries.add(new EntryUniText(corruptionCatalystPages, "item.Sanguimancy.corruptionCatalist.name")); + + ArrayList corruptionReaderPages = new ArrayList(); + corruptionReaderPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptionReader"), SanguimancyItemStacks.corruptionReader)); + corruptionReaderPages.add(new PageIRecipe(RecipesRegistry.corruptionReader)); + entries.add(new EntryUniText(corruptionReaderPages, "item.Sanguimancy.soulCorruption.reader.name")); + + ArrayList oreLumpPages = new ArrayList(); + oreLumpPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.oreLump"), SanguimancyItemStacks.oreLump)); + for (RecipeCorruptedInfusion r : RecipesRegistry.oreLumpRecipes) { + oreLumpPages.add(new PageCorruptionRecipe(r)); + } + //for (RecipeBloodCleanser r : RecipesRegistry.oreLumpCleansing) { + // oreLumpPages.add(new EntryBloodCleanserRecipe(r)); + // } + entries.add(new EntryUniText(oreLumpPages, "info.Sanguimancy.tooltip.any")); + + ArrayList playerSacrificingStonesPages = new ArrayList(); + playerSacrificingStonesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.sacrificingStones.1"), SanguimancyItemStacks.unattunedPlayerSacrificer)); + playerSacrificingStonesPages.add(new PageOrbRecipe(RecipesRegistry.unattunedPlayerSacrificer)); + playerSacrificingStonesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.sacrificingStones.2"), SanguimancyItemStacks.attunnedPlayerSacrificer)); + playerSacrificingStonesPages.add(new PageAltarRecipe(RecipesRegistry.attunedPlayerSacrificer)); + playerSacrificingStonesPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.sacrificingStones.3"), SanguimancyItemStacks.focusedPlayerSacrificer)); + entries.add(new EntryUniText(playerSacrificingStonesPages, "Player Sacrificing Stones")); + + ArrayList wandPages = new ArrayList(); + wandPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.wand"), SanguimancyItemStacks.wand)); + wandPages.add(new PageIRecipe(RecipesRegistry.wand)); + entries.add(new EntryUniText(wandPages, "item.Sanguimancy.spellWand.name")); + + ArrayList corruptedAxePages = new ArrayList(); + corruptedAxePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptedAxe"), SanguimancyItemStacks.corruptedAxe)); + corruptedAxePages.add(new PageIRecipe(RecipesRegistry.corruptedAxe)); + entries.add(new EntryUniText(corruptedAxePages, "item.Sanguimancy.corruptedAxe.name")); + + ArrayList corruptedPickaxePages = new ArrayList(); + corruptedPickaxePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptedPickaxe"), SanguimancyItemStacks.corruptedPickaxe)); + corruptedPickaxePages.add(new PageIRecipe(RecipesRegistry.corruptedPickaxe)); + entries.add(new EntryUniText(corruptedPickaxePages, "item.Sanguimancy.corruptedPickaxe.name")); + + ArrayList corruptedShovelPages = new ArrayList(); + corruptedShovelPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptedShovel"), SanguimancyItemStacks.corruptedShovel)); + corruptedShovelPages.add(new PageIRecipe(RecipesRegistry.corruptedShovel)); + entries.add(new EntryUniText(corruptedShovelPages, "item.Sanguimancy.corruptedShovel.name")); + + ArrayList corruptedSwordPages = new ArrayList(); + corruptedSwordPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptedSword"), SanguimancyItemStacks.corruptedSword)); + corruptedSwordPages.add(new PageIRecipe(RecipesRegistry.corruptedSword)); + entries.add(new EntryUniText(corruptedSwordPages, "item.Sanguimancy.corruptedSword.name")); + + ArrayList soulTranporterPages = new ArrayList(); + soulTranporterPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.soulTransporter"), SanguimancyItemStacks.soulTransporter)); + soulTranporterPages.add(new PageOrbRecipe(RecipesRegistry.soulTransporter)); + entries.add(new EntryUniText(soulTranporterPages, "item.Sanguimancy.soulTransporter.name")); + + ArrayList telepositionSigilIPages = new ArrayList(); + telepositionSigilIPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.telepositionSigil"), SanguimancyItemStacks.telepositionSigil)); + telepositionSigilIPages.add(new PageOrbRecipe(RecipesRegistry.telepositionSigil)); + entries.add(new EntryUniText(telepositionSigilIPages, "item.Sanguimancy.telepositionSigil.name")); + + ArrayList transpositionSigilPages = new ArrayList(); + transpositionSigilPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.transpositionSigil"), SanguimancyItemStacks.transpositionSigil)); + transpositionSigilPages.add(new PageOrbRecipe(RecipesRegistry.transpositionSigil)); + entries.add(new EntryUniText(transpositionSigilPages, "item.Sanguimancy.transpositionSigil.name")); + + categories.add(new CategoryItemStack(entries, "guide.Sanguimancy.category.items", SanguimancyItemStacks.corruptedSword)); + } + + public static void createRitualEntries() { + List entries = new ArrayList(); + + if (ConfigHandler.enableDrillOfTheDead) { + ArrayList drillOfTheDeadPages = new ArrayList(); + drillOfTheDeadPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.drillOfTheDead"))); + entries.add(new EntryUniText(drillOfTheDeadPages, "ritual.Sanguimancy.drill.dead")); + } + + if (ConfigHandler.enableFelling) { + ArrayList timbermanPages = new ArrayList(); + timbermanPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.timberman"))); + entries.add(new EntryUniText(timbermanPages, "ritual.Sanguimancy.feller")); + ; + } + + if (ConfigHandler.enableIllumination) { + ArrayList enlightenmentPages = new ArrayList(); + enlightenmentPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.enlightenment"))); + entries.add(new EntryUniText(enlightenmentPages, "ritual.Sanguimancy.illumination")); + } + + if (ConfigHandler.enableVulcanosFrigius) { + ArrayList vulcanosFrigiusPages = new ArrayList(); + vulcanosFrigiusPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.vulcanosFrigius"))); + entries.add(new EntryUniText(vulcanosFrigiusPages, "ritual.Sanguimancy.vulcanos.frigius")); + } + + if (ConfigHandler.enablePlacer) { + ArrayList fillerPages = new ArrayList(); + fillerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.filler"))); + entries.add(new EntryUniText(fillerPages, "ritual.Sanguimancy.placer")); + } + + if (ConfigHandler.enablePortal) { + ArrayList portalPages = new ArrayList(); + portalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.portal.1"))); + portalPages.add(new PageUnlocImage("guide.Sanguimancy.entry.portal.picture", new ResourceLocation(Sanguimancy.texturePath + ":textures/screenshots/PortalExample.png"), true)); + portalPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.portal.2"))); + entries.add(new EntryUniText(portalPages, "ritual.Sanguimancy.portal")); + } + + if (ConfigHandler.enableTrash) { + ArrayList greatDeletionPages = new ArrayList(); + greatDeletionPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.greatDeletion"))); + entries.add(new EntryUniText(greatDeletionPages, "ritual.Sanguimancy.trash")); + } + + categories.add(new CategoryItemStack(entries, "guide.Sanguimancy.category.rituals", new ItemStack(ModBlocks.blockMasterStone))); + } + + public static void createBlockEntries() { + List entries = new ArrayList(); + + ArrayList altarEmitterPages = new ArrayList(); + altarEmitterPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.altarEmitter"), SanguimancyItemStacks.altarEmitter)); + altarEmitterPages.add(new PageIRecipe(RecipesRegistry.altarEmitter)); + entries.add(new EntryUniText(altarEmitterPages, "tile.Sanguimancy.altarEmitter.name")); + + ArrayList altarDivinerPages = new ArrayList(); + altarDivinerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.altarDiviner"), SanguimancyItemStacks.altarDiviner)); + altarDivinerPages.add(new PageAltarRecipe(RecipesRegistry.altarDiviner)); + entries.add(new EntryUniText(altarDivinerPages, "tile.Sanguimancy.altarDiviner.name")); + + ArrayList altarManipulatorPages = new ArrayList(); + altarManipulatorPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.altarManipulator"), SanguimancyItemStacks.altarManipulator)); + altarManipulatorPages.add(new PageOrbRecipe(RecipesRegistry.altarManipulator)); + altarManipulatorPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.sanguineShifter"), SanguimancyItemStacks.sanguineShifter)); + altarManipulatorPages.add(new PageOrbRecipe(RecipesRegistry.sanguineShifter)); + entries.add(new EntryUniText(altarManipulatorPages, "tile.Sanguimancy.altarManipulator.name")); + + ArrayList bloodInterfacePages = new ArrayList(); + bloodInterfacePages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.bloodInterface"), SanguimancyItemStacks.bloodInterface)); + bloodInterfacePages.add(new PageIRecipe(RecipesRegistry.bloodInterface)); + entries.add(new EntryUniText(bloodInterfacePages, "tile.Sanguimancy.interface.name")); + + ArrayList decorativeBlocksPages = new ArrayList(); + decorativeBlocksPages.add(new PageIRecipe(RecipesRegistry.bloodstoneSlab)); + decorativeBlocksPages.add(new PageIRecipe(RecipesRegistry.largeBloodstoneSlab)); + decorativeBlocksPages.add(new PageIRecipe(RecipesRegistry.bloodstoneStairs)); + decorativeBlocksPages.add(new PageIRecipe(RecipesRegistry.largeBloodstoneStairs)); + entries.add(new EntryUniText(decorativeBlocksPages, "guide.Sanguimancy.entryName.decorativeBlocks")); + + ArrayList bloodTankPages = new ArrayList(); + bloodTankPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.bloodTank"), SanguimancyItemStacks.bloodTank)); + bloodTankPages.add(new PageOrbRecipe(RecipesRegistry.bloodTank)); + entries.add(new EntryUniText(bloodTankPages, "tile.Sanguimancy.bloodTank.name")); + + ArrayList corruptionCrystallizerPages = new ArrayList(); + corruptionCrystallizerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptionCrystallizer"), SanguimancyItemStacks.corruptionCrystallizer)); + corruptionCrystallizerPages.add(new PageOrbRecipe(RecipesRegistry.corruptionCrystallizer)); + entries.add(new EntryUniText(corruptionCrystallizerPages, "tile.Sanguimancy.corruptionCrystallizer.name")); + + ArrayList manifestationsPages = new ArrayList(); + manifestationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.itemManifestation"), SanguimancyItemStacks.boundItem)); + manifestationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.ritualManifestation"), SanguimancyItemStacks.ritualRepresentation)); + manifestationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.etherealManifestation"), SanguimancyItemStacks.etherealManifestation)); + manifestationsPages.add(new PageAltarRecipe(RecipesRegistry.etherealManifestation)); + manifestationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.soulBranch"), SanguimancyItemStacks.simpleBranch)); + manifestationsPages.add(new PageIRecipe(RecipesRegistry.simpleBranch)); + manifestationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.simpleKnot"), SanguimancyItemStacks.simpleKnot)); + manifestationsPages.add(new PageIRecipe(RecipesRegistry.simpleKnot)); + manifestationsPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.toggledKnot"), SanguimancyItemStacks.toggleKnot)); + manifestationsPages.add(new PageIRecipe(RecipesRegistry.toggledKnot)); + entries.add(new EntryUniText(manifestationsPages, "guide.Sanguimancy.entryName.manifestations")); + + ArrayList bloodCleanserPages = new ArrayList(); + bloodCleanserPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.bloodCleanser"), SanguimancyItemStacks.lumpCleaner)); + bloodCleanserPages.add(new PageOrbRecipe(RecipesRegistry.lumpCleaner)); + //for (RecipeBloodCleanser r : RecipeBloodCleanser.getAllRecipes()) { + // bloodCleanserPages.add(new EntryBloodCleanserRecipe(r)); + //} + entries.add(new EntryUniText(bloodCleanserPages, "tile.Sanguimancy.lumpCleaner.name")); + + ArrayList soulTransferrerPages = new ArrayList(); + soulTransferrerPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.soulTransferrer"), SanguimancyItemStacks.sacrificeTransferrer)); + soulTransferrerPages.add(new PageIRecipe(RecipesRegistry.sacrificeTransferrer)); + entries.add(new EntryUniText(soulTransferrerPages, "tile.Sanguimancy.sacrificeTransfer.name")); + + ArrayList etherealBlocksPages = new ArrayList(); + etherealBlocksPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.etherealBlock"), SanguimancyItemStacks.etherealBlock)); + etherealBlocksPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.corruptedEtherealBlock"), SanguimancyItemStacks.etherealCorruptedBlock)); + etherealBlocksPages.add(new PageCorruptionRecipe(RecipesRegistry.corruptedEtherealBlock)); + etherealBlocksPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.toggledEtherealBlock"), SanguimancyItemStacks.etherealToggledBlock)); + etherealBlocksPages.add(new PageIRecipe(RecipesRegistry.toggledEtherealBlock)); + etherealBlocksPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.boundEtherealBlocks"))); + etherealBlocksPages.addAll(PageHelper.pagesForLongText(StatCollector.translateToLocal("guide.Sanguimancy.entry.personalEtherealBlock"), SanguimancyItemStacks.personalEtherealBlock)); + etherealBlocksPages.add(new PageIRecipe(RecipesRegistry.personalEtherealBlock)); + entries.add(new EntryUniText(etherealBlocksPages, "guide.Sanguimancy.entryName.etherealBlocks")); + + categories.add(new CategoryItemStack(entries, "guide.Sanguimancy.category.blocks", SanguimancyItemStacks.lumpCleaner)); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/registry/TileRegistry.java b/src/main/java/tombenpotter/sanguimancy/registry/TileRegistry.java index d93dc03..56e1208 100644 --- a/src/main/java/tombenpotter/sanguimancy/registry/TileRegistry.java +++ b/src/main/java/tombenpotter/sanguimancy/registry/TileRegistry.java @@ -1,6 +1,7 @@ package tombenpotter.sanguimancy.registry; import cpw.mods.fml.common.registry.GameRegistry; +import tombenpotter.sanguimancy.api.tile.TileCamouflage; import tombenpotter.sanguimancy.tile.*; public class TileRegistry { @@ -20,5 +21,8 @@ public static void registerTEs() { GameRegistry.registerTileEntity(TileSimpleSNBranch.class, "TileSimpleSNBranch"); GameRegistry.registerTileEntity(TileToggleSNKnot.class, "TileToggleSNKnot"); GameRegistry.registerTileEntity(TileRitualSNPart.class, "TileRitualSNPart"); + GameRegistry.registerTileEntity(TileCamouflage.class, "TileCamouflage"); + GameRegistry.registerTileEntity(TileCamouflageBound.class, "TileCamouflageBound"); + GameRegistry.registerTileEntity(TileAltarManipulator.class, "TileAltarManipulator"); } } diff --git a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectObsidian.java b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectCobble.java similarity index 51% rename from src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectObsidian.java rename to src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectCobble.java index e65118c..3fea87d 100644 --- a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectObsidian.java +++ b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectCobble.java @@ -1,5 +1,6 @@ package tombenpotter.sanguimancy.rituals; +import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; @@ -12,7 +13,9 @@ import java.util.ArrayList; import java.util.List; -public class RitualEffectObsidian extends RitualEffect { +public class RitualEffectCobble extends RitualEffect { + + public int reagentDrain = 5; @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -32,28 +35,53 @@ public void performEffect(IMasterRitualStone ritualStone) { for (int i = 0; i < 10; i++) { SpellHelper.sendIndexedParticleToAllAround(world, x, y, z, 20, world.provider.dimensionId, 3, x, y, z); } + boolean hasTenebrae = this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, reagentDrain, false); if (world.isAirBlock(x + 1, y + 1, z)) { - world.setBlock(x + 1, y + 1, z, Blocks.obsidian, 0, 3); - SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + if (hasTenebrae) { + world.setBlock(x + 1, y + 1, z, Blocks.obsidian, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh() * 10); + this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, reagentDrain, true); + } else { + world.setBlock(x + 1, y + 1, z, Blocks.cobblestone, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + } } if (world.isAirBlock(x - 1, y + 1, z)) { - world.setBlock(x - 1, y + 1, z, Blocks.obsidian, 0, 3); - SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + if (hasTenebrae) { + world.setBlock(x - 1, y + 1, z, Blocks.obsidian, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh() * 10); + this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, reagentDrain, true); + } else { + world.setBlock(x - 1, y + 1, z, Blocks.cobblestone, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + } } if (world.isAirBlock(x, y + 1, z + 1)) { - world.setBlock(x, y + 1, z + 1, Blocks.obsidian, 0, 3); - SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + if (hasTenebrae) { + world.setBlock(x, y + 1, z + 1, Blocks.obsidian, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh() * 10); + this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, reagentDrain, true); + } else { + world.setBlock(x, y + 1, z + 1, Blocks.cobblestone, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + } } if (world.isAirBlock(x, y + 1, z - 1)) { - world.setBlock(x, y + 1, z - 1, Blocks.obsidian, 0, 3); - SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + if (hasTenebrae) { + world.setBlock(x, y + 1, z - 1, Blocks.obsidian, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh() * 10); + this.canDrainReagent(ritualStone, ReagentRegistry.tenebraeReagent, reagentDrain, true); + } else { + world.setBlock(x, y + 1, z - 1, Blocks.cobblestone, 0, 3); + SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); + } } } } @Override public int getCostPerRefresh() { - return 250; + return 10; } @Override diff --git a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectFelling.java b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectFelling.java index 511fba5..561b901 100644 --- a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectFelling.java +++ b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectFelling.java @@ -7,15 +7,11 @@ import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.Int3; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import tombenpotter.sanguimancy.client.particle.EntityColoredFlameFX; import tombenpotter.sanguimancy.util.RitualUtils; import java.util.ArrayList; @@ -94,7 +90,6 @@ public void performEffect(IMasterRitualStone ritualStone) { RitualUtils.placeInInventory(block, world, int3.xCoord, int3.yCoord, int3.zCoord, tileEntity); } world.setBlockToAir(int3.xCoord, int3.yCoord, int3.zCoord); - addParticles(world, int3); SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); } } @@ -103,12 +98,6 @@ public void performEffect(IMasterRitualStone ritualStone) { } } - @SideOnly(Side.CLIENT) - public static void addParticles(World world, Int3 int3) { - EntityColoredFlameFX particle = new EntityColoredFlameFX(world, int3.xCoord, int3.yCoord, int3.zCoord, 0, 0, 0, 159, 70, 18); - FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); - } - @Override public int getCostPerRefresh() { return 30; diff --git a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPlacer.java b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPlacer.java index b0445aa..59d1f53 100644 --- a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPlacer.java +++ b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPlacer.java @@ -45,12 +45,11 @@ public void performEffect(IMasterRitualStone ritualStone) { for (int i = x - 2; i <= x + 2; i++) { for (int k = z - 2; k <= z + 2; k++) { for (int inv = 0; inv < tileEntity.getSizeInventory(); inv++) { - if (world.getBlock(i, y, k).isReplaceable(world, i, y + 1, k) && tileEntity.getStackInSlot(inv) != null) { + if (world.getBlock(i, y, k).isReplaceable(world, i, y + 1, k) && tileEntity.getStackInSlot(inv) != null && tileEntity.getStackInSlot(inv).stackSize != 0) { if (tileEntity.getStackInSlot(inv).getItem() instanceof ItemBlock && world.getBlock(i, y - 1, k) != null) { world.setBlock(i, y, k, Block.getBlockFromItem(tileEntity.getStackInSlot(inv).getItem()), tileEntity.getStackInSlot(inv).getItemDamage(), 3); - if (tileEntity.getStackInSlot(inv).stackSize > 1) { - tileEntity.getStackInSlot(inv).stackSize = tileEntity.getStackInSlot(inv).stackSize - 1; - } else tileEntity.setInventorySlotContents(inv, null); + tileEntity.decrStackSize(inv, 1); + tileEntity.markDirty(); SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh()); } } diff --git a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPortal.java b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPortal.java index 5b56da7..98697dc 100644 --- a/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPortal.java +++ b/src/main/java/tombenpotter/sanguimancy/rituals/RitualEffectPortal.java @@ -9,9 +9,9 @@ import net.minecraft.world.World; import tombenpotter.sanguimancy.registry.BlocksRegistry; import tombenpotter.sanguimancy.tile.TileDimensionalPortal; -import tombenpotter.sanguimancy.util.PortalLocation; import tombenpotter.sanguimancy.util.RandomUtils; import tombenpotter.sanguimancy.util.singletons.LocationsHandler; +import tombenpotter.sanguimancy.util.teleporting.PortalLocation; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileAltarDiviner.java b/src/main/java/tombenpotter/sanguimancy/tile/TileAltarDiviner.java index d2c0d11..30438cd 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileAltarDiviner.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileAltarDiviner.java @@ -13,7 +13,7 @@ public class TileAltarDiviner extends TileBaseInventory { public TileAltarDiviner() { slots = new ItemStack[1]; - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } @Override @@ -63,22 +63,23 @@ public void checkBloodAndMoveItems(TEAltar tile) { ItemStack stack = getStackInSlot(0).copy(); if (AltarRecipeRegistry.isRequiredItemValid(stack, tier)) { int containedBlood = tile.getCurrentBlood(); - int altarCapacity = tile.getCapacity(); AltarRecipe recipe = AltarRecipeRegistry.getAltarRecipeForItemAndTier(stack, tier); int bloodRequired = recipe.liquidRequired; - if (bloodRequired * stack.stackSize <= containedBlood) { - if (tile.getStackInSlot(0) == null) { + if (tile.getStackInSlot(0) == null) { + if (bloodRequired * stack.stackSize <= containedBlood) { tile.setInventorySlotContents(0, stack); this.setInventorySlotContents(0, null); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); tile.startCycle(); - } else if (tile.getStackInSlot(0).isItemEqual(stack) && tile.getStackInSlot(0).stackSize + stack.stackSize <= tile.getInventoryStackLimit() && tile.getStackInSlot(0).stackSize + stack.stackSize <= stack.getMaxStackSize()) { - int s1 = tile.getStackInSlot(0).stackSize; - tile.getStackInSlot(0).stackSize = s1 + stack.stackSize; - this.setInventorySlotContents(0, null); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } - worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + } else if (tile.getStackInSlot(0) != null && tile.getStackInSlot(0).isItemEqual(stack) && + tile.getStackInSlot(0).stackSize + stack.stackSize <= tile.getInventoryStackLimit() + && tile.getStackInSlot(0).stackSize + stack.stackSize <= stack.getMaxStackSize() + && (tile.getStackInSlot(0).stackSize + stack.stackSize) * bloodRequired <= containedBlood) { + int s1 = tile.getStackInSlot(0).stackSize; + tile.getStackInSlot(0).stackSize = s1 + stack.stackSize; + this.setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileAltarEmitter.java b/src/main/java/tombenpotter/sanguimancy/tile/TileAltarEmitter.java index 0ff1838..46f6008 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileAltarEmitter.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileAltarEmitter.java @@ -4,20 +4,15 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.tile.TileBase; -public class TileAltarEmitter extends TileEntity implements ICustomNBTTag { +public class TileAltarEmitter extends TileBase { public int bloodAsked; public boolean isOverBloodAsked; - private NBTTagCompound custoomNBTTag; public TileAltarEmitter() { - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } @Override @@ -76,7 +71,6 @@ public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); bloodAsked = tagCompound.getInteger("bloodAsked"); isOverBloodAsked = tagCompound.getBoolean("isBloodOverAsked"); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); } @Override @@ -84,40 +78,5 @@ public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setInteger("bloodAsked", bloodAsked); tagCompound.setBoolean("isBloodOverAsked", isOverBloodAsked); - tagCompound.setTag("customNBTTag", custoomNBTTag); - } - - - @Override - public final Packet getDescriptionPacket() { - NBTTagCompound nbt = new NBTTagCompound(); - writeToNBT(nbt); - S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt); - return packet; - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound nbt = pkt.func_148857_g(); - readFromNBT(nbt); - } - - @Override - public void markDirty() { - super.markDirty(); // Mark dirty for gamesave - if (worldObj.isRemote) { - return; - } - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // Update block + TE via Network - } - - @Override - public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; - } - - @Override - public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileAltarManipulator.java b/src/main/java/tombenpotter/sanguimancy/tile/TileAltarManipulator.java new file mode 100644 index 0000000..40c9d80 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileAltarManipulator.java @@ -0,0 +1,159 @@ +package tombenpotter.sanguimancy.tile; + +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import tombenpotter.sanguimancy.api.tile.TileBaseSidedInventory; + +public class TileAltarManipulator extends TileBaseSidedInventory { + + public int sideToOutput; + + public TileAltarManipulator() { + slots = new ItemStack[3]; + customNBTTag = new NBTTagCompound(); + sideToOutput = 0; + } + + @Override + public String getInventoryName() { + return "Altar Manipulator"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return true; + } + + @Override + public void updateEntity() { + if (worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) != null && worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) instanceof TEAltar) { + TEAltar altar = (TEAltar) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); + if (getStackInSlot(1) != null) outputToAdjacentInventory(); + if (altar.getStackInSlot(0) != null) moveItemsFromAltar(altar); + if (getStackInSlot(0) != null) insertItemInAltar(altar); + } + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, int side) { + if (worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) != null && worldObj.getTileEntity(xCoord, yCoord - 1, zCoord) instanceof TEAltar) { + TEAltar altar = (TEAltar) worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); + return slot == 0 && canInsertItemInAltar(altar, stack); + } + return false; + } + + @Override + public boolean canExtractItem(int slot, ItemStack stack, int side) { + return slot == 1; + } + + public boolean canInsertItemInAltar(TEAltar altar, ItemStack stack) { + if (stack != null && altar != null) { + int tier = altar.getTier(); + if (AltarRecipeRegistry.isRequiredItemValid(stack, tier)) { + int containedBlood = altar.getCurrentBlood(); + AltarRecipe recipe = AltarRecipeRegistry.getAltarRecipeForItemAndTier(stack, tier); + int bloodRequired = recipe.liquidRequired; + if (altar.getStackInSlot(0) == null && bloodRequired * stack.stackSize <= containedBlood) { + return true; + } else if (altar.getStackInSlot(0) != null && altar.getStackInSlot(0).isItemEqual(stack) && + altar.getStackInSlot(0).stackSize + stack.stackSize <= altar.getInventoryStackLimit() + && altar.getStackInSlot(0).stackSize + stack.stackSize <= stack.getMaxStackSize() + && (altar.getStackInSlot(0).stackSize + stack.stackSize) * bloodRequired <= containedBlood) { + return true; + } + } + } + return false; + } + + public void insertItemInAltar(TEAltar altar) { + ItemStack stack = getStackInSlot(0).copy(); + int tier = altar.getTier(); + if (AltarRecipeRegistry.isRequiredItemValid(stack, tier)) { + int containedBlood = altar.getCurrentBlood(); + AltarRecipe recipe = AltarRecipeRegistry.getAltarRecipeForItemAndTier(stack, tier); + int bloodRequired = recipe.liquidRequired; + if (altar.getStackInSlot(0) == null) { + if (bloodRequired * stack.stackSize <= containedBlood) { + altar.setInventorySlotContents(0, stack); + this.setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + altar.startCycle(); + } + } else if (altar.getStackInSlot(0) != null && altar.getStackInSlot(0).isItemEqual(stack) && + altar.getStackInSlot(0).stackSize + stack.stackSize <= altar.getInventoryStackLimit() + && altar.getStackInSlot(0).stackSize + stack.stackSize <= stack.getMaxStackSize() + && (altar.getStackInSlot(0).stackSize + stack.stackSize) * bloodRequired <= containedBlood) { + int s1 = altar.getStackInSlot(0).stackSize; + altar.getStackInSlot(0).stackSize = s1 + stack.stackSize; + this.setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + worldObj.markBlockForUpdate(altar.xCoord, altar.yCoord, altar.zCoord); + } + } + } + + public void moveItemsFromAltar(TEAltar altar) { + ItemStack stack = altar.getStackInSlot(0).copy(); + if (altar.getProgress() <= 0) { + if (getStackInSlot(1) == null) { + this.setInventorySlotContents(1, stack); + altar.setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + worldObj.markBlockForUpdate(altar.xCoord, altar.yCoord, altar.zCoord); + } else if (getStackInSlot(1) != null && getStackInSlot(1).isItemEqual(stack) && + getStackInSlot(1).stackSize + stack.stackSize <= stack.getMaxStackSize()) { + getStackInSlot(1).stackSize += stack.stackSize; + altar.setInventorySlotContents(0, null); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + worldObj.markBlockForUpdate(altar.xCoord, altar.yCoord, altar.zCoord); + } + } + } + + public void outputToAdjacentInventory() { + ItemStack stack = getStackInSlot(1).copy(); + ForgeDirection dir = ForgeDirection.getOrientation(sideToOutput); + if (dir != ForgeDirection.DOWN) { + TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + if (tile != null && tile instanceof IInventory) { + IInventory inventory = (IInventory) tile; + if (inventory.getSizeInventory() <= 0) return; + SpellHelper.insertStackIntoInventory(stack, inventory, ForgeDirection.UNKNOWN); + setInventorySlotContents(1, null); + } + } + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + sideToOutput = tagCompound.getInteger("sideToOutput"); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + tagCompound.setInteger("sideToOutput", sideToOutput); + } + + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + return new int[]{0, 1}; + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileBloodCleaner.java b/src/main/java/tombenpotter/sanguimancy/tile/TileBloodCleaner.java index 3a84095..7a5d8e6 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileBloodCleaner.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileBloodCleaner.java @@ -23,7 +23,7 @@ public TileBloodCleaner() { maxTicks = 150; tank = new FluidTank(new FluidStack(AlchemicalWizardry.lifeEssenceFluid, 0), capacity); isActive = false; - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } @Override @@ -171,4 +171,20 @@ public boolean isItemValidForSlot(int slot, ItemStack stack) { if (slot == 0) return true; else return false; } + + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + ForgeDirection dir = ForgeDirection.getOrientation(var1); + switch (dir) { + case DOWN: + case UP: + case NORTH: + case SOUTH: + case EAST: + case WEST: + return new int[]{0, 1}; + default: + return new int[]{}; + } + } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileBloodInterface.java b/src/main/java/tombenpotter/sanguimancy/tile/TileBloodInterface.java index 3d99c87..18b2f45 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileBloodInterface.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileBloodInterface.java @@ -8,13 +8,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; -import tombenpotter.sanguimancy.api.Timer; +import tombenpotter.sanguimancy.api.objects.Timer; +import tombenpotter.sanguimancy.api.tile.TileComputerBase; import tombenpotter.sanguimancy.compat.lua.events.LuaOrbMaxed; import tombenpotter.sanguimancy.compat.lua.methods.LuaGetLifeEssence; import tombenpotter.sanguimancy.compat.lua.methods.LuaGetOrbMax; import tombenpotter.sanguimancy.compat.lua.methods.LuaGetOwner; -import tombenpotter.sanguimancy.network.packets.PacketBloodInterfaceUpdate; import tombenpotter.sanguimancy.network.PacketHandler; +import tombenpotter.sanguimancy.network.packets.PacketBloodInterfaceUpdate; import tombenpotter.sanguimancy.registry.BlocksRegistry; public class TileBloodInterface extends TileComputerBase implements IInventory { diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileBloodTank.java b/src/main/java/tombenpotter/sanguimancy/tile/TileBloodTank.java index c610ba2..17f9314 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileBloodTank.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileBloodTank.java @@ -1,29 +1,30 @@ package tombenpotter.sanguimancy.tile; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.tile.TileBase; -public class TileBloodTank extends TileEntity implements IFluidHandler, ICustomNBTTag { +public class TileBloodTank extends TileBase implements IFluidHandler { public int capacity; public FluidTank tank; - private NBTTagCompound custoomNBTTag; public TileBloodTank() { capacity = 16 * FluidContainerRegistry.BUCKET_VOLUME; tank = new FluidTank(capacity); - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); + } + + public TileBloodTank(int capacity) { + capacity = capacity * FluidContainerRegistry.BUCKET_VOLUME; + tank = new FluidTank(capacity); + customNBTTag = new NBTTagCompound(); } @Override public void updateEntity() { - if (worldObj.getWorldTime() % 50 == 0) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + if (worldObj.getWorldTime() % 60 == 0) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @Override @@ -61,7 +62,6 @@ public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); tank.readFromNBT(tagCompound.getCompoundTag("tank")); capacity = tagCompound.getInteger("capacity"); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); } @Override @@ -69,30 +69,5 @@ public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); if (tank.getFluidAmount() != 0) tagCompound.setTag("tank", tank.writeToNBT(new NBTTagCompound())); tagCompound.setInteger("capacity", capacity); - tagCompound.setTag("customNBTTag", custoomNBTTag); - } - - @Override - public final Packet getDescriptionPacket() { - NBTTagCompound nbt = new NBTTagCompound(); - writeToNBT(nbt); - S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt); - return packet; - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound nbt = pkt.func_148857_g(); - readFromNBT(nbt); - } - - @Override - public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; - } - - @Override - public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileCamouflageBound.java b/src/main/java/tombenpotter/sanguimancy/tile/TileCamouflageBound.java new file mode 100644 index 0000000..9a9f0a1 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileCamouflageBound.java @@ -0,0 +1,55 @@ +package tombenpotter.sanguimancy.tile; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraftforge.common.util.Constants; +import tombenpotter.sanguimancy.api.tile.IBoundTile; +import tombenpotter.sanguimancy.api.tile.TileCamouflage; + +import java.util.ArrayList; + +public class TileCamouflageBound extends TileCamouflage implements IBoundTile { + + ArrayList ownerList; + + public TileCamouflageBound() { + customNBTTag = new NBTTagCompound(); + this.ownerList = new ArrayList(); + } + + @Override + public ArrayList getOwnersList() { + return this.ownerList; + } + + @Override + public void setOwnersList(ArrayList ownersList) { + this.ownerList = ownersList; + } + + @Override + public void addOwnerToList(String ownerName) { + this.ownerList.add(ownerName); + } + + @Override + public void removeOwnerFromList(String ownerName) { + this.ownerList.remove(ownerName); + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + NBTTagList owners = tagCompound.getTagList("owners", Constants.NBT.TAG_STRING); + for (int i = 0; i < owners.tagCount(); i++) this.ownerList.add(owners.getStringTagAt(i)); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + NBTTagList owners = new NBTTagList(); + for (String s : this.ownerList) owners.appendTag(new NBTTagString(s)); + tagCompound.setTag("owners", owners); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileCorruptionCrystallizer.java b/src/main/java/tombenpotter/sanguimancy/tile/TileCorruptionCrystallizer.java index 2d049cb..821a565 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileCorruptionCrystallizer.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileCorruptionCrystallizer.java @@ -14,7 +14,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; public class TileCorruptionCrystallizer extends TileSegmentedReagentHandler implements ICustomNBTTag { @@ -22,10 +22,10 @@ public class TileCorruptionCrystallizer extends TileSegmentedReagentHandler impl public int corruptionStored = 0; public String owner; public boolean multiblockFormed; - private NBTTagCompound custoomNBTTag; + private NBTTagCompound customNBTTag; public TileCorruptionCrystallizer() { - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } @Override @@ -49,7 +49,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { owner = tagCompound.getString("owner"); corruptionStored = tagCompound.getInteger("corruptionStored"); multiblockFormed = tagCompound.getBoolean("multiblockFormed"); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); } @Override @@ -58,7 +58,7 @@ public void writeToNBT(NBTTagCompound tagCompound) { tagCompound.setString("owner", owner); tagCompound.setInteger("corruptionStored", corruptionStored); tagCompound.setBoolean("multiblockFormed", multiblockFormed); - tagCompound.setTag("customNBTTag", custoomNBTTag); + tagCompound.setTag("customNBTTag", customNBTTag); } public boolean checkMultiblockTier(World world, int x, int y, int z) { @@ -163,11 +163,11 @@ public boolean canDrainReagent(Reagent reagent, int amount) { @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } } \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileDimensionalPortal.java b/src/main/java/tombenpotter/sanguimancy/tile/TileDimensionalPortal.java index 6ccaf2a..7438089 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileDimensionalPortal.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileDimensionalPortal.java @@ -2,7 +2,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; public class TileDimensionalPortal extends TileEntity implements ICustomNBTTag { @@ -10,10 +10,10 @@ public class TileDimensionalPortal extends TileEntity implements ICustomNBTTag { public int masterStoneX; public int masterStoneY; public int masterStoneZ; - private NBTTagCompound custoomNBTTag; + private NBTTagCompound customNBTTag; public TileDimensionalPortal() { - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } public void readFromNBT(NBTTagCompound tagCompound) { @@ -22,7 +22,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { masterStoneX = tagCompound.getInteger("masterStoneX"); masterStoneY = tagCompound.getInteger("masterStoneY"); masterStoneZ = tagCompound.getInteger("masterStoneZ"); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); } public void writeToNBT(NBTTagCompound tagCompound) { @@ -31,16 +31,16 @@ public void writeToNBT(NBTTagCompound tagCompound) { tagCompound.setInteger("masterStoneX", masterStoneX); tagCompound.setInteger("masterStoneY", masterStoneY); tagCompound.setInteger("masterStoneZ", masterStoneZ); - tagCompound.setTag("customNBTTag", custoomNBTTag); + tagCompound.setTag("customNBTTag", customNBTTag); } @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileItemSNPart.java b/src/main/java/tombenpotter/sanguimancy/tile/TileItemSNPart.java index d39ad63..8c43936 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileItemSNPart.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileItemSNPart.java @@ -12,8 +12,8 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; import tombenpotter.sanguimancy.api.objects.BlockPostition; -import tombenpotter.sanguimancy.api.EnumSNType; import tombenpotter.sanguimancy.api.objects.SNKNotBoolean; +import tombenpotter.sanguimancy.api.snManifestation.EnumSNType; import tombenpotter.sanguimancy.api.snManifestation.ISNKnot; import tombenpotter.sanguimancy.api.tile.TileBaseSNPart; import tombenpotter.sanguimancy.util.BoundItemState; @@ -24,11 +24,11 @@ public class TileItemSNPart extends TileBaseSNPart implements IInventory { public ItemStack[] slots; - private NBTTagCompound custoomNBTTag; + private NBTTagCompound customNBTTag; public TileItemSNPart() { slots = new ItemStack[1]; - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } public int getSizeInventory() { @@ -102,7 +102,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); } @Override @@ -119,7 +119,7 @@ public void writeToNBT(NBTTagCompound tagCompound) { } } tagCompound.setTag("Items", nbttaglist); - tagCompound.setTag("customNBTTag", custoomNBTTag); + tagCompound.setTag("customNBTTag", customNBTTag); } public boolean onBlockRightClicked(EntityPlayer player, ItemStack stack) { @@ -210,12 +210,12 @@ public void disablePart(Boolean bool) { @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } @Override @@ -223,7 +223,7 @@ public void updateEntity() { if (worldObj.getWorldTime() % 200 == 0) { HashMap map = getComponentsInNetwork().hashMap; for (BlockPostition postition : map.keySet()) { - if (map.get(postition).isSNKnot && map.get(postition).isSNKnotActive && worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0) { + if (map.get(postition).isSNKnot && map.get(postition).isSNKnotActive && (worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0 || worldObj.getStrongestIndirectPower(xCoord, yCoord, zCoord) > 0)) { disablePart(false); } else if (map.get(postition).isSNKnot && !map.get(postition).isSNKnotActive) { disablePart(false); diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileRitualSNPart.java b/src/main/java/tombenpotter/sanguimancy/tile/TileRitualSNPart.java index fa2b93e..fcc0193 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileRitualSNPart.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileRitualSNPart.java @@ -1,30 +1,35 @@ package tombenpotter.sanguimancy.tile; +import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.api.event.RitualRunEvent; import WayofTime.alchemicalWizardry.api.event.RitualStopEvent; -import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.ChatComponentText; import net.minecraftforge.common.MinecraftForge; import tombenpotter.sanguimancy.api.objects.BlockPostition; -import tombenpotter.sanguimancy.api.EnumSNType; -import tombenpotter.sanguimancy.api.ICustomNBTTag; +import tombenpotter.sanguimancy.api.objects.ICustomNBTTag; import tombenpotter.sanguimancy.api.objects.SNKNotBoolean; +import tombenpotter.sanguimancy.api.snManifestation.EnumSNType; import tombenpotter.sanguimancy.api.tile.TileBaseSNPart; import java.util.HashMap; public class TileRitualSNPart extends TileBaseSNPart implements ICustomNBTTag { - public NBTTagCompound custoomNBTTag; - public BlockPostition ritualPosition; + public NBTTagCompound customNBTTag; + public int xRitual; + public int yRitual; + public int zRitual; public TileRitualSNPart() { MinecraftForge.EVENT_BUS.register(this); - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } @Override @@ -44,25 +49,29 @@ public void onNetworkUpdate(BlockPostition originalPosition) { @Override public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); - ritualPosition = BlockPostition.readFromNBT(tagCompound); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); + this.xRitual = tagCompound.getInteger("xRitual"); + this.yRitual = tagCompound.getInteger("yRitual"); + this.zRitual = tagCompound.getInteger("zRitual"); } @Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); - tagCompound.setTag("customNBTTag", custoomNBTTag); - ritualPosition.writeToNBT(tagCompound); + tagCompound.setTag("customNBTTag", customNBTTag); + tagCompound.setInteger("xRitual", xRitual); + tagCompound.setInteger("yRitual", yRitual); + tagCompound.setInteger("zRitual", zRitual); } @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } @@ -91,17 +100,22 @@ public void markDirty() { @SubscribeEvent public void disableLinkedRitual(RitualRunEvent event) { - if (ritualPosition != null) { - HashMap map = getComponentsInNetwork().hashMap; - for (BlockPostition postition : map.keySet()) { - if (map.get(postition).isSNKnot && map.get(postition).isSNKnotActive && worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0) { - if (event.mrs.getXCoord() == ritualPosition.x && event.mrs.getYCoord() == ritualPosition.y && event.mrs.getZCoord() == ritualPosition.z) { - event.setResult(Event.Result.DENY); - } - } else if (map.get(postition).isSNKnot && !map.get(postition).isSNKnotActive) { - if (event.mrs.getXCoord() == ritualPosition.x && event.mrs.getYCoord() == ritualPosition.y && event.mrs.getZCoord() == ritualPosition.z) { - event.setResult(Event.Result.DENY); - } + HashMap map = getComponentsInNetwork().hashMap; + for (BlockPostition postition : map.keySet()) { + if (map.get(postition).isSNKnot && map.get(postition).isSNKnotActive && (worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0 || worldObj.getStrongestIndirectPower(xCoord, yCoord, zCoord) > 0)) { + if (event.mrs.getXCoord() == xRitual && event.mrs.getYCoord() == yRitual && event.mrs.getZCoord() == zRitual) { + this.xRitual = event.mrs.getXCoord(); + this.yRitual = event.mrs.getYCoord(); + this.zRitual = event.mrs.getZCoord(); + event.setCanceled(true); + } + } + if (map.get(postition).isSNKnot && !map.get(postition).isSNKnotActive) { + if (event.mrs.getXCoord() == xRitual && event.mrs.getYCoord() == yRitual && event.mrs.getZCoord() == zRitual) { + this.xRitual = event.mrs.getXCoord(); + this.yRitual = event.mrs.getYCoord(); + this.zRitual = event.mrs.getZCoord(); + event.setCanceled(true); } } } @@ -109,10 +123,20 @@ public void disableLinkedRitual(RitualRunEvent event) { @SubscribeEvent public void removeMasterStone(RitualStopEvent event) { - if (ritualPosition != null) { - if (event.mrs.getXCoord() == ritualPosition.x && event.mrs.getYCoord() == ritualPosition.y && event.mrs.getZCoord() == ritualPosition.z) { - worldObj.setBlockToAir(xCoord, yCoord, zCoord); + if (event.mrs.getXCoord() == xRitual && event.mrs.getYCoord() == yRitual && event.mrs.getZCoord() == zRitual) { + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + } + + public boolean onBlockRightClicked(EntityPlayer player, ItemStack stack) { + if (stack != null) { + if (stack.isItemEqual(new ItemStack(ModItems.divinationSigil)) || stack.isItemEqual(new ItemStack(ModItems.itemSeerSigil))) { + if (!worldObj.isRemote) { + player.addChatComponentMessage(new ChatComponentText("x: " + String.valueOf(xRitual) + " y: " + String.valueOf(yRitual) + " z: " + String.valueOf(zRitual))); + } + return true; } } + return false; } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileSacrificeTransfer.java b/src/main/java/tombenpotter/sanguimancy/tile/TileSacrificeTransfer.java index 9a4a9e3..88f5b78 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileSacrificeTransfer.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileSacrificeTransfer.java @@ -8,7 +8,7 @@ public class TileSacrificeTransfer extends TileBaseInventory { public TileSacrificeTransfer() { - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); slots = new ItemStack[1]; } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNBranch.java b/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNBranch.java index d58f4cb..5ec69f8 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNBranch.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNBranch.java @@ -1,41 +1,36 @@ package tombenpotter.sanguimancy.tile; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.particle.EntityFX; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; +import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.objects.BlockPostition; import tombenpotter.sanguimancy.api.tile.TileBaseSNBranch; -import tombenpotter.sanguimancy.client.particle.EntityColoredFlameFX; public class TileSimpleSNBranch extends TileBaseSNBranch { - private NBTTagCompound custoomNBTTag; + private NBTTagCompound customNBTTag; public TileSimpleSNBranch() { - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); } public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); } public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); - tagCompound.setTag("customNBTTag", custoomNBTTag); + tagCompound.setTag("customNBTTag", customNBTTag); } @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } @Override @@ -44,39 +39,14 @@ public boolean isSNKnot() { } @Override - @SideOnly(Side.CLIENT) public void onNetworkUpdate(BlockPostition originalPosition) { - addLinkingEffects(); + Sanguimancy.proxy.addLinkingEffects(this, worldObj, xCoord, yCoord, zCoord); } @Override public void updateEntity() { if (worldObj.getWorldTime() % 100 == 0) { - addLinkingEffects(); - } - } - - public void addLinkingEffects() { - if (!getSNKnots().isEmpty()) { - double dx = xCoord + 0.5; - double dy = yCoord + 0.5; - double dz = zCoord + 0.5; - for (int i = 0; i < getAdjacentISNComponents().length; i++) { - if (getAdjacentISNComponents()[i] != null) { - for (float j = 0; j <= ForgeDirection.VALID_DIRECTIONS[i].offsetX; j += 0.1) { - EntityFX particle = new EntityColoredFlameFX(worldObj, dx + j, dy, dz, 0, 0, 0, 160, 160, 160, 100); - FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); - } - for (float j = 0; j <= ForgeDirection.VALID_DIRECTIONS[i].offsetY; j += 0.1) { - EntityFX particle = new EntityColoredFlameFX(worldObj, dx, dy + j, dz, 0, 0, 0, 160, 160, 160, 100); - FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); - } - for (float j = 0; j <= ForgeDirection.VALID_DIRECTIONS[i].offsetZ; j += 0.1) { - EntityFX particle = new EntityColoredFlameFX(worldObj, dx, dy, dz + j, 0, 0, 0, 160, 160, 160, 100); - FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle); - } - } - } + Sanguimancy.proxy.addLinkingEffects(this, worldObj, xCoord, yCoord, zCoord); } } } diff --git a/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNKnot.java b/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNKnot.java index 70d10fa..9b3e037 100644 --- a/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNKnot.java +++ b/src/main/java/tombenpotter/sanguimancy/tile/TileSimpleSNKnot.java @@ -1,8 +1,6 @@ package tombenpotter.sanguimancy.tile; import WayofTime.alchemicalWizardry.ModItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import tombenpotter.sanguimancy.api.objects.BlockPostition; @@ -12,10 +10,10 @@ public class TileSimpleSNKnot extends TileBaseSNKnot { public String knotOwner; public boolean knotActive; - private NBTTagCompound custoomNBTTag; + private NBTTagCompound customNBTTag; public TileSimpleSNKnot() { - custoomNBTTag = new NBTTagCompound(); + customNBTTag = new NBTTagCompound(); knotActive = true; } @@ -44,7 +42,7 @@ public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); knotOwner = tagCompound.getString("knotOwner"); knotActive = tagCompound.getBoolean("knotActive"); - custoomNBTTag = tagCompound.getCompoundTag("customNBTTag"); + customNBTTag = tagCompound.getCompoundTag("customNBTTag"); } @Override @@ -52,17 +50,17 @@ public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setString("knotOwner", knotOwner); tagCompound.setBoolean("knotActive", knotActive); - tagCompound.setTag("customNBTTag", custoomNBTTag); + tagCompound.setTag("customNBTTag", customNBTTag); } @Override public NBTTagCompound getCustomNBTTag() { - return custoomNBTTag; + return customNBTTag; } @Override public void setCustomNBTTag(NBTTagCompound tag) { - custoomNBTTag = tag; + customNBTTag = tag; } @Override @@ -71,7 +69,6 @@ public boolean isSNKnot() { } @Override - @SideOnly(Side.CLIENT) public void onNetworkUpdate(BlockPostition originalPosition) { } diff --git a/src/main/java/tombenpotter/sanguimancy/util/ConfigHandler.java b/src/main/java/tombenpotter/sanguimancy/util/ConfigHandler.java index 1d7a84c..f3fbc55 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/ConfigHandler.java +++ b/src/main/java/tombenpotter/sanguimancy/util/ConfigHandler.java @@ -24,10 +24,17 @@ public class ConfigHandler { public static boolean enablePump; public static boolean enableQuarry; public static boolean enablePortal; + public static boolean messagesWhenCorruptionEffect; + public static boolean enableTelepositionBlacklist; public static int snDimID; public static int addHeartPotionID; public static int removeHeartPotionID; - public static boolean messagesWhenCorruptionEffect; + public static int minimumToolCorruption; + public static int transpositionSigilCost; + public static String[] transpositionSigilBlacklist; + public static boolean addItemsOnFirstLogin; + public static String[] teleposerBlacklist; + public static boolean renderSillyAprilFish; public static void init(File file) { config = new Configuration(file); @@ -56,9 +63,18 @@ public static void syncConfig() { //Features snDimID = config.get(features, "soulNetworkDimensionID", 42).getInt(snDimID); - addHeartPotionID = config.get(features, "addHeartPotionID", 100).getInt(addHeartPotionID); - removeHeartPotionID = config.get(features, "removeHeartPotionID", 101).getInt(removeHeartPotionID); + addHeartPotionID = config.get(features, "addHeartPotionID", 150).getInt(addHeartPotionID); + removeHeartPotionID = config.get(features, "removeHeartPotionID", 151).getInt(removeHeartPotionID); messagesWhenCorruptionEffect = config.get(features, "messageWhenCorruptionEffect", true).getBoolean(messagesWhenCorruptionEffect); + addItemsOnFirstLogin = config.get(features, "addItemsOnFirstLogin", true).getBoolean(addItemsOnFirstLogin); + enableTelepositionBlacklist = config.get(features, "canTeleposeManifestations", true).getBoolean(enableTelepositionBlacklist); + renderSillyAprilFish = config.get(features, "renderSillyAprilFish", true).getBoolean(renderSillyAprilFish); + + //Balance + minimumToolCorruption = config.get(balancing, "minimumCorruptionForTools", 200).getInt(minimumToolCorruption); + transpositionSigilCost = config.get(balancing, "transpositionSigilCost", 7500).getInt(transpositionSigilCost); + transpositionSigilBlacklist = config.get(balancing, "transpositionSigilBlacklist", new String[]{"minecraft:bedrock"}).getStringList(); + teleposerBlacklist = config.get(balancing, "teleposerBlacklist", new String[]{"Sanguimancy:BlockItemSNPart", "Sanguimancy:BlockRitualRepresentation"}).getStringList(); config.save(); } diff --git a/src/main/java/tombenpotter/sanguimancy/util/EventHandler.java b/src/main/java/tombenpotter/sanguimancy/util/EventHandler.java index e4e3d27..70df60d 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/EventHandler.java +++ b/src/main/java/tombenpotter/sanguimancy/util/EventHandler.java @@ -1,12 +1,10 @@ package tombenpotter.sanguimancy.util; -import WayofTime.alchemicalWizardry.api.event.ItemBindEvent; -import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent; -import WayofTime.alchemicalWizardry.api.event.PlayerAddToNetworkEvent; -import WayofTime.alchemicalWizardry.api.event.RitualActivatedEvent; +import WayofTime.alchemicalWizardry.api.event.*; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; +import amerifrance.guideapi.api.GuideRegistry; import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; @@ -20,7 +18,6 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; @@ -31,23 +28,28 @@ import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.common.ForgeChunkManager; import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.entity.EntityStruckByLightningEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.event.world.BlockEvent; import org.lwjgl.opengl.GL11; import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.api.objects.BlockPostition; import tombenpotter.sanguimancy.api.soulCorruption.SoulCorruptionHelper; import tombenpotter.sanguimancy.network.PacketHandler; import tombenpotter.sanguimancy.network.events.EventCorruptedInfusion; import tombenpotter.sanguimancy.network.packets.PacketSyncCorruption; import tombenpotter.sanguimancy.registry.BlocksRegistry; import tombenpotter.sanguimancy.registry.ItemsRegistry; +import tombenpotter.sanguimancy.registry.SanguimancyGuide; +import tombenpotter.sanguimancy.tile.TileCamouflageBound; import tombenpotter.sanguimancy.tile.TileItemSNPart; import tombenpotter.sanguimancy.tile.TileRitualSNPart; import tombenpotter.sanguimancy.util.singletons.BoundItems; import tombenpotter.sanguimancy.util.singletons.ClaimedChunks; +import java.util.ArrayList; + public class EventHandler { public EventHandler() { @@ -89,22 +91,19 @@ public void onPlayerSacrificed(LivingDeathEvent event) { @SubscribeEvent public void onPlayerJoinWorld(EntityJoinWorldEvent event) { if (!event.entity.worldObj.isRemote && event.entity != null && event.entity instanceof EntityPlayer) { - EntityPlayerMP player = (EntityPlayerMP) event.entity; - if (SoulCorruptionHelper.getCorruptionLevel(player.getDisplayName()) > 0) return; - else SoulCorruptionHelper.negateCorruption(player.getDisplayName()); - + EntityPlayer player = (EntityPlayer) event.entity; NBTTagCompound tag = RandomUtils.getModTag(player, Sanguimancy.modid); - if (!tag.getBoolean("hasInitialChunkClaimer")) { + if (!tag.getBoolean("hasInitialChunkClaimer") && ConfigHandler.addItemsOnFirstLogin) { player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.intial.claimer"))); - if (!player.inventory.addItemStackToInventory(RandomUtils.SanguimancyItemStacks.chunkClaimer.copy())) { - RandomUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, RandomUtils.SanguimancyItemStacks.chunkClaimer.copy()); + if (!player.inventory.addItemStackToInventory(SanguimancyItemStacks.chunkClaimer.copy())) { + RandomUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, SanguimancyItemStacks.chunkClaimer.copy()); } tag.setBoolean("hasInitialChunkClaimer", true); } - if (!tag.getBoolean("hasInitialGuide")) { - if (!player.inventory.addItemStackToInventory(RandomUtils.SanguimancyItemStacks.playerGuide.copy())) { - RandomUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, RandomUtils.SanguimancyItemStacks.playerGuide.copy()); + if (!tag.getBoolean("hasInitialGuide") && ConfigHandler.addItemsOnFirstLogin) { + if (!player.inventory.addItemStackToInventory(GuideRegistry.getItemStackForBook(SanguimancyGuide.sanguimancyGuide).copy())) { + RandomUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, (GuideRegistry.getItemStackForBook(SanguimancyGuide.sanguimancyGuide).copy())); } tag.setBoolean("hasInitialGuide", true); } @@ -113,7 +112,10 @@ public void onPlayerJoinWorld(EntityJoinWorldEvent event) { @SubscribeEvent public void onPlayerTick(TickEvent.PlayerTickEvent event) { - String playerName = event.player.getDisplayName(); + String playerName; + if (!event.player.worldObj.isRemote) playerName = event.player.getDisplayName(); + else playerName = Sanguimancy.proxy.getClientPlayer().getDisplayName(); + if (SoulCorruptionHelper.isCorruptionOver(playerName, 10)) { SoulCorruptionHelper.spawnChickenFollower(event.player); } @@ -132,9 +134,8 @@ public void onPlayerTick(TickEvent.PlayerTickEvent event) { if (SoulCorruptionHelper.isCorruptionOver(playerName, 200)) { SoulCorruptionHelper.loseHeart(event.player); } - - if (event.player.worldObj.getWorldTime() % 200 == 0 && !event.player.worldObj.isRemote) { - PacketHandler.INSTANCE.sendTo(new PacketSyncCorruption(event.player), (EntityPlayerMP) event.player); + if (!event.player.worldObj.isRemote && event.player.worldObj.getWorldTime() % 200 == 0) { + PacketHandler.INSTANCE.sendToAll(new PacketSyncCorruption(event.player.getDisplayName())); } } @@ -150,7 +151,7 @@ public void onPlayerAttack(AttackEntityEvent event) { @SubscribeEvent public void onRitualActivation(RitualActivatedEvent event) { if (event.player != null) { - if (SoulCorruptionHelper.isCorruptionOver(event.player.getDisplayName(), 15) && event.player.worldObj.rand.nextInt(10) == 0) { + if (SoulCorruptionHelper.isCorruptionOver(event.player.getDisplayName(), 50) && event.player.worldObj.rand.nextInt(10) == 0) { event.setResult(Event.Result.DENY); } } @@ -173,39 +174,39 @@ public void onChunkUnforce(ForgeChunkManager.UnforceChunkEvent event) { @SubscribeEvent public void onItemAddedToSN(ItemBindEvent event) { if (!event.player.worldObj.isRemote) { - int dimID = ConfigHandler.snDimID; - WorldServer dimWorld = MinecraftServer.getServer().worldServerForDimension(dimID); - if (ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName()) != null) { - for (ChunkIntPairSerializable chunkInt : ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName())) { - int baseX = (chunkInt.chunkXPos << 4) + (dimWorld.rand.nextInt(16)); - int baseZ = (chunkInt.chunkZPos << 4) + (dimWorld.rand.nextInt(16)); - int baseY = dimWorld.getTopSolidOrLiquidBlock(baseX, baseZ) + 2; - if (baseY >= 128) { - continue; - } - BoundItemState boundItemState = new BoundItemState(baseX, baseY, baseZ, dimID, true); - String name = String.valueOf(dimID) + String.valueOf(baseX) + String.valueOf(baseY) + String.valueOf(baseZ) + event.itemStack.getUnlocalizedName() + event.itemStack.getDisplayName() + event.itemStack.getItemDamage() + event.player.getCommandSenderName(); - if (dimWorld.isAirBlock(baseX, baseY, baseZ)) { - RandomUtils.checkAndSetCompound(event.itemStack); - if (BoundItems.getBoundItems().addItem(name, boundItemState)) { - dimWorld.setBlock(baseX, baseY, baseZ, BlocksRegistry.boundItem); - event.itemStack.stackTagCompound.setString("SavedItemName", name); - if (dimWorld.getTileEntity(baseX, baseY, baseZ) != null && dimWorld.getTileEntity(baseX, baseY, baseZ) instanceof TileItemSNPart) { - TileItemSNPart tile = (TileItemSNPart) dimWorld.getTileEntity(baseX, baseY, baseZ); - tile.setInventorySlotContents(0, event.itemStack.copy()); - tile.getCustomNBTTag().setString("SavedItemName", name); - dimWorld.markBlockForUpdate(baseX, baseY, baseZ); + if (event.player.inventory.hasItemStack(SanguimancyItemStacks.etherealManifestation)) { + int dimID = ConfigHandler.snDimID; + WorldServer dimWorld = MinecraftServer.getServer().worldServerForDimension(dimID); + if (ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName()) != null) { + for (ChunkIntPairSerializable chunkInt : ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName())) { + int baseX = (chunkInt.chunkXPos << 4) + (dimWorld.rand.nextInt(16)); + int baseZ = (chunkInt.chunkZPos << 4) + (dimWorld.rand.nextInt(16)); + int baseY = dimWorld.getTopSolidOrLiquidBlock(baseX, baseZ) + 2; + if (baseY >= 128) { + continue; + } + BoundItemState boundItemState = new BoundItemState(baseX, baseY, baseZ, dimID, true); + String name = String.valueOf(dimID) + String.valueOf(baseX) + String.valueOf(baseY) + String.valueOf(baseZ) + event.itemStack.getUnlocalizedName() + event.itemStack.getDisplayName() + event.itemStack.getItemDamage() + event.player.getCommandSenderName(); + if (dimWorld.isAirBlock(baseX, baseY, baseZ)) { + RandomUtils.checkAndSetCompound(event.itemStack); + if (BoundItems.getBoundItems().addItem(name, boundItemState)) { + dimWorld.setBlock(baseX, baseY, baseZ, BlocksRegistry.boundItem); + event.itemStack.stackTagCompound.setString("SavedItemName", name); + if (dimWorld.getTileEntity(baseX, baseY, baseZ) != null && dimWorld.getTileEntity(baseX, baseY, baseZ) instanceof TileItemSNPart) { + TileItemSNPart tile = (TileItemSNPart) dimWorld.getTileEntity(baseX, baseY, baseZ); + tile.setInventorySlotContents(0, event.itemStack.copy()); + tile.getCustomNBTTag().setString("SavedItemName", name); + dimWorld.markBlockForUpdate(baseX, baseY, baseZ); + } } } + event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.added.success"))); + dimWorld.markBlockForUpdate(baseX, baseY, baseZ); + break; } - event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.added.success"))); - break; } - } else { - event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.added.fail"))); - event.setResult(Event.Result.DENY); + event.player.inventory.consumeInventoryItem(SanguimancyItemStacks.etherealManifestation.getItem()); } - } } @@ -222,8 +223,6 @@ public void onItemDrainNetwork(ItemDrainNetworkEvent event) { event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.deactivated"))); event.setResult(Event.Result.DENY); } - } else { - event.setResult(Event.Result.DENY); } } } @@ -240,8 +239,6 @@ public void onItemAddToNetwork(PlayerAddToNetworkEvent event) { event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.deactivated"))); event.setResult(Event.Result.DENY); } - } else { - event.setResult(Event.Result.DENY); } } } @@ -249,31 +246,33 @@ public void onItemAddToNetwork(PlayerAddToNetworkEvent event) { @SubscribeEvent public void onRitualStart(RitualActivatedEvent event) { if (!event.player.worldObj.isRemote) { - int dimID = ConfigHandler.snDimID; - WorldServer dimWorld = MinecraftServer.getServer().worldServerForDimension(dimID); - if (ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName()) != null) { - for (ChunkIntPairSerializable chunkInt : ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName())) { - int baseX = (chunkInt.chunkXPos << 4) + (dimWorld.rand.nextInt(16)); - int baseZ = (chunkInt.chunkZPos << 4) + (dimWorld.rand.nextInt(16)); - int baseY = dimWorld.getTopSolidOrLiquidBlock(baseX, baseZ) + 2; - if (baseY >= 128) { - continue; - } - if (dimWorld.isAirBlock(baseX, baseY, baseZ)) { - dimWorld.setBlock(baseX, baseY, baseZ, BlocksRegistry.ritualRepresentation); - if (dimWorld.getTileEntity(baseX, baseY, baseZ) != null && dimWorld.getTileEntity(baseX, baseY, baseZ) instanceof TileRitualSNPart) { - TileRitualSNPart part = (TileRitualSNPart) dimWorld.getTileEntity(baseX, baseY, baseZ); - part.ritualPosition = new BlockPostition(event.mrs.getXCoord(), event.mrs.getYCoord(), event.mrs.getZCoord()); + if (event.player.inventory.hasItemStack(SanguimancyItemStacks.etherealManifestation)) { + int dimID = ConfigHandler.snDimID; + WorldServer dimWorld = MinecraftServer.getServer().worldServerForDimension(dimID); + if (ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName()) != null) { + for (ChunkIntPairSerializable chunkInt : ClaimedChunks.getClaimedChunks().getLinkedChunks(event.player.getCommandSenderName())) { + int baseX = (chunkInt.chunkXPos << 4) + (dimWorld.rand.nextInt(16)); + int baseZ = (chunkInt.chunkZPos << 4) + (dimWorld.rand.nextInt(16)); + int baseY = dimWorld.getTopSolidOrLiquidBlock(baseX, baseZ) + 2; + if (baseY >= 128) { + continue; + } + if (dimWorld.isAirBlock(baseX, baseY, baseZ)) { + dimWorld.setBlock(baseX, baseY, baseZ, BlocksRegistry.ritualRepresentation); + if (dimWorld.getTileEntity(baseX, baseY, baseZ) != null && dimWorld.getTileEntity(baseX, baseY, baseZ) instanceof TileRitualSNPart) { + TileRitualSNPart part = (TileRitualSNPart) dimWorld.getTileEntity(baseX, baseY, baseZ); + part.xRitual = event.mrs.getXCoord(); + part.yRitual = event.mrs.getYCoord(); + part.zRitual = event.mrs.getZCoord(); + dimWorld.markBlockForUpdate(baseX, baseY, baseZ); + } } + event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.added.success"))); + break; } - event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.added.success"))); - break; } - } else { - event.player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("chat.Sanguimancy.added.fail"))); - event.setResult(Event.Result.DENY); + event.player.inventory.consumeInventoryItem(SanguimancyItemStacks.etherealManifestation.getItem()); } - } } @@ -289,12 +288,14 @@ public void onPlayerCorruptedInfusionAesthetic(EventCorruptedInfusion.EventPlaye @SubscribeEvent(priority = EventPriority.HIGHEST) //This code is very much inspired by the one in ProfMobius' Waila mod public void onSanguimancyItemTooltip(ItemTooltipEvent event) { + ItemStack stack = event.itemStack; + try { - ModContainer mod = GameData.findModOwner(GameData.itemRegistry.getNameForObject(event.itemStack.getItem())); + ModContainer mod = GameData.findModOwner(GameData.itemRegistry.getNameForObject(stack.getItem())); String modname = mod == null ? "Minecraft" : mod.getName(); - if (modname.equals(Sanguimancy.name) && event.itemStack.stackTagCompound != null && event.itemStack.stackTagCompound.hasKey("ownerName")) { + if (modname.equals(Sanguimancy.name) && stack.stackTagCompound != null && stack.stackTagCompound.hasKey("ownerName")) { if (GuiScreen.isShiftKeyDown()) { - event.toolTip.add((StatCollector.translateToLocal("info.Sanguimancy.tooltip.owner") + ": " + RandomUtils.getItemOwner(event.itemStack))); + event.toolTip.add((StatCollector.translateToLocal("info.Sanguimancy.tooltip.owner") + ": " + RandomUtils.getItemOwner(stack))); } } } catch (NullPointerException e) { @@ -302,33 +303,49 @@ public void onSanguimancyItemTooltip(ItemTooltipEvent event) { } } - public static class ClientEventHandler { - /* - public static KeyBinding keySearchPlayer = new KeyBinding(StatCollector.translateToLocal("key.Sanguimancy.search"), Keyboard.KEY_F, Sanguimancy.modid); - - public ClientEventHandler() { - ClientRegistry.registerKeyBinding(keySearchPlayer); + @SubscribeEvent + public void onBreakBoundTile(BlockEvent.BreakEvent event) { + if (event.world.getTileEntity(event.x, event.y, event.z) != null && event.world.getTileEntity(event.x, event.y, event.z) instanceof TileCamouflageBound) { + TileCamouflageBound tile = (TileCamouflageBound) event.world.getTileEntity(event.x, event.y, event.z); + if (tile.getOwnersList() == null) tile.setOwnersList(new ArrayList()); + if (!tile.getOwnersList().isEmpty() && !tile.getOwnersList().contains(event.getPlayer().getCommandSenderName())) { + event.getPlayer().addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("info.Sanguimancy.tooltip.wrong.player"))); + event.setCanceled(true); + } } + } - @SubscribeEvent - public void onKeyInput(InputEvent.KeyInputEvent event) { - if (keySearchPlayer.isPressed()) { - PacketHandler.INSTANCE.sendToServer(new PacketPlayerSearch()); - } + @SubscribeEvent + public void onTranspositionSigilLightning(EntityStruckByLightningEvent event) { + if (event.lightning.getEntityData() != null && event.lightning.getEntityData().getBoolean("isTranspositionSigilBolt")) { + event.setCanceled(true); } - */ + } - public ClientEventHandler() { + @SubscribeEvent + public void onTeleposeBlock(TeleposeEvent event) { + if (!ConfigHandler.enableTelepositionBlacklist && (RandomUtils.teleposerBlacklist.contains(event.finalBlock) || RandomUtils.teleposerBlacklist.contains(event.initialBlock))) { + event.setCanceled(true); } + } + public static class ClientEventHandler { + /* + public static KeyBinding keySearchPlayer = new KeyBinding(StatCollector.translateToLocal("key.Sanguimancy.search"), Keyboard.KEY_F, Sanguimancy.modid); + public ClientEventHandler() {ClientRegistry.registerKeyBinding(keySearchPlayer);} @SubscribeEvent - public void onRenderPlayerSpecialAntlers(RenderPlayerEvent.Pre event) { - String names[] = {"Tombenpotter", "Speedynutty68", "WayofFlowingTime", "Jadedcat", "Kris1432", "Drullkus", "TheOrangeGenius", "Direwolf20", "Pahimar", "ValiarMarcus", "Alex_hawks", "StoneWaves", "DemoXin"}; + public void onKeyInput(InputEvent.KeyInputEvent event) {if (keySearchPlayer.isPressed()) {PacketHandler.INSTANCE.sendToServer(new PacketPlayerSearch());} + */ + + private static float renderTicks; + private static long tickTime = 0L; + + public void onRenderPlayerSpecialAntlers(RenderPlayerEvent.Specials.Post event) { + String names[] = {"Tombenpotter", "TehNut", "WayofFlowingTime", "Jadedcat", "Kris1432", "Drullkus", "TheOrangeGenius", "Direwolf20", "Pahimar", "ValiarMarcus", "Alex_hawks", "StoneWaves", "DemoXin", "insaneau"}; for (String name : names) { if (event.entityPlayer.getCommandSenderName().equalsIgnoreCase(name)) { GL11.glPushMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - event.renderer.modelBipedMain.bipedBody.render(0.1F); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/items/Wand.png")); GL11.glTranslatef(0.0F, -0.95F, -0.125F); Tessellator tesselator = Tessellator.instance; @@ -359,6 +376,56 @@ public void onRenderPlayerSpecialAntlers(RenderPlayerEvent.Pre event) { } } + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent event) { + renderTicks = event.renderTickTime; + } + + @SubscribeEvent + public void onClientTick(TickEvent.ClientTickEvent event) { + tickTime += 1L; + } + + private float render() { + return (float) tickTime + renderTicks; + } + + @SubscribeEvent + public void onRenderPlayerFish(RenderPlayerEvent.Specials.Post event) { + if (ConfigHandler.renderSillyAprilFish) { + GL11.glPushMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Sanguimancy.texturePath + ":textures/items/AprilFish.png")); + GL11.glTranslatef(0F, -0.95F, 0F); + Tessellator tesselator = Tessellator.instance; + + float flap = (1.0F + (float) Math.cos(render() / 4.0F)) * 13.0F; + + GL11.glPushMatrix(); + GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-flap, 0.0F, 1.0F, 0.0F); + tesselator.startDrawingQuads(); + tesselator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + tesselator.addVertexWithUV(0.0D, 1.0D, 0.0D, 0.0D, 1.0D); + tesselator.addVertexWithUV(1.0D, 1.0D, 0.0D, 1.0D, 1.0D); + tesselator.addVertexWithUV(1.0D, 0.0D, 0.0D, 1.0D, 0.0D); + tesselator.draw(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glRotatef(flap, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(20.0F, 0.0F, 1.0F, 0.0F); + tesselator.startDrawingQuads(); + tesselator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + tesselator.addVertexWithUV(0.0D, 1.0D, 0.0D, 0.0D, 1.0D); + tesselator.addVertexWithUV(-1.0D, 1.0D, 0.0D, 1.0D, 1.0D); + tesselator.addVertexWithUV(-1.0D, 0.0D, 0.0D, 1.0D, 0.0D); + tesselator.draw(); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + } + } + @SubscribeEvent public void prePlayerRender(RenderPlayerEvent.Pre event) { if (SoulCorruptionHelper.getClientPlayerCorruption() >= 20) { diff --git a/src/main/java/tombenpotter/sanguimancy/util/RandomUtils.java b/src/main/java/tombenpotter/sanguimancy/util/RandomUtils.java index 2573fc8..b895576 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/RandomUtils.java +++ b/src/main/java/tombenpotter/sanguimancy/util/RandomUtils.java @@ -1,5 +1,6 @@ package tombenpotter.sanguimancy.util; +import WayofTime.alchemicalWizardry.ModItems; import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -24,7 +25,6 @@ import net.minecraftforge.oredict.OreDictionary; import tombenpotter.sanguimancy.Sanguimancy; import tombenpotter.sanguimancy.api.objects.MapKey; -import tombenpotter.sanguimancy.registry.BlocksRegistry; import tombenpotter.sanguimancy.registry.ItemsRegistry; import tombenpotter.sanguimancy.world.WorldProviderSoulNetworkDimension; @@ -42,6 +42,9 @@ public class RandomUtils { public static HashMap oreDictColor = new HashMap(); public static Item.ToolMaterial corruptedMaterial = EnumHelper.addToolMaterial("corruptedToolMaterial", Integer.MAX_VALUE, 9000, 32, 10, 32); public static HashMap logToPlank = new HashMap(); + public static ArrayList oreLumpList = new ArrayList(); + public static ArrayList transpositionBlockBlacklist = new ArrayList(); + public static ArrayList teleposerBlacklist = new ArrayList(); public static void dropItems(World world, int x, int y, int z) { Random rand = new Random(); @@ -382,7 +385,11 @@ public static void renderBlock(RenderWorldLastEvent event, EntityPlayer player, } public static void setLogToPlank() { - ArrayList arrayList = OreDictionary.getOres("plankWood"); + getCraftingRecipeForOreDictItem("plankWood", logToPlank); + } + + public static void getCraftingRecipeForOreDictItem(String ore, HashMap map) { + ArrayList arrayList = OreDictionary.getOres(ore); for (Object o : CraftingManager.getInstance().getRecipeList()) { IRecipe recipe = (IRecipe) o; ItemStack output = recipe.getRecipeOutput(); @@ -406,7 +413,7 @@ public static void setLogToPlank() { ItemStack plank = output.copy(); plank.stackSize = 1; if (log != null) { - logToPlank.put(new MapKey(log.copy()), plank); + map.put(new MapKey(log.copy()), plank); } } } @@ -431,64 +438,50 @@ public static NBTTagCompound getModTag(EntityPlayer player, String modName) { return modTag; } + public static void setOreLumpList() { + for (String ore : OreDictionary.getOreNames()) { + if (ore.startsWith("ore")) { + String output = ore.substring(3); + if (!OreDictionary.getOres(ore).isEmpty() && !OreDictionary.getOres("ingot" + output).isEmpty()) { + ItemStack stack = new ItemStack(ItemsRegistry.oreLump); + checkAndSetCompound(stack); + stack.stackTagCompound.setString("ore", output); + oreLumpList.add(stack); + } + } + } + } - public static class SanguimancyItemStacks { + public static void setTranspositionBlockBlacklist() { + for (String s : ConfigHandler.transpositionSigilBlacklist) { + if (Block.getBlockFromName(s) != null) transpositionBlockBlacklist.add(Block.getBlockFromName(s)); + else Sanguimancy.logger.error(s + " is not a correct block name."); + } + } - // Items - public static ItemStack unattunedPlayerSacrificer = new ItemStack(ItemsRegistry.playerSacrificer, 1, 0); - public static ItemStack attunnedPlayerSacrificer = new ItemStack(ItemsRegistry.playerSacrificer, 1, 1); - public static ItemStack focusedPlayerSacrificer = new ItemStack(ItemsRegistry.playerSacrificer, 1, 2); - public static ItemStack wayToDie = new ItemStack(ItemsRegistry.playerSacrificer, 1, 3); - public static ItemStack addCorruption = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 0); - public static ItemStack removeCorruption = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 1); - public static ItemStack negateCorruption = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 2); - public static ItemStack corruptionReader = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 3); - public static ItemStack corruptedDemonShard = new ItemStack(ItemsRegistry.corruptedDemonShard); - public static ItemStack corruptionCatalist = new ItemStack(ItemsRegistry.corruptionCatalyst); - public static ItemStack oreLump = new ItemStack(ItemsRegistry.oreLump); - public static ItemStack bloodAmulet = new ItemStack(ItemsRegistry.bloodAmulet); - public static ItemStack wand = new ItemStack(ItemsRegistry.wand); - public static ItemStack chunkClaimer = new ItemStack(ItemsRegistry.chunkClaimer); - public static ItemStack corruptedSword = new ItemStack(ItemsRegistry.corruptedSword); - public static ItemStack corruptedPickaxe = new ItemStack(ItemsRegistry.corruptedPickaxe); - public static ItemStack corruptedShovel = new ItemStack(ItemsRegistry.corruptedShovel); - public static ItemStack corruptedAxe = new ItemStack(ItemsRegistry.corruptedAxe); - public static ItemStack corruptedMineral = new ItemStack(ItemsRegistry.corruptedMineral); - public static ItemStack imbuedStick = new ItemStack(ItemsRegistry.imbuedStick); - public static ItemStack playerGuide = new ItemStack(ItemsRegistry.playerGuide); + public static ItemStack getOrbForLevel(int orbLevel) { + switch (orbLevel) { + default: + return new ItemStack(ModItems.weakBloodOrb); + case 1: + return new ItemStack(ModItems.weakBloodOrb); + case 2: + return new ItemStack(ModItems.apprenticeBloodOrb); + case 3: + return new ItemStack(ModItems.magicianBloodOrb); + case 4: + return new ItemStack(ModItems.masterBloodOrb); + case 5: + return new ItemStack(ModItems.archmageBloodOrb); + case 6: + return new ItemStack(ModItems.transcendentBloodOrb); + } + } - // Blocks - public static ItemStack altarEmitter = new ItemStack(BlocksRegistry.altarEmitter); - public static ItemStack altarDiviner = new ItemStack(BlocksRegistry.altarDiviner); - public static ItemStack sacrificeTransferrer = new ItemStack(BlocksRegistry.sacrificeTransfer); - public static ItemStack diamondOreIllusion = new ItemStack(BlocksRegistry.illusion, 1, 0); - public static ItemStack diamondBlockIllusion = new ItemStack(BlocksRegistry.illusion, 1, 1); - public static ItemStack glowstoneIllusion = new ItemStack(BlocksRegistry.illusion, 1, 2); - public static ItemStack netherrackIllusion = new ItemStack(BlocksRegistry.illusion, 1, 3); - public static ItemStack quartzOreIllusion = new ItemStack(BlocksRegistry.illusion, 1, 4); - public static ItemStack endStoneIllusion = new ItemStack(BlocksRegistry.illusion, 1, 5); - public static ItemStack pinkWoolIllusion = new ItemStack(BlocksRegistry.illusion, 1, 6); - public static ItemStack lavaIllusion = new ItemStack(BlocksRegistry.illusion, 1, 7); - public static ItemStack jackOLanternIllusion = new ItemStack(BlocksRegistry.illusion, 1, 8); - public static ItemStack bedrockIllusion = new ItemStack(BlocksRegistry.illusion, 1, 9); - public static ItemStack obsidianIllusion = new ItemStack(BlocksRegistry.illusion, 1, 10); - public static ItemStack glassIllusion = new ItemStack(BlocksRegistry.illusion, 1, 11); - public static ItemStack snowIllusion = new ItemStack(BlocksRegistry.illusion, 1, 12); - public static ItemStack melonIllusion = new ItemStack(BlocksRegistry.illusion, 1, 13); - public static ItemStack goldBlockIllusion = new ItemStack(BlocksRegistry.illusion, 1, 14); - public static ItemStack clayIllusion = new ItemStack(BlocksRegistry.illusion, 1, 15); - public static ItemStack corruptionCrystallizer = new ItemStack(BlocksRegistry.corruptionCrystallizer); - public static ItemStack lumpCleaner = new ItemStack(BlocksRegistry.lumpCleaner); - public static ItemStack bloodTank = new ItemStack(BlocksRegistry.bloodTank); - public static ItemStack bloodstoneStairs = new ItemStack(BlocksRegistry.bloodStoneStairs); - public static ItemStack largeBloodstoneStairs = new ItemStack(BlocksRegistry.largeBloodStoneStairs); - public static ItemStack bloodstoneSlab = new ItemStack(BlocksRegistry.bloodstoneSlab); - public static ItemStack largeBloodstoneSlab = new ItemStack(BlocksRegistry.largeBloodstoneSlab); - public static ItemStack boundItem = new ItemStack(BlocksRegistry.boundItem); - public static ItemStack simpleBranch = new ItemStack(BlocksRegistry.simpleBranch); - public static ItemStack simpleKnot = new ItemStack(BlocksRegistry.simpleKnot); - public static ItemStack toggleKnot = new ItemStack(BlocksRegistry.toggleKnot); - public static ItemStack bloodInterface = new ItemStack(BlocksRegistry.bloodInterface); - public static ItemStack ritualRepresentation = new ItemStack(BlocksRegistry.ritualRepresentation); + public static void setTeleposerBlacklist() { + for (String s : ConfigHandler.teleposerBlacklist) { + if (Block.getBlockFromName(s) != null) teleposerBlacklist.add(Block.getBlockFromName(s)); + else Sanguimancy.logger.error(s + " is not a correct block name."); + } } } diff --git a/src/main/java/tombenpotter/sanguimancy/util/RitualUtils.java b/src/main/java/tombenpotter/sanguimancy/util/RitualUtils.java index d12ef8b..c644930 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/RitualUtils.java +++ b/src/main/java/tombenpotter/sanguimancy/util/RitualUtils.java @@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -19,7 +20,7 @@ public static void placeInInventory(Block block, World world, int x, int y, int if (block.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0) != null) { for (ItemStack stack : block.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0)) { ItemStack copyStack = stack.copy(); - SpellHelper.insertStackIntoInventory(copyStack, tile); + SpellHelper.insertStackIntoInventory(copyStack, tile, ForgeDirection.UNKNOWN); if (copyStack.stackSize > 0) { world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); } @@ -30,7 +31,7 @@ public static void placeInInventory(Block block, World world, int x, int y, int public static void silkPlaceInInventory(Block block, World world, int x, int y, int z, IInventory tile) { if (block.canSilkHarvest(world, null, x, y, z, world.getBlockMetadata(x, y, z))) { ItemStack copyStack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z)).copy(); - SpellHelper.insertStackIntoInventory(copyStack, tile); + SpellHelper.insertStackIntoInventory(copyStack, tile, ForgeDirection.UNKNOWN); if (copyStack.stackSize > 0) { world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); } @@ -42,13 +43,13 @@ public static void smeltPlaceInInventory(Block block, World world, int x, int y, for (ItemStack stack : block.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0)) { ItemStack copyStack = stack.copy(); if (FurnaceRecipes.smelting().getSmeltingResult(copyStack) == null) { - SpellHelper.insertStackIntoInventory(copyStack, tile); + SpellHelper.insertStackIntoInventory(copyStack, tile, ForgeDirection.UNKNOWN); if (copyStack.stackSize > 0) { world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); } } else { ItemStack output = FurnaceRecipes.smelting().getSmeltingResult(stack).copy(); - SpellHelper.insertStackIntoInventory(output, tile); + SpellHelper.insertStackIntoInventory(output, tile, ForgeDirection.UNKNOWN); if (output.stackSize > 0) { world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, output)); } diff --git a/src/main/java/tombenpotter/sanguimancy/util/SanguimancyItemStacks.java b/src/main/java/tombenpotter/sanguimancy/util/SanguimancyItemStacks.java new file mode 100644 index 0000000..3ed92ec --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/util/SanguimancyItemStacks.java @@ -0,0 +1,77 @@ +package tombenpotter.sanguimancy.util; + +import net.minecraft.item.ItemStack; +import tombenpotter.sanguimancy.registry.BlocksRegistry; +import tombenpotter.sanguimancy.registry.ItemsRegistry; + +public class SanguimancyItemStacks { + + // Items + public static ItemStack unattunedPlayerSacrificer = new ItemStack(ItemsRegistry.playerSacrificer, 1, 0); + public static ItemStack attunnedPlayerSacrificer = new ItemStack(ItemsRegistry.playerSacrificer, 1, 1); + public static ItemStack focusedPlayerSacrificer = new ItemStack(ItemsRegistry.playerSacrificer, 1, 2); + public static ItemStack wayToDie = new ItemStack(ItemsRegistry.playerSacrificer, 1, 3); + public static ItemStack addCorruption = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 0); + public static ItemStack removeCorruption = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 1); + public static ItemStack negateCorruption = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 2); + public static ItemStack corruptionReader = new ItemStack(ItemsRegistry.soulCorruptionTest, 1, 3); + public static ItemStack corruptedDemonShard = new ItemStack(ItemsRegistry.resource, 1, 0); + public static ItemStack corruptionCatalist = new ItemStack(ItemsRegistry.corruptionCatalyst); + public static ItemStack oreLump = new ItemStack(ItemsRegistry.oreLump); + public static ItemStack bloodAmulet = new ItemStack(ItemsRegistry.bloodAmulet); + public static ItemStack wand = new ItemStack(ItemsRegistry.wand); + public static ItemStack chunkClaimer = new ItemStack(ItemsRegistry.chunkClaimer); + public static ItemStack corruptedSword = new ItemStack(ItemsRegistry.corruptedSword); + public static ItemStack corruptedPickaxe = new ItemStack(ItemsRegistry.corruptedPickaxe); + public static ItemStack corruptedShovel = new ItemStack(ItemsRegistry.corruptedShovel); + public static ItemStack corruptedAxe = new ItemStack(ItemsRegistry.corruptedAxe); + public static ItemStack corruptedMineral = new ItemStack(ItemsRegistry.resource, 1, 1); + public static ItemStack imbuedStick = new ItemStack(ItemsRegistry.resource, 1, 2); + public static ItemStack etherealManifestation = new ItemStack(ItemsRegistry.resource, 1, 3); + public static ItemStack soulTransporter = new ItemStack(ItemsRegistry.soulTransporter); + public static ItemStack telepositionSigil = new ItemStack(ItemsRegistry.telepositionSigil); + public static ItemStack transpositionSigil = new ItemStack(ItemsRegistry.transpositionSigil); + public static ItemStack sanguineShifter = new ItemStack(ItemsRegistry.resource, 1, 4); + + // Blocks + public static ItemStack altarEmitter = new ItemStack(BlocksRegistry.altarEmitter); + public static ItemStack altarDiviner = new ItemStack(BlocksRegistry.altarDiviner); + public static ItemStack sacrificeTransferrer = new ItemStack(BlocksRegistry.sacrificeTransfer); + public static ItemStack diamondOreIllusion = new ItemStack(BlocksRegistry.illusion, 1, 0); + public static ItemStack diamondBlockIllusion = new ItemStack(BlocksRegistry.illusion, 1, 1); + public static ItemStack glowstoneIllusion = new ItemStack(BlocksRegistry.illusion, 1, 2); + public static ItemStack netherrackIllusion = new ItemStack(BlocksRegistry.illusion, 1, 3); + public static ItemStack quartzOreIllusion = new ItemStack(BlocksRegistry.illusion, 1, 4); + public static ItemStack endStoneIllusion = new ItemStack(BlocksRegistry.illusion, 1, 5); + public static ItemStack pinkWoolIllusion = new ItemStack(BlocksRegistry.illusion, 1, 6); + public static ItemStack lavaIllusion = new ItemStack(BlocksRegistry.illusion, 1, 7); + public static ItemStack jackOLanternIllusion = new ItemStack(BlocksRegistry.illusion, 1, 8); + public static ItemStack bedrockIllusion = new ItemStack(BlocksRegistry.illusion, 1, 9); + public static ItemStack obsidianIllusion = new ItemStack(BlocksRegistry.illusion, 1, 10); + public static ItemStack glassIllusion = new ItemStack(BlocksRegistry.illusion, 1, 11); + public static ItemStack snowIllusion = new ItemStack(BlocksRegistry.illusion, 1, 12); + public static ItemStack melonIllusion = new ItemStack(BlocksRegistry.illusion, 1, 13); + public static ItemStack goldBlockIllusion = new ItemStack(BlocksRegistry.illusion, 1, 14); + public static ItemStack clayIllusion = new ItemStack(BlocksRegistry.illusion, 1, 15); + public static ItemStack corruptionCrystallizer = new ItemStack(BlocksRegistry.corruptionCrystallizer); + public static ItemStack lumpCleaner = new ItemStack(BlocksRegistry.lumpCleaner); + public static ItemStack bloodTank = new ItemStack(BlocksRegistry.bloodTank); + public static ItemStack bloodstoneStairs = new ItemStack(BlocksRegistry.bloodStoneStairs); + public static ItemStack largeBloodstoneStairs = new ItemStack(BlocksRegistry.largeBloodStoneStairs); + public static ItemStack bloodstoneSlab = new ItemStack(BlocksRegistry.bloodstoneSlab); + public static ItemStack largeBloodstoneSlab = new ItemStack(BlocksRegistry.largeBloodstoneSlab); + public static ItemStack boundItem = new ItemStack(BlocksRegistry.boundItem); + public static ItemStack simpleBranch = new ItemStack(BlocksRegistry.simpleBranch); + public static ItemStack simpleKnot = new ItemStack(BlocksRegistry.simpleKnot); + public static ItemStack toggleKnot = new ItemStack(BlocksRegistry.toggleKnot); + public static ItemStack bloodInterface = new ItemStack(BlocksRegistry.bloodInterface); + public static ItemStack ritualRepresentation = new ItemStack(BlocksRegistry.ritualRepresentation); + public static ItemStack etherealBlock = new ItemStack(BlocksRegistry.etherealBlock); + public static ItemStack etherealCorruptedBlock = new ItemStack(BlocksRegistry.etherealCorruptedBlock); + public static ItemStack etherealToggledBlock = new ItemStack(BlocksRegistry.etherealToggledBlock); + public static ItemStack etherealBoundBlock = new ItemStack(BlocksRegistry.etherealBoundBlock); + public static ItemStack etherealBoundCorruptedBlock = new ItemStack(BlocksRegistry.etherealBoundCorruptedBlock); + public static ItemStack etherealBoundToggledBlock = new ItemStack(BlocksRegistry.etherealBoundToggledBlock); + public static ItemStack personalEtherealBlock = new ItemStack(BlocksRegistry.etherealPersonalBlock); + public static ItemStack altarManipulator = new ItemStack(BlocksRegistry.altarManipulator); +} \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/util/TeleportingUtils.java b/src/main/java/tombenpotter/sanguimancy/util/TeleportingUtils.java deleted file mode 100644 index 904a0f2..0000000 --- a/src/main/java/tombenpotter/sanguimancy/util/TeleportingUtils.java +++ /dev/null @@ -1,116 +0,0 @@ -package tombenpotter.sanguimancy.util; - -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import cpw.mods.fml.common.FMLCommonHandler; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.play.server.S06PacketUpdateHealth; -import net.minecraft.network.play.server.S07PacketRespawn; -import net.minecraft.network.play.server.S1DPacketEntityEffect; -import net.minecraft.network.play.server.S1FPacketSetExperience; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.management.ServerConfigurationManager; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; - -import java.util.Iterator; - -public class TeleportingUtils { - - public static Entity teleportEntitySameDim(int x, int y, int z, Entity entity, String name) { - if (entity != null) { - if (entity.timeUntilPortal <= 0) { - if (entity instanceof EntityPlayer) { - EntityPlayerMP player = (EntityPlayerMP) entity; - player.setPositionAndUpdate(x, y, z); - player.worldObj.updateEntityWithOptionalForce(player, false); - player.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel())); - player.timeUntilPortal = 150; - SoulNetworkHandler.syphonFromNetwork(name, 1000); - player.worldObj.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); - return player; - } else { - WorldServer world = (WorldServer) entity.worldObj; - if (entity != null) { - entity.setPosition(x, y, z); - entity.timeUntilPortal = 150; - } - world.resetUpdateEntityTick(); - SoulNetworkHandler.syphonFromNetwork(name, 1000); - entity.worldObj.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); - return entity; - } - } - } - return null; - } - - //Adapated from Enhanced Portals 3 code - public static Entity teleportEntityToDim(World oldWorld, int newWorldID, int x, int y, int z, Entity entity, String name) { - if (entity != null) { - if (entity.timeUntilPortal <= 0) { - WorldServer oldWorldServer = MinecraftServer.getServer().worldServerForDimension(entity.dimension); - WorldServer newWorldServer = MinecraftServer.getServer().worldServerForDimension(newWorldID); - if (entity instanceof EntityPlayer) { - EntityPlayerMP player = (EntityPlayerMP) entity; - if (!player.worldObj.isRemote) { - player.worldObj.theProfiler.startSection("portal"); - player.worldObj.theProfiler.startSection("changeDimension"); - ServerConfigurationManager config = player.mcServer.getConfigurationManager(); - oldWorld.playSoundEffect(player.posX, player.posY, player.posZ, "mob.endermen.portal", 1.0F, 1.0F); - player.closeScreen(); - player.dimension = newWorldServer.provider.dimensionId; - player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorldServer.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType())); - oldWorldServer.removeEntity(player); - player.isDead = false; - player.setLocationAndAngles(x, y, z, player.rotationYaw, player.rotationPitch); - newWorldServer.spawnEntityInWorld(player); - player.setWorld(newWorldServer); - config.func_72375_a(player, oldWorldServer); - player.playerNetServerHandler.setPlayerLocation(x, y, z, entity.rotationYaw, entity.rotationPitch); - player.theItemInWorldManager.setWorld(newWorldServer); - config.updateTimeAndWeatherForPlayer(player, newWorldServer); - config.syncPlayerInventory(player); - player.worldObj.theProfiler.endSection(); - oldWorldServer.resetUpdateEntityTick(); - newWorldServer.resetUpdateEntityTick(); - player.worldObj.theProfiler.endSection(); - for (Iterator potion = player.getActivePotionEffects().iterator(); potion.hasNext(); ) { - player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potion.next())); - } - player.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); - FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldWorldServer.provider.dimensionId, player.dimension); - player.timeUntilPortal = 150; - } - player.worldObj.theProfiler.endSection(); - SoulNetworkHandler.syphonFromNetwork(name, 10000); - newWorldServer.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); - return player; - } else { - NBTTagCompound tag = new NBTTagCompound(); - entity.writeToNBTOptional(tag); - entity.setDead(); - oldWorld.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.endermen.portal", 1.0F, 1.0F); - Entity teleportedEntity = EntityList.createEntityFromNBT(tag, newWorldServer); - if (teleportedEntity != null) { - teleportedEntity.setLocationAndAngles(x, y, z, entity.rotationYaw, entity.rotationPitch); - teleportedEntity.forceSpawn = true; - newWorldServer.spawnEntityInWorld(teleportedEntity); - teleportedEntity.setWorld(newWorldServer); - teleportedEntity.timeUntilPortal = 150; - } - oldWorldServer.resetUpdateEntityTick(); - newWorldServer.resetUpdateEntityTick(); - SoulNetworkHandler.syphonFromNetwork(name, 10000); - newWorldServer.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); - return teleportedEntity; - } - } - } - return null; - } -} diff --git a/src/main/java/tombenpotter/sanguimancy/util/singletons/ClaimedChunks.java b/src/main/java/tombenpotter/sanguimancy/util/singletons/ClaimedChunks.java index 3a17abf..2950366 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/singletons/ClaimedChunks.java +++ b/src/main/java/tombenpotter/sanguimancy/util/singletons/ClaimedChunks.java @@ -103,6 +103,7 @@ public boolean removeLocation(String name, ChunkIntPairSerializable location) { } public ArrayList getLinkedChunks(String name) { + if (chunks.get(name) == null) chunks.put(name, new ArrayList()); return chunks.get(name); } } \ No newline at end of file diff --git a/src/main/java/tombenpotter/sanguimancy/util/singletons/LocationsHandler.java b/src/main/java/tombenpotter/sanguimancy/util/singletons/LocationsHandler.java index e21844e..8e8b1f6 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/singletons/LocationsHandler.java +++ b/src/main/java/tombenpotter/sanguimancy/util/singletons/LocationsHandler.java @@ -2,7 +2,7 @@ import net.minecraftforge.common.DimensionManager; import tombenpotter.sanguimancy.Sanguimancy; -import tombenpotter.sanguimancy.util.PortalLocation; +import tombenpotter.sanguimancy.util.teleporting.PortalLocation; import java.io.*; import java.util.ArrayList; diff --git a/src/main/java/tombenpotter/sanguimancy/util/PortalLocation.java b/src/main/java/tombenpotter/sanguimancy/util/teleporting/PortalLocation.java similarity index 96% rename from src/main/java/tombenpotter/sanguimancy/util/PortalLocation.java rename to src/main/java/tombenpotter/sanguimancy/util/teleporting/PortalLocation.java index f5479b3..ac46431 100644 --- a/src/main/java/tombenpotter/sanguimancy/util/PortalLocation.java +++ b/src/main/java/tombenpotter/sanguimancy/util/teleporting/PortalLocation.java @@ -1,4 +1,4 @@ -package tombenpotter.sanguimancy.util; +package tombenpotter.sanguimancy.util.teleporting; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/tombenpotter/sanguimancy/util/teleporting/SanguimancyTeleporter.java b/src/main/java/tombenpotter/sanguimancy/util/teleporting/SanguimancyTeleporter.java new file mode 100644 index 0000000..dcafeed --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/util/teleporting/SanguimancyTeleporter.java @@ -0,0 +1,31 @@ +package tombenpotter.sanguimancy.util.teleporting; + +import net.minecraft.entity.Entity; +import net.minecraft.world.Teleporter; +import net.minecraft.world.WorldServer; + +public class SanguimancyTeleporter extends Teleporter { + + public SanguimancyTeleporter(WorldServer worldServer) { + super(worldServer); + } + + @Override + public boolean makePortal(Entity p_85188_1_) { + return true; + } + + @Override + public void removeStalePortalLocations(long p_85189_1_) { + } + + @Override + public boolean placeInExistingPortal(Entity entity, double x, double y, double z, float p_77184_8_) { + return true; + } + + @Override + public void placeInPortal(Entity entity, double x, double y, double z, float p_77185_8_) { + entity.setLocationAndAngles(x, y, z, entity.rotationPitch, entity.rotationYaw); + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/util/teleporting/TeleportingQueue.java b/src/main/java/tombenpotter/sanguimancy/util/teleporting/TeleportingQueue.java new file mode 100644 index 0000000..96f76a0 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/util/teleporting/TeleportingQueue.java @@ -0,0 +1,80 @@ +package tombenpotter.sanguimancy.util.teleporting; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; + +public class TeleportingQueue { + private static TeleportingQueue teleportingQueue = new TeleportingQueue(); + private List queue = new ArrayList(); + + + public static TeleportingQueue getInstance() { + return teleportingQueue; + } + + public void teleportToDim(World oldWorld, int newWorld, int x, int y, int z, Entity entity, String name) { + queue.add(new TeleportToDim(oldWorld, newWorld, x, y, z, entity, name)); + } + + public void teleportSameDim(int x, int y, int z, Entity entity, String name) { + queue.add(new TeleportSameDim(x, y, z, entity, name)); + } + + @SubscribeEvent + public void serverTick(TickEvent.ServerTickEvent event) { + if (event.phase != TickEvent.Phase.END) return; + for (Teleport teleport : queue) teleport.teleport(); + queue.clear(); + } + + private abstract static class Teleport { + public abstract void teleport(); + } + + private static class TeleportSameDim extends Teleport { + int x, y, z; + Entity entity; + String name; + + public TeleportSameDim(int x, int y, int z, Entity entity, String name) { + this.x = x; + this.y = y; + this.z = z; + this.entity = entity; + this.name = name; + } + + @Override + public void teleport() { + TeleportingUtils.teleportEntitySameDim(x, y, z, entity, name); + } + } + + private static class TeleportToDim extends Teleport { + World oldWorld; + int newWorld; + int x, y, z; + Entity entity; + String name; + + public TeleportToDim(World oldWorld, int newWorld, int x, int y, int z, Entity entity, String name) { + this.oldWorld = oldWorld; + this.newWorld = newWorld; + this.x = x; + this.y = y; + this.z = z; + this.entity = entity; + this.name = name; + } + + @Override + public void teleport() { + TeleportingUtils.teleportEntityToDim(oldWorld, newWorld, x, y, z, entity, name); + } + } +} diff --git a/src/main/java/tombenpotter/sanguimancy/util/teleporting/TeleportingUtils.java b/src/main/java/tombenpotter/sanguimancy/util/teleporting/TeleportingUtils.java new file mode 100644 index 0000000..5951360 --- /dev/null +++ b/src/main/java/tombenpotter/sanguimancy/util/teleporting/TeleportingUtils.java @@ -0,0 +1,78 @@ +package tombenpotter.sanguimancy.util.teleporting; + +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class TeleportingUtils { + + public static Entity teleportEntitySameDim(int x, int y, int z, Entity entity, String name) { + if (entity != null) { + if (entity.timeUntilPortal <= 0) { + if (entity instanceof EntityPlayer) { + EntityPlayerMP player = (EntityPlayerMP) entity; + player.setPositionAndUpdate(x, y, z); + player.worldObj.updateEntityWithOptionalForce(player, false); + player.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel())); + player.timeUntilPortal = 150; + SoulNetworkHandler.syphonFromNetwork(name, 1000); + player.worldObj.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); + return player; + } else { + WorldServer world = (WorldServer) entity.worldObj; + entity.setPosition(x, y, z); + entity.timeUntilPortal = 150; + world.resetUpdateEntityTick(); + SoulNetworkHandler.syphonFromNetwork(name, 1000); + entity.worldObj.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); + return entity; + } + } + } + return null; + } + + public static void teleportEntityToDim(World oldWorld, int newWorldID, int x, int y, int z, Entity entity, String name) { + if (entity != null) { + if (entity.timeUntilPortal <= 0) { + MinecraftServer server = MinecraftServer.getServer(); + WorldServer oldWorldServer = server.worldServerForDimension(entity.dimension); + WorldServer newWorldServer = server.worldServerForDimension(newWorldID); + if (entity instanceof EntityPlayer) { + EntityPlayerMP player = (EntityPlayerMP) entity; + if (!player.worldObj.isRemote) { + server.getConfigurationManager().transferPlayerToDimension(player, newWorldID, new SanguimancyTeleporter(newWorldServer)); + player.setPositionAndUpdate(x, y, z); + player.worldObj.updateEntityWithOptionalForce(player, false); + player.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel())); + } + } else if (!entity.worldObj.isRemote) { + NBTTagCompound tag = new NBTTagCompound(); + entity.writeToNBTOptional(tag); + entity.setDead(); + oldWorld.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.endermen.portal", 1.0F, 1.0F); + Entity teleportedEntity = EntityList.createEntityFromNBT(tag, newWorldServer); + if (teleportedEntity != null) { + teleportedEntity.setLocationAndAngles(x, y, z, entity.rotationYaw, entity.rotationPitch); + teleportedEntity.forceSpawn = true; + newWorldServer.spawnEntityInWorld(teleportedEntity); + teleportedEntity.setWorld(newWorldServer); + teleportedEntity.timeUntilPortal = 150; + } + oldWorldServer.resetUpdateEntityTick(); + newWorldServer.resetUpdateEntityTick(); + } + entity.timeUntilPortal = 150; + SoulNetworkHandler.syphonFromNetwork(name, 10000); + newWorldServer.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F); + } + } + } +} diff --git a/src/main/resources/assets/sanguimancy/lang/en_US.lang b/src/main/resources/assets/sanguimancy/lang/en_US.lang index e179227..e673026 100644 --- a/src/main/resources/assets/sanguimancy/lang/en_US.lang +++ b/src/main/resources/assets/sanguimancy/lang/en_US.lang @@ -18,6 +18,7 @@ tile.Sanguimancy.illusion.snow.name=Snow tile.Sanguimancy.illusion.melon.name=Melon tile.Sanguimancy.illusion.gold.block.name=Gold Block tile.Sanguimancy.illusion.clay.name=Clay +tile.Sanguimancy.illusion.nether.brick.name=Nether Brick tile.Sanguimancy.corruptionCrystallizer.name=Soul Corruption Crystallizer tile.Sanguimancy.lumpCleaner.name=Blood Cleanser tile.Sanguimancy.bloodTank.name=Blood Tank @@ -35,6 +36,14 @@ tile.Sanguimancy.simpleSNKnot.name=Simple Soul Knot tile.Sanguimancy.toggleSNKnot.name=Toggled Soul Knot tile.Sanguimancy.simpleSNBranch.name=Simple Soul Branch tile.Sanguimancy.ritualRepresentation.name=Ritual Representation +tile.Sanguimancy.etherealBlock.name=Ethereal Block +tile.Sanguimancy.etherealCorruptedBlock.name=Corrupted Ethereal Block +tile.Sanguimancy.etherealToggledBlock.name=Toggled Ethereal Block +tile.Sanguimancy.etherealBoundBlock.name=Bound Ethereal Block +tile.Sanguimancy.etherealBoundCorruptedBlock.name=Bound Corrupted Ethereal Block +tile.Sanguimancy.etherealBoundToggledBlock.name=Bound Toggled Ethereal Block +tile.Sanguimancy.etherealPersonalBlock.name=Personal Ethereal Block +tile.Sanguimancy.altarManipulator.name=Altar Manipulator #Items item.Sanguimancy.playerSacrificer.unattuned.name=Unattuned Player Sacrificing Stone @@ -45,9 +54,9 @@ item.Sanguimancy.soulCorruption.add.name=Add Soul Corruption item.Sanguimancy.soulCorruption.remove.name=Remove Soul Corruption item.Sanguimancy.soulCorruption.negate.name=Negate Soul Corruption item.Sanguimancy.soulCorruption.reader.name=Soul Corruption Reader -item.Sanguimancy.corruptedDemonShard.name=Corrupted Demon Shard +item.Sanguimancy.resource.corruptedDemonShard.name=Corrupted Demon Shard item.Sanguimancy.corruptionCatalist.name=Corruption Catalyst -item.Sanguimancy.oreLump.name=Ore Lump +item.Sanguimancy.oreLump.name=%s Ore Lump item.Sanguimancy.bloodAmulet.name=Blood Amulet item.Sanguimancy.spellWand.name=Wand item.Sanguimancy.chunkClaimer.name=Soul Chunk Claimer @@ -55,9 +64,13 @@ item.Sanguimancy.corruptedSword.name=Corrupted Blade item.Sanguimancy.corruptedPickaxe.name=Corrupted Pickaxe item.Sanguimancy.corruptedShovel.name=Corrupted Shovel item.Sanguimancy.corruptedAxe.name=Corrupted Axe -item.Sanguimancy.playerGuide.name=Sanguimancy: A How-To Guide -item.Sanguimancy.corruptedMineral.name=Corrupted Mineral -item.Sanguimancy.imbuedStick.name=Imbued Stick +item.Sanguimancy.resource.corruptedMineral.name=Corrupted Mineral +item.Sanguimancy.resource.imbuedStick.name=Imbued Stick +item.Sanguimancy.resource.etherealManifestation.name=Ethereal Manifestation +item.Sanguimancy.soulTransporter.name=Soul Transposer +item.Sanguimancy.telepositionSigil.name=Teleposition Sigil +item.Sanguimancy.transpositionSigil.name=Sigil of Transposition +item.Sanguimancy.resource.manipulatorUpgrade.name=Sanguine Shifter #Entities entity.Sanguimancy.EntityChickenMinion.name=Chicken Minion @@ -88,7 +101,7 @@ chat.Sanguimancy.deactivated=The item's ties to your Soul seem to be weakened to chat.Sanguimancy.removed=The item's ties to your Soul seem to be severed. chat.Sanguimancy.added.success=You feel something creating ties to your Soul. chat.Sanguimancy.added.fail=You feel something failing to create ties to your Soul... -chat.Sanguimancy.successfully.claimed=This chunk was successfully claimed. +chat.Sanguimancy.successfully.claimed=The chunk at x: %x%, y: %y% in dimension %dim% was successfully claimed. chat.Sanguimancy.unsuccessfully.claimed=This chunk is already claimed. chat.Sanguimancy.intial.claimer=This was dropped when your Soul formed. chat.Sanguimancy.not.sn.dim=You are not in the Soul Network Dimension. @@ -109,9 +122,10 @@ info.Sanguimancy.tooltip.creative.only=Creative Only info.Sanguimancy.tooltip.illusion=The block is a lie. info.Sanguimancy.tooltip.corrupted.infusion.1=With this item in your inventory, info.Sanguimancy.tooltip.corrupted.infusion.2=Corrupted Infusion can start. -info.Sanguimancy.tooltip.ore=Ore +info.Sanguimancy.tooltip.ore=%s Ore info.Sanguimancy.tooltip.amount=Amount info.Sanguimancy.tooltip.fluid=Fluid +info.Sanguimancy.tooltip.capacity=Capacity info.Sanguimancy.tooltip.none=None info.Sanguimancy.tooltip.any=Any Ore Lump info.Sanguimancy.tooltip.per.point=per half-heart @@ -119,7 +133,7 @@ info.Sanguimancy.tooltip.activated=Ability Activated info.Sanguimancy.tooltip.owner=Current Owner info.Sanguimancy.tooltip.minimum.corruption.1=Minimum corruption to reach the tool's info.Sanguimancy.tooltip.minimum.corruption.2=default capabilities -info.Sanguimancy.tooltip.wrong.player=This is not yours to use. +info.Sanguimancy.tooltip.wrong.player=This is not yours to break. info.Sanguimancy.tooltip.mode=Mode info.Sanguimancy.tooltip.mode.regular=Normal info.Sanguimancy.tooltip.pickaxe.mode.silk.touch=Silk Touch @@ -138,13 +152,32 @@ info.Sanguimancy.tooltip.book.author=By Tombenpotter info.Sanguimancy.tooltip.spell.current=Current Spell info.Sanguimancy.tooltip.coordinates=Coordinates info.Sanguimancy.tooltip.bound.dimension=Bound Dimension +info.Sanguimancy.tooltip.teleposition.sigil.pun=I am very close to being moved by this. +info.Sanguimancy.tooltip.evil.toaster=Evil Toaster since 1996 +info.Sanguimancy.tooltip.shift.transposition.sigil.pun=Trans.... position of course! +info.Sanguimancy.tooltip.place.top=Place on top of Altar #Guide Entries +guide.Sanguimancy.book.name=Delving into the Darkness +guide.Sanguimancy.book.title=A Journey through the Magicks +guide.Sanguimancy.welcomeMessage=Welcome, Blood Magicker, to your journey through the Dark paths in Blood Magic. Strange and dangerous things will happen should you follow this path. Thou hast been warned. + guide.Sanguimancy.category.lore=Of Dark Magicks guide.Sanguimancy.category.items=Items guide.Sanguimancy.category.blocks=Blocks guide.Sanguimancy.category.rituals=Rituals +#Page Info +text.recipe.shapedOrb=Shaped Orb Recipe + +text.recipe.altar=Blood Altar +text.recipe.altar.tier=Tier: %s +text.recipe.altar.bloodRequired=LP: %s + +text.recipe.corrupted=Corruption +text.recipe.corruption.minCorruption=Minimum Corruption: %s +text.recipe.corruption.duration=Duration: %s + #Items guide.Sanguimancy.entry.corruptionReader=The Reader allows you to keep an eye on your Soul Corruption. Right clicking the reader will tell you how corrupted your Soul is. guide.Sanguimancy.entry.sacrificingStones.1=The Unattuned Player Sacrificing Stone is the base of a mechanic in Sanguimancy, LP transfer. @@ -162,6 +195,10 @@ guide.Sanguimancy.entry.corruptedAxe=The Corrupted Axe is part of the Corrupted guide.Sanguimancy.entry.corruptedPickaxe=The Corrupted Pickaxe is part of the Corrupted Tool set. While its primary function is to break blocks, the corruption imbued in it developed other abilities. The particularity of this tool is the fact that the speed at which the blocks are broken entirely depends on how corrupted the owner's Soul is. To reach the tool's base capabilities, the owner needs to have reached a certain level of corruption, precised in the tooltip. Before, the capabilities are lowered, and after they are augmented. There are 5 different modes, plus the regular mode. Every time a block is broken or an entity hit, some Life Essence from your Soul Network is consumed. If the tool isn't in the base mode, the owner gains Soul Corruption for each use. The first mode of the Corrupted Pickaxe is the Silk Touch mode. The second, third and fourth modes are the fortune modes, each adding a level of fortune to the tool. The fifth mode is the Auto-Smelting mode. If the block broken can be smelted, the result of the smelting will be dropped. If not, the block will simply be dropped. guide.Sanguimancy.entry.corruptedShovel=The Corrupted Shovel is part of the Corrupted Tool set. While its primary function is to break blocks, the corruption imbued in it developed other abilities. The particularity of this tool is the fact that the speed at which the blocks are broken entirely depends on how corrupted the owner's Soul is. To reach the tool's base capabilities, the owner needs to have reached a certain level of corruption, precised in the tooltip. Before, the capabilities are lowered, and after they are augmented. There are 3 different modes, plus the regular mode. Every time a block is broken or an entity hit, some Life Essence from your Soul Network is consumed. If the tool isn't in the base mode, the owner gains Soul Corruption for each use. The first mode of the Corrupted Shovel is the Breaking Down mode. If the block mined is amongst a list of blocks, a ghost image of another block will be displayed on one of the 6 sides of the block. When the block is broken it will be replaced by the block the ghost image was showing. The second mode is the Gold Digging mode. When breaking gravel with the shovel in that mode, the gravel block will not be dropped. Instead, there is a chance for a diamond, a gold nugget and an emerald to be dropped. The third mode is the Transmutation mode. If the block mined is amongst a list of blocks, a ghost image of another block will be displayed on one of the 6 sides of the block. When the block is broken it will be replaced by the block the ghost image was showing. guide.Sanguimancy.entry.corruptedSword=The Corrupted Sword is part of the Corrupted Tool set. While its primary function is to hit mobs, the corruption imbued in it developed other abilities. The particularity of this tool is the fact that the damage it does entirely depends on how corrupted the owner's Soul is. To reach the tool's base capabilities, the owner needs to have reached a certain level of corruption, precised in the tooltip. Before, the capabilities are lowered, and after they are augmented. There is one main ability. Every time a block is broken or an entity hit, some Life Essence from your Soul Network is consumed. If the tool isn't in the base mode, the owner gains Soul Corruption for each use. The tool's ability is the Heart Stealing ability. When a player is hit by this sword, and the ability is activated, some hearts are taken from the player who has hit, and added to the life of the player who holds the sword. The maximum number of hearts that can be stolen is 7,5. Which means a player can be down to 2,5 hearts for a full minute, while another can go up to 17,5 for one minute. +guide.Sanguimancy.entry.etherealManifestation=You must have an Ethereal Manifestation in your inventory while binding an item or activating a ritual if you want it to have its representation in the Soul Network Dimension. +guide.Sanguimancy.entry.soulTransporter=The Soul Transporter is an item that allows you to teleport to the Soul Network Dimension. Do not forget to bring two, as there is no other way in and out of the dimension! +guide.Sanguimancy.entry.telepositionSigil=The Teleposition Sigil is an item that will teleport you to a location previously set. To set that location, simply shift-right click on a teleposer with the Sigil in hand. Right click the Sigil to teleport back to that location. Teleporting in the same dimension costs 1000LP, while teleporting across dimensions costs 10000LP. +guide.Sanguimancy.entry.transpositionSigil=The Transposition Sigil allows the player to move any block he can break without actually doing so. Indeed, shift-right clicking on a block with the sigil will store it inside the item if the sigil is empty. Right clicking again will set the block back in the exact state it was picked up. #Blocks guide.Sanguimancy.entry.soulTransferrer=The Soul Transferrer is the block the allows you to actually transfer the stolen LP to yourself via the LP stealing mechanic. See the Sacrifice Magic Entry in 'Of Dark Magic' @@ -178,10 +215,18 @@ guide.Sanguimancy.entry.ritualManifestation=This block appears inside the chunks guide.Sanguimancy.entry.soulBranch=The Soul Branch is used to link different Soul Representations to a Soul Knot. Once they are connected to a Soul Knot, flames appear to show the link. guide.Sanguimancy.entry.simpleKnot=The Simple Soul Knot is the very core of the controlling of different Soul Representations. If a Representation is linked to a Soul Knot, directly or via Soul Branches, you are able to gain some control over your network. When the Soul Knot is right clicked with a divination sigil, any Soul Representation linked to it is disabled. This overrides any redstone power disabling. Right click it again to re-enable the Soul Knot. guide.Sanguimancy.entry.toggledKnot=The Toggled Soul Knot acts exactly like a Simple Soul Knot, except for one fact: if the Toggled Knot is powered with redstone, it stops acting like a Soul Knot and is instead considered as a simple Soul Branch, conducting but not able to disable any Representation. +guide.Sanguimancy.entryName.etherealBlocks=Ethereal Blocks +guide.Sanguimancy.entry.etherealBlock=The Ethereal Block is a block solid to all entities but players. Right clicking on it with any solid block will give the Ehtereal Block its texture, but will also trick other mods (**cough**Waila**cough**) into believing that the block is the one it seems to be. Right clicking the block with a bucket of water will remove the texture. +guide.Sanguimancy.entry.corruptedEtherealBlock=The Corrupted Ethereal Block has all the proprieties of the Ethereal Block, plus one: the player needs to have reached a certain level of corruption to be able to pass through it. Right clicking it will raise the level of corruption, shift-right clicking will lower it. +guide.Sanguimancy.entry.toggledEtherealBlock=The Toggled Ethereal Block is a block that can be camouflaged like the Ethereal Block, but acts a bit different: if no redstone signal is supplied, any entity can go through it. When a redstone signal is supplied, it becomes solid once more. Sneaking makes it solid. +guide.Sanguimancy.entry.boundEtherealBlocks=The Bound Ethereal Blocks are Ethereal, Corrupted or Toggled Ethereal Blocks with one more feature: only the one who placed them can break them. To craft them, drop between 1 and 64 of them in a ritual of binding and activate it. +guide.Sanguimancy.entry.personalEtherealBlock=The Personal Ethereal Block acts like a Bound Ethereal Block, but only the one who placed it can go through it. It is solid for anything else. +guide.Sanguimancy.entry.altarManipulator=The Altar Manipulator is the third stage of Blood Altar automation. Like its predecessors, it is a GUI-less machine. It is however much more complex than the others. Where the Altar Emitter and the Altar Diviner were somehow limited, the Altar Manipulator has no such qualms. Indeed, any item inserted into or taken from the block cannot be done by human hands. Phantom, however... The Altar Manipulator will only accept items in its input slot if there's a Blood Altar directly under it, with enough Life Essence and the required tier to craft the item to its upgrade. It will then pick up the item once the crafting is done, and hold onto it until it is taken out. This makes sure the item inserted is processed only once, and not until it has reached its maximum. +guide.Sanguimancy.entry.sanguineShifter=The Sanguine Shifter is a way to upgrade the Altar Manipulator. While items can be inserted via hoppers, there is no Way to take them out. Do not fear! The Sanguine Shifter is here! Right clicking this item to any side of the Altar Manipulator but its bottom, and placing an inventory on this side will make the Altar Manipulator output its items to this inventory. Hooray! #Rituals guide.Sanguimancy.entry.drillOfTheDead=The Drill of the Dead is, to put it simply, a Well of Suffering on steroids. Where the Well deals half a heart of damage to any mob in the area, the Drill of the Dead kills said mobs instantly. Each kill costs 75LP and gives 200LP per default. However, the Drill of the Dead has limitations. As it is such a powerful tool, it cannot kill Boss Mobs, Elementals and Demons. Activating this ritual will cause your §4 Soul Corruption §r to augment. -guide.Sanguimancy.entry.vulcanosFrigius=The Vulcanos Frigius is a cooled down Serenade of the Nether. With no actual lava involved, this ritual creates 4 pieces of Obsidian, at the cost of 250LP per piece. Obisidan will keep resupplying as long as the ritual is active. +guide.Sanguimancy.entry.vulcanosFrigius=The Vulcanos Frigius is a cooled down Serenade of the Nether. With no actual lava involved, this ritual creates 4 pieces of Cobblestone, at the cost of 10 per piece. Cobblestone will keep resupplying as long as the ritual is active. If the ritual has some of the Tenebrae reagent, it will create 4 pieces of obsidian, at the cost of 100LP and 5 reagent per obsidian. guide.Sanguimancy.entry.greatDeletion=The Great Deletion allows you to trash unwanted items, simply by throwing them in the vicinity of the Ritual Stone. Be careful with it though! There is no way to get said items back! guide.Sanguimancy.entry.enlightenment=The Enlightenment is a ritual that lights up an entire area around the Ritual Stone. It has a very low cost of 1LP per tick, but will keep checking around itself to make sure no area is left unlit. guide.Sanguimancy.entry.timberman=The timberman is a ritual that, as its name suggests cuts trees in a wide area. It can handle almost any tree, given that it’s not going to the world limit. diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/AltarManipulator.png b/src/main/resources/assets/sanguimancy/textures/blocks/AltarManipulator.png new file mode 100644 index 0000000..85d2281 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/AltarManipulator.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealBlock.png new file mode 100644 index 0000000..dbdb1ef Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealCorruptedBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealCorruptedBlock.png new file mode 100644 index 0000000..c55ee84 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealCorruptedBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealToggledBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealToggledBlock.png new file mode 100644 index 0000000..9d020ed Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/BoundEtherealToggledBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/EtherealBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/EtherealBlock.png new file mode 100644 index 0000000..b5b0f00 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/EtherealBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/EtherealCorruptedBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/EtherealCorruptedBlock.png new file mode 100644 index 0000000..8c57124 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/EtherealCorruptedBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/EtherealToggledBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/EtherealToggledBlock.png new file mode 100644 index 0000000..567f230 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/EtherealToggledBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/PersonalEtherealBlock.png b/src/main/resources/assets/sanguimancy/textures/blocks/PersonalEtherealBlock.png new file mode 100644 index 0000000..b239341 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/PersonalEtherealBlock.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/RitualRepresentation.png b/src/main/resources/assets/sanguimancy/textures/blocks/RitualRepresentation.png new file mode 100644 index 0000000..a713943 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/RitualRepresentation.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/SimpleSNKnot.png b/src/main/resources/assets/sanguimancy/textures/blocks/SimpleSNKnot.png new file mode 100644 index 0000000..72fabed Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/SimpleSNKnot.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/blocks/ToggleSNKnot.png b/src/main/resources/assets/sanguimancy/textures/blocks/ToggleSNKnot.png new file mode 100644 index 0000000..4b6bf9a Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/blocks/ToggleSNKnot.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/gui/guide/altar.png b/src/main/resources/assets/sanguimancy/textures/gui/guide/altar.png index d287d05..75c61c7 100644 Binary files a/src/main/resources/assets/sanguimancy/textures/gui/guide/altar.png and b/src/main/resources/assets/sanguimancy/textures/gui/guide/altar.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/gui/guide/crafting.png b/src/main/resources/assets/sanguimancy/textures/gui/guide/crafting.png deleted file mode 100644 index eee9737..0000000 Binary files a/src/main/resources/assets/sanguimancy/textures/gui/guide/crafting.png and /dev/null differ diff --git a/src/main/resources/assets/sanguimancy/textures/gui/guide/front.png b/src/main/resources/assets/sanguimancy/textures/gui/guide/front.png deleted file mode 100644 index 870d942..0000000 Binary files a/src/main/resources/assets/sanguimancy/textures/gui/guide/front.png and /dev/null differ diff --git a/src/main/resources/assets/sanguimancy/textures/gui/guide/guide.png b/src/main/resources/assets/sanguimancy/textures/gui/guide/guide.png deleted file mode 100644 index f99e309..0000000 Binary files a/src/main/resources/assets/sanguimancy/textures/gui/guide/guide.png and /dev/null differ diff --git a/src/main/resources/assets/sanguimancy/textures/gui/guide/tab.png b/src/main/resources/assets/sanguimancy/textures/gui/guide/tab.png deleted file mode 100644 index 4226a37..0000000 Binary files a/src/main/resources/assets/sanguimancy/textures/gui/guide/tab.png and /dev/null differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/AprilFish.png b/src/main/resources/assets/sanguimancy/textures/items/AprilFish.png new file mode 100644 index 0000000..f7d0953 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/AprilFish.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe.png new file mode 100644 index 0000000..0dc4762 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_HeadHunter.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_HeadHunter.png new file mode 100644 index 0000000..c2d95a7 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_HeadHunter.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_LeafDecay.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_LeafDecay.png new file mode 100644 index 0000000..8d7359e Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_LeafDecay.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_Refine.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_Refine.png new file mode 100644 index 0000000..c919df8 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedAxe_Refine.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedMineral.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedMineral.png new file mode 100644 index 0000000..f80c3ea Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedMineral.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe.png new file mode 100644 index 0000000..ce13259 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_AutoSmelt.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_AutoSmelt.png new file mode 100644 index 0000000..71db4b0 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_AutoSmelt.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneI.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneI.png new file mode 100644 index 0000000..4f21855 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneI.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneII.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneII.png new file mode 100644 index 0000000..7887eba Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneII.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneIII.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneIII.png new file mode 100644 index 0000000..7ddfa4f Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_FortuneIII.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_SilkTouch.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_SilkTouch.png new file mode 100644 index 0000000..317fdc7 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedPickaxe_SilkTouch.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel.png new file mode 100644 index 0000000..e1f12a5 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_BreakDown.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_BreakDown.png new file mode 100644 index 0000000..f599df5 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_BreakDown.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_GoldDigger.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_GoldDigger.png new file mode 100644 index 0000000..cc10bfb Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_GoldDigger.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_Transmute.png b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_Transmute.png new file mode 100644 index 0000000..307d56e Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/CorruptedShovel_Transmute.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/EtherealManifestation.png b/src/main/resources/assets/sanguimancy/textures/items/EtherealManifestation.png new file mode 100644 index 0000000..beadb3c Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/EtherealManifestation.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/ImbuedStick.png b/src/main/resources/assets/sanguimancy/textures/items/ImbuedStick.png new file mode 100644 index 0000000..5b4c8cf Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/ImbuedStick.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/ManipulatorUpgrade.png b/src/main/resources/assets/sanguimancy/textures/items/ManipulatorUpgrade.png new file mode 100644 index 0000000..674e0ca Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/ManipulatorUpgrade.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/SoulTransporter.png b/src/main/resources/assets/sanguimancy/textures/items/SoulTransporter.png new file mode 100644 index 0000000..32edd7d Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/SoulTransporter.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/TelepositionSigil.png b/src/main/resources/assets/sanguimancy/textures/items/TelepositionSigil.png new file mode 100644 index 0000000..393f6bb Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/TelepositionSigil.png differ diff --git a/src/main/resources/assets/sanguimancy/textures/items/TranspositionSigil.png b/src/main/resources/assets/sanguimancy/textures/items/TranspositionSigil.png new file mode 100644 index 0000000..613d013 Binary files /dev/null and b/src/main/resources/assets/sanguimancy/textures/items/TranspositionSigil.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index ab2efe5..1dd9da7 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,11 +3,11 @@ "modid": "Sanguimancy", "name": "Sanguimancy", "description": "A Blood Magic addon adding all kind of stuff", - "version": "1.1.9", - "mcversion": "1.7.10", + "version": "${version}", + "mcversion": "${mcversion}", "url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2194354-blood-magic-addon-sanguimancy", "updateUrl": "http://www.curse.com/mc-mods/minecraft/223722-sanguimancy", - "authorList": ["Tombenpotter"], + "authorList": [ "Tombenpotter" ], "credits": "AWayOfTime, for making BloodMagic", "logoFile": "", "screenshots": [],