From 47e7cad9e9592fb63d13e994709990325199ba07 Mon Sep 17 00:00:00 2001 From: Anton Date: Sun, 26 Apr 2015 13:50:55 +0300 Subject: [PATCH 1/4] Make some messages localized serverside --- .../common/entity/mob/EntityDemon.java | 9 ++- .../items/energy/ItemAttunedCrystal.java | 11 ++-- .../items/energy/ItemDestinationClearer.java | 4 +- .../rituals/RitualEffectDemonPortal.java | 5 +- .../common/tileEntity/TEAltar.java | 15 +++-- .../common/tileEntity/TEMasterStone.java | 17 +++-- .../assets/alchemicalwizardry/lang/ru_RU.lang | 66 ++++++++++++++++--- 7 files changed, 88 insertions(+), 39 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java index 7452ed03..c398a961 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java @@ -5,8 +5,7 @@ import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModItems; import WayofTime.alchemicalWizardry.common.IDemon; @@ -116,14 +115,14 @@ public class EntityDemon extends EntityTameable implements IDemon { if (owner != null && owner.worldObj.isRemote) { - ChatComponentText chatmessagecomponent; + ChatComponentTranslation chatmessagecomponent; if (isSitting) { - chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.demon.willstay")); + chatmessagecomponent = new ChatComponentTranslation("message.demon.willstay"); } else { - chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.demon.shallfollow")); + chatmessagecomponent = new ChatComponentTranslation("message.demon.shallfollow"); } owner.addChatComponentMessage(chatmessagecomponent); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java index d8923262..b3db9b7c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemAttunedCrystal.java @@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; @@ -148,7 +149,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator if (player.isSneaking()) { this.setHasSavedCoordinates(itemStack, false); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.clearing"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.clearing")); } return itemStack; @@ -224,14 +225,14 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator if (dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance) { - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.error.toofar"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.toofar")); return itemStack; } TileEntity pastTile = world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord); if (!(pastTile instanceof TEReagentConduit)) { - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.error.cannotfind"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.cannotfind")); return itemStack; } @@ -254,7 +255,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linked") + " " + reagent.name)); } else { - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.error.noconnections"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.error.noconnections")); } } world.markBlockForUpdate(coords.xCoord, coords.yCoord, coords.zCoord); @@ -265,7 +266,7 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator this.setDimension(itemStack, dimension); this.setCoordinates(itemStack, new Int3(x, y, z)); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.attunedcrystal.linking"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.attunedcrystal.linking")); } } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java index bc8c9af7..d4642a7f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/energy/ItemDestinationClearer.java @@ -10,7 +10,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -72,7 +72,7 @@ public class ItemDestinationClearer extends Item implements IReagentManipulator relay.reagentTargetList.clear(); - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.destinationclearer.cleared"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.destinationclearer.cleared")); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java index e59ef368..c083863d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java @@ -8,8 +8,7 @@ import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.api.Int3; @@ -125,7 +124,7 @@ public class RitualEffectDemonPortal extends RitualEffect { if(!checkJars(ritualStone)) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.ritualdemonportal.missingjar"))); + player.addChatMessage(new ChatComponentTranslation("message.ritualdemonportal.missingjar")); return false; } return true; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index 0a703f49..930bcf36 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -12,6 +12,7 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; @@ -511,7 +512,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I { if(AlchemicalWizardry.causeHungerChatMessage && !player.isPotionActive(Potion.hunger.id)) { - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger"))); + player.addChatComponentMessage(new ChatComponentTranslation("message.altar.hunger")); } player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2)); } @@ -943,9 +944,9 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I public void sendChatInfoToPlayer(EntityPlayer player) { - player.addChatMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("message.altar.currentessence"), this.fluid.amount))); - player.addChatMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("message.altar.currenttier"), UpgradedAltars.isAltarValid(worldObj, xCoord, yCoord, zCoord)))); - player.addChatMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("message.altar.capacity"), this.getCapacity()))); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currentessence"), this.fluid.amount)); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currenttier"), UpgradedAltars.isAltarValid(worldObj, xCoord, yCoord, zCoord))); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.capacity"), this.getCapacity())); } public void sendMoreChatInfoToPlayer(EntityPlayer player) @@ -956,9 +957,9 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.progress") + " " + progress + "LP/" + liquidRequired * stackSize + "LP")); player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.consumptionrate") + " " + (int) (consumptionRate * (1 + consumptionMultiplier)) + "LP/t")); } - player.addChatMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("message.altar.currentessence"), this.fluid.amount))); - player.addChatMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("message.altar.inputtank"), this.fluidInput.amount))); - player.addChatMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("message.altar.outputtank"), this.fluidOutput.amount))); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.currentessence"), this.fluid.amount)); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.inputtank"), this.fluidInput.amount)); + player.addChatMessage(new ChatComponentTranslation(String.format("message.altar.outputtank"), this.fluidOutput.amount)); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java index cfb815be..d9c98822 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEMasterStone.java @@ -13,8 +13,7 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.StatCollector; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.Constants; @@ -220,7 +219,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (testRitual.equals("")) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.nothinghappened"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.nothinghappened")); return; } @@ -228,7 +227,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone RitualActivatedEvent event = new RitualActivatedEvent(this, crystalOwner, testRitual, player, activationCrystal, crystalLevel); if(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.somethingstoppedyou"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.somethingstoppedyou")); return; } @@ -241,7 +240,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (!testLevel) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.crystalvibrates"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.crystalvibrates")); return; } @@ -250,7 +249,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if (currentEssence < Rituals.getCostForActivation(testRitual)) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.youfeelapull"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.youfeelapull")); return; } @@ -259,7 +258,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone { if (!Rituals.startRitual(this, testRitual, player)) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.ritualresistyou"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.ritualresistyou")); return; } else @@ -268,7 +267,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone if(drain > 0) { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.energyflows"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.energyflows")); for (int i = 0; i < 12; i++) { @@ -276,7 +275,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone } }else { - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("message.masterstone.somethingstoppedyou"))); + player.addChatMessage(new ChatComponentTranslation("message.masterstone.somethingstoppedyou")); return; } diff --git a/src/main/resources/assets/alchemicalwizardry/lang/ru_RU.lang b/src/main/resources/assets/alchemicalwizardry/lang/ru_RU.lang index e0fd4019..8d749816 100644 --- a/src/main/resources/assets/alchemicalwizardry/lang/ru_RU.lang +++ b/src/main/resources/assets/alchemicalwizardry/lang/ru_RU.lang @@ -59,6 +59,14 @@ tile.crystalBlock.fullCrystal.name=Кристальное скопление tile.crystalBlock.crystalBrick.name=Кирпич кристального скопления tile.demonPortal.name=Демонический портал tile.demonChest.name=Сундук демона +tile.enchantmentGlyph.enchantability.name=Глиф искусного зачарователя +tile.enchantmentGlyph.enchantmentLevel.name=Глиф магической силы +tile.stabilityGlyph.stability1.name=Глиф непреклонный стабильности +tile.schematicSaver.name=Schematic Saver +tile.blockMimic.name=Блок-имитатор +tile.blockSpectralContainer.name=Призрачный контейнер +tile.blockBloodLightSource.name=Кровавый свет +tile.spectralBlock.name=Призрачный блок #Item Localization item.weakBloodOrb.name=Слабый кровавый шар @@ -201,6 +209,31 @@ item.itemHarvestSigil.name=Сигил богини плодородия item.itemCompressionSigil.name=Сигил сжатия item.itemAssassinSigil.name=Сигил убийцы item.transcendentBloodOrb.name=Трансцендентальный кровавый шар +item.itemMailCatalogue.name=Mail Order Catalogue +item.inputRoutingFocus.name=Фокус направления входа +item.bloodMagicBaseItem.EnderShard.name=Осколок Края +item.outputRoutingFocus.default.name=Обычный фокус направления выхода +item.outputRoutingFocus.modItem.name=Фокус направления выхода (ModItem) +item.outputRoutingFocus.ignMeta.name=Фокус направления выхода (Ignore Meta) +item.outputRoutingFocus.matchNBT.name=Фокус направления выхода (MatchNBT) +item.outputRoutingFocus.global.name=Фокус направления выхода (Global) +item.dawnScribeTool.name=Elemental Inscription Tool: Dawn +item.boundHelmetEarth.name=Земляной омега шлем +item.boundPlateEarth.name=Земляная омега кираса +item.boundLeggingsEarth.name=Земляные омега поножи +item.boundBootsEarth.name=Земляные омега ботинки +item.boundHelmetWind.name=Воздушный омега шлем +item.boundPlateWind.name=Воздушная омега кираса +item.boundLeggingsWind.name=Воздушные омега поножи +item.boundBootsWind.name=Воздушные омега ботинки +item.boundHelmetFire.name=Огненный омега шлем +item.boundPlateFire.name=Огненная омега кираса +item.boundLeggingsFire.name=Огненные омега поножи +item.boundBootsFire.name=Огненные омега ботинки +item.boundHelmetWater.name=Водный омега шлем +item.boundPlateWater.name=Водная омега кираса +item.boundLeggingsWater.name=Водные омега поножи +item.boundBootsWater.name=Водные омега ботинки #Creative Tab itemGroup.tabBloodMagic=Blood Magic @@ -211,6 +244,10 @@ bm.string.drain=Опустошение bm.string.tier=Уровень bm.string.crafting.orb.shaped=Форменное создание шара bm.string.crafting.orb.shapeless=Бесформенное создание шара +text.recipe.altar=Кровавый алтарь +text.recipe.altar.tier=Уровень: %s +text.recipe.altar.bloodRequired=LP: %s +text.recipe.shapedOrb=Форменный рецепт шара #Entities entity.AWWayofTime.EarthElemental.name=Элементаль земли @@ -334,8 +371,9 @@ tooltip.reinforcedtelepfocus.desc1=Ещё более сильная версия tooltip.reinforcedtelepfocus.desc2=которая использует слабый осколок tooltip.ritualdiviner.airstones=Камни воздуха: tooltip.ritualdiviner.blankstones=Пустые камни: -tooltip.ritualdiviner.cannotplace=Не может размещать сумеречные руны -tooltip.ritualdiviner.canplace=Может размещать сумеречные руны +tooltip.ritualdiviner.cannotplace=Не может размещать руны сумерек +tooltip.ritualdiviner.canplace=Может размещать руны сумерек +tooltip.ritualdiviner.canplacedawn=Может размещать руны сумерек и рассвета tooltip.ritualdiviner.desc=Используется для обнаружения новых видов ритуалов tooltip.ritualdiviner.duskstones=Камни сумерек: tooltip.ritualdiviner.earthstones=Камни земли: @@ -343,6 +381,8 @@ tooltip.ritualdiviner.firestones=Камни огня: tooltip.ritualdiviner.moreinfo=Нажмите shift, чтобы увидеть дополнительную информацию tooltip.ritualdiviner.ritualtunedto=Ритуал настроен на сторону: tooltip.ritualdiviner.waterstones=Камни воды: +tooltip.ritualdiviner.dawnstones=Камни рассвета: +tooltip.ritualdiviner.totalStones=Всего камней: tooltip.sacrificialdagger.desc1=Чувство потери крови щекочет Ваши пальцы tooltip.sacrificialdagger.desc2=Простого укольчика tooltip.sacrificialdagger.desc3=будет достаточно... @@ -372,15 +412,18 @@ tooltip.tanksegmenter.desc2=реагентов, которые могут быт tooltip.telepositionfocus.desc=Жемчуг Края, проникнутый кровью tooltip.voidsigil.desc=Лучше, чем швабра «Swiffer»! tooltip.watersigil.desc=Бесконечная вода, кому-нибудь? +tooltip.routingFocus.limit=Лимит: +tooltip.routingFocus.desc=Фокус, используемый для направления предметов #Messages -message.altar.capacity=Ёмкость: +message.altar.capacity=Ёмкость: %s LP message.altar.consumptionrate=Скорость потребления: -message.altar.currentessence=Текущая эссенция алтаря: -message.altar.currenttier=Текущий уровень алтаря: +message.altar.currentessence=Текущая эссенция алтаря: %s LP +message.altar.currenttier=Текущий уровень алтаря: %s message.altar.progress=Прогресс алтаря: -message.altar.inputtank= Резервуар для входа: -message.altar.outputtank= Резервуар для выхода: +message.altar.inputtank= Резервуар для входа: %s LP +message.altar.outputtank= Резервуар для выхода: %s LP +message.altar.hunger=[BM] Из-за Вашего высокого уровня регенерации Вы проголодались... message.attunedcrystal.clearing=Очистка сохранённого контейнера... message.attunedcrystal.error.cannotfind=Не удалось найти соединённый контейнер. message.attunedcrystal.error.noconnections=У соединённого контейнера не осталось свободных соединений! @@ -408,4 +451,11 @@ message.ritual.side.west=ЗАПАД message.ritualdemonportal.missingjar=Сосуд на одной из колонн, кажется, отсутствует... message.tanksegmenter.nowhas=У резервуара теперь message.tanksegmenter.setto=Сегментер резервуаров установлен на: -message.tanksegmenter.tankssetto=резервуара(-ов) установлены на: \ No newline at end of file +message.tanksegmenter.tankssetto=резервуара(-ов) установлены на: +message.routerfocus.limit=Ограничение предметов установлено на: + +#Achievements +achievement.alchemicalwizardry:firstPrick=Ваш первый укольчик! +achievement.alchemicalwizardry:firstPrick.desc=Первая капля жизни в алтаре... +achievement.alchemicalwizardry:weakOrb=Слабо мерцающий красный цвет... +achievement.alchemicalwizardry:weakOrb.desc=Этого шара будет достаточно...пока что... From 0bec104bf666c5362028f8e7669c7ecab86c0e2d Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 30 Apr 2015 15:18:55 +0300 Subject: [PATCH 2/4] Solve merge conflicts? --- .../WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index 930bcf36..4b1fe190 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -512,7 +512,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I { if(AlchemicalWizardry.causeHungerChatMessage && !player.isPotionActive(Potion.hunger.id)) { - player.addChatComponentMessage(new ChatComponentTranslation("message.altar.hunger")); + player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger"))); } player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2)); } From 47c9c8439d693234838b0242e5126de540176ff5 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 30 Apr 2015 15:22:37 +0300 Subject: [PATCH 3/4] Git why --- .../WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java index 4b1fe190..56fe3570 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/TEAltar.java @@ -512,7 +512,7 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I { if(AlchemicalWizardry.causeHungerChatMessage && !player.isPotionActive(Potion.hunger.id)) { - player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger"))); + player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger"))); } player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2)); } From 786498e615a7aed1d8f2e35c4afe62baa22deb83 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Wed, 8 Jul 2015 22:03:38 -0400 Subject: [PATCH 4/4] Removed redundant book code. --- .../AlchemicalWizardry.java | 3 +- .../book/classes/guide/GuiCategories.java | 83 ---- .../book/classes/guide/GuiEntry.java | 150 -------- .../book/classes/guide/GuiIndex.java | 216 ----------- .../classes/guide/buttons/ButtonNext.java | 38 -- .../classes/guide/buttons/ButtonPage.java | 33 -- .../guide/elements/ElementCategory.java | 55 --- .../book/compact/Category.java | 16 - .../book/compact/CompactItem.java | 21 -- .../book/compact/Entry.java | 14 - .../book/entries/EntryAltarRecipe.java | 124 ------ .../book/entries/EntryCraftingRecipe.java | 209 ---------- .../EntryCraftingRecipeCustomText.java | 21 -- .../book/entries/EntryImage.java | 73 ---- .../book/entries/EntryImageCustomText.java | 49 --- .../book/entries/EntryItemCustomText.java | 52 --- .../book/entries/EntryItemText.java | 86 ----- .../book/entries/EntryRitualInfo.java | 38 -- .../book/entries/EntryText.java | 48 --- .../book/entries/EntryTextCustomText.java | 38 -- .../book/entries/IEntry.java | 25 -- .../book/entries/IEntryCustomText.java | 7 - .../book/enums/EnumType.java | 5 - .../book/helpers/GuiHelper.java | 102 ----- .../book/helpers/OreDictionaryHelper.java | 16 - .../book/interfaces/IEntryElement.java | 41 -- .../book/interfaces/IReviving.java | 7 - .../book/interfaces/StringEntry.java | 14 - .../book/registries/EntryRegistry.java | 70 ---- .../book/registries/RecipeRegistry.java | 47 --- .../common/book/BUEntries.java | 357 ------------------ .../common/book/BookParser.java | 333 ---------------- .../common/book/ItemBMBook.java | 62 --- .../common/book/SpecialEntryRegistry.java | 27 -- .../common/items/ItemRitualDismantler.java | 3 +- .../common/tileEntity/gui/GuiHandler.java | 34 +- 36 files changed, 7 insertions(+), 2510 deletions(-) delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiCategories.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiEntry.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiIndex.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonNext.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonPage.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/elements/ElementCategory.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/compact/Category.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/compact/CompactItem.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/compact/Entry.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryAltarRecipe.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipe.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipeCustomText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImageCustomText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemCustomText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryRitualInfo.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryTextCustomText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntry.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntryCustomText.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/enums/EnumType.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/helpers/GuiHelper.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/helpers/OreDictionaryHelper.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IEntryElement.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IReviving.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/interfaces/StringEntry.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/registries/EntryRegistry.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/book/registries/RecipeRegistry.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/book/BookParser.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/book/ItemBMBook.java delete mode 100644 src/main/java/WayofTime/alchemicalWizardry/common/book/SpecialEntryRegistry.java diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index b2b3e2e0..0585a9ce 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -11,8 +11,6 @@ import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import WayofTime.alchemicalWizardry.common.thread.CommandDown -loadGAPI; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -256,6 +254,7 @@ import WayofTime.alchemicalWizardry.common.spell.simple.SpellWateryGrave; import WayofTime.alchemicalWizardry.common.spell.simple.SpellWindGust; import WayofTime.alchemicalWizardry.common.summoning.SummoningHelperAW; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import WayofTime.alchemicalWizardry.common.thread.CommandDownloadGAPI; import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiCategories.java b/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiCategories.java deleted file mode 100644 index 917aca0e..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiCategories.java +++ /dev/null @@ -1,83 +0,0 @@ -package WayofTime.alchemicalWizardry.book.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 WayofTime.alchemicalWizardry.book.classes.guide.elements.ElementCategory; -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.registries.EntryRegistry; - -public class GuiCategories extends GuiScreen{ - public GuiCategories(EntityPlayer player){ - this.player = player; - } - private static final ResourceLocation gui = new ResourceLocation("bloodutils:textures/gui/front.png"); - - int gwidth = 192; - int gheight = 192; - int x, y; - ElementCategory[] categories = new ElementCategory[EntryRegistry.categories.size()]; - EntityPlayer 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 - 15, 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/WayofTime/alchemicalWizardry/book/classes/guide/GuiEntry.java b/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiEntry.java deleted file mode 100644 index 31831c59..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiEntry.java +++ /dev/null @@ -1,150 +0,0 @@ -package WayofTime.alchemicalWizardry.book.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 WayofTime.alchemicalWizardry.book.classes.guide.buttons.ButtonNext; -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.compact.Entry; -import WayofTime.alchemicalWizardry.book.entries.IEntry; -import WayofTime.alchemicalWizardry.book.registries.EntryRegistry; - -public class GuiEntry extends GuiScreen{ - 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; - } - - private static final ResourceLocation gui = new ResourceLocation("bloodutils:textures/gui/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; - - @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); - if(e != null){ - IEntry entry = e.entry[this.currPage - 1]; - if(entry != null) - entry.initGui(gwidth, gheight, left, top, player, this.buttonList); - }else{ - mc.displayGuiScreen(new GuiCategories(this.player)); - } - } - - @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); - if(e != null){ - IEntry entry = e.entry[this.currPage]; - if(entry != null) - entry.actionPerformed(button); - }else{ - mc.displayGuiScreen(new GuiCategories(this.player)); - } - } - } - - @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/WayofTime/alchemicalWizardry/book/classes/guide/GuiIndex.java b/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiIndex.java deleted file mode 100644 index f96670ac..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/GuiIndex.java +++ /dev/null @@ -1,216 +0,0 @@ -package WayofTime.alchemicalWizardry.book.classes.guide; - -import java.util.HashMap; - -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 WayofTime.alchemicalWizardry.book.classes.guide.buttons.ButtonNext; -import WayofTime.alchemicalWizardry.book.classes.guide.buttons.ButtonPage; -import WayofTime.alchemicalWizardry.book.classes.guide.elements.ElementCategory; -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.compact.Entry; -import WayofTime.alchemicalWizardry.book.registries.EntryRegistry; - -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("bloodutils:textures/gui/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/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonNext.java b/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonNext.java deleted file mode 100644 index c5d185d4..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonNext.java +++ /dev/null @@ -1,38 +0,0 @@ -package WayofTime.alchemicalWizardry.book.classes.guide.buttons; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -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("bloodutils:textures/gui/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/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonPage.java b/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonPage.java deleted file mode 100644 index 3c33d8f9..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/buttons/ButtonPage.java +++ /dev/null @@ -1,33 +0,0 @@ -package WayofTime.alchemicalWizardry.book.classes.guide.buttons; - -import java.awt.Color; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; - -public class ButtonPage extends GuiButton { - - public ButtonPage(int id, int xPos, int yPos, int width, int height, String string) { - super(id, xPos, yPos, width, height, string); - } - int gwidth = 170; - int gheight = 180; - - @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/WayofTime/alchemicalWizardry/book/classes/guide/elements/ElementCategory.java b/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/elements/ElementCategory.java deleted file mode 100644 index c5db9a7a..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/classes/guide/elements/ElementCategory.java +++ /dev/null @@ -1,55 +0,0 @@ -package WayofTime.alchemicalWizardry.book.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 WayofTime.alchemicalWizardry.book.classes.guide.GuiIndex; -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.helpers.GuiHelper; -import WayofTime.alchemicalWizardry.book.interfaces.IEntryElement; - -public class ElementCategory extends GuiScreen implements IEntryElement{ - 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; - } - public Category category; - public EntityPlayer player; - - public int x; - public int y; - public int width; - public int height; - - - @Override - public void drawElement() { - IIcon icon = category.iconStack.getIconIndex(); - Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodutils:textures/misc/tab.png")); - GuiHelper.drawIconWithoutColor(x - 1, y - 1, width + 2 , height + 2, 0); - - GuiHelper.renderIcon(x + 3, y + 2, 16, 16, icon, this.category.type); - } - - @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/WayofTime/alchemicalWizardry/book/compact/Category.java b/src/main/java/WayofTime/alchemicalWizardry/book/compact/Category.java deleted file mode 100644 index 7177dff7..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/compact/Category.java +++ /dev/null @@ -1,16 +0,0 @@ -package WayofTime.alchemicalWizardry.book.compact; - -import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.book.enums.EnumType; - -public class Category { - public Category(String name, ItemStack iconStack, EnumType type){ - this.name = name; - this.iconStack = iconStack; - this.type = type; - } - public String name; - public ItemStack iconStack; - - public EnumType type; -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/compact/CompactItem.java b/src/main/java/WayofTime/alchemicalWizardry/book/compact/CompactItem.java deleted file mode 100644 index 93144ad9..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/compact/CompactItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package WayofTime.alchemicalWizardry.book.compact; - -import net.minecraft.item.Item; - -public class CompactItem { - public CompactItem(Item item1, Item item2){ - this.item1 = item1; - this.item2 = item2; - } - public Item item1; - public Item item2; - - @Override - public boolean equals(Object obj){ - if(obj instanceof CompactItem){ - CompactItem ci = (CompactItem)obj; - return ci.item1 == this.item1 && ci.item2 == this.item2; - } - return false; - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/compact/Entry.java b/src/main/java/WayofTime/alchemicalWizardry/book/compact/Entry.java deleted file mode 100644 index 9bcf5632..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/compact/Entry.java +++ /dev/null @@ -1,14 +0,0 @@ -package WayofTime.alchemicalWizardry.book.compact; - -import WayofTime.alchemicalWizardry.book.entries.IEntry; - -public class Entry { - public Entry(IEntry[] entry, String name, int indexPage){ - this.entry = entry; - this.name = name; - this.indexPage = indexPage - 1; - } - public IEntry[] entry; - public String name; - public int indexPage; -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryAltarRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryAltarRecipe.java deleted file mode 100644 index 3e3aede1..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryAltarRecipe.java +++ /dev/null @@ -1,124 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -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 WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryAltarRecipe implements IEntry{ - public EntryAltarRecipe(AltarRecipe recipes){ - this.recipes = recipes; - populate(recipes); - } - public AltarRecipe recipes; - - public ItemStack input; - public ItemStack output; - public int essence; - - public ArrayList icons = new ArrayList(); - - @SuppressWarnings("unchecked") - 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("bloodutils:textures/gui/altar.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){ - - } - - static class ItemIcon { - public ItemIcon(ItemStack stack, int x, int y){ - this.stack = stack; - this.x = x; - this.y = y; - } - public ItemStack stack; - public int x, 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/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipe.java deleted file mode 100644 index e7da132c..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipe.java +++ /dev/null @@ -1,209 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -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 WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; -import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryCraftingRecipe implements IEntry{ - public EntryCraftingRecipe(IRecipe recipes){ - this.recipes = recipes; - populate(recipes); - } - public IRecipe recipes; - - public ItemStack[] recipe; - public ItemStack output; - - public ArrayList icons = new ArrayList(); - - @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 Integer) - { - s = AltarRecipeRegistry.orbMap.get((Integer)rec.getInput()[i]); - }else if(rec.getInput()[i] instanceof Object){ - System.out.println(rec.getInput()[i].getClass()); - 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 && 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("bloodutils:textures/gui/crafting.png")); - entry.drawTexturedModalRect(left, (height/2 - 18) + (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){ - - } - - static class ItemIcon { - public ItemIcon(ItemStack stack, int x, int y){ - this.stack = stack; - this.x = x; - this.y = y; - } - public ItemStack stack; - public int x, 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); - } - } - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipeCustomText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipeCustomText.java deleted file mode 100644 index 13293da8..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryCraftingRecipeCustomText.java +++ /dev/null @@ -1,21 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import net.minecraft.item.crafting.IRecipe; - -public class EntryCraftingRecipeCustomText extends EntryCraftingRecipe implements IEntryCustomText -{ - - public EntryCraftingRecipeCustomText(IRecipe recipes) - { - super(recipes); - } - - @Override - public String getText() - { - return ""; - } - - @Override - public void setText(String str){} -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java deleted file mode 100644 index 5843876d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImage.java +++ /dev/null @@ -1,73 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.util.List; - -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 WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; -import WayofTime.alchemicalWizardry.book.helpers.GuiHelper; - -public class EntryImage implements IEntry{ - public EntryImage(String resource, int iconWidth, int iconHeight){ - this.resource = new ResourceLocation(resource); - this.iconWidth = iconWidth; - this.iconHeight = iconHeight; - } - public ResourceLocation resource; - public int iconWidth; - public int 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; - } - public String 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 + 32; - 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("aw.entry." + this.entryName + "." + page); - 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/WayofTime/alchemicalWizardry/book/entries/EntryImageCustomText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImageCustomText.java deleted file mode 100644 index 525cb596..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryImageCustomText.java +++ /dev/null @@ -1,49 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryImageCustomText extends EntryImage implements IEntryCustomText -{ - public EntryImageCustomText(String resource, int iconWidth, int iconHeight) - { - super(resource, iconWidth, iconHeight); - } - - public EntryImageCustomText(String resource, int iconWidth, int iconHeight, String entryName) - { - super(resource, iconWidth, iconHeight, entryName); - } - - public String str = ""; - - @Override - public String getText() - { - return str; - } - - @Override - public void setText(String str) - { - this.str = str; - } - - 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 = this.str; - 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); - - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemCustomText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemCustomText.java deleted file mode 100644 index 3f2d3032..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemCustomText.java +++ /dev/null @@ -1,52 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryItemCustomText extends EntryItemText implements IEntryCustomText -{ - - public EntryItemCustomText(ItemStack stack) - { - super(stack); - } - - public EntryItemCustomText(ItemStack stack, String title) - { - super(stack, title); - } - - public String str = ""; - - @Override - public String getText() - { - return str; - } - - @Override - public void setText(String str) - { - this.str = str; - } - - @Override - 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 = this.str; - 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); - - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemText.java deleted file mode 100644 index 45be8ca1..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryItemText.java +++ /dev/null @@ -1,86 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.util.List; - -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 WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryItemText implements IEntry{ - public EntryItemText(ItemStack stack){ - this.stack = stack; - } - public ItemStack stack; - - public EntryItemText(ItemStack stack, String entryName){ - this.stack = stack; - this.entryName = entryName; - } - public String 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){ - 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 = StatCollector.translateToLocal("aw.entry." + this.entryName + "." + page); - 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 - (left/2) + 2, top + 20); - ri.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, left - (left/2) + 2, top + 20); - - 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/WayofTime/alchemicalWizardry/book/entries/EntryRitualInfo.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryRitualInfo.java deleted file mode 100644 index d74c425d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryRitualInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryRitualInfo implements IEntry{ - public EntryRitualInfo(int cost){ - - this.cost = cost; - } - public int 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/WayofTime/alchemicalWizardry/book/entries/EntryText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryText.java deleted file mode 100644 index 1e8a687f..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryText.java +++ /dev/null @@ -1,48 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.StatCollector; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryText implements IEntry{ - public EntryText(){ - - } - - public EntryText(String entryName){ - this.entryName = entryName; - } - public String 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){ - int x, y; - - if(this.entryName == null) - this.entryName = key; - - String s = StatCollector.translateToLocal("aw.entry." + this.entryName + "." + page); - 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/WayofTime/alchemicalWizardry/book/entries/EntryTextCustomText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryTextCustomText.java deleted file mode 100644 index e54c17fe..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/EntryTextCustomText.java +++ /dev/null @@ -1,38 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -public class EntryTextCustomText extends EntryText implements IEntryCustomText -{ - public String str = ""; - - @Override - public String getText() - { - return str; - } - - @Override - public void setText(String str) - { - this.str = str; - } - - @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 = this.str; - 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); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntry.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntry.java deleted file mode 100644 index 5bc72e9d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntry.java +++ /dev/null @@ -1,25 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -import java.util.List; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; - -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); - - @SuppressWarnings("rawtypes") - 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/WayofTime/alchemicalWizardry/book/entries/IEntryCustomText.java b/src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntryCustomText.java deleted file mode 100644 index 6001635d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/entries/IEntryCustomText.java +++ /dev/null @@ -1,7 +0,0 @@ -package WayofTime.alchemicalWizardry.book.entries; - -public interface IEntryCustomText extends IEntry -{ - public String getText(); - public void setText(String str); -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/enums/EnumType.java b/src/main/java/WayofTime/alchemicalWizardry/book/enums/EnumType.java deleted file mode 100644 index 16042d7b..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/enums/EnumType.java +++ /dev/null @@ -1,5 +0,0 @@ -package WayofTime.alchemicalWizardry.book.enums; - -public enum EnumType { - BLOCK, ITEM; -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/helpers/GuiHelper.java b/src/main/java/WayofTime/alchemicalWizardry/book/helpers/GuiHelper.java deleted file mode 100644 index fd9a8c76..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/helpers/GuiHelper.java +++ /dev/null @@ -1,102 +0,0 @@ -package WayofTime.alchemicalWizardry.book.helpers; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import WayofTime.alchemicalWizardry.book.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(); - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/helpers/OreDictionaryHelper.java b/src/main/java/WayofTime/alchemicalWizardry/book/helpers/OreDictionaryHelper.java deleted file mode 100644 index d82c0420..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/helpers/OreDictionaryHelper.java +++ /dev/null @@ -1,16 +0,0 @@ -package WayofTime.alchemicalWizardry.book.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/WayofTime/alchemicalWizardry/book/interfaces/IEntryElement.java b/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IEntryElement.java deleted file mode 100644 index 41a2970c..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IEntryElement.java +++ /dev/null @@ -1,41 +0,0 @@ -package WayofTime.alchemicalWizardry.book.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 - */ - void drawElement(); - - /** - * @param mX - * Mouse X Position - * @param mY - * Mouse Y Position - * @return is the mouse in a element - */ - 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 - */ - - 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) - */ - void onMouseClick(int mX, int mY, int type); -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IReviving.java b/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IReviving.java deleted file mode 100644 index 2cf180fd..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/IReviving.java +++ /dev/null @@ -1,7 +0,0 @@ -package WayofTime.alchemicalWizardry.book.interfaces; - -import net.minecraft.world.World; - -public interface IReviving { - void spawnEntity(World world, int x, int y, int z); -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/StringEntry.java b/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/StringEntry.java deleted file mode 100644 index cf891e5a..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/interfaces/StringEntry.java +++ /dev/null @@ -1,14 +0,0 @@ -package WayofTime.alchemicalWizardry.book.interfaces; - -import WayofTime.alchemicalWizardry.book.compact.Entry; - -public class StringEntry -{ - public String str; - public Entry entry; - public StringEntry(String str, Entry ent) - { - this.str = str; - this.entry = ent; - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/book/registries/EntryRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/book/registries/EntryRegistry.java deleted file mode 100644 index a3546eb8..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/book/registries/EntryRegistry.java +++ /dev/null @@ -1,70 +0,0 @@ -package WayofTime.alchemicalWizardry.book.registries; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.compact.Entry; - -public class EntryRegistry -{ - public static void registerCategories(Category category) - { - categories.add(category); - categoryMap.put(category.name, category); - entryOrder.put(category, new ArrayList()); - categoryCount++; - } - public static ArrayList categories = new ArrayList(); - public static HashMap> entryOrder = new HashMap(); - public static HashMap categoryMap = new HashMap(); - - public static int categoryCount = 0; - - 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 HashMap> entries = new HashMap>(); - - public static HashMap maxEntries = new HashMap(); - - - public static HashMap architect = new HashMap(); - public static HashMap basics = new HashMap(); - public static HashMap rituals = new HashMap(); - public static HashMap bloodUtils = new HashMap(); - public static HashMap test = new HashMap(); - - 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 craftingRecipes = new ArrayList(); -public static ArrayList altarRecipes = new ArrayList(); - - /** Used to register crafting recipes to the guide */ - public static IRecipe getLatestCraftingRecipe(){ - IRecipe rec = (IRecipe)CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() -1); - craftingRecipes.add(rec); - return craftingRecipes.get(craftingRecipes.size() - 1); - } - - /** Used to register items to the guide */ - public static AltarRecipe getLatestAltarRecipe(){ - AltarRecipe rec = (AltarRecipe)AltarRecipeRegistry.altarRecipes.get(AltarRecipeRegistry.altarRecipes.size() - 1); - altarRecipes.add(rec); - return altarRecipes.get(altarRecipes.size() - 1); - } - - public static void addAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled){ - AltarRecipeRegistry.registerAltarRecipe(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled); - } - - public static void addShapedRecipe(ItemStack output, Object[] obj){ - GameRegistry.addShapedRecipe(output, obj); - } - - public static void addShapedOrbRecipe(ItemStack output, Object[] obj){ - GameRegistry.addRecipe(new ShapedBloodOrbRecipe(output, obj)); - } - - public static void addShapedOreRecipe(ItemStack output, Object[] obj){ - GameRegistry.addRecipe(new ShapedOreRecipe(output, obj)); - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java b/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java deleted file mode 100644 index 1a181643..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/book/BUEntries.java +++ /dev/null @@ -1,357 +0,0 @@ -package WayofTime.alchemicalWizardry.common.book; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import WayofTime.alchemicalWizardry.ModBlocks; -import WayofTime.alchemicalWizardry.ModItems; -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.compact.Entry; -import WayofTime.alchemicalWizardry.book.entries.EntryImage; -import WayofTime.alchemicalWizardry.book.entries.EntryItemText; -import WayofTime.alchemicalWizardry.book.entries.EntryRitualInfo; -import WayofTime.alchemicalWizardry.book.entries.EntryText; -import WayofTime.alchemicalWizardry.book.entries.IEntry; -import WayofTime.alchemicalWizardry.book.enums.EnumType; -import WayofTime.alchemicalWizardry.book.registries.EntryRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BUEntries -{ - public void postInit() - { - initCategories(); - initEntries(); - } - - public void initCategories(){ - categoryBasics = new Category("Basics", new ItemStack(ModItems.weakBloodOrb), EnumType.ITEM); - categoryRituals = new Category("Rituals", new ItemStack(ModItems.itemRitualDiviner), EnumType.ITEM); - catagoryArchitect = new Category("The Architect", new ItemStack(ModBlocks.blockAltar), EnumType.BLOCK); - - categoryTest = new Category("Test", new ItemStack(ModItems.aether), EnumType.ITEM); - - registerCategories(); - } - public static Category categoryBasics; - public static Category categoryRituals; - public static Category catagoryArchitect; - public static Category categoryTest; - - public void registerCategories(){ - EntryRegistry.registerCategories(BUEntries.categoryBasics); - EntryRegistry.registerCategories(BUEntries.categoryRituals); - EntryRegistry.registerCategories(BUEntries.catagoryArchitect); - EntryRegistry.registerCategories(BUEntries.categoryTest); - } - - @SideOnly(Side.CLIENT) - public void initEntries() - { - HashMap aIntroMap = new HashMap(); - aIntroMap.put(0, new EntryImage("bloodutils:textures/misc/screenshots/t1.png", 854, 480)); - /* The Architect */ - aIntro = this.getMixedTextEntry(6, "Your classic tragic backstory", 1, aIntroMap); - aBloodAltar = this.getPureTextEntry(3, "The Blood Altar", 1); - aSoulNetwork = this.getPureTextEntry(3, "The Soul Network", 1); - aBasicsOfSigils = this.getPureTextEntry(4, "Basics of sigils and a glimpse into the soul", 1); - aTrainingAndWaterSigil = this.getPureTextEntry(6, "Training, and water sigils", 1); - aLavaCrystal = this.getPureTextEntry(5, "The Lava crystal", 1); - aLavaSigil = this.getPureTextEntry(8, "The perversion of the Nether, and a sigil of lava", 1); - aBlankRunes = this.getPureTextEntry(5, "Blank runes, the building blocks of the future", 1); - aSpeedRune = this.getPureTextEntry(2, "Speed runes", 1); - aApprenticeOrb = this.getPureTextEntry(4, "A shining green orb", 1); - aVoidSigil = this.getPureTextEntry(2, "The void sigil", 1); - aAirSigil = this.getPureTextEntry(2, "Air sigil", 1); - aSightSigil = this.getPureTextEntry(2, "Sigil of Sight", 1); - aAdvancedAltar = this.getPureTextEntry(5, "Advanced altar mechanics", 1); - aFastMinder = this.getPureTextEntry(2, "Sigil of the fast miner", 2); - aSoulFray = this.getPureTextEntry(2, "Soul Fray, a few thin threads", 2); - aGreenGrove = this.getPureTextEntry(2, "Green grove, a farmers friend", 2); - aDaggerOfSacrifice = this.getPureTextEntry(9, "Dagger of sacrifice, an alternative energy source", 2); - aRunesOfSacrifice = this.getPureTextEntry(10, "Runes of Sacrifice", 2); - aBloodLetterPack = this.getPureTextEntry(4, "The blood letters pack", 2); - aNewFriends = this.getPureTextEntry(18, "And then there was five", 2); - aUpgradedAltar = this.getPureTextEntry(4, "An altar upgraded, and orb formed", 2); - aNewRunes = this.getPureTextEntry(5, "New runes", 2); - aPhandomBridge = this.getPureTextEntry(8, "The Phantom bridge", 2); - aHolding = this.getPureTextEntry(2, "Sigil of holding", 2); - aElementalAffinity = this.getPureTextEntry(2, "Elemental affinity, a spell casters best friend", 2); - aRitualStones = this.getPureTextEntry(2, "Recreating ritual stones", 2); - aBloodLamp = this.getPureTextEntry(3, "Shining a blood lamp sigil", 2); - aBoundArmour = this.getPureTextEntry(8, "Bound armor, the walking fortress", 3); - aSanguineArmour = this.getPureTextEntry(2, "Sanguine armor", 3); - aSoulSuppressing = this.getPureTextEntry(1, "Suppressing the soul", 3); - aRitualDiviner = this.getPureTextEntry(5, "The ritual diviner", 3); - aBloodShards = this.getPureTextEntry(5, "Blood shards", 3); - aLifeOfMage = this.getPureTextEntry(9, "he life of a Mage", 3); - aT4 = this.getPureTextEntry(5, "The T4 altar, and a master's orb", 3); - aSigilOfWhirlwind = this.getPureTextEntry(2, "The sigil of whirlwinds", 3); - aSigilOfCompression = this.getPureTextEntry(2, "The sigil of compression", 3); - aEnderDivergence = this.getPureTextEntry(3, "The Ender divergence", 3); - aTeleposer = this.getPureTextEntry(9, "The Teleposer", 3); - aSuppression = this.getPureTextEntry(2, "The sigil of suppression", 3); - aSuperiorCapacity = this.getPureTextEntry(2, "The superior capacity rune", 3); - aRuneOfOrb = this.getPureTextEntry(3, "The rune of the orb", 3); - aFieldTrip = this.getPureTextEntry(19, "A field trip", 4); - aKeyOfBinding = this.getPureTextEntry(4, "The key of binding", 4); - aT5 = this.getPureTextEntry(4, "The trials of a T5 altar", 4); - aPriceOfPower = this.getPureTextEntry(2, "The price of power", 4); - aDemonicOrb = this.getPureTextEntry(1, "Demonic orb", 4); - aEnergyBazooka = this.getPureTextEntry(2, "The unspeakable power of the energy bazooka", 4); - aAccelerationRune = this.getPureTextEntry(2, "Acceleration runes", 4); - aHarvestSigil = this.getPureTextEntry(3, "The sigil of the Harvest goddess", 4); - aDemons = this.getPureTextEntry(6, "Solving a demon problem with more demons", 4); - aT6 = this.getPureTextEntry(3, "The T6 altar already", 4); - - rIntro = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText()}, "Introduction", 1); - rWeakRituals = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText(), new EntryText()}, "Weak Rituals", 1); - rRituals = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText(), new EntryText()}, "Rituals", 1); - rRitualWater = this.getPureTextEntry(2, "Ritual of the Full Spring", 1); - - theAltar = new Entry(new IEntry[]{new EntryItemText(new ItemStack(ModBlocks.blockAltar), "Blood Altar")}, EnumChatFormatting.BLUE + "Blood Altar", 1); - runes = new Entry(new IEntry[]{new EntryItemText(new ItemStack(ModBlocks.runeOfSelfSacrifice)), new EntryItemText(new ItemStack(ModBlocks.runeOfSacrifice)), new EntryItemText(new ItemStack(ModBlocks.speedRune))}, "Runes", 1); - - /** Page 1 */ - ritualWater = new Entry(new IEntry[]{new EntryText()}, "Full Spring", 1); - ritualLava = new Entry(new IEntry[]{new EntryText(), new EntryText()}, "Nether", 1); - ritualGreenGrove = new Entry(new IEntry[]{new EntryText(), new EntryText()}, "Green Grove", 1); - ritualInterdiction = new Entry(new IEntry[]{new EntryText(), new EntryText()}, "Interdiction", 1); - ritualContainment = new Entry(new IEntry[]{new EntryText()}, "Containment", 1); - ritualHighJump = new Entry(new IEntry[]{new EntryText()}, "High Jump", 1); - ritualSpeed = new Entry(new IEntry[]{new EntryText()}, "Speed", 1); - ritualMagnet = new Entry(new IEntry[]{new EntryText()}, "Magnetism", 1); - ritualCrusher = new Entry(new IEntry[]{new EntryText()}, "Crusher", 1); - ritualShepherd = new Entry(new IEntry[]{new EntryText()}, "Shepherd", 1); - ritualRegeneration = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText()}, "Regeneration", 1); - ritualFeatheredKnife = new Entry(new IEntry[]{new EntryText(), new EntryText(), new EntryText(), new EntryText()}, "Feathered Knife", 1); - ritualMoon = new Entry(new IEntry[]{new EntryText()}, "Harvest Moon", 1); - ritualSoul = new Entry(new IEntry[]{new EntryText(), new EntryText()}, "Eternal Soul", 2); - - ritualCure = new Entry(new IEntry[]{new EntryText(), new EntryRitualInfo(500)}, "Curing", 1); -// blockDivination = new Entry(new IEntry[]{new EntryItemText(new ItemStack(BUBlocks.altarProgress)), new EntryCraftingRecipe(BURecipes.altarProgress)}, "Divination Block", 1); -// sigilAdvancedDivination = new Entry(new IEntry[]{new EntryItemText(new ItemStack(BUItems.sigil_advancedDivination)), new EntryAltarRecipe(BURecipes.advancedSigil)}, "Advanced Divination", 1); -// -// elementRituals = new Entry(new IEntry[]{new EntryItemText(new ItemStack(BUBlocks.darknessArea)), new EntryText(), new EntryCraftingRecipe(BURecipes.gemEmpty), new EntryAltarRecipe(BURecipes.diamondBlood)}, "Elemental Rituals", 1); -// reviving = new Entry(new IEntry[]{new EntryText(), new EntryCraftingRecipe(BURecipes.reviver)}, "Reviving", 1); - - /** Debug */ - debug = new Entry(new IEntry[]{new EntryText("Debug"), new EntryImage("bloodutils:textures/misc/screenshots/t1.png", 854, 480, "Debug")}, EnumChatFormatting.AQUA + "De" + EnumChatFormatting.RED + "bug", 1); - - registerEntries(); - } - - public Entry getPureTextEntry(int numberOfPages, String name, int pageNumber) - { - IEntry[] entries = new IEntry[numberOfPages]; - for(int i=0; i map) - { - IEntry[] entries = new IEntry[numberOfPages]; - for(int i=0; i ent : map.entrySet()) - { - if(ent.getKey() < entries.length) - { - entries[ent.getKey()] = ent.getValue(); - } - } - - return new Entry(entries, name, pageNumber); - } - - /* Architect */ - public static Entry aIntro; - public static Entry aBloodAltar; - public static Entry aSoulNetwork; - public static Entry aBasicsOfSigils; - public static Entry aTrainingAndWaterSigil; - public static Entry aLavaCrystal; - public static Entry aLavaSigil; - public static Entry aBlankRunes; - public static Entry aSpeedRune; - public static Entry aApprenticeOrb; - public static Entry aVoidSigil; - public static Entry aAirSigil; - public static Entry aSightSigil; - public static Entry aAdvancedAltar; - public static Entry aFastMinder; - public static Entry aSoulFray; - public static Entry aGreenGrove; - public static Entry aDaggerOfSacrifice; - public static Entry aRunesOfSacrifice; - public static Entry aBloodLetterPack; - public static Entry aNewFriends; - public static Entry aUpgradedAltar; - public static Entry aNewRunes; - public static Entry aPhandomBridge; - public static Entry aHolding; - public static Entry aElementalAffinity; - public static Entry aRitualStones; - public static Entry aBloodLamp; - public static Entry aBoundArmour; - public static Entry aSanguineArmour; - public static Entry aSoulSuppressing; - public static Entry aRitualDiviner; - public static Entry aBloodShards; - public static Entry aLifeOfMage; - public static Entry aT4; - public static Entry aSigilOfWhirlwind; - public static Entry aSigilOfCompression; - public static Entry aEnderDivergence; - public static Entry aTeleposer; - public static Entry aSuppression; - public static Entry aSuperiorCapacity; - public static Entry aRuneOfOrb; - public static Entry aFieldTrip; - public static Entry aKeyOfBinding; - public static Entry aT5; - public static Entry aPriceOfPower; - public static Entry aDemonicOrb; - public static Entry aEnergyBazooka; - public static Entry aAccelerationRune; - public static Entry aHarvestSigil; - public static Entry aDemons; - public static Entry aT6; - - public static Entry rIntro; - public static Entry rWeakRituals; - public static Entry rRituals; - public static Entry rRitualWater; - - public static Entry theAltar; - public static Entry runes; - - public static Entry ritualCure; - public static Entry sigilAdvancedDivination; - public static Entry blockDivination; - - public static Entry ritualWater; - public static Entry ritualLava; - public static Entry ritualGreenGrove; - public static Entry ritualInterdiction; - public static Entry ritualContainment; - public static Entry ritualHighJump; - public static Entry ritualSpeed; - public static Entry ritualMagnet; - public static Entry ritualCrusher; - public static Entry ritualShepherd; - public static Entry ritualRegeneration; - public static Entry ritualFeatheredKnife; - public static Entry ritualMoon; - public static Entry ritualSoul; - - public static Entry elementRituals; - public static Entry reviving; - - public static Entry debug; - - public void registerEntries() - { - /* Architect */ - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aIntro); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodAltar); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSoulNetwork); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBasicsOfSigils); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aTrainingAndWaterSigil); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aLavaCrystal); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aLavaSigil); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBlankRunes); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSpeedRune); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aApprenticeOrb); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aVoidSigil); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aAirSigil); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSightSigil); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aAdvancedAltar); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aFastMinder); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSoulFray); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aGreenGrove); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aDaggerOfSacrifice); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRunesOfSacrifice); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodLetterPack); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aNewFriends); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aUpgradedAltar); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aNewRunes); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aPhandomBridge); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aHolding); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aElementalAffinity); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRitualStones); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodLamp); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBoundArmour); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSanguineArmour); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSoulSuppressing); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRitualDiviner); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aBloodShards); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aLifeOfMage); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aT4); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSigilOfWhirlwind); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSigilOfCompression); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aEnderDivergence); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aTeleposer); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSuppression); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aSuperiorCapacity); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aRuneOfOrb); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aFieldTrip); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aKeyOfBinding); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aT5); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aPriceOfPower); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aDemonicOrb); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aEnergyBazooka); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aAccelerationRune); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aHarvestSigil); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aDemons); - EntryRegistry.registerEntry(BUEntries.catagoryArchitect, EntryRegistry.architect, BUEntries.aT6); - - EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.theAltar); - EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.runes); - - EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.rIntro); - EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.rWeakRituals); - EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.rRituals); - EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.rRitualWater); - -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualWater); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualLava); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualGreenGrove); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualInterdiction); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualContainment); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualHighJump); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualSpeed); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualMagnet); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualCrusher); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualShepherd); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualRegeneration); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualFeatheredKnife); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualMoon); -// EntryRegistry.registerEntry(BUEntries.categoryRituals, EntryRegistry.rituals, BUEntries.ritualSoul); - - /** Debug */ - EntryRegistry.registerEntry(BUEntries.categoryBasics, EntryRegistry.basics, BUEntries.debug); - - - -// this.registerCategory(BUEntries.categoryTest, EntryRegistry.test, BookParser.parseTextFile("/assets/alchemicalwizardryBooks/books/book.txt")); - } - - public void registerCategory(Category cat, HashMap entryMap, List entries) - { - for(Entry entry : entries) - { - EntryRegistry.registerEntry(cat, entryMap, entry); - } - } -} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/book/BookParser.java b/src/main/java/WayofTime/alchemicalWizardry/common/book/BookParser.java deleted file mode 100644 index 8d874318..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/book/BookParser.java +++ /dev/null @@ -1,333 +0,0 @@ -package WayofTime.alchemicalWizardry.common.book; - -import java.io.BufferedReader; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.api.spell.APISpellHelper; -import WayofTime.alchemicalWizardry.book.compact.Entry; -import WayofTime.alchemicalWizardry.book.entries.EntryCraftingRecipeCustomText; -import WayofTime.alchemicalWizardry.book.entries.EntryImageCustomText; -import WayofTime.alchemicalWizardry.book.entries.EntryItemCustomText; -import WayofTime.alchemicalWizardry.book.entries.EntryTextCustomText; -import WayofTime.alchemicalWizardry.book.entries.IEntryCustomText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BookParser -{ - @SideOnly(Side.CLIENT) - public static List parseTextFile(String location) - { -// File textFiles = new File("config/BloodMagic/bookDocs"); - ArrayList entryList = new ArrayList(); - //if(textFiles.exists()) - { - try { - System.out.println("I am in an island of files!"); - - InputStream input = AlchemicalWizardry.class.getResourceAsStream(location); - - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true); - - if(input != null) - { - DataInputStream in = new DataInputStream(input); - BufferedReader br = new BufferedReader(new InputStreamReader(in)); - String strLine; - //Read File Line By Line - - int defMaxLines = 16; - int maxLines = defMaxLines; - - int currentPage = 0; - - int pageIndex = 1; - - String currentTitle = "aw.entry.Magnus"; - - String[] strings = new String[1]; - strings[0] = ""; - - //New entry stuff - ArrayList iEntryList = new ArrayList(); - IEntryCustomText currentIEntry = new EntryTextCustomText(); - - boolean lastPageWasSpecial = true; - - int entriesPerPage = 14; - - while ((strLine = br.readLine()) != null) - { - if(strLine.trim().isEmpty()) - { - continue; - } - - if(strLine.startsWith("//TITLE ")) //New entry~ - { - lastPageWasSpecial = false; - String[] newStrings = new String[currentPage + 1 + 1]; //Just to show that it is increasing - for(int i=0; i maxLines) - { - changePage = true; - } - if(changePage) //Encode into current entry, then move to next entry - { - String[] newStrings = new String[currentPage + 1 + 1]; //Just to show that it is increasing - for(int i=0; i 3L) -//// { -//// -//// }else -// { -// PrintWriter writer = new PrintWriter(file); -// for(String stri : strings) -// { -// writer.println(stri); -// } -// writer.close(); -// } - -// - } - - Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false); - - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - return entryList; - } - - public static IEntryCustomText[] getArrayForList(List list) - { - Object[] tempArray = list.toArray(); - IEntryCustomText[] customTextArray = new IEntryCustomText[tempArray.length]; - for(int i=0; i= 5) - { - return new EntryImageCustomText(arguments[3], xSize, ySize, arguments[4]); - }else - { - return new EntryImageCustomText(arguments[3], xSize, ySize); - } - }else if(unparsedString.startsWith("//CRAFTING ")) - { - String lines = unparsedString.replaceFirst("//CRAFTING ", ""); - ItemStack stack = APISpellHelper.getItemStackForString(lines); - IRecipe recipe = APISpellHelper.getRecipeForItemStack(stack); - if(recipe != null) - { - return new EntryCraftingRecipeCustomText(recipe); - } - }else if(unparsedString.startsWith("//ITEM ")) - { - String lines = unparsedString.replaceFirst("//ITEM ", ""); - ItemStack stack = APISpellHelper.getItemStackForString(lines); - if(stack != null) - { - return new EntryItemCustomText(stack); - } - } - - return new EntryTextCustomText(); - } - - public static int getlineLimitForStringTitle(String unparsedString, int def) - { - if(unparsedString.startsWith("//IMAGE ")) - { - String lines = unparsedString.replaceFirst("//IMAGE ", ""); - String[] arguments = lines.split(" "); - if(arguments.length < 4) - { - return def; - } - - return Integer.decode(arguments[0]); - }else if(unparsedString.startsWith("//CRAFTING ")) - { - return 0; - }else if(unparsedString.startsWith("//ITEM ")) - { - return 9; - } - - return def; - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/book/ItemBMBook.java b/src/main/java/WayofTime/alchemicalWizardry/common/book/ItemBMBook.java deleted file mode 100644 index 0027578f..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/book/ItemBMBook.java +++ /dev/null @@ -1,62 +0,0 @@ -package WayofTime.alchemicalWizardry.common.book; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.AlchemicalWizardry; -import WayofTime.alchemicalWizardry.common.entity.mob.BookEntityItem; - -public class ItemBMBook extends Item -{ - public ItemBMBook() - { - super(); - setMaxStackSize(1); - this.setCreativeTab(AlchemicalWizardry.tabBloodMagic); - } - - @Override - public void registerIcons(IIconRegister ir) - { - itemIcon = ir.registerIcon("AlchemicalWizardry" + ":" + "guide"); - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - player.openGui(AlchemicalWizardry.instance, 2, 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); - if(!stack.hasTagCompound()) - stack.setTagCompound(new NBTTagCompound()); - } - - @Override - public void onCreated(ItemStack stack, World world, EntityPlayer player) - { - super.onCreated(stack, world, player); - if(!stack.hasTagCompound()) - stack.setTagCompound(new NBTTagCompound()); - } - - @Override - public boolean hasCustomEntity(ItemStack stack) - { - return true; - } - - @Override - public Entity createEntity(World world, Entity location, ItemStack itemstack) - { - return new BookEntityItem(world, location, itemstack); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/book/SpecialEntryRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/book/SpecialEntryRegistry.java deleted file mode 100644 index 1961e729..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/book/SpecialEntryRegistry.java +++ /dev/null @@ -1,27 +0,0 @@ -package WayofTime.alchemicalWizardry.common.book; - -import java.util.HashMap; -import java.util.Map; - -import WayofTime.alchemicalWizardry.book.registries.RecipeRegistry; -import net.minecraft.item.crafting.IRecipe; - -public class SpecialEntryRegistry -{ - public static Map recipeStringMap = new HashMap(); - - public static void registerIRecipeKey(IRecipe recipe, String key) - { - recipeStringMap.put(key, recipe); - } - - public static IRecipe getIRecipeForKey(String str) - { - return recipeStringMap.get(str); - } - - public static void registerLatestIRecipe(String key) - { - SpecialEntryRegistry.registerIRecipeKey(RecipeRegistry.getLatestCraftingRecipe(), key); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java index dededdf6..9da448a8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDismantler.java @@ -37,7 +37,8 @@ public class ItemRitualDismantler extends EnergyItems public void addInformation(ItemStack stack, EntityPlayer player, List par3List, boolean x) { par3List.add(StatCollector.translateToLocal("tooltip.dismatler.desc")); - par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); + if(stack.hasTagCompound()) + par3List.add(StatCollector.translateToLocal("tooltip.owner.currentowner") + " " + stack.getTagCompound().getString("ownerName")); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java index a827238c..064f01fd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java @@ -1,17 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity.gui; -import WayofTime.alchemicalWizardry.common.items.sigil.holding.ContainerHolding; -import WayofTime.alchemicalWizardry.common.items.sigil.holding.GuiHolding; -import WayofTime.alchemicalWizardry.common.items.sigil.holding.InventoryHolding; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiCategories; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry; -import WayofTime.alchemicalWizardry.book.classes.guide.GuiIndex; -import WayofTime.alchemicalWizardry.book.compact.Category; -import WayofTime.alchemicalWizardry.book.registries.EntryRegistry; +import WayofTime.alchemicalWizardry.common.items.sigil.holding.ContainerHolding; +import WayofTime.alchemicalWizardry.common.items.sigil.holding.GuiHolding; +import WayofTime.alchemicalWizardry.common.items.sigil.holding.InventoryHolding; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; @@ -82,28 +77,7 @@ public class GuiHandler implements IGuiHandler break; case 2: - - if(held.hasTagCompound() && held.getTagCompound().getString("CATEGORY") != null){ - if(held.hasTagCompound() && held.getTagCompound().getString("KEY") != null && held.getTagCompound().getString("KEY") != "0"){ - String cate = held.getTagCompound().getString("CATEGORY"); - String key = held.getTagCompound().getString("KEY"); - int page = held.getTagCompound().getInteger("PAGE"); - if(EntryRegistry.categoryMap.containsKey(cate)){ - Category category = EntryRegistry.categoryMap.get(cate); - return new GuiEntry(key, player, category, page); - }else{ - return new GuiCategories(player); - } - }else if(held.hasTagCompound() && held.getTagCompound().getString("CATEGORY") != null){ - String cate = held.getTagCompound().getString("CATEGORY"); - int page = held.getTagCompound().getInteger("PAGE"); - if(EntryRegistry.categoryMap.containsKey(cate)){ - Category category = EntryRegistry.categoryMap.get(cate); - return new GuiIndex(category, player, page); - } - } - } - return new GuiCategories(player); + case 3: return new GuiHolding(player, new InventoryHolding(player.getHeldItem()));