From 2a3e65c8ec314602d5483f0ee6515d9fc13b442b Mon Sep 17 00:00:00 2001 From: pahimar Date: Fri, 23 Aug 2013 11:01:17 -0400 Subject: [PATCH] Missed the removal part of the last commit --- .gitignore | 3 +- .../com/pahimar/ee3/EquivalentExchange3.java | 201 ------- .../ee3/block/BlockAlchemicalChest.java | 130 ----- .../pahimar/ee3/block/BlockAludelBase.java | 168 ------ .../pahimar/ee3/block/BlockCalcinator.java | 128 ----- ee3_common/com/pahimar/ee3/block/BlockEE.java | 76 --- .../com/pahimar/ee3/block/BlockGlassBell.java | 231 -------- .../ee3/block/BlockRedWaterFlowing.java | 28 - .../pahimar/ee3/block/BlockRedWaterStill.java | 29 - .../com/pahimar/ee3/block/ModBlocks.java | 55 -- .../ee3/client/audio/SoundHandler.java | 35 -- .../gui/inventory/GuiAlchemicalBag.java | 78 --- .../gui/inventory/GuiAlchemicalChest.java | 58 -- .../ee3/client/gui/inventory/GuiAludel.java | 56 -- .../client/gui/inventory/GuiCalcinator.java | 58 -- .../client/gui/inventory/GuiGlassBell.java | 56 -- .../gui/inventory/GuiPortableCrafting.java | 76 --- .../inventory/GuiPortableTransmutation.java | 58 -- .../pahimar/ee3/client/model/ModelAludel.java | 34 -- .../ee3/client/model/ModelCalcinator.java | 39 -- .../ee3/client/model/ModelGlassBell.java | 21 - .../ee3/client/renderer/RenderUtils.java | 84 --- .../item/ItemAlchemicalChestRenderer.java | 81 --- .../renderer/item/ItemAludelRenderer.java | 90 ---- .../renderer/item/ItemCalcinatorRenderer.java | 90 ---- .../renderer/item/ItemGlassBellRenderer.java | 90 ---- .../TileEntityAlchemicalChestRenderer.java | 81 --- .../tileentity/TileEntityAludelRenderer.java | 167 ------ .../TileEntityCalcinatorRenderer.java | 58 -- .../TileEntityGlassBellRenderer.java | 265 --------- .../com/pahimar/ee3/command/CommandEE.java | 103 ---- .../pahimar/ee3/command/CommandHandler.java | 20 - .../pahimar/ee3/command/CommandOverlay.java | 143 ----- .../pahimar/ee3/command/CommandParticles.java | 56 -- .../pahimar/ee3/command/CommandSounds.java | 65 --- .../pahimar/ee3/command/CommandVersion.java | 50 -- .../configuration/ConfigurationHandler.java | 138 ----- .../configuration/ConfigurationSettings.java | 132 ----- .../core/handlers/ActionRequestHandler.java | 23 - .../ee3/core/handlers/AddonHandler.java | 18 - .../ee3/core/handlers/CraftingHandler.java | 75 --- .../handlers/DrawBlockHighlightHandler.java | 199 ------- .../core/handlers/EntityLivingHandler.java | 42 -- .../ee3/core/handlers/EquivalencyHandler.java | 254 --------- .../ee3/core/handlers/FuelHandler.java | 24 - .../core/handlers/InterModCommsHandler.java | 98 ---- .../ee3/core/handlers/ItemEventHandler.java | 66 --- .../ee3/core/handlers/KeyBindingHandler.java | 78 --- .../core/handlers/LocalizationHandler.java | 30 -- .../handlers/PlayerDestroyItemHandler.java | 24 - .../TransmutationTargetOverlayHandler.java | 149 ----- .../handlers/VersionCheckTickHandler.java | 71 --- .../handlers/WorldTransmutationHandler.java | 181 ------- .../pahimar/ee3/core/proxy/ClientProxy.java | 224 -------- .../pahimar/ee3/core/proxy/CommonProxy.java | 151 ------ .../pahimar/ee3/core/util/EnergyStack.java | 49 -- .../pahimar/ee3/core/util/GeneralHelper.java | 55 -- .../com/pahimar/ee3/core/util/ItemUtil.java | 204 ------- .../pahimar/ee3/core/util/KeyBindingUtil.java | 65 --- .../ee3/core/util/LocalizationUtil.java | 46 -- .../com/pahimar/ee3/core/util/LogHelper.java | 72 --- .../com/pahimar/ee3/core/util/OreStack.java | 97 ---- .../pahimar/ee3/core/util/QualityHelper.java | 40 -- .../pahimar/ee3/core/util/RecipeHelper.java | 175 ------ .../ee3/core/util/ResourceLocationHelper.java | 13 - .../ee3/core/util/TransmutationHelper.java | 146 ----- .../pahimar/ee3/core/util/VersionHelper.java | 224 -------- .../ee3/creativetab/CreativeTabEE3.java | 36 -- ee3_common/com/pahimar/ee3/emc/DynEMC.java | 161 ------ .../com/pahimar/ee3/emc/EmcBlackList.java | 119 ---- .../com/pahimar/ee3/emc/EmcComponent.java | 46 -- .../com/pahimar/ee3/emc/EmcDefaultValues.java | 15 - ee3_common/com/pahimar/ee3/emc/EmcMap.java | 37 -- ee3_common/com/pahimar/ee3/emc/EmcType.java | 5 - ee3_common/com/pahimar/ee3/emc/EmcValue.java | 161 ------ .../com/pahimar/ee3/emc/EquivalencyGroup.java | 113 ---- .../ee3/emc/graph/WeightedDirectedGraph.java | 272 ---------- .../pahimar/ee3/emc/graph/WeightedEdge.java | 55 -- .../com/pahimar/ee3/event/ActionEvent.java | 45 -- .../pahimar/ee3/event/ActionRequestEvent.java | 46 -- .../ee3/event/WorldTransmutationEvent.java | 28 - .../ee3/inventory/ContainerAlchemicalBag.java | 94 ---- .../inventory/ContainerAlchemicalChest.java | 99 ---- .../ee3/inventory/ContainerAludel.java | 119 ---- .../ee3/inventory/ContainerCalcinator.java | 108 ---- .../ee3/inventory/ContainerGlassBell.java | 80 --- .../inventory/ContainerPortableCrafting.java | 51 -- .../ContainerPortableTransmutation.java | 45 -- .../pahimar/ee3/inventory/SlotCalcinator.java | 29 - .../ee3/inventory/WorldSavedDataEE.java | 130 ----- .../pahimar/ee3/item/CustomWrappedStack.java | 290 ---------- .../com/pahimar/ee3/item/IChargeable.java | 24 - .../com/pahimar/ee3/item/IKeyBound.java | 19 - .../pahimar/ee3/item/ITransmutationStone.java | 24 - .../pahimar/ee3/item/ItemAlchemicalBag.java | 154 ------ .../pahimar/ee3/item/ItemAlchemicalDust.java | 117 ---- ee3_common/com/pahimar/ee3/item/ItemEE.java | 35 -- .../com/pahimar/ee3/item/ItemInertStone.java | 23 - .../com/pahimar/ee3/item/ItemMiniumShard.java | 24 - .../com/pahimar/ee3/item/ItemMiniumStone.java | 129 ----- .../ee3/item/ItemPhilosophersStone.java | 186 ------- ee3_common/com/pahimar/ee3/item/ModItems.java | 48 -- .../ee3/item/crafting/CalcinationManager.java | 20 - .../ee3/item/crafting/RecipeRegistry.java | 301 ----------- .../crafting/RecipesAlchemicalBagDyes.java | 148 ----- .../ee3/item/crafting/RecipesPotions.java | 292 ---------- .../ee3/item/crafting/RecipesSmelting.java | 48 -- .../ee3/item/crafting/RecipesVanilla.java | 49 -- .../item/crafting/TransmutationManager.java | 42 -- .../com/pahimar/ee3/lib/ActionTypes.java | 16 - ee3_common/com/pahimar/ee3/lib/BlockIds.java | 28 - ee3_common/com/pahimar/ee3/lib/Colours.java | 21 - ee3_common/com/pahimar/ee3/lib/Commands.java | 61 --- ee3_common/com/pahimar/ee3/lib/GuiIds.java | 23 - .../com/pahimar/ee3/lib/InterModComms.java | 14 - ee3_common/com/pahimar/ee3/lib/ItemIds.java | 30 -- .../com/pahimar/ee3/lib/ItemUpdateTypes.java | 16 - .../com/pahimar/ee3/lib/Localizations.java | 18 - ee3_common/com/pahimar/ee3/lib/Models.java | 11 - ee3_common/com/pahimar/ee3/lib/Particles.java | 42 -- ee3_common/com/pahimar/ee3/lib/Reference.java | 32 -- ee3_common/com/pahimar/ee3/lib/RenderIds.java | 18 - ee3_common/com/pahimar/ee3/lib/Sounds.java | 39 -- ee3_common/com/pahimar/ee3/lib/Strings.java | 92 ---- ee3_common/com/pahimar/ee3/lib/Textures.java | 49 -- ee3_common/com/pahimar/ee3/nbt/NBTHelper.java | 508 ------------------ .../pahimar/ee3/network/PacketHandler.java | 44 -- .../ee3/network/PacketTypeHandler.java | 90 ---- .../pahimar/ee3/network/packet/PacketEE.java | 75 --- .../ee3/network/packet/PacketItemUpdate.java | 66 --- .../ee3/network/packet/PacketKeyPressed.java | 60 --- .../network/packet/PacketRequestEvent.java | 85 --- .../ee3/network/packet/PacketSoundEvent.java | 88 --- .../network/packet/PacketSpawnParticle.java | 83 --- .../ee3/network/packet/PacketTileUpdate.java | 75 --- .../packet/PacketTileWithItemUpdate.java | 78 --- .../pahimar/ee3/recipe/RecipesCalcinator.java | 14 - .../ee3/tileentity/TileAlchemicalChest.java | 268 --------- .../pahimar/ee3/tileentity/TileAludel.java | 206 ------- .../ee3/tileentity/TileCalcinator.java | 186 ------- .../com/pahimar/ee3/tileentity/TileEE.java | 127 ----- .../pahimar/ee3/tileentity/TileGlassBell.java | 190 ------- ee3_common/mcmod.info | 21 - 143 files changed, 2 insertions(+), 12863 deletions(-) delete mode 100644 ee3_common/com/pahimar/ee3/EquivalentExchange3.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockAlchemicalChest.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockAludelBase.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockEE.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockGlassBell.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockRedWaterFlowing.java delete mode 100644 ee3_common/com/pahimar/ee3/block/BlockRedWaterStill.java delete mode 100644 ee3_common/com/pahimar/ee3/block/ModBlocks.java delete mode 100644 ee3_common/com/pahimar/ee3/client/audio/SoundHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAludel.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiGlassBell.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableCrafting.java delete mode 100644 ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java delete mode 100644 ee3_common/com/pahimar/ee3/client/model/ModelAludel.java delete mode 100644 ee3_common/com/pahimar/ee3/client/model/ModelCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/client/model/ModelGlassBell.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/RenderUtils.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/item/ItemAlchemicalChestRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/item/ItemAludelRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/item/ItemCalcinatorRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/item/ItemGlassBellRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAlchemicalChestRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAludelRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java delete mode 100644 ee3_common/com/pahimar/ee3/command/CommandEE.java delete mode 100644 ee3_common/com/pahimar/ee3/command/CommandHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/command/CommandOverlay.java delete mode 100644 ee3_common/com/pahimar/ee3/command/CommandParticles.java delete mode 100644 ee3_common/com/pahimar/ee3/command/CommandSounds.java delete mode 100644 ee3_common/com/pahimar/ee3/command/CommandVersion.java delete mode 100644 ee3_common/com/pahimar/ee3/configuration/ConfigurationHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/configuration/ConfigurationSettings.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/ActionRequestHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/AddonHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/CraftingHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/EntityLivingHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/FuelHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/InterModCommsHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/ItemEventHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/KeyBindingHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/LocalizationHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/PlayerDestroyItemHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/VersionCheckTickHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/core/proxy/ClientProxy.java delete mode 100644 ee3_common/com/pahimar/ee3/core/proxy/CommonProxy.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/EnergyStack.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/GeneralHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/ItemUtil.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/KeyBindingUtil.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/LocalizationUtil.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/LogHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/OreStack.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/QualityHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/RecipeHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/ResourceLocationHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/TransmutationHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/core/util/VersionHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/creativetab/CreativeTabEE3.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/DynEMC.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EmcBlackList.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EmcComponent.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EmcDefaultValues.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EmcMap.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EmcType.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EmcValue.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/EquivalencyGroup.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java delete mode 100644 ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java delete mode 100644 ee3_common/com/pahimar/ee3/event/ActionEvent.java delete mode 100644 ee3_common/com/pahimar/ee3/event/ActionRequestEvent.java delete mode 100644 ee3_common/com/pahimar/ee3/event/WorldTransmutationEvent.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalBag.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalChest.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerAludel.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerGlassBell.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerPortableCrafting.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/ContainerPortableTransmutation.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/SlotCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/inventory/WorldSavedDataEE.java delete mode 100644 ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java delete mode 100644 ee3_common/com/pahimar/ee3/item/IChargeable.java delete mode 100644 ee3_common/com/pahimar/ee3/item/IKeyBound.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ITransmutationStone.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemAlchemicalBag.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemAlchemicalDust.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemEE.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemInertStone.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemMiniumShard.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemMiniumStone.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ItemPhilosophersStone.java delete mode 100644 ee3_common/com/pahimar/ee3/item/ModItems.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/CalcinationManager.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/RecipeRegistry.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/RecipesAlchemicalBagDyes.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/RecipesPotions.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/RecipesSmelting.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/RecipesVanilla.java delete mode 100644 ee3_common/com/pahimar/ee3/item/crafting/TransmutationManager.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/ActionTypes.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/BlockIds.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Colours.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Commands.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/GuiIds.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/InterModComms.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/ItemIds.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/ItemUpdateTypes.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Localizations.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Models.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Particles.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Reference.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/RenderIds.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Sounds.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Strings.java delete mode 100644 ee3_common/com/pahimar/ee3/lib/Textures.java delete mode 100644 ee3_common/com/pahimar/ee3/nbt/NBTHelper.java delete mode 100644 ee3_common/com/pahimar/ee3/network/PacketHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/network/PacketTypeHandler.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketEE.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketItemUpdate.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketKeyPressed.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketRequestEvent.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketSoundEvent.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketSpawnParticle.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketTileUpdate.java delete mode 100644 ee3_common/com/pahimar/ee3/network/packet/PacketTileWithItemUpdate.java delete mode 100644 ee3_common/com/pahimar/ee3/recipe/RecipesCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/tileentity/TileAlchemicalChest.java delete mode 100644 ee3_common/com/pahimar/ee3/tileentity/TileAludel.java delete mode 100644 ee3_common/com/pahimar/ee3/tileentity/TileCalcinator.java delete mode 100644 ee3_common/com/pahimar/ee3/tileentity/TileEE.java delete mode 100644 ee3_common/com/pahimar/ee3/tileentity/TileGlassBell.java delete mode 100644 ee3_common/mcmod.info diff --git a/.gitignore b/.gitignore index 722a513f..897d4656 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build.properties .DS_Store .DS_Store? .Spotlight-V100 -.Trashes \ No newline at end of file +.Trashes +/bin diff --git a/ee3_common/com/pahimar/ee3/EquivalentExchange3.java b/ee3_common/com/pahimar/ee3/EquivalentExchange3.java deleted file mode 100644 index e7cd13cf..00000000 --- a/ee3_common/com/pahimar/ee3/EquivalentExchange3.java +++ /dev/null @@ -1,201 +0,0 @@ -package com.pahimar.ee3; - -import java.io.File; -import java.util.Arrays; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraftforge.common.MinecraftForge; - -import com.pahimar.ee3.block.ModBlocks; -import com.pahimar.ee3.command.CommandHandler; -import com.pahimar.ee3.configuration.ConfigurationHandler; -import com.pahimar.ee3.core.handlers.ActionRequestHandler; -import com.pahimar.ee3.core.handlers.AddonHandler; -import com.pahimar.ee3.core.handlers.CraftingHandler; -import com.pahimar.ee3.core.handlers.EntityLivingHandler; -import com.pahimar.ee3.core.handlers.FuelHandler; -import com.pahimar.ee3.core.handlers.InterModCommsHandler; -import com.pahimar.ee3.core.handlers.ItemEventHandler; -import com.pahimar.ee3.core.handlers.LocalizationHandler; -import com.pahimar.ee3.core.handlers.PlayerDestroyItemHandler; -import com.pahimar.ee3.core.handlers.VersionCheckTickHandler; -import com.pahimar.ee3.core.handlers.WorldTransmutationHandler; -import com.pahimar.ee3.core.proxy.CommonProxy; -import com.pahimar.ee3.core.util.LogHelper; -import com.pahimar.ee3.core.util.VersionHelper; -import com.pahimar.ee3.creativetab.CreativeTabEE3; -import com.pahimar.ee3.emc.DynEMC; -import com.pahimar.ee3.item.ModItems; -import com.pahimar.ee3.item.crafting.RecipesAlchemicalBagDyes; -import com.pahimar.ee3.lib.InterModComms; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; -import com.pahimar.ee3.network.PacketHandler; - -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLFingerprintViolationEvent; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.TickRegistry; -import cpw.mods.fml.relauncher.Side; - -/** - * Equivalent-Exchange-3 - * - * EquivalentExchange3 - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION_NUMBER, dependencies = Reference.DEPENDENCIES, certificateFingerprint = Reference.FINGERPRINT) -@NetworkMod(channels = { Reference.CHANNEL_NAME }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) -public class EquivalentExchange3 { - - @Instance(Reference.MOD_ID) - public static EquivalentExchange3 instance; - - @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) - public static CommonProxy proxy; - - public static CreativeTabs tabsEE3 = new CreativeTabEE3( - CreativeTabs.getNextID(), Reference.MOD_ID); - - @EventHandler - public void invalidFingerprint(FMLFingerprintViolationEvent event) { - - // Report (log) to the user that the version of Equivalent Exchange 3 - // they are using has been changed/tampered with - LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE); - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - - // Initialize the custom commands - CommandHandler.initCommands(event); - } - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - - // Initialize the log helper - LogHelper.init(); - - // Load the localization files into the LanguageRegistry - LocalizationHandler.loadLanguages(); - - // Initialize the configuration - ConfigurationHandler.init(new File(event.getModConfigurationDirectory() - .getAbsolutePath() - + File.separator - + Reference.CHANNEL_NAME - + File.separator + Reference.MOD_ID + ".cfg")); - - // Conduct the version check and log the result - VersionHelper.execute(); - - // Initialize the Version Check Tick Handler (Client only) - TickRegistry.registerTickHandler(new VersionCheckTickHandler(), - Side.CLIENT); - - // Initialize the Render Tick Handler (Client only) - proxy.registerRenderTickHandler(); - - // Register the KeyBinding Handler (Client only) - proxy.registerKeyBindingHandler(); - - // Register the Sound Handler (Client only) - proxy.registerSoundHandler(); - - // Initialize mod blocks - ModBlocks.init(); - - // Initialize mod items - ModItems.init(); - } - - @EventHandler - @SuppressWarnings("unchecked") - public void load(FMLInitializationEvent event) { - - // Register the GUI Handler - NetworkRegistry.instance().registerGuiHandler(instance, proxy); - - // Register the PlayerDestroyItem Handler - MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler()); - - // Register the Item Pickup Handler - MinecraftForge.EVENT_BUS.register(new ItemEventHandler()); - - // Register the EntityLiving Handler - MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); - - MinecraftForge.EVENT_BUS.register(new ActionRequestHandler()); - - MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler()); - - GameRegistry.registerCraftingHandler(new CraftingHandler()); - - // Register the DrawBlockHighlight Handler - proxy.registerDrawBlockHighlightHandler(); - - // Initialize mod tile entities - proxy.registerTileEntities(); - - // Initialize custom rendering and pre-load textures (Client only) - proxy.initRenderingAndTextures(); - - // Add in the ability to dye Alchemical Bags - CraftingManager.getInstance().getRecipeList() - .add(new RecipesAlchemicalBagDyes()); - - // Register the Fuel Handler - GameRegistry.registerFuelHandler(new FuelHandler()); - - // Quick test to see that sending an encoded recipe to be added to the - // recipe registry works - FMLInterModComms.sendMessage( - Reference.MOD_ID, - InterModComms.ADD_RECIPE, - NBTHelper.encodeRecipeAsNBT(Item.bucketWater, - Arrays.asList(Item.bucketEmpty, Block.waterStill))); - FMLInterModComms.sendMessage( - Reference.MOD_ID, - InterModComms.ADD_RECIPE, - NBTHelper.encodeRecipeAsNBT(Item.bucketLava, - Arrays.asList(Item.bucketEmpty, Block.lavaStill))); - } - - @EventHandler - public void modsLoaded(FMLPostInitializationEvent event) { - - // Initialize the Addon Handler - AddonHandler.init(); - - // Initialize the DynEMC system - // TODO Seems like this happens earlier than it should now, investigate - // where this should go - DynEMC dynEMC = DynEMC.getInstance(); - } - - @EventHandler - public void handleIMCMessages(IMCEvent event) { - - InterModCommsHandler.processIMCMessages(event); - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockAlchemicalChest.java b/ee3_common/com/pahimar/ee3/block/BlockAlchemicalChest.java deleted file mode 100644 index c1feb173..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockAlchemicalChest.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.pahimar.ee3.block; - -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.RenderIds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.tileentity.TileAlchemicalChest; - -/** - * Equivalent-Exchange-3 - * - * BlockAlchemicalChest - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class BlockAlchemicalChest extends BlockEE { - - /** - * Is the random generator used by alchemical chest to drop the inventory - * contents in random directions. - */ - private Random rand = new Random(); - - public BlockAlchemicalChest(int id) { - - super(id, Material.wood); - this.setUnlocalizedName(Strings.ALCHEMICAL_CHEST_NAME); - this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - } - - @Override - public TileEntity createNewTileEntity(World world) { - - return new TileAlchemicalChest(); - } - - @Override - public boolean renderAsNormalBlock() { - - return false; - } - - @Override - public boolean isOpaqueCube() { - - return false; - } - - @Override - public int getRenderType() { - - return RenderIds.alchemicalChestRenderId; - } - - @Override - public void breakBlock(World world, int x, int y, int z, int id, int meta) { - - dropInventory(world, x, y, z); - super.breakBlock(world, x, y, z, id, meta); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - - if (player.isSneaking()) - return true; - else if (world.isBlockSolidOnSide(x, y + 1, z, ForgeDirection.DOWN)) - return true; - else { - if (!world.isRemote) { - TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z); - - if (tileAlchemicalChest != null) { - player.openGui(EquivalentExchange3.instance, GuiIds.ALCHEMICAL_CHEST, world, x, y, z); - } - } - - return true; - } - } - - private void dropInventory(World world, int x, int y, int z) { - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (!(tileEntity instanceof IInventory)) - return; - - IInventory inventory = (IInventory) tileEntity; - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - - ItemStack itemStack = inventory.getStackInSlot(i); - - if (itemStack != null && itemStack.stackSize > 0) { - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; - - EntityItem entityItem = new EntityItem(world, x + dX, y + dY, z + dZ, new ItemStack(itemStack.itemID, itemStack.stackSize, itemStack.getItemDamage())); - - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } - - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockAludelBase.java b/ee3_common/com/pahimar/ee3/block/BlockAludelBase.java deleted file mode 100644 index e122cddf..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockAludelBase.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.pahimar.ee3.block; - -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.RenderIds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.tileentity.TileAludel; -import com.pahimar.ee3.tileentity.TileGlassBell; - -/** - * Equivalent-Exchange-3 - * - * BlockAludel - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class BlockAludelBase extends BlockEE { - - /** - * Is the random generator used by aludel to drop the inventory contents in - * random directions. - */ - private Random rand = new Random(); - - public BlockAludelBase(int id) { - - super(id, Material.anvil); - this.setUnlocalizedName(Strings.ALUDEL_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); - this.setHardness(5F); - } - - @Override - public TileEntity createNewTileEntity(World world) { - - return new TileAludel(); - } - - @Override - public boolean renderAsNormalBlock() { - - return false; - } - - @Override - public boolean isOpaqueCube() { - - return false; - } - - @Override - public int getRenderType() { - - return RenderIds.aludelRenderId; - } - - @Override - public void breakBlock(World world, int x, int y, int z, int id, int meta) { - - dropInventory(world, x, y, z); - - if (world.getBlockTileEntity(x, y + 1, z) instanceof TileGlassBell) { - world.markBlockForUpdate(x, y + 1, z); - world.updateAllLightTypes(x, y + 1, z); - } - - super.breakBlock(world, x, y, z, id, meta); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - - if (player.isSneaking()) - return false; - else { - if (!world.isRemote) { - TileAludel tileAludel = (TileAludel) world.getBlockTileEntity(x, y, z); - - if (tileAludel != null) { - player.openGui(EquivalentExchange3.instance, GuiIds.ALUDEL, world, x, y, z); - } - } - - return true; - } - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) { - - super.onBlockPlacedBy(world, x, y, z, entityLiving, itemStack); - - if (world.getBlockTileEntity(x, y + 1, z) != null && world.getBlockTileEntity(x, y + 1, z) instanceof TileGlassBell) { - - TileGlassBell tileGlassBell = (TileGlassBell) world.getBlockTileEntity(x, y + 1, z); - - tileGlassBell.setOrientation(ForgeDirection.UP); - - if (world.getBlockTileEntity(x, y, z) != null && world.getBlockTileEntity(x, y, z) instanceof TileAludel) { - - TileAludel tileAludel = (TileAludel) world.getBlockTileEntity(x, y, z); - - ItemStack itemStackGlassBell = tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX); - - tileGlassBell.setInventorySlotContents(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX, null); - - tileAludel.setInventorySlotContents(TileAludel.INPUT_INVENTORY_INDEX, itemStackGlassBell); - } - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - - return 0; - } - - private void dropInventory(World world, int x, int y, int z) { - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (!(tileEntity instanceof IInventory)) - return; - - IInventory inventory = (IInventory) tileEntity; - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - - ItemStack itemStack = inventory.getStackInSlot(i); - - if (itemStack != null && itemStack.stackSize > 0) { - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; - - EntityItem entityItem = new EntityItem(world, x + dX, y + dY, z + dZ, new ItemStack(itemStack.itemID, itemStack.stackSize, itemStack.getItemDamage())); - - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } - - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockCalcinator.java b/ee3_common/com/pahimar/ee3/block/BlockCalcinator.java deleted file mode 100644 index 7b643fef..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockCalcinator.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.pahimar.ee3.block; - -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.RenderIds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.tileentity.TileCalcinator; - -/** - * Equivalent-Exchange-3 - * - * BlockCalcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class BlockCalcinator extends BlockEE { - - /** - * Is the random generator used by calcinator to drop the inventory contents - * in random directions. - */ - private Random rand = new Random(); - - public BlockCalcinator(int id) { - - super(id, Material.rock); - this.setUnlocalizedName(Strings.CALCINATOR_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.setHardness(5F); - this.setBlockBounds(0.1F, 0.0F, 0.1F, 0.9F, 1.0F, 0.9F); - } - - @Override - public TileEntity createNewTileEntity(World world) { - - return new TileCalcinator(); - } - - @Override - public boolean renderAsNormalBlock() { - - return false; - } - - @Override - public boolean isOpaqueCube() { - - return false; - } - - @Override - public int getRenderType() { - - return RenderIds.calcinatorRenderId; - } - - @Override - public void breakBlock(World world, int x, int y, int z, int id, int meta) { - - dropInventory(world, x, y, z); - super.breakBlock(world, x, y, z, id, meta); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - - if (player.isSneaking()) - return false; - else { - if (!world.isRemote) { - TileCalcinator tileCalcinator = (TileCalcinator) world.getBlockTileEntity(x, y, z); - - if (tileCalcinator != null) { - player.openGui(EquivalentExchange3.instance, GuiIds.CALCINATOR, world, x, y, z); - } - } - - return true; - } - } - - private void dropInventory(World world, int x, int y, int z) { - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (!(tileEntity instanceof IInventory)) - return; - - IInventory inventory = (IInventory) tileEntity; - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - - ItemStack itemStack = inventory.getStackInSlot(i); - - if (itemStack != null && itemStack.stackSize > 0) { - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; - - EntityItem entityItem = new EntityItem(world, x + dX, y + dY, z + dZ, new ItemStack(itemStack.itemID, itemStack.stackSize, itemStack.getItemDamage())); - - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } - - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockEE.java b/ee3_common/com/pahimar/ee3/block/BlockEE.java deleted file mode 100644 index 1b4eafa3..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockEE.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.pahimar.ee3.block; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.tileentity.TileEE; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * BlockEE - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public abstract class BlockEE extends BlockContainer { - - public BlockEE(int id, Material material) { - - super(id, material); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - - blockIcon = iconRegister.registerIcon(String.format("%s:%s", Reference.MOD_ID.toLowerCase(), getUnwrappedUnlocalizedName(this.getUnlocalizedName()))); - } - - protected String getUnwrappedUnlocalizedName(String unlocalizedName) { - - return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1); - } - - /** - * Sets the direction of the block when placed - */ - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) { - - int direction = 0; - int facing = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - - if (facing == 0) { - direction = ForgeDirection.NORTH.ordinal(); - } - else if (facing == 1) { - direction = ForgeDirection.EAST.ordinal(); - } - else if (facing == 2) { - direction = ForgeDirection.SOUTH.ordinal(); - } - else if (facing == 3) { - direction = ForgeDirection.WEST.ordinal(); - } - - world.setBlockMetadataWithNotify(x, y, z, direction, 3); - - if (itemStack.hasDisplayName()) { - ((TileEE) world.getBlockTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName()); - } - - ((TileEE) world.getBlockTileEntity(x, y, z)).setOrientation(direction); - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockGlassBell.java b/ee3_common/com/pahimar/ee3/block/BlockGlassBell.java deleted file mode 100644 index 0262ff15..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockGlassBell.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.pahimar.ee3.block; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.RenderIds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.tileentity.TileAludel; -import com.pahimar.ee3.tileentity.TileEE; -import com.pahimar.ee3.tileentity.TileGlassBell; - -public class BlockGlassBell extends BlockEE { - - /** - * Is the random generator used by glass bell to drop the inventory contents - * in random directions. - */ - private Random rand = new Random(); - - public BlockGlassBell(int id) { - - super(id, Material.glass); - this.setUnlocalizedName(Strings.GLASS_BELL_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.setHardness(1.0F); - } - - @Override - public TileEntity createNewTileEntity(World world) { - - return new TileGlassBell(); - } - - @Override - public boolean renderAsNormalBlock() { - - return false; - } - - @Override - public boolean isOpaqueCube() { - - return false; - } - - @Override - public int getRenderType() { - - return RenderIds.glassBellId; - } - - @Override - public void breakBlock(World world, int x, int y, int z, int id, int meta) { - - dropInventory(world, x, y, z); - super.breakBlock(world, x, y, z, id, meta); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - - if (player.isSneaking()) - return false; - else { - if (!world.isRemote) { - TileEntity tileEntityGlassBell = world.getBlockTileEntity(x, y, z); - TileEntity tileEntityAludel = world.getBlockTileEntity(x, y - 1, z); - - if (tileEntityAludel instanceof TileAludel && tileEntityGlassBell instanceof TileGlassBell) { - player.openGui(EquivalentExchange3.instance, GuiIds.ALUDEL, world, x, y - 1, z); - return true; - } - - if (tileEntityGlassBell != null) { - player.openGui(EquivalentExchange3.instance, GuiIds.GLASS_BELL, world, x, y, z); - } - } - - return true; - } - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) { - - if (itemStack.hasDisplayName()) { - ((TileEE) world.getBlockTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName()); - } - - if (world.getBlockTileEntity(x, y - 1, z) != null && world.getBlockTileEntity(x, y - 1, z) instanceof TileAludel) { - ((TileEE) world.getBlockTileEntity(x, y, z)).setOrientation(ForgeDirection.UP); - } - else { - ((TileEE) world.getBlockTileEntity(x, y, z)).setOrientation(world.getBlockMetadata(x, y, z)); - } - - world.setBlockMetadataWithNotify(x, y, z, 0, 3); - } - - @Override - public int onBlockPlaced(World world, int x, int y, int z, int sideHit, float hitX, float hitY, float hitZ, int metaData) { - - return sideHit; - } - - /** - * Ray traces through the blocks collision from start vector to end vector - * returning a ray trace hit. Args: world, x, y, z, startVec, endVec - */ - @Override - public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec) { - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) { - if (tileEntity instanceof TileGlassBell) { - - TileGlassBell tileGlassBell = (TileGlassBell) tileEntity; - - switch (tileGlassBell.getOrientation()) { - case DOWN: { - this.setBlockBounds(0.125F, 0.33F, 0.125F, 0.875F, 1.0F, 0.875F); - break; - } - case UP: { - this.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.66F, 0.875F); - break; - } - case NORTH: { - this.setBlockBounds(0.125F, 0.125F, 0.33F, 0.875F, 0.875F, 1.0F); - break; - } - case SOUTH: { - this.setBlockBounds(0.125F, 0.125F, 0.0F, 0.875F, 0.875F, 0.66F); - break; - } - case EAST: { - this.setBlockBounds(0.0F, 0.125F, 0.125F, 0.66F, 0.875F, 0.875F); - break; - } - case WEST: { - this.setBlockBounds(0.33F, 0.125F, 0.125F, 1.0F, 0.875F, 0.875F); - break; - } - case UNKNOWN: { - break; - } - } - } - } - - return super.collisionRayTrace(world, x, y, z, startVec, endVec); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - - ItemStack itemStack; - - if (world.getBlockTileEntity(x, y, z) instanceof TileGlassBell) { - - TileGlassBell tileGlassBell = (TileGlassBell) world.getBlockTileEntity(x, y, z); - - if (world.getBlockTileEntity(x, y - 1, z) instanceof TileAludel) { - TileAludel tileAludel = (TileAludel) world.getBlockTileEntity(x, y - 1, z); - - itemStack = tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX); - - if (itemStack != null && itemStack.itemID < 4096) - return Block.lightValue[itemStack.itemID]; - } - - itemStack = tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX); - - if (itemStack != null && itemStack.itemID < 4096) - return Block.lightValue[itemStack.itemID]; - } - - return 0; - } - - private void dropInventory(World world, int x, int y, int z) { - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (!(tileEntity instanceof IInventory)) - return; - - IInventory inventory = (IInventory) tileEntity; - - for (int i = 0; i < inventory.getSizeInventory(); i++) { - - ItemStack itemStack = inventory.getStackInSlot(i); - - if (itemStack != null && itemStack.stackSize > 0) { - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; - - EntityItem entityItem = new EntityItem(world, x + dX, y + dY, z + dZ, new ItemStack(itemStack.itemID, itemStack.stackSize, itemStack.getItemDamage())); - - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } - - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockRedWaterFlowing.java b/ee3_common/com/pahimar/ee3/block/BlockRedWaterFlowing.java deleted file mode 100644 index c5fab873..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockRedWaterFlowing.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.pahimar.ee3.block; - -import net.minecraft.block.BlockFlowing; -import net.minecraft.block.material.Material; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * BlockRedWaterFlowing - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class BlockRedWaterFlowing extends BlockFlowing { - - protected BlockRedWaterFlowing(int id) { - - super(id, Material.water); - blockHardness = 100F; - this.setLightOpacity(3); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.setUnlocalizedName(Strings.RED_WATER_FLOWING_NAME); - } -} diff --git a/ee3_common/com/pahimar/ee3/block/BlockRedWaterStill.java b/ee3_common/com/pahimar/ee3/block/BlockRedWaterStill.java deleted file mode 100644 index f11d831f..00000000 --- a/ee3_common/com/pahimar/ee3/block/BlockRedWaterStill.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.pahimar.ee3.block; - -import net.minecraft.block.BlockStationary; -import net.minecraft.block.material.Material; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * BlockRedWaterStill - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class BlockRedWaterStill extends BlockStationary { - - protected BlockRedWaterStill(int id) { - - super(id, Material.water); - blockHardness = 100F; - this.setLightOpacity(3); - this.setUnlocalizedName(Strings.RED_WATER_STILL_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.disableStats(); - } -} diff --git a/ee3_common/com/pahimar/ee3/block/ModBlocks.java b/ee3_common/com/pahimar/ee3/block/ModBlocks.java deleted file mode 100644 index a5bc6905..00000000 --- a/ee3_common/com/pahimar/ee3/block/ModBlocks.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.pahimar.ee3.block; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.lib.BlockIds; -import com.pahimar.ee3.lib.Strings; - -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * Equivalent-Exchange-3 - * - * ModBlocks - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ModBlocks { - - /* Mod block instances */ - public static Block calcinator; - public static Block aludelBase; - public static Block alchemicalChest; - public static Block glassBell; - public static Block redWaterStill; - public static Block redWaterFlowing; - - public static void init() { - - calcinator = new BlockCalcinator(BlockIds.CALCINATOR); - aludelBase = new BlockAludelBase(BlockIds.ALUDEL_BASE); - alchemicalChest = new BlockAlchemicalChest(BlockIds.ALCHEMICAL_CHEST); - glassBell = new BlockGlassBell(BlockIds.GLASS_BELL); - redWaterStill = new BlockRedWaterStill(BlockIds.RED_WATER_STILL); - redWaterFlowing = new BlockRedWaterFlowing(BlockIds.RED_WATER_STILL - 1); - - GameRegistry.registerBlock(calcinator, Strings.CALCINATOR_NAME); - GameRegistry.registerBlock(aludelBase, Strings.ALUDEL_NAME); - GameRegistry.registerBlock(alchemicalChest, Strings.ALCHEMICAL_CHEST_NAME); - GameRegistry.registerBlock(glassBell, Strings.GLASS_BELL_NAME); - //GameRegistry.registerBlock(redWaterStill, Strings.RED_WATER_STILL_NAME); - //GameRegistry.registerBlock(redWaterFlowing, Strings.RED_WATER_FLOWING_NAME); - - initBlockRecipes(); - } - - private static void initBlockRecipes() { - - GameRegistry.addRecipe(new ItemStack(glassBell), new Object[] { "iii", "i i", "i i", Character.valueOf('i'), Block.glass }); - GameRegistry.addRecipe(new ItemStack(aludelBase), new Object[] { "iii", "sis", "iii", Character.valueOf('i'), Item.ingotIron, Character.valueOf('s'), Block.stone }); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/audio/SoundHandler.java b/ee3_common/com/pahimar/ee3/client/audio/SoundHandler.java deleted file mode 100644 index df51d2f0..00000000 --- a/ee3_common/com/pahimar/ee3/client/audio/SoundHandler.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.pahimar.ee3.client.audio; - -import net.minecraftforge.client.event.sound.SoundLoadEvent; -import net.minecraftforge.event.ForgeSubscribe; - -import com.pahimar.ee3.core.util.LogHelper; -import com.pahimar.ee3.lib.Sounds; - -/** - * Equivalent-Exchange-3 - * - * SoundHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class SoundHandler { - - @ForgeSubscribe - public void onSoundLoad(SoundLoadEvent event) { - - // For each custom sound file we have defined in Sounds - for (String soundFile : Sounds.soundFiles) { - // Try to add the custom sound file to the pool of sounds - try { - event.manager.addSound(soundFile); - } - // If we cannot add the custom sound file to the pool, log the exception - catch (Exception e) { - LogHelper.warning("Failed loading sound file: " + soundFile); - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java deleted file mode 100644 index afe61336..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.inventory.ContainerAlchemicalBag; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiAlchemicalBag - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiAlchemicalBag extends GuiContainer { - - public GuiAlchemicalBag(InventoryPlayer inventoryPlayer) { - - super(new ContainerAlchemicalBag(inventoryPlayer)); - xSize = 248; - ySize = 186; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - - fontRenderer.drawString(StatCollector - .translateToLocal(Strings.CONTAINER_ALCHEMICAL_BAG_NAME), 8, 6, - 4210752); - fontRenderer.drawString( - StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), - 44, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - // this.mc.getTextureManager().bindTexture(...) - this.mc.func_110434_K().func_110577_a(Textures.GUI_ALCHEMICAL_STORAGE); - - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } - - @Override - public void onGuiClosed() { - - super.onGuiClosed(); - - if (mc.thePlayer != null) { - for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, - Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, - Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); - } - } - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java deleted file mode 100644 index 1d242505..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.inventory.ContainerAlchemicalChest; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileAlchemicalChest; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiAlchemicalChest - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiAlchemicalChest extends GuiContainer { - - private TileAlchemicalChest tileAlchemicalChest; - - public GuiAlchemicalChest(InventoryPlayer inventoryPlayer, TileAlchemicalChest alchemicalChest) { - - super(new ContainerAlchemicalChest(inventoryPlayer, alchemicalChest)); - tileAlchemicalChest = alchemicalChest; - xSize = 248; - ySize = 186; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - - fontRenderer.drawString(tileAlchemicalChest.isInvNameLocalized() ? tileAlchemicalChest.getInvName() : StatCollector.translateToLocal(tileAlchemicalChest.getInvName()), 8, 6, 4210752); - fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 44, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - // this.mc.getTextureManager().bindTexture(...) - this.mc.func_110434_K().func_110577_a(Textures.GUI_ALCHEMICAL_STORAGE); - - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAludel.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAludel.java deleted file mode 100644 index 91e75b79..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiAludel.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.inventory.ContainerAludel; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileAludel; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiAludel - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiAludel extends GuiContainer { - - private TileAludel tileAludel; - - public GuiAludel(InventoryPlayer inventoryPlayer, TileAludel tileAludel) { - - super(new ContainerAludel(inventoryPlayer, tileAludel)); - this.tileAludel = tileAludel; - xSize = 176; - ySize = 187; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - - String containerName = tileAludel.isInvNameLocalized() ? tileAludel.getInvName() : StatCollector.translateToLocal(tileAludel.getInvName()); - fontRenderer.drawString(containerName, xSize / 2 - fontRenderer.getStringWidth(containerName) / 2, 6, 4210752); - fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 8, ySize - 93, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.func_110434_K().func_110577_a(Textures.GUI_ALUDEL); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java deleted file mode 100644 index d3116d18..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.inventory.ContainerCalcinator; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileCalcinator; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiCalcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiCalcinator extends GuiContainer { - - private TileCalcinator tileCalcinator; - - public GuiCalcinator(InventoryPlayer player, TileCalcinator tileCalcinator) { - - super(new ContainerCalcinator(player, tileCalcinator)); - ySize = 176; - this.tileCalcinator = tileCalcinator; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - - String containerName = tileCalcinator.isInvNameLocalized() ? tileCalcinator.getInvName() : StatCollector.translateToLocal(tileCalcinator.getInvName()); - fontRenderer.drawString(containerName, xSize / 2 - fontRenderer.getStringWidth(containerName) / 2, 6, 4210752); - fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - //this.mc.getTextureManager().bindTexture(...) - this.mc.func_110434_K().func_110577_a(Textures.GUI_CALCINATOR); - - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiGlassBell.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiGlassBell.java deleted file mode 100644 index b689e9b9..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiGlassBell.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.inventory.ContainerGlassBell; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileGlassBell; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiGlassBell - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiGlassBell extends GuiContainer { - - private TileGlassBell tileGlassBell; - - public GuiGlassBell(InventoryPlayer inventoryPlayer, TileGlassBell tileGlassBell) { - - super(new ContainerGlassBell(inventoryPlayer, tileGlassBell)); - this.tileGlassBell = tileGlassBell; - xSize = 176; - ySize = 140; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { - - String containerName = tileGlassBell.isInvNameLocalized() ? tileGlassBell.getInvName() : StatCollector.translateToLocal(tileGlassBell.getInvName()); - fontRenderer.drawString(containerName, xSize / 2 - fontRenderer.getStringWidth(containerName) / 2, 6, 4210752); - fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 8, ySize - 93, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.func_110434_K().func_110577_a(Textures.GUI_GLASS_BELL); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableCrafting.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableCrafting.java deleted file mode 100644 index 540623a8..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableCrafting.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.inventory.ContainerPortableCrafting; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiPortableCrafting - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiPortableCrafting extends GuiContainer { - - public GuiPortableCrafting(EntityPlayer player, World world, int x, int y, int z) { - - super(new ContainerPortableCrafting(player.inventory, world, x, y, z)); - } - - /** - * Draw the foreground layer for the GuiContainer (everything in front of - * the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - - fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_PORTABLE_CRAFTING), 28, 6, 4210752); - fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 8, ySize - 96 + 2, 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the - * items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.func_110434_K().func_110577_a(Textures.GUI_PORTABLE_CRAFTING); - int var5 = (width - xSize) / 2; - int var6 = (height - ySize) / 2; - this.drawTexturedModalRect(var5, var6, 0, 0, xSize, ySize); - } - - @Override - public void onGuiClosed() { - - super.onGuiClosed(); - - if (mc.thePlayer != null) { - for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN); - } - } - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java b/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java deleted file mode 100644 index 84e2ddbc..00000000 --- a/ee3_common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * GuiPortableTransmutation - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class GuiPortableTransmutation extends GuiContainer { - - public GuiPortableTransmutation(Container par1Container) { - - super(par1Container); - // TODO Auto-generated constructor stub - } - - @Override - protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.func_110434_K().func_110577_a(Textures.GUI_PORTABLE_TRANSMUTATION); - int var5 = (width - xSize) / 2; - int var6 = (height - ySize) / 2; - this.drawTexturedModalRect(var5, var6, 0, 0, xSize, ySize); - } - - @Override - public void onGuiClosed() { - - super.onGuiClosed(); - - if (mc.thePlayer != null) { - for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - } - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/client/model/ModelAludel.java b/ee3_common/com/pahimar/ee3/client/model/ModelAludel.java deleted file mode 100644 index e5fbd60c..00000000 --- a/ee3_common/com/pahimar/ee3/client/model/ModelAludel.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.pahimar.ee3.client.model; - -import net.minecraftforge.client.model.AdvancedModelLoader; -import net.minecraftforge.client.model.IModelCustom; - -import com.pahimar.ee3.lib.Models; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ModelAludel - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class ModelAludel { - - private IModelCustom modelAludel; - - public ModelAludel() { - - modelAludel = AdvancedModelLoader.loadModel(Models.ALUDEL); - } - - public void render() { - - modelAludel.renderPart("Base"); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/model/ModelCalcinator.java b/ee3_common/com/pahimar/ee3/client/model/ModelCalcinator.java deleted file mode 100644 index 8cf9d33f..00000000 --- a/ee3_common/com/pahimar/ee3/client/model/ModelCalcinator.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.pahimar.ee3.client.model; - -import net.minecraftforge.client.model.AdvancedModelLoader; -import net.minecraftforge.client.model.IModelCustom; - -import com.pahimar.ee3.lib.Models; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * ModelCalcinator - * - * Model for the Calcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class ModelCalcinator { - - private IModelCustom modelCalcinator; - - public ModelCalcinator() { - - modelCalcinator = AdvancedModelLoader.loadModel(Models.CALCINATOR); - } - - public void render() { - - modelCalcinator.renderAll(); - } - - public void renderPart(String partName) { - - modelCalcinator.renderPart(partName); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/model/ModelGlassBell.java b/ee3_common/com/pahimar/ee3/client/model/ModelGlassBell.java deleted file mode 100644 index 124e0b86..00000000 --- a/ee3_common/com/pahimar/ee3/client/model/ModelGlassBell.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.pahimar.ee3.client.model; - -import net.minecraftforge.client.model.AdvancedModelLoader; -import net.minecraftforge.client.model.IModelCustom; - -import com.pahimar.ee3.lib.Models; - -public class ModelGlassBell { - - private IModelCustom modelGlassBell; - - public ModelGlassBell() { - - modelGlassBell = AdvancedModelLoader.loadModel(Models.GLASS_BELL); - } - - public void render() { - - modelGlassBell.renderPart("Bell"); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/RenderUtils.java b/ee3_common/com/pahimar/ee3/client/renderer/RenderUtils.java deleted file mode 100644 index 40eca4da..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/RenderUtils.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.pahimar.ee3.client.renderer; - -import net.minecraft.block.Block; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.lib.Textures; - -import cpw.mods.fml.client.FMLClientHandler; - -/** - * Equivalent-Exchange-3 - * - * RenderUtils - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class RenderUtils { - - private static int rotationAngle = 0; - - public static void renderRotatingBlockIntoGUI(FontRenderer fontRenderer, ItemStack stack, int x, int y, float zLevel, float scale) { - - RenderBlocks renderBlocks = new RenderBlocks(); - - Block block = Block.blocksList[stack.itemID]; - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.VANILLA_BLOCK_TEXTURE_SHEET); - GL11.glPushMatrix(); - GL11.glTranslatef(x - 2, y + 3, -3.0F + zLevel); - GL11.glScalef(10.0F, 10.0F, 10.0F); - GL11.glTranslatef(1.0F, 0.5F, 1.0F); - GL11.glScalef(1.0F * scale, 1.0F * scale, -1.0F); - GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(0F + 1 * rotationAngle, 0.0F, 1.0F, 0.0F); - rotationAngle = (rotationAngle + 1) % 360; - - int var10 = Item.itemsList[stack.itemID].getColorFromItemStack(stack, 0); - float var16 = (var10 >> 16 & 255) / 255.0F; - float var12 = (var10 >> 8 & 255) / 255.0F; - float var13 = (var10 & 255) / 255.0F; - - GL11.glColor4f(var16, var12, var13, 1.0F); - - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - renderBlocks.useInventoryTint = true; - renderBlocks.renderBlockAsItem(block, stack.getItemDamage(), 1.0F); - renderBlocks.useInventoryTint = true; - GL11.glPopMatrix(); - } - - public static void renderItemIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int x, int y, float opacity, float scale) { - - Icon icon = itemStack.getIconIndex(); - GL11.glDisable(GL11.GL_LIGHTING); - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.VANILLA_ITEM_TEXTURE_SHEET); - int overlayColour = itemStack.getItem().getColorFromItemStack(itemStack, 0); - float red = (overlayColour >> 16 & 255) / 255.0F; - float green = (overlayColour >> 8 & 255) / 255.0F; - float blue = (overlayColour & 255) / 255.0F; - GL11.glColor4f(red, green, blue, opacity); - drawTexturedQuad(x, y, icon, 16 * scale, 16 * scale, -90); - GL11.glEnable(GL11.GL_LIGHTING); - - } - - public static void drawTexturedQuad(int x, int y, Icon icon, float width, float height, double zLevel) { - - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(x + 0, y + height, zLevel, icon.getMinU(), icon.getMaxV()); - tessellator.addVertexWithUV(x + width, y + height, zLevel, icon.getMaxU(), icon.getMaxV()); - tessellator.addVertexWithUV(x + width, y + 0, zLevel, icon.getMaxU(), icon.getMinV()); - tessellator.addVertexWithUV(x + 0, y + 0, zLevel, icon.getMinU(), icon.getMinV()); - tessellator.draw(); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemAlchemicalChestRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/item/ItemAlchemicalChestRenderer.java deleted file mode 100644 index d4f641e1..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemAlchemicalChestRenderer.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.pahimar.ee3.client.renderer.item; - -import net.minecraft.client.model.ModelChest; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.lib.Textures; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemAlchemicalChestRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class ItemAlchemicalChestRenderer implements IItemRenderer { - - private ModelChest modelChest; - - public ItemAlchemicalChestRenderer() { - - modelChest = new ModelChest(); - } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - - switch (type) { - case ENTITY: { - renderAlchemicalChest(0.5F, 0.5F, 0.5F); - break; - } - case EQUIPPED: { - renderAlchemicalChest(1.0F, 1.0F, 1.0F); - break; - } - case EQUIPPED_FIRST_PERSON: { - renderAlchemicalChest(1.0F, 1.0F, 1.0F); - break; - } - case INVENTORY: { - renderAlchemicalChest(0.0F, 0.075F, 0.0F); - break; - } - default: - break; - } - } - - private void renderAlchemicalChest(float x, float y, float z) { - - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_ALCHEMICAL_CHEST); - GL11.glPushMatrix(); //start - GL11.glTranslatef(x, y, z); //size - GL11.glRotatef(180, 1, 0, 0); - GL11.glRotatef(-90, 0, 1, 0); - modelChest.renderAll(); - GL11.glPopMatrix(); //end - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemAludelRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/item/ItemAludelRenderer.java deleted file mode 100644 index 91b33275..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemAludelRenderer.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.pahimar.ee3.client.renderer.item; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.client.model.ModelAludel; -import com.pahimar.ee3.lib.Textures; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemAludelRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class ItemAludelRenderer implements IItemRenderer { - - private ModelAludel modelAludel; - - public ItemAludelRenderer() { - - modelAludel = new ModelAludel(); - } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - - switch (type) { - case ENTITY: { - renderAludel(-0.5F, -0.38F, 0.5F, 1.0F); - return; - } - case EQUIPPED: { - renderAludel(0.0F, 0.0F, 1.0F, 1.0F); - return; - } - case EQUIPPED_FIRST_PERSON: { - renderAludel(0.0F, 0.0F, 1.0F, 1.0F); - return; - } - case INVENTORY: { - renderAludel(-1.0F, -0.9F, 0.0F, 1.0F); - return; - } - default: - return; - } - } - - private void renderAludel(float x, float y, float z, float scale) { - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - - // Scale, Translate, Rotate - GL11.glScalef(scale, scale, scale); - GL11.glTranslatef(x, y, z); - GL11.glRotatef(-90F, 1F, 0, 0); - - // Bind texture - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_ALUDEL); - - // Render - modelAludel.render(); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemCalcinatorRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/item/ItemCalcinatorRenderer.java deleted file mode 100644 index 2a253900..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemCalcinatorRenderer.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.pahimar.ee3.client.renderer.item; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.client.model.ModelCalcinator; -import com.pahimar.ee3.lib.Textures; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemCalcinatorRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class ItemCalcinatorRenderer implements IItemRenderer { - - private ModelCalcinator modelCalcinator; - - public ItemCalcinatorRenderer() { - - modelCalcinator = new ModelCalcinator(); - } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - - switch (type) { - case ENTITY: { - renderCalcinator(-0.5F, 0.0F, 0.5F, 1.0F); - return; - } - case EQUIPPED: { - renderCalcinator(0.0F, 0.0F, 1.0F, 1.0F); - return; - } - case EQUIPPED_FIRST_PERSON: { - renderCalcinator(0.0F, 0.0F, 1.0F, 1.0F); - return; - } - case INVENTORY: { - renderCalcinator(0.0F, -0.1F, 1.0F, 1.0F); - return; - } - default: - return; - } - } - - private void renderCalcinator(float x, float y, float z, float scale) { - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - - // Scale, Translate, Rotate - GL11.glScalef(scale, scale, scale); - GL11.glTranslatef(x, y, z); - GL11.glRotatef(-90F, 1F, 0, 0); - - // Bind texture - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_CALCINATOR); - - // Render - modelCalcinator.render(); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemGlassBellRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/item/ItemGlassBellRenderer.java deleted file mode 100644 index b90f926f..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/item/ItemGlassBellRenderer.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.pahimar.ee3.client.renderer.item; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.client.model.ModelGlassBell; -import com.pahimar.ee3.lib.Textures; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemGlassBellRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class ItemGlassBellRenderer implements IItemRenderer { - - private ModelGlassBell modelGlassBell; - - public ItemGlassBellRenderer() { - - modelGlassBell = new ModelGlassBell(); - } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - - switch (type) { - case ENTITY: { - renderGlassBell(-0.5F, -1.2F, 0.5F, 1.4F); - return; - } - case EQUIPPED: { - renderGlassBell(-0.2F, -0.85F, 0.8F, 1.4F); - return; - } - case EQUIPPED_FIRST_PERSON: { - renderGlassBell(-0.2F, -0.85F, 0.8F, 1.4F); - return; - } - case INVENTORY: { - renderGlassBell(-1.0F, -1.675F, 0.0F, 1.4F); - return; - } - default: - return; - } - } - - private void renderGlassBell(float x, float y, float z, float scale) { - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - - // Scale, Translate, Rotate - GL11.glScalef(scale, scale, scale); - GL11.glTranslatef(x, y, z); - GL11.glRotatef(-90F, 1F, 0, 0); - - // Bind texture - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_GLASS_BELL); - - // Render - modelGlassBell.render(); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAlchemicalChestRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAlchemicalChestRenderer.java deleted file mode 100644 index 953186d4..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAlchemicalChestRenderer.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.pahimar.ee3.client.renderer.tileentity; - -import net.minecraft.client.model.ModelChest; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileAlchemicalChest; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * TileEntityAlchemicalChestRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class TileEntityAlchemicalChestRenderer extends - TileEntitySpecialRenderer { - - private ModelChest modelChest = new ModelChest(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { - - if (tileEntity instanceof TileAlchemicalChest) { - - TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) tileEntity; - ForgeDirection direction = null; - - if (tileAlchemicalChest.getWorldObj() != null) { - direction = ForgeDirection.getOrientation(tileAlchemicalChest.getBlockMetadata()); - } - - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_ALCHEMICAL_CHEST); - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F); - GL11.glScalef(1.0F, -1.0F, -1.0F); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - short angle = 0; - - if (direction != null) { - if (direction == ForgeDirection.NORTH) { - angle = 180; - } - else if (direction == ForgeDirection.SOUTH) { - angle = 0; - } - else if (direction == ForgeDirection.WEST) { - angle = 90; - } - else if (direction == ForgeDirection.EAST) { - angle = -90; - } - } - - GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - float adjustedLidAngle = tileAlchemicalChest.prevLidAngle + (tileAlchemicalChest.lidAngle - tileAlchemicalChest.prevLidAngle) * tick; - adjustedLidAngle = 1.0F - adjustedLidAngle; - adjustedLidAngle = 1.0F - adjustedLidAngle * adjustedLidAngle * adjustedLidAngle; - modelChest.chestLid.rotateAngleX = -(adjustedLidAngle * (float) Math.PI / 2.0F); - modelChest.renderAll(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAludelRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAludelRenderer.java deleted file mode 100644 index 105feffa..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityAludelRenderer.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.pahimar.ee3.client.renderer.tileentity; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.client.model.ModelAludel; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileAludel; -import com.pahimar.ee3.tileentity.TileGlassBell; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * TileEntityAludelRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class TileEntityAludelRenderer extends TileEntitySpecialRenderer { - - private ModelAludel modelAludel = new ModelAludel(); - private final RenderItem customRenderItem; - - public TileEntityAludelRenderer() { - - customRenderItem = new RenderItem() { - - @Override - public boolean shouldBob() { - - return false; - }; - }; - - customRenderItem.setRenderManager(RenderManager.instance); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { - - if (tileEntity instanceof TileAludel) { - - TileAludel tileAludel = (TileAludel) tileEntity; - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - - // Scale, Translate, Rotate - scaleTranslateRotate(x, y, z, tileAludel.getOrientation()); - - // Bind texture - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_ALUDEL); - - // Render - modelAludel.render(); - - GL11.glPopMatrix(); - - /** - * Render the ghost item inside of the Aludel, slowly spinning - */ - GL11.glPushMatrix(); - - TileEntity tileGlassBell = tileAludel.worldObj.getBlockTileEntity(tileAludel.xCoord, tileAludel.yCoord + 1, tileAludel.zCoord); - - if (tileGlassBell instanceof TileGlassBell) { - if (tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX) != null) { - - float scaleFactor = getGhostItemScaleFactor(tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX)); - float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); - - EntityItem ghostEntityItem = new EntityItem(tileAludel.worldObj); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileAludel.getStackInSlot(TileAludel.INPUT_INVENTORY_INDEX)); - - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.25F, (float) z + 0.5F); - GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); - GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); - - customRenderItem.doRenderItem(ghostEntityItem, 0, 0, 0, 0, 0); - } - } - - GL11.glPopMatrix(); - - GL11.glEnable(GL11.GL_LIGHTING); - } - } - - private void scaleTranslateRotate(double x, double y, double z, ForgeDirection orientation) { - - if (orientation == ForgeDirection.NORTH) { - GL11.glTranslated(x + 1, y, z); - GL11.glRotatef(180F, 0F, 1F, 0F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - } - else if (orientation == ForgeDirection.EAST) { - GL11.glTranslated(x + 1, y, z + 1); - GL11.glRotatef(90F, 0F, 1F, 0F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - } - else if (orientation == ForgeDirection.SOUTH) { - GL11.glTranslated(x, y, z + 1); - GL11.glRotatef(0F, 0F, 1F, 0F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - } - else if (orientation == ForgeDirection.WEST) { - GL11.glTranslated(x, y, z); - GL11.glRotatef(-90F, 0F, 1F, 0F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - } - } - - private float getGhostItemScaleFactor(ItemStack itemStack) { - - float scaleFactor = 1.0F; - - if (itemStack != null) { - if (itemStack.getItem() instanceof ItemBlock) { - switch (customRenderItem.getMiniBlockCount(itemStack)) { - case 1: - return 0.90F; - case 2: - return 0.90F; - case 3: - return 0.90F; - case 4: - return 0.90F; - case 5: - return 0.80F; - default: - return 0.90F; - } - } - else { - switch (customRenderItem.getMiniItemCount(itemStack)) { - case 1: - return 0.65F; - case 2: - return 0.65F; - case 3: - return 0.65F; - case 4: - return 0.65F; - default: - return 0.65F; - } - } - } - - return scaleFactor; - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java deleted file mode 100644 index dba7b9bc..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.pahimar.ee3.client.renderer.tileentity; - -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.client.model.ModelCalcinator; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileCalcinator; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * TileEntityCalcinatorRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class TileEntityCalcinatorRenderer extends TileEntitySpecialRenderer { - - private ModelCalcinator modelCalcinator = new ModelCalcinator(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { - - if (tileEntity instanceof TileCalcinator) { - TileCalcinator tileCalcinator = (TileCalcinator) tileEntity; - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - - // Scale, Translate, Rotate - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.0F, (float) z + 1.2F); - GL11.glRotatef(45F, 0F, 1F, 0F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - - // Bind texture - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_CALCINATOR); - - // Render - modelCalcinator.renderPart("Calcinator"); - - if (tileCalcinator.getStackInSlot(TileCalcinator.OUTPUT_INVENTORY_INDEX) != null) { - modelCalcinator.renderPart("Dust"); - } - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - } -} diff --git a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java b/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java deleted file mode 100644 index 9491daf2..00000000 --- a/ee3_common/com/pahimar/ee3/client/renderer/tileentity/TileEntityGlassBellRenderer.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.pahimar.ee3.client.renderer.tileentity; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import com.pahimar.ee3.client.model.ModelGlassBell; -import com.pahimar.ee3.lib.Textures; -import com.pahimar.ee3.tileentity.TileGlassBell; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * TileEntityGlassBellRenderer - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class TileEntityGlassBellRenderer extends TileEntitySpecialRenderer { - - private ModelGlassBell modelGlassBell = new ModelGlassBell(); - private final RenderItem customRenderItem; - - public TileEntityGlassBellRenderer() { - - customRenderItem = new RenderItem() { - - @Override - public boolean shouldBob() { - - return false; - }; - }; - - customRenderItem.setRenderManager(RenderManager.instance); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { - - if (tileEntity instanceof TileGlassBell) { - TileGlassBell tileGlassBell = (TileGlassBell) tileEntity; - - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - - /** - * Render the Glass Bell - */ - GL11.glPushMatrix(); - - // Scale, Translate, Rotate - renderGlassBellByOrientation(x, y, z, tileGlassBell.getOrientation()); - - // Bind texture - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(Textures.MODEL_GLASS_BELL); - - modelGlassBell.render(); - - GL11.glPopMatrix(); - - /** - * Render the ghost item inside of the Glass Bell, slowly spinning - */ - GL11.glPushMatrix(); - - if (tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX) != null) { - - float scaleFactor = getGhostItemScaleFactor(tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX)); - float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); - - EntityItem ghostEntityItem = new EntityItem(tileGlassBell.worldObj); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX)); - - translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), x, y, z, tileGlassBell.getOrientation()); - GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); - GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); - - customRenderItem.doRenderItem(ghostEntityItem, 0, 0, 0, 0, 0); - } - - GL11.glPopMatrix(); - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_LIGHTING); - } - } - - private void renderGlassBellByOrientation(double x, double y, double z, ForgeDirection forgeDirection) { - - switch (forgeDirection) { - case DOWN: { - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + 0.0F, (float) y + 2.0F, (float) z + 0.0F); - GL11.glRotatef(90F, 1F, 0F, 0F); - return; - } - case UP: { - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + 0.0F, (float) y + -1.0F, (float) z + 1.0F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - return; - } - case NORTH: { - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + 1.0F, (float) y + 0.0F, (float) z + 2.0F); - GL11.glRotatef(180F, 0F, 1F, 0F); - return; - } - case SOUTH: { - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + 0.0F, (float) y + 0.0F, (float) z + -1.0F); - return; - } - case EAST: { - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + -1.0F, (float) y + 1.0F, (float) z + 1.0F); - GL11.glRotatef(-90F, 0F, 0F, 1F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - return; - } - case WEST: { - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x + 2.0F, (float) y + 0.0F, (float) z + 1.0F); - GL11.glRotatef(90F, 0F, 0F, 1F); - GL11.glRotatef(-90F, 1F, 0F, 0F); - return; - } - case UNKNOWN: { - return; - } - default: { - return; - } - } - } - - private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection) { - - if (ghostItemStack != null) { - if (ghostItemStack.getItem() instanceof ItemBlock) { - switch (forgeDirection) { - case DOWN: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.7F, (float) z + 0.5F); - return; - } - case UP: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); - return; - } - case NORTH: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); - return; - } - case SOUTH: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); - return; - } - case EAST: { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - case WEST: { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - case UNKNOWN: { - return; - } - default: { - return; - } - } - } - else { - switch (forgeDirection) { - case DOWN: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); - return; - } - case UP: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); - return; - } - case NORTH: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); - return; - } - case SOUTH: { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); - return; - } - case EAST: { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - case WEST: { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - case UNKNOWN: { - return; - } - default: { - return; - } - } - } - } - } - - private float getGhostItemScaleFactor(ItemStack itemStack) { - - float scaleFactor = 1.0F; - - if (itemStack != null) { - if (itemStack.getItem() instanceof ItemBlock) { - switch (customRenderItem.getMiniBlockCount(itemStack)) { - case 1: - return 0.90F; - case 2: - return 0.90F; - case 3: - return 0.90F; - case 4: - return 0.90F; - case 5: - return 0.80F; - default: - return 0.90F; - } - } - else { - switch (customRenderItem.getMiniItemCount(itemStack)) { - case 1: - return 0.65F; - case 2: - return 0.65F; - case 3: - return 0.65F; - case 4: - return 0.65F; - default: - return 0.65F; - } - } - } - - return scaleFactor; - } -} diff --git a/ee3_common/com/pahimar/ee3/command/CommandEE.java b/ee3_common/com/pahimar/ee3/command/CommandEE.java deleted file mode 100644 index da68bbb2..00000000 --- a/ee3_common/com/pahimar/ee3/command/CommandEE.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.pahimar.ee3.command; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; - -import com.pahimar.ee3.lib.Commands; - -/** - * Equivalent-Exchange-3 - * - * CommandEE - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommandEE extends CommandBase { - - @Override - public String getCommandName() { - - return Commands.COMMAND_EE3; - } - - @Override - public boolean canCommandSenderUseCommand(ICommandSender commandSender) { - - return true; - } - - @Override - @SuppressWarnings("rawtypes") - public List addTabCompletionOptions(ICommandSender commandSender, String[] args) { - - switch (args.length) { - case 1: { - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_OVERLAY, Commands.COMMAND_PARTICLES, Commands.COMMAND_SOUNDS, Commands.COMMAND_VERSION }); - } - case 2: { - if (args[0].equalsIgnoreCase(Commands.COMMAND_OVERLAY)) - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_ON, Commands.COMMAND_OFF, Commands.COMMAND_POSITION, Commands.COMMAND_SCALE, Commands.COMMAND_OPACITY }); - else if (args[0].equalsIgnoreCase(Commands.COMMAND_PARTICLES)) - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_ON, Commands.COMMAND_OFF }); - else if (args[0].equalsIgnoreCase(Commands.COMMAND_SOUNDS)) - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_ALL, Commands.COMMAND_SELF, Commands.COMMAND_OFF }); - else if (args[0].equalsIgnoreCase(Commands.COMMAND_VERSION)) - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_CHANGELOG }); - } - case 3: { - if (args[0].equalsIgnoreCase(Commands.COMMAND_OVERLAY)) { - if (args[1].equalsIgnoreCase(Commands.COMMAND_POSITION)) - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_TOP, Commands.COMMAND_BOTTOM }); - } - } - case 4: { - if (args[0].equalsIgnoreCase(Commands.COMMAND_OVERLAY)) { - if (args[1].equalsIgnoreCase(Commands.COMMAND_POSITION)) { - if (args[2].equalsIgnoreCase(Commands.COMMAND_TOP) || args[2].equalsIgnoreCase(Commands.COMMAND_BOTTOM)) - return getListOfStringsMatchingLastWord(args, new String[] { Commands.COMMAND_LEFT, Commands.COMMAND_RIGHT }); - } - } - } - default: { - return null; - } - } - } - - @Override - public void processCommand(ICommandSender commandSender, String[] args) { - - if (args.length > 0) { - String commandName = args[0]; - System.arraycopy(args, 1, args, 0, args.length - 1); - - if (commandName.equalsIgnoreCase(Commands.COMMAND_OVERLAY)) { - CommandOverlay.processCommand(commandSender, args); - } - else if (commandName.equalsIgnoreCase(Commands.COMMAND_PARTICLES)) { - CommandParticles.processCommand(commandSender, args); - } - else if (commandName.equalsIgnoreCase(Commands.COMMAND_SOUNDS)) { - CommandSounds.processCommand(commandSender, args); - } - else if (commandName.equalsIgnoreCase(Commands.COMMAND_VERSION)) { - CommandVersion.processCommand(commandSender, args); - } - else - throw new WrongUsageException(Commands.COMMAND_EE3_USAGE, new Object[0]); - } - else - throw new WrongUsageException(Commands.COMMAND_EE3_USAGE, new Object[0]); - } - - @Override - public String getCommandUsage(ICommandSender icommandsender) { - // TODO Auto-generated method stub - return null; - } -} diff --git a/ee3_common/com/pahimar/ee3/command/CommandHandler.java b/ee3_common/com/pahimar/ee3/command/CommandHandler.java deleted file mode 100644 index 47fcb737..00000000 --- a/ee3_common/com/pahimar/ee3/command/CommandHandler.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.pahimar.ee3.command; - -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -/** - * Equivalent-Exchange-3 - * - * CommandHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommandHandler { - - public static void initCommands(FMLServerStartingEvent event) { - - event.registerServerCommand(new CommandEE()); - } -} diff --git a/ee3_common/com/pahimar/ee3/command/CommandOverlay.java b/ee3_common/com/pahimar/ee3/command/CommandOverlay.java deleted file mode 100644 index 564be6b1..00000000 --- a/ee3_common/com/pahimar/ee3/command/CommandOverlay.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.pahimar.ee3.command; - -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.util.ChatMessageComponent; - -import com.pahimar.ee3.configuration.ConfigurationHandler; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.LocalizationUtil; -import com.pahimar.ee3.lib.Commands; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * CommandOverlay - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommandOverlay { - - public static void processCommand(ICommandSender commandSender, String[] args) { - - if (args.length > 0) { - String subCommand = args[0]; - - if (subCommand.equalsIgnoreCase(Commands.COMMAND_ON)) { - processOnCommand(commandSender); - } - else if (subCommand.equalsIgnoreCase(Commands.COMMAND_OFF)) { - processOffCommand(commandSender); - } - else if (subCommand.equalsIgnoreCase(Commands.COMMAND_OPACITY)) { - processOpacityCommand(commandSender, args); - } - else if (subCommand.equalsIgnoreCase(Commands.COMMAND_SCALE)) { - processScaleCommand(commandSender, args); - } - else if (subCommand.equalsIgnoreCase(Commands.COMMAND_POSITION)) { - processPositionCommand(commandSender, args); - } - else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_USAGE, new Object[0]); - } - else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_USAGE, new Object[0]); - } - - private static void processOnCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION = true; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME, Strings.TRUE); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_TURNED_ON)); - } - - private static void processOffCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION = false; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME, Strings.FALSE); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_TURNED_OFF)); - } - - private static void processScaleCommand(ICommandSender commandSender, String[] args) { - - if (args.length > 2 && args.length < 4) { - try { - float scale = Float.parseFloat(args[1]); - - if (scale <= 0F) - throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT), new Object[0]); - else { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = scale; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME, args[1]); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_SCALE_UPDATED)); - } - } - catch (Exception e) { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT), new Object[0]); - } - } - else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT), new Object[0]); - } - - private static void processOpacityCommand(ICommandSender commandSender, String[] args) { - - if (args.length > 2 && args.length < 4) { - try { - float opacity = Float.parseFloat(args[1]); - - if (opacity < 0F || opacity > 1F) - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT), new Object[0]); - else { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = opacity; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME, args[1]); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_OPACITY_UPDATED)); - } - } - catch (Exception e) { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT), new Object[0]); - } - } - else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT), new Object[0]); - } - - private static void processPositionCommand(ICommandSender commandSender, String[] args) { - - String yPosition, xPosition; - - if (args.length > 2 && args.length < 5) { - yPosition = args[1]; - xPosition = args[2]; - - if (yPosition.equalsIgnoreCase(Commands.COMMAND_TOP) && xPosition.equalsIgnoreCase(Commands.COMMAND_LEFT)) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION = 0; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME, "0"); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_POSITION_TOP_LEFT)); - } - else if (yPosition.equalsIgnoreCase(Commands.COMMAND_TOP) && xPosition.equalsIgnoreCase(Commands.COMMAND_RIGHT)) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION = 1; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME, "1"); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_POSITION_TOP_RIGHT)); - } - else if (yPosition.equalsIgnoreCase(Commands.COMMAND_BOTTOM) && xPosition.equalsIgnoreCase(Commands.COMMAND_LEFT)) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION = 2; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME, "2"); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_POSITION_BOTTOM_LEFT)); - } - else if (yPosition.equalsIgnoreCase(Commands.COMMAND_BOTTOM) && xPosition.equalsIgnoreCase(Commands.COMMAND_RIGHT)) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION = 3; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME, "3"); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_OVERLAY_POSITION_BOTTOM_RIGHT)); - } - else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_POSITION_USAGE, new Object[0]); - } - else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_POSITION_USAGE, new Object[0]); - } -} diff --git a/ee3_common/com/pahimar/ee3/command/CommandParticles.java b/ee3_common/com/pahimar/ee3/command/CommandParticles.java deleted file mode 100644 index 06a2852a..00000000 --- a/ee3_common/com/pahimar/ee3/command/CommandParticles.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.pahimar.ee3.command; - -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.util.ChatMessageComponent; - -import com.pahimar.ee3.configuration.ConfigurationHandler; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.lib.Commands; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * CommandParticles - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommandParticles { - - public static void processCommand(ICommandSender commandSender, String[] args) { - - String subCommand; - - if (args.length > 0) { - subCommand = args[0]; - - if (subCommand.toLowerCase().equals(Commands.COMMAND_ON)) { - processOnCommand(commandSender); - } - else if (subCommand.toLowerCase().equals(Commands.COMMAND_OFF)) { - processOffCommand(commandSender); - } - else - throw new WrongUsageException(Commands.COMMAND_PARTICLES_USAGE, new Object[0]); - } - else - throw new WrongUsageException(Commands.COMMAND_PARTICLES_USAGE, new Object[0]); - } - - private static void processOnCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_PARTICLE_FX = true; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, Strings.TRUE); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_PARTICLES_TURNED_ON)); - } - - private static void processOffCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_PARTICLE_FX = false; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, Strings.FALSE); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_PARTICLES_TURNED_OFF)); - } -} diff --git a/ee3_common/com/pahimar/ee3/command/CommandSounds.java b/ee3_common/com/pahimar/ee3/command/CommandSounds.java deleted file mode 100644 index 0c486680..00000000 --- a/ee3_common/com/pahimar/ee3/command/CommandSounds.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.pahimar.ee3.command; - -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.util.ChatMessageComponent; - -import com.pahimar.ee3.configuration.ConfigurationHandler; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.lib.Commands; - -/** - * Equivalent-Exchange-3 - * - * CommandSounds - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommandSounds { - - public static void processCommand(ICommandSender commandSender, String[] args) { - - String subCommand; - - if (args.length > 0) { - subCommand = args[0]; - - if (subCommand.toLowerCase().equals(Commands.COMMAND_ALL)) { - processAllCommand(commandSender); - } - else if (subCommand.toLowerCase().equals(Commands.COMMAND_SELF)) { - processSelfCommand(commandSender); - } - else if (subCommand.toLowerCase().equals(Commands.COMMAND_OFF)) { - processOffCommand(commandSender); - } - else - throw new WrongUsageException(Commands.COMMAND_SOUNDS_USAGE, new Object[0]); - } - else - throw new WrongUsageException(Commands.COMMAND_SOUNDS_USAGE, new Object[0]); - } - - private static void processAllCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_SOUNDS = Commands.ALL; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_AUDIO, ConfigurationSettings.ENABLE_SOUNDS_CONFIGNAME, Commands.ALL); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_SOUNDS_SET_TO_ALL)); - } - - private static void processSelfCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_SOUNDS = Commands.SELF; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_AUDIO, ConfigurationSettings.ENABLE_SOUNDS_CONFIGNAME, Commands.SELF); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_SOUNDS_SET_TO_SELF)); - } - - private static void processOffCommand(ICommandSender commandSender) { - - ConfigurationSettings.ENABLE_SOUNDS = Commands.OFF; - ConfigurationHandler.set(ConfigurationHandler.CATEGORY_AUDIO, ConfigurationSettings.ENABLE_SOUNDS_CONFIGNAME, Commands.OFF); - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(Commands.COMMAND_SOUNDS_TURNED_OFF)); - } -} diff --git a/ee3_common/com/pahimar/ee3/command/CommandVersion.java b/ee3_common/com/pahimar/ee3/command/CommandVersion.java deleted file mode 100644 index 3f52f2c1..00000000 --- a/ee3_common/com/pahimar/ee3/command/CommandVersion.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.pahimar.ee3.command; - -import net.minecraft.command.ICommandSender; -import net.minecraft.command.WrongUsageException; -import net.minecraft.util.ChatMessageComponent; - -import com.pahimar.ee3.core.util.VersionHelper; -import com.pahimar.ee3.lib.Commands; - -/** - * Equivalent-Exchange-3 - * - * CommandVersion - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommandVersion { - - public static void processCommand(ICommandSender commandSender, String[] args) { - - String subCommand; - - if (args.length > 0) { - subCommand = args[0]; - - if (subCommand.toLowerCase().equals(Commands.COMMAND_VERSION)) { - processVersionCommand(commandSender); - } - else if (subCommand.toLowerCase().equals(Commands.COMMAND_CHANGELOG)) { - processChangelogCommand(commandSender); - } - else - throw new WrongUsageException(Commands.COMMAND_VERSION_USAGE, new Object[0]); - } - else - throw new WrongUsageException(Commands.COMMAND_VERSION_USAGE, new Object[0]); - } - - private static void processVersionCommand(ICommandSender commandSender) { - - commandSender.sendChatToPlayer(ChatMessageComponent.func_111077_e(VersionHelper.getResultMessage())); - } - - private static void processChangelogCommand(ICommandSender commandSender) { - - } - -} diff --git a/ee3_common/com/pahimar/ee3/configuration/ConfigurationHandler.java b/ee3_common/com/pahimar/ee3/configuration/ConfigurationHandler.java deleted file mode 100644 index 4b1a52e2..00000000 --- a/ee3_common/com/pahimar/ee3/configuration/ConfigurationHandler.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.pahimar.ee3.configuration; - -import static net.minecraftforge.common.Configuration.CATEGORY_GENERAL; - -import java.io.File; -import java.util.logging.Level; - -import net.minecraftforge.common.Configuration; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.BlockIds; -import com.pahimar.ee3.lib.ItemIds; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.lib.Strings; - -import cpw.mods.fml.common.FMLLog; - -/** - * Equivalent-Exchange-3 - * - * ConfigurationHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ConfigurationHandler { - - public static Configuration configuration; - - public static final String CATEGORY_KEYBIND = "keybindings"; - public static final String CATEGORY_GRAPHICS = "graphics"; - public static final String CATEGORY_AUDIO = "audio"; - public static final String CATEGORY_TRANSMUTATION = "transmutation"; - public static final String CATEGORY_BLOCK_PROPERTIES = Configuration.CATEGORY_BLOCK + Configuration.CATEGORY_SPLITTER + "properties"; - public static final String CATEGORY_RED_WATER_PROPERTIES = CATEGORY_BLOCK_PROPERTIES + Configuration.CATEGORY_SPLITTER + "red_water"; - public static final String CATEGORY_DURABILITY = Configuration.CATEGORY_ITEM + Configuration.CATEGORY_SPLITTER + "durability"; - - public static void init(File configFile) { - - configuration = new Configuration(configFile); - - try { - configuration.load(); - - /* General configs */ - ConfigurationSettings.DISPLAY_VERSION_RESULT = configuration.get(CATEGORY_GENERAL, ConfigurationSettings.DISPLAY_VERSION_RESULT_CONFIGNAME, ConfigurationSettings.DISPLAY_VERSION_RESULT_DEFAULT).getBoolean(ConfigurationSettings.DISPLAY_VERSION_RESULT_DEFAULT); - ConfigurationSettings.LAST_DISCOVERED_VERSION = configuration.get(CATEGORY_GENERAL, ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME, ConfigurationSettings.LAST_DISCOVERED_VERSION_DEFAULT).getString(); - ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE = configuration.get(CATEGORY_GENERAL, ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_CONFIGNAME, ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_DEFAULT).getString(); - - /* Graphic configs */ - ConfigurationSettings.ENABLE_PARTICLE_FX = configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT).getBoolean(ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT); - ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION = configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT).getBoolean(ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT); - ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION = configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME, ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_DEFAULT).getInt(ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION_DEFAULT); - try { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = Float.parseFloat(configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_DEFAULT).getString()); - - if (ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE <= 0F) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_DEFAULT; - } - } - catch (Exception e) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_DEFAULT; - } - try { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = Float.parseFloat(configuration.get(CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME, ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT).getString()); - - if (ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY < 0F || ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY > 1F) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT; - } - } - catch (Exception e) { - ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY = ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT; - } - - /* Audio configs */ - ConfigurationSettings.ENABLE_SOUNDS = configuration.get(CATEGORY_AUDIO, ConfigurationSettings.ENABLE_SOUNDS_CONFIGNAME, ConfigurationSettings.ENABLE_SOUNDS_DEFAULT).getString(); - - /* Block configs */ - BlockIds.CALCINATOR = configuration.getBlock(Strings.CALCINATOR_NAME, BlockIds.CALCINATOR_DEFAULT).getInt(BlockIds.CALCINATOR_DEFAULT); - BlockIds.ALUDEL_BASE = configuration.getBlock(Strings.ALUDEL_NAME, BlockIds.ALUDEL_BASE_DEFAULT).getInt(BlockIds.ALUDEL_BASE_DEFAULT); - BlockIds.ALCHEMICAL_CHEST = configuration.getBlock(Strings.ALCHEMICAL_CHEST_NAME, BlockIds.ALCHEMICAL_CHEST_DEFAULT).getInt(BlockIds.ALCHEMICAL_CHEST_DEFAULT); - BlockIds.GLASS_BELL = configuration.getBlock(Strings.GLASS_BELL_NAME, BlockIds.GLASS_BELL_DEFAULT).getInt(BlockIds.GLASS_BELL_DEFAULT); - BlockIds.RED_WATER_STILL = configuration.getBlock(Strings.RED_WATER_STILL_NAME, BlockIds.RED_WATER_STILL_DEFAULT).getInt(BlockIds.RED_WATER_STILL_DEFAULT); - - /* Block property configs */ - configuration.addCustomCategoryComment(CATEGORY_BLOCK_PROPERTIES, "Custom block properties"); - - /* Red Water configs */ - configuration.addCustomCategoryComment(CATEGORY_RED_WATER_PROPERTIES, "Configuration settings for various properties of Red Water"); - ConfigurationSettings.RED_WATER_DURATION_BASE = configuration.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_DURATION_BASE_CONFIGNAME, ConfigurationSettings.RED_WATER_DURATION_BASE_DEFAULT).getInt(ConfigurationSettings.RED_WATER_DURATION_BASE_DEFAULT); - ConfigurationSettings.RED_WATER_DURATION_MODIFIER = configuration.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_DURATION_MODIFIER_CONFIGNAME, ConfigurationSettings.RED_WATER_DURATION_MODIFIER_DEFAULT).getInt(ConfigurationSettings.RED_WATER_DURATION_MODIFIER_DEFAULT); - ConfigurationSettings.RED_WATER_RANGE_BASE = configuration.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_RANGE_BASE_CONFIGNAME, ConfigurationSettings.RED_WATER_RANGE_BASE_DEFAULT).getInt(ConfigurationSettings.RED_WATER_RANGE_BASE_DEFAULT); - ConfigurationSettings.RED_WATER_RANGE_MODIFIER = configuration.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_RANGE_MODIFIER_CONFIGNAME, ConfigurationSettings.RED_WATER_RANGE_MODIFIER_DEFAULT).getInt(ConfigurationSettings.RED_WATER_RANGE_MODIFIER_DEFAULT); - - /* Item configs */ - ItemIds.MINIUM_SHARD = configuration.getItem(Strings.MINIUM_SHARD_NAME, ItemIds.MINIUM_SHARD_DEFAULT).getInt(ItemIds.MINIUM_SHARD_DEFAULT); - ItemIds.INERT_STONE = configuration.getItem(Strings.INERT_STONE_NAME, ItemIds.INERT_STONE_DEFAULT).getInt(ItemIds.INERT_STONE_DEFAULT); - ItemIds.MINIUM_STONE = configuration.getItem(Strings.MINIUM_STONE_NAME, ItemIds.MINIUM_STONE_DEFAULT).getInt(ItemIds.MINIUM_STONE_DEFAULT); - ItemIds.PHILOSOPHERS_STONE = configuration.getItem(Strings.PHILOSOPHERS_STONE_NAME, ItemIds.PHILOSOPHERS_STONE_DEFAULT).getInt(ItemIds.PHILOSOPHERS_STONE_DEFAULT); - ItemIds.ALCHEMICAL_DUST = configuration.getItem(Strings.ALCHEMICAL_DUST_NAME, ItemIds.ALCHEMICAL_DUST_DEFAULT).getInt(ItemIds.ALCHEMICAL_DUST_DEFAULT); - ItemIds.ALCHEMICAL_BAG = configuration.getItem(Strings.ALCHEMICAL_BAG_NAME, ItemIds.ALCHEMICAL_BAG_DEFAULT).getInt(ItemIds.ALCHEMICAL_BAG_DEFAULT); - - /* Item durability configs */ - ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY = configuration.get(CATEGORY_DURABILITY, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT).getInt(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT); - ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY = configuration.get(CATEGORY_DURABILITY, ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT).getInt(ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT); - - /* KeyBinding configs */ - configuration.addCustomCategoryComment(CATEGORY_KEYBIND, "Keybindings for Equivalent Exchange 3. See http://www.minecraftwiki.net/wiki/Key_codes for mapping of key codes to keyboard keys"); - EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_EXTRA, configuration.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_EXTRA, ConfigurationSettings.KEYBINDING_EXTRA_DEFAULT).getInt(ConfigurationSettings.KEYBINDING_EXTRA_DEFAULT)); - EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_CHARGE, configuration.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_CHARGE, ConfigurationSettings.KEYBINDING_CHARGE_DEFAULT).getInt(ConfigurationSettings.KEYBINDING_CHARGE_DEFAULT)); - EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_TOGGLE, configuration.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_TOGGLE, ConfigurationSettings.KEYBINDING_TOGGLE_DEFAULT).getInt(ConfigurationSettings.KEYBINDING_TOGGLE_DEFAULT)); - EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_RELEASE, configuration.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_RELEASE, ConfigurationSettings.KEYBINDING_RELEASE_DEFAULT).getInt(ConfigurationSettings.KEYBINDING_RELEASE_DEFAULT)); - - /* Transmutation configs */ - ConfigurationSettings.TRANSMUTE_COST_ITEM = configuration.get(CATEGORY_TRANSMUTATION, ConfigurationSettings.TRANSMUTE_COST_ITEM_CONFIGNAME, ConfigurationSettings.TRANSMUTE_COST_ITEM_DEFAULT).getInt(ConfigurationSettings.TRANSMUTE_COST_ITEM_DEFAULT); - ConfigurationSettings.TRANSMUTE_COST_BLOCK = configuration.get(CATEGORY_TRANSMUTATION, ConfigurationSettings.TRANSMUTE_COST_BLOCK_CONFIGNAME, ConfigurationSettings.TRANSMUTE_COST_BLOCK_DEFAULT).getInt(ConfigurationSettings.TRANSMUTE_COST_BLOCK_DEFAULT); - ConfigurationSettings.TRANSMUTE_COST_MOB = configuration.get(CATEGORY_TRANSMUTATION, ConfigurationSettings.TRANSMUTE_COST_MOB_CONFIGNAME, ConfigurationSettings.TRANSMUTE_COST_MOB_DEFAULT).getInt(ConfigurationSettings.TRANSMUTE_COST_MOB_DEFAULT); - } - catch (Exception e) { - FMLLog.log(Level.SEVERE, e, Reference.MOD_NAME + " has had a problem loading its configuration"); - } - finally { - configuration.save(); - } - } - - public static void set(String categoryName, String propertyName, String newValue) { - - configuration.load(); - if (configuration.getCategoryNames().contains(categoryName)) { - if (configuration.getCategory(categoryName).containsKey(propertyName)) { - configuration.getCategory(categoryName).get(propertyName).set(newValue); - } - } - configuration.save(); - } -} diff --git a/ee3_common/com/pahimar/ee3/configuration/ConfigurationSettings.java b/ee3_common/com/pahimar/ee3/configuration/ConfigurationSettings.java deleted file mode 100644 index e5f6bf28..00000000 --- a/ee3_common/com/pahimar/ee3/configuration/ConfigurationSettings.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.pahimar.ee3.configuration; - -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * ConfigurationSettings - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ConfigurationSettings { - - /* - * Version check related settings - */ - public static boolean DISPLAY_VERSION_RESULT; - public static final String DISPLAY_VERSION_RESULT_CONFIGNAME = "version_check.display_results"; - public static final boolean DISPLAY_VERSION_RESULT_DEFAULT = true; - - public static String LAST_DISCOVERED_VERSION; - public static final String LAST_DISCOVERED_VERSION_CONFIGNAME = "version_check.last_discovered_version"; - public static final String LAST_DISCOVERED_VERSION_DEFAULT = ""; - - public static String LAST_DISCOVERED_VERSION_TYPE; - public static final String LAST_DISCOVERED_VERSION_TYPE_CONFIGNAME = "version_check.last_discovered_version_type"; - public static final String LAST_DISCOVERED_VERSION_TYPE_DEFAULT = ""; - - /* - * Audio config settings - */ - public static String ENABLE_SOUNDS; - public static final String ENABLE_SOUNDS_CONFIGNAME = "sounds.enabled"; - public static final String ENABLE_SOUNDS_DEFAULT = "all"; - - /* - * Graphic config settings - */ - // Whether or not EE3 particle fx are enabled - public static boolean ENABLE_PARTICLE_FX; - public static final String ENABLE_PARTICLE_FX_CONFIGNAME = "particle_fx.enabled"; - public static final boolean ENABLE_PARTICLE_FX_DEFAULT = true; - - // Whether or not the in world transmutation overlays are enabled - public static boolean ENABLE_OVERLAY_WORLD_TRANSMUTATION; - public static final String ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME = "world_transmutation_overlay.enabled"; - public static final boolean ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT = true; - - public static int TARGET_BLOCK_OVERLAY_POSITION; - public static final String TARGET_BLOCK_OVERLAY_POSITION_CONFIGNAME = "block_overlay_position"; - public static final int TARGET_BLOCK_OVERLAY_POSITION_DEFAULT = 3; - - public static float TARGET_BLOCK_OVERLAY_OPACITY; - public static final String TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME = "block_overlay_opacity"; - public static final float TARGET_BLOCK_OVERLAY_OPACITY_DEFAULT = 0.75F; - - public static float TARGET_BLOCK_OVERLAY_SCALE; - public static final String TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME = "block_overlay_scale"; - public static final float TARGET_BLOCK_OVERLAY_SCALE_DEFAULT = 2.5F; - - /* - * Block related config settings - */ - public static int RED_WATER_DURATION_BASE; - public static String RED_WATER_DURATION_BASE_CONFIGNAME = "duration.base"; - public static final int RED_WATER_DURATION_BASE_DEFAULT = 5; - - public static int RED_WATER_DURATION_MODIFIER; - public static String RED_WATER_DURATION_MODIFIER_CONFIGNAME = "duration.modifier"; - public static final int RED_WATER_DURATION_MODIFIER_DEFAULT = 2; - - public static int RED_WATER_RANGE_BASE; - public static String RED_WATER_RANGE_BASE_CONFIGNAME = "range.base"; - public static final int RED_WATER_RANGE_BASE_DEFAULT = 1; - - public static int RED_WATER_RANGE_MODIFIER; - public static String RED_WATER_RANGE_MODIFIER_CONFIGNAME = "range.modifier"; - public static final int RED_WATER_RANGE_MODIFIER_DEFAULT = 3; - - /* - * Item related config settings - */ - // The maximum durability for the Minium Stone - public static int MINIUM_STONE_MAX_DURABILITY; - public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME; - public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521; - - // The maximum durability for the Philosophers Stone - public static int PHILOSOPHERS_STONE_MAX_DURABILITY; - public static final String PHILOSOPHERS_STONE_MAX_DURABILITY_CONFIGNAME = Strings.PHILOSOPHERS_STONE_NAME; - public static final int PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT = 10001; - - /* - * Keybinding related config settings - */ - // Extra key - public static final String KEYBINDING_EXTRA = "key.extra"; - public static final int KEYBINDING_EXTRA_DEFAULT = 46; - - // Release key - public static final String KEYBINDING_RELEASE = "key.release"; - public static final int KEYBINDING_RELEASE_DEFAULT = 19; - - // Toggle key - public static final String KEYBINDING_TOGGLE = "key.toggle"; - public static final int KEYBINDING_TOGGLE_DEFAULT = 34; - - // Charge key - public static final String KEYBINDING_CHARGE = "key.charge"; - public static final int KEYBINDING_CHARGE_DEFAULT = 47; - - /* - * Transmutation related config settings - */ - // The durability cost for each item transmutation - public static int TRANSMUTE_COST_ITEM; - public static final String TRANSMUTE_COST_ITEM_CONFIGNAME = Strings.TRANSMUTATION_COST_ITEM; - public static final int TRANSMUTE_COST_ITEM_DEFAULT = 1; - - // The durability cost for each block transmutation - public static int TRANSMUTE_COST_BLOCK; - public static final String TRANSMUTE_COST_BLOCK_CONFIGNAME = Strings.TRANSMUTATION_COST_BLOCK; - public static final int TRANSMUTE_COST_BLOCK_DEFAULT = 1; - - // The durability cost for each block transmutation - public static int TRANSMUTE_COST_MOB; - public static final String TRANSMUTE_COST_MOB_CONFIGNAME = Strings.TRANSMUTATION_COST_MOB; - public static final int TRANSMUTE_COST_MOB_DEFAULT = 1; - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/ActionRequestHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/ActionRequestHandler.java deleted file mode 100644 index f9163057..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/ActionRequestHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraftforge.event.ForgeSubscribe; - -import com.pahimar.ee3.event.ActionRequestEvent; - -/** - * Equivalent-Exchange-3 - * - * ActionRequestHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ActionRequestHandler { - - @ForgeSubscribe - public void onModActionEvent(ActionRequestEvent event) { - - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/AddonHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/AddonHandler.java deleted file mode 100644 index 439a16ba..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/AddonHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -/** - * Equivalent-Exchange-3 - * - * AddonHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class AddonHandler { - - public static void init() { - - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/CraftingHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/CraftingHandler.java deleted file mode 100644 index 75d6b506..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/CraftingHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.common.ICraftingHandler; - -/** - * Equivalent-Exchange-3 - * - * CraftingHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CraftingHandler implements ICraftingHandler { - - @Override - public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) { - - if (player.worldObj.isRemote) { - doPortableCrafting(player, craftMatrix); - } - } - - @Override - public void onSmelting(EntityPlayer player, ItemStack item) { - - } - - /*** - * Check to see if the crafting is occurring from the portable crafting - * interface. If so, do durability damage to the appropriate transmutation - * stone that was used for portable crafting. - * - * @param player - * The player that is completing the crafting - * @param craftMatrix - * The contents of the crafting matrix - */ - private void doPortableCrafting(EntityPlayer player, IInventory craftMatrix) { - - ItemStack openStone = null; - - for (ItemStack itemStack : player.inventory.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - openStone = itemStack; - } - } - } - - ItemStack itemStack = null; - if (openStone != null) { - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - itemStack = craftMatrix.getStackInSlot(i); - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - openStone = itemStack; - } - } - } - } - - if (openStone != null) { - openStone.damageItem(ConfigurationSettings.TRANSMUTE_COST_ITEM, player); - } - } -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java deleted file mode 100644 index a817896e..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/DrawBlockHighlightHandler.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.EnumMovingObjectType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.event.DrawBlockHighlightEvent; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.event.ForgeSubscribe; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.TransmutationHelper; -import com.pahimar.ee3.item.IChargeable; -import com.pahimar.ee3.item.ITransmutationStone; -import com.pahimar.ee3.lib.Textures; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * DrawBlockHighlightHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class DrawBlockHighlightHandler { - - private static int pulse = 0; - private static boolean doInc = true; - - @ForgeSubscribe - public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event) { - - Minecraft minecraft = FMLClientHandler.instance().getClient(); - - if (event.currentItem != null) { - if (event.currentItem.getItem() instanceof ITransmutationStone) { - if (event.target.typeOfHit == EnumMovingObjectType.TILE) { - TransmutationHelper.updateTargetBlock(event.player.worldObj, event.target.blockX, event.target.blockY, event.target.blockZ); - - if (Minecraft.isGuiEnabled() && minecraft.inGameHasFocus) { - if (ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION) { - drawInWorldTransmutationOverlay(event); - } - } - } - } - } - } - - public void drawInWorldTransmutationOverlay(DrawBlockHighlightEvent event) { - - double x = event.target.blockX + 0.5F; - double y = event.target.blockY + 0.5F; - double z = event.target.blockZ + 0.5F; - double iPX = event.player.prevPosX + (event.player.posX - event.player.prevPosX) * event.partialTicks; - double iPY = event.player.prevPosY + (event.player.posY - event.player.prevPosY) * event.partialTicks; - double iPZ = event.player.prevPosZ + (event.player.posZ - event.player.prevPosZ) * event.partialTicks; - - float xScale = 1; - float yScale = 1; - float zScale = 1; - float xShift = 0.1F; - float yShift = 0.1F; - float zShift = 0.1F; - int chargeLevel; - int itemChargeLevel = 0; - - if (event.currentItem.getItem() instanceof IChargeable) { - itemChargeLevel = ((IChargeable) event.currentItem.getItem()).getCharge(event.currentItem); - } - chargeLevel = 1 + itemChargeLevel * 2; - - ForgeDirection sideHit = ForgeDirection.getOrientation(event.target.sideHit); - - switch (sideHit) { - case UP: { - xScale = chargeLevel + 0.1F; - zScale = chargeLevel + 0.1F; - xShift = 0; - zShift = 0; - break; - } - case DOWN: { - xScale = chargeLevel + 0.1F; - zScale = chargeLevel + 0.1F; - xShift = 0; - yShift = -yShift; - zShift = 0; - break; - } - case NORTH: { - xScale = chargeLevel + 0.1F; - yScale = chargeLevel + 0.1F; - xShift = 0; - yShift = 0; - zShift = -zShift; - break; - } - case SOUTH: { - xScale = chargeLevel + 0.1F; - yScale = chargeLevel + 0.1F; - xShift = 0; - yShift = 0; - break; - } - case EAST: { - yScale = chargeLevel + 0.1F; - zScale = chargeLevel + 0.1F; - yShift = 0; - zShift = 0; - break; - } - case WEST: { - yScale = chargeLevel + 0.1F; - zScale = chargeLevel + 0.1F; - xShift = -xShift; - yShift = 0; - zShift = 0; - break; - } - default: - break; - } - - GL11.glDepthMask(false); - GL11.glDisable(GL11.GL_CULL_FACE); - - for (int i = 0; i < 6; i++) { - ForgeDirection forgeDir = ForgeDirection.getOrientation(i); - int zCorrection = i == 2 ? -1 : 1; - GL11.glPushMatrix(); - GL11.glTranslated(-iPX + x + xShift, -iPY + y + yShift, -iPZ + z + zShift); - GL11.glScalef(1F * xScale, 1F * yScale, 1F * zScale); - GL11.glRotatef(90, forgeDir.offsetX, forgeDir.offsetY, forgeDir.offsetZ); - GL11.glTranslated(0, 0, 0.5f * zCorrection); - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); - renderPulsingQuad(Textures.EFFECT_WORLD_TRANSMUTATION, 0.75F); - GL11.glPopMatrix(); - } - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDepthMask(true); - } - - public static void renderPulsingQuad(ResourceLocation texture, float maxTransparency) { - - float pulseTransparency = getPulseValue() * maxTransparency / 3000f; - - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(texture); - Tessellator tessellator = Tessellator.instance; - - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1, 1, 1, pulseTransparency); - - tessellator.startDrawingQuads(); - tessellator.setColorRGBA_F(1, 1, 1, pulseTransparency); - - tessellator.addVertexWithUV(-0.5D, 0.5D, 0F, 0, 1); - tessellator.addVertexWithUV(0.5D, 0.5D, 0F, 1, 1); - tessellator.addVertexWithUV(0.5D, -0.5D, 0F, 1, 0); - tessellator.addVertexWithUV(-0.5D, -0.5D, 0F, 0, 0); - - tessellator.draw(); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - - private static int getPulseValue() { - - if (doInc) { - pulse += 8; - } - else { - pulse -= 8; - } - - if (pulse == 3000) { - doInc = false; - } - - if (pulse == 0) { - doInc = true; - } - - return pulse; - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/EntityLivingHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/EntityLivingHandler.java deleted file mode 100644 index f76dcc17..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/EntityLivingHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; - -import com.pahimar.ee3.core.util.ItemUtil; - -/** - * Equivalent-Exchange-3 - * - * EntityLivingHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class EntityLivingHandler { - - @ForgeSubscribe - public void onEntityLivingUpdate(LivingUpdateEvent event) { - - } - - @ForgeSubscribe - public void onEntityLivingDeath(LivingDeathEvent event) { - - if (event.source.getDamageType().equals("player")) { - ItemUtil.dropMiniumShard((EntityPlayer) event.source.getSourceOfDamage(), event.entityLiving); - } - if (event.source.getSourceOfDamage() instanceof EntityArrow) { - if (((EntityArrow) event.source.getSourceOfDamage()).shootingEntity != null) { - if (((EntityArrow) event.source.getSourceOfDamage()).shootingEntity instanceof EntityPlayer) { - ItemUtil.dropMiniumShard((EntityPlayer) ((EntityArrow) event.source.getSourceOfDamage()).shootingEntity, event.entityLiving); - } - } - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java deleted file mode 100644 index e7effecc..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/EquivalencyHandler.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.core.util.GeneralHelper; -import com.pahimar.ee3.core.util.LogHelper; - -/** - * Equivalent-Exchange-3 - * - * EquivalencyHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class EquivalencyHandler { - - private static final EquivalencyHandler instance = new EquivalencyHandler(); - - private static ArrayList> equivalencyList = new ArrayList>(); - - public static EquivalencyHandler instance() { - - return instance; - } - - public ArrayList> getAllLists() { - - return equivalencyList; - } - - public void addObjects(Object obj1, Object obj2) { - - ItemStack stack1 = GeneralHelper.convertObjectToItemStack(obj1); - ItemStack stack2 = GeneralHelper.convertObjectToItemStack(obj2); - - ArrayList currentList = new ArrayList(); - - Integer stack1Index = getIndexInList(stack1); - Integer stack2Index = getIndexInList(stack2); - - if (stack1Index != null && stack2Index != null) - return; - else if (stack1Index != null && stack2Index == null) { - currentList = equivalencyList.get(stack1Index.intValue()); - currentList.add(stack2); - equivalencyList.set(stack1Index.intValue(), currentList); - } - else if (stack1Index == null && stack2Index != null) { - currentList = equivalencyList.get(stack2Index.intValue()); - currentList.add(stack1); - equivalencyList.set(stack2Index.intValue(), currentList); - } - else if (stack1Index == null && stack2Index == null) { - currentList.add(stack1); - currentList.add(stack2); - equivalencyList.add(currentList); - } - } - - public void addObjects(Object... objList) { - - if (objList.length < 2) - return; - - for (int i = 0; i < objList.length - 1; i++) { - addObjects(objList[i], objList[i + 1]); - } - } - - public Integer getIndexInList(Object obj) { - - ItemStack checkStack = GeneralHelper.convertObjectToItemStack(obj); - ArrayList currentList; - int i = 0; - - while (i < equivalencyList.size()) { - currentList = equivalencyList.get(i); - for (ItemStack currentStack : currentList) { - if (ItemStack.areItemStacksEqual(checkStack, currentStack)) - return new Integer(i); - } - ++i; - } - - return null; - } - - public Integer getIndexInList(int id, int meta) { - - ArrayList currentList; - int i = 0; - - while (i < equivalencyList.size()) { - currentList = equivalencyList.get(i); - for (ItemStack currentStack : currentList) { - if (id == currentStack.itemID && meta == currentStack.getItemDamage()) - return new Integer(i); - } - ++i; - } - - return null; - } - - public ArrayList getEquivalencyList(Object obj) { - - ItemStack checkStack = GeneralHelper.convertObjectToItemStack(obj); - - if (checkStack == null) - return null; - - for (ArrayList list : equivalencyList) { - for (ItemStack currentStack : list) { - if (ItemStack.areItemStacksEqual(checkStack, currentStack)) - return list; - } - } - - return null; - } - - public ArrayList getEquivalencyList(int id, int meta) { - - for (ArrayList list : equivalencyList) { - for (ItemStack currentStack : list) { - if (id == currentStack.itemID && meta == currentStack.getItemDamage()) - return list; - } - } - - return null; - } - - public ItemStack getNextInList(Object obj) { - - ItemStack checkStack = GeneralHelper.convertObjectToItemStack(obj); - - if (checkStack != null) - return getNextInList(checkStack.itemID, checkStack.getItemDamage()); - - return null; - } - - public ItemStack getNextInList(int id, int meta) { - - ArrayList list = getEquivalencyList(id, meta); - - ItemStack currentStack; - ItemStack returnStack = null; - int i = 0; - - if (list != null) { - if (list.size() == 1) - return list.get(i); - - while (i < list.size()) { - currentStack = list.get(i); - - if (id == currentStack.itemID && meta == currentStack.getItemDamage()) { - returnStack = list.get((i + 1) % list.size()); - break; - } - - ++i; - } - } - - return returnStack; - } - - public ItemStack getPrevInList(Object obj) { - - ItemStack checkStack = GeneralHelper.convertObjectToItemStack(obj); - - if (checkStack != null) - return getPrevInList(checkStack.itemID, checkStack.getItemDamage()); - - return null; - } - - public ItemStack getPrevInList(int id, int meta) { - - ArrayList list = getEquivalencyList(id, meta); - - ItemStack currentStack; - ItemStack returnStack = null; - int i = 0; - - if (list != null) { - if (list.size() == 1) - return list.get(i); - - while (i < list.size()) { - currentStack = list.get(i); - - if (id == currentStack.itemID && meta == currentStack.getItemDamage()) { - int index = (i - 1 + list.size()) % list.size(); - returnStack = list.get(index); - break; - } - - ++i; - } - } - - return returnStack; - } - - public boolean areEquivalent(Object obj1, Object obj2) { - - if (getEquivalencyList(obj1) != null && getEquivalencyList(obj2) != null) { - // TODO This could be cleaner - if (GeneralHelper.convertObjectToItemStack(obj1).itemID == GeneralHelper.convertObjectToItemStack(obj2).itemID && GeneralHelper.convertObjectToItemStack(obj1).getItemDamage() == GeneralHelper.convertObjectToItemStack(obj2).getItemDamage()) - return true; - else - return getEquivalencyList(obj1).equals(getEquivalencyList(obj2)); - } - else - return false; - } - - /* Ignores stack size for world transmutation */ - public boolean areWorldEquivalent(Object obj1, Object obj2) { - - ItemStack first = GeneralHelper.convertObjectToItemStack(obj1); - if (first == null) - return false; - ItemStack second = GeneralHelper.convertObjectToItemStack(obj2); - if (second == null) - return false; - - if (getEquivalencyList(first.itemID, first.getItemDamage()) != null && getEquivalencyList(second.itemID, second.getItemDamage()) != null) { - if (first.itemID == second.itemID && first.getItemDamage() == second.getItemDamage()) - return true; - else - return getEquivalencyList(first.itemID, first.getItemDamage()).equals(getEquivalencyList(second.itemID, second.getItemDamage())); - } - else - return false; - } - - public void debug() { - - int i = 0; - for (ArrayList list : equivalencyList) { - LogHelper.info("equivalencyList[" + i + "]: " + list.toString()); - ++i; - } - } -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/FuelHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/FuelHandler.java deleted file mode 100644 index 14584581..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/FuelHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.IFuelHandler; - -/** - * Equivalent-Exchange-3 - * - * FuelHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class FuelHandler implements IFuelHandler { - - @Override - public int getBurnTime(ItemStack fuel) { - - // TODO Add in fuel values for EE3 fuel related items - return 0; - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/InterModCommsHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/InterModCommsHandler.java deleted file mode 100644 index 4c137770..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/InterModCommsHandler.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import java.util.List; -import java.util.Map; - -import net.minecraft.nbt.NBTTagCompound; - -import com.pahimar.ee3.core.util.LogHelper; -import com.pahimar.ee3.emc.EmcBlackList; -import com.pahimar.ee3.item.CustomWrappedStack; -import com.pahimar.ee3.item.crafting.RecipeRegistry; -import com.pahimar.ee3.lib.InterModComms; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent; -import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; - -public class InterModCommsHandler { - - public static void processIMCMessages(IMCEvent event) { - - for (IMCMessage imcMessage : event.getMessages()) { - - if (imcMessage.getMessageType() == NBTTagCompound.class) { - - if (imcMessage.key.equalsIgnoreCase(InterModComms.ADD_RECIPE)) { - processAddRecipeMessage(imcMessage); - } - else if (imcMessage.key.equalsIgnoreCase(InterModComms.ADD_BLACKLIST_ENTRY)) { - processAddBlackListMessage(imcMessage); - } - else if (imcMessage.key.equalsIgnoreCase(InterModComms.REMOVE_BLACKLIST_ENTRY)) { - processRemoveBlackListMessage(imcMessage); - } - else if (imcMessage.key.equalsIgnoreCase(InterModComms.SET_EMC_VALUE)) { - processSetEmcValueMessage(imcMessage); - } - } - else { - LogHelper.severe("[IMC] Mod '" + imcMessage.getSender() + "' sent a message with key '" + imcMessage.key + "' with an invalid argument type (received " + imcMessage.getMessageType().getSimpleName() + ", expected NBTTagCompound)"); - } - } - } - - private static void processAddRecipeMessage(IMCMessage imcMessage) { - - NBTTagCompound encodedRecipe = imcMessage.getNBTValue(); - - Map> decodedRecipe = NBTHelper.decodeRecipeFromNBT(encodedRecipe); - - if (!decodedRecipe.isEmpty()) { - for (CustomWrappedStack key : decodedRecipe.keySet()) { - RecipeRegistry.getInstance().addRecipe(key, decodedRecipe.get(key)); - LogHelper.info("[IMC] Mod '" + imcMessage.getSender() + "' added recipe with output '" + key.toString() + "' and inputs '" + decodedRecipe.get(key) + "'"); - } - } - else { - LogHelper.severe("[IMC] Mod '" + imcMessage.getSender() + "' attempting to add a NBT encoded recipe to the recipe registry, but the encoded recipe is invalid"); - } - } - - private static void processAddBlackListMessage(IMCMessage imcMessage) { - - NBTTagCompound encodedStack = imcMessage.getNBTValue(); - - CustomWrappedStack decodedStack = NBTHelper.decodeStackFromNBT(encodedStack); - - if (decodedStack != null) { - if (EmcBlackList.getInstance().add(decodedStack)) { - LogHelper.info("[IMC] Mod '" + imcMessage.getSender() + "' added object '" + decodedStack.toString() + "' to the EMC blacklist"); - } - else { - LogHelper.severe("[IMC] Mod '" + imcMessage.getSender() + "' attempted to add an object to the EMC blacklist that already existed"); - } - } - } - - private static void processRemoveBlackListMessage(IMCMessage imcMessage) { - - NBTTagCompound encodedStack = imcMessage.getNBTValue(); - - CustomWrappedStack decodedStack = NBTHelper.decodeStackFromNBT(encodedStack); - - if (decodedStack != null) { - if (EmcBlackList.getInstance().remove(decodedStack)) { - LogHelper.info("[IMC] Mod '" + imcMessage.getSender() + "' removed object '" + decodedStack.toString() + "' from the EMC blacklist"); - } - else { - LogHelper.severe("[IMC] Mod '" + imcMessage.getSender() + "' attempted to remove an object to the EMC blacklist that was not present"); - } - } - } - - private static void processSetEmcValueMessage(IMCMessage imcMessage) { - - // TODO Set an EMC Value via IMC - } -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/ItemEventHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/ItemEventHandler.java deleted file mode 100644 index 1017f4a4..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/ItemEventHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraft.entity.item.EntityItem; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.entity.item.ItemTossEvent; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; - -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -/** - * Equivalent-Exchange-3 - * - * ItemEventHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemEventHandler { - - @ForgeSubscribe - public void onItemPickup(EntityItemPickupEvent event) { - - if (NBTHelper.hasTag(event.item.getEntityItem(), Strings.NBT_ITEM_CRAFTING_GUI_OPEN)) { - NBTHelper.removeTag(event.item.getEntityItem(), Strings.NBT_ITEM_CRAFTING_GUI_OPEN); - } - else if (NBTHelper.hasTag(event.item.getEntityItem(), Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - NBTHelper.removeTag(event.item.getEntityItem(), Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - else if (NBTHelper.hasTag(event.item.getEntityItem(), Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - NBTHelper.removeTag(event.item.getEntityItem(), Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); - } - } - - @ForgeSubscribe - public void onItemToss(ItemTossEvent event) { - - if (NBTHelper.hasTag(event.entityItem.getEntityItem(), Strings.NBT_ITEM_CRAFTING_GUI_OPEN)) { - NBTHelper.removeTag(event.entityItem.getEntityItem(), Strings.NBT_ITEM_CRAFTING_GUI_OPEN); - } - else if (NBTHelper.hasTag(event.entityItem.getEntityItem(), Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - NBTHelper.removeTag(event.entityItem.getEntityItem(), Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - else if (NBTHelper.hasTag(event.entityItem.getEntityItem(), Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - NBTHelper.removeTag(event.entityItem.getEntityItem(), Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); - } - } - - @ForgeSubscribe - public void onPlayerDrop(PlayerDropsEvent event) { - - for (EntityItem entityItem : event.drops) { - if (NBTHelper.hasTag(entityItem.getEntityItem(), Strings.NBT_ITEM_CRAFTING_GUI_OPEN)) { - NBTHelper.removeTag(entityItem.getEntityItem(), Strings.NBT_ITEM_CRAFTING_GUI_OPEN); - } - else if (NBTHelper.hasTag(entityItem.getEntityItem(), Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - NBTHelper.removeTag(entityItem.getEntityItem(), Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - else if (NBTHelper.hasTag(entityItem.getEntityItem(), Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - NBTHelper.removeTag(entityItem.getEntityItem(), Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/KeyBindingHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/KeyBindingHandler.java deleted file mode 100644 index 2395cd88..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/KeyBindingHandler.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import java.util.EnumSet; - -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.core.util.KeyBindingUtil; -import com.pahimar.ee3.item.IKeyBound; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketKeyPressed; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.KeyBindingRegistry; -import cpw.mods.fml.common.TickType; -import cpw.mods.fml.common.network.PacketDispatcher; - -/** - * Equivalent-Exchange-3 - * - * KeyBindingHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class KeyBindingHandler extends KeyBindingRegistry.KeyHandler { - - public KeyBindingHandler() { - - super(KeyBindingUtil.gatherKeyBindings(), KeyBindingUtil.gatherIsRepeating()); - } - - @Override - public String getLabel() { - - return Reference.MOD_NAME + ": " + this.getClass().getSimpleName(); - } - - @Override - public void keyDown(EnumSet types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { - - // Only operate at the end of the tick - if (tickEnd) { - // If we are not in a GUI of any kind, continue execution - if (FMLClientHandler.instance().getClient().inGameHasFocus) { - EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer; - if (player != null) { - ItemStack currentItem = FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem(); - - if (currentItem != null) { - if (currentItem.getItem() instanceof IKeyBound) { - if (!KeyBindingUtil.isClientSided(kb.keyDescription)) { - PacketDispatcher.sendPacketToServer(PacketTypeHandler.populatePacket(new PacketKeyPressed(kb.keyDescription))); - } - else { - ((IKeyBound) currentItem.getItem()).doKeyBindingAction(player, currentItem, kb.keyDescription); - } - } - } - } - } - } - } - - @Override - public void keyUp(EnumSet types, KeyBinding kb, boolean tickEnd) { - - } - - @Override - public EnumSet ticks() { - - return EnumSet.of(TickType.CLIENT); - } -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/LocalizationHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/LocalizationHandler.java deleted file mode 100644 index 90344d4a..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/LocalizationHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import com.pahimar.ee3.core.util.LocalizationUtil; -import com.pahimar.ee3.lib.Localizations; - -import cpw.mods.fml.common.registry.LanguageRegistry; - -/** - * Equivalent-Exchange-3 - * - * LocalizationHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class LocalizationHandler { - - /*** - * Loads in all the localization files from the Localizations library class - */ - public static void loadLanguages() { - - // For every file specified in the Localization library class, load them into the Language Registry - for (String localizationFile : Localizations.localeFiles) { - LanguageRegistry.instance().loadLocalization(localizationFile, LocalizationUtil.getLocaleFromFileName(localizationFile), LocalizationUtil.isXMLLanguageFile(localizationFile)); - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/PlayerDestroyItemHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/PlayerDestroyItemHandler.java deleted file mode 100644 index 9a816458..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/PlayerDestroyItemHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; - -/** - * Equivalent-Exchange-3 - * - * PlayerDestroyItemHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PlayerDestroyItemHandler { - - @ForgeSubscribe - public void onPlayerDestroyItemEvent(PlayerDestroyItemEvent event) { - - // TODO Come back and actually do what I want here - - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java deleted file mode 100644 index 11afbf0e..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/TransmutationTargetOverlayHandler.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import com.pahimar.ee3.client.renderer.RenderUtils; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.TransmutationHelper; -import com.pahimar.ee3.item.ITransmutationStone; -import com.pahimar.ee3.lib.Reference; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.ITickHandler; -import cpw.mods.fml.common.TickType; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * TransmutationTargetOverlayHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@SideOnly(Side.CLIENT) -public class TransmutationTargetOverlayHandler implements ITickHandler { - - @Override - public void tickStart(EnumSet type, Object... tickData) { - - } - - @Override - public void tickEnd(EnumSet type, Object... tickData) { - - Minecraft minecraft = FMLClientHandler.instance().getClient(); - EntityPlayer player = minecraft.thePlayer; - ItemStack currentItemStack = null; - - if (type.contains(TickType.RENDER)) { - if (player != null) { - currentItemStack = player.inventory.getCurrentItem(); - - if (Minecraft.isGuiEnabled() && minecraft.inGameHasFocus) { - if (currentItemStack != null && currentItemStack.getItem() instanceof ITransmutationStone && ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION) { - renderStoneHUD(minecraft, player, currentItemStack, (Float) tickData[0]); - } - } - } - } - } - - @Override - public EnumSet ticks() { - - return EnumSet.of(TickType.CLIENT, TickType.RENDER); - } - - @Override - public String getLabel() { - - return Reference.MOD_NAME + ": " + this.getClass().getSimpleName(); - } - - private static void renderStoneHUD(Minecraft minecraft, EntityPlayer player, ItemStack stack, float partialTicks) { - - float overlayScale = ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE; - float blockScale = overlayScale / 2; - float overlayOpacity = ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY; - - GL11.glPushMatrix(); - ScaledResolution sr = new ScaledResolution(minecraft.gameSettings, minecraft.displayWidth, minecraft.displayHeight); - GL11.glClear(256); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GL11.glOrtho(0.0D, sr.getScaledWidth_double(), sr.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); - GL11.glTranslatef(0.0F, 0.0F, -2000.0F); - - GL11.glPushMatrix(); - RenderHelper.enableGUIStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glEnable(GL11.GL_LIGHTING); - - int hudOverlayX = 0; - int hudOverlayY = 0; - int hudBlockX = 0; - int hudBlockY = 0; - - switch (ConfigurationSettings.TARGET_BLOCK_OVERLAY_POSITION) { - case 0: { - hudOverlayX = 0; - hudBlockX = (int) (16 * overlayScale / 2 - 8); - hudOverlayY = 0; - hudBlockY = (int) (16 * overlayScale / 2 - 8); - break; - } - case 1: { - hudOverlayX = (int) (sr.getScaledWidth() - 16 * overlayScale); - hudBlockX = (int) (sr.getScaledWidth() - 16 * overlayScale / 2 - 8); - hudOverlayY = 0; - hudBlockY = (int) (16 * overlayScale / 2 - 8); - break; - } - case 2: { - hudOverlayX = 0; - hudBlockX = (int) (16 * overlayScale / 2 - 8); - hudOverlayY = (int) (sr.getScaledHeight() - 16 * overlayScale); - hudBlockY = (int) (sr.getScaledHeight() - 16 * overlayScale / 2 - 8); - break; - } - case 3: { - hudOverlayX = (int) (sr.getScaledWidth() - 16 * overlayScale); - hudBlockX = (int) (sr.getScaledWidth() - 16 * overlayScale / 2 - 8); - hudOverlayY = (int) (sr.getScaledHeight() - 16 * overlayScale); - hudBlockY = (int) (sr.getScaledHeight() - 16 * overlayScale / 2 - 8); - break; - } - default: { - break; - } - } - - RenderUtils.renderItemIntoGUI(minecraft.fontRenderer, stack, hudOverlayX, hudOverlayY, overlayOpacity, overlayScale); - - if (TransmutationHelper.targetBlockStack != null && TransmutationHelper.targetBlockStack.getItem() instanceof ItemBlock) { - RenderUtils.renderRotatingBlockIntoGUI(minecraft.fontRenderer, TransmutationHelper.targetBlockStack, hudBlockX, hudBlockY, -90, blockScale); - } - - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/VersionCheckTickHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/VersionCheckTickHandler.java deleted file mode 100644 index 98c4b597..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/VersionCheckTickHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import java.util.EnumSet; - -import net.minecraftforge.common.Configuration; - -import com.pahimar.ee3.configuration.ConfigurationHandler; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.VersionHelper; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.lib.Strings; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.ITickHandler; -import cpw.mods.fml.common.TickType; - -/** - * Equivalent-Exchange-3 - * - * VersionCheckTickHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class VersionCheckTickHandler implements ITickHandler { - - private static boolean initialized = false; - - @Override - public void tickStart(EnumSet type, Object... tickData) { - - } - - @Override - public void tickEnd(EnumSet type, Object... tickData) { - - if (ConfigurationSettings.DISPLAY_VERSION_RESULT) { - if (!initialized) { - for (TickType tickType : type) { - if (tickType == TickType.CLIENT) { - if (FMLClientHandler.instance().getClient().currentScreen == null) { - if (VersionHelper.getResult() != VersionHelper.UNINITIALIZED || VersionHelper.getResult() != VersionHelper.FINAL_ERROR) { - - initialized = true; - - if (VersionHelper.getResult() == VersionHelper.OUTDATED) { - FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(VersionHelper.getResultMessageForClient()); - ConfigurationHandler.set(Configuration.CATEGORY_GENERAL, ConfigurationSettings.DISPLAY_VERSION_RESULT_CONFIGNAME, Strings.FALSE); - } - } - } - } - } - } - } - } - - @Override - public EnumSet ticks() { - - return EnumSet.of(TickType.CLIENT); - } - - @Override - public String getLabel() { - - return Reference.MOD_NAME + ": " + this.getClass().getSimpleName(); - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java b/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java deleted file mode 100644 index 24ae7635..00000000 --- a/ee3_common/com/pahimar/ee3/core/handlers/WorldTransmutationHandler.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.pahimar.ee3.core.handlers; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.Event.Result; -import net.minecraftforge.event.ForgeSubscribe; - -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.TransmutationHelper; -import com.pahimar.ee3.event.ActionEvent; -import com.pahimar.ee3.event.ActionEvent.ActionResult; -import com.pahimar.ee3.event.ActionRequestEvent; -import com.pahimar.ee3.event.WorldTransmutationEvent; -import com.pahimar.ee3.lib.ActionTypes; -import com.pahimar.ee3.lib.ItemUpdateTypes; -import com.pahimar.ee3.lib.Particles; -import com.pahimar.ee3.lib.Sounds; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketItemUpdate; -import com.pahimar.ee3.network.packet.PacketSoundEvent; -import com.pahimar.ee3.network.packet.PacketSpawnParticle; - -import cpw.mods.fml.common.network.PacketDispatcher; -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * WorldTransmutationHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class WorldTransmutationHandler { - - public static void handleWorldTransmutation(EntityPlayer thePlayer, int originX, int originY, int originZ, byte rangeX, byte rangeY, byte rangeZ, byte sideHit, String data) { - - ActionRequestEvent actionRequestEvent = null; - ActionEvent actionEvent = null; - - int lowerBoundX = -1 * rangeX / 2; - int upperBoundX = -1 * lowerBoundX; - int lowerBoundY = -1 * rangeY / 2; - int upperBoundY = -1 * lowerBoundY; - int lowerBoundZ = -1 * rangeZ / 2; - int upperBoundZ = -1 * lowerBoundZ; - boolean anySuccess = false; - - double xShift = 0; - double yShift = 0; - double zShift = 0; - - int xSign = 1; - int ySign = 1; - int zSign = 1; - - switch (ForgeDirection.getOrientation(sideHit)) { - case UP: { - yShift = 1.5D; - break; - } - case DOWN: { - yShift = 0.1D; - ySign = -1; - break; - } - case NORTH: { - zShift = 1D; - zSign = -1; - break; - } - case SOUTH: { - zShift = 1D; - break; - } - case EAST: { - xShift = 1D; - break; - } - case WEST: { - xShift = 1D; - xSign = -1; - break; - } - case UNKNOWN: { - break; - } - default: - break; - } - - for (int x = lowerBoundX; x <= upperBoundX; x++) { - for (int y = lowerBoundY; y <= upperBoundY; y++) { - for (int z = lowerBoundZ; z <= upperBoundZ; z++) { - - actionEvent = new WorldTransmutationEvent(ActionTypes.TRANSMUTATION, thePlayer.getCurrentEquippedItem(), thePlayer, thePlayer.worldObj, originX + x, originY + y, originZ + z, false, data); - - if (actionEvent != null) { - actionRequestEvent = new ActionRequestEvent(thePlayer, actionEvent, originX + x, originY + y, originZ + z, sideHit); - MinecraftForge.EVENT_BUS.post(actionRequestEvent); - - if (actionRequestEvent.allowEvent != Result.DENY) { - MinecraftForge.EVENT_BUS.post(actionEvent); - } - - if (actionEvent.actionResult == ActionResult.SUCCESS) { - if (!anySuccess) { - anySuccess = true; - } - - PacketDispatcher.sendPacketToAllAround(originX + x, originY + y, originZ + z, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSpawnParticle(Particles.LARGE_SMOKE, originX + x + xShift * xSign, originY + y + yShift * ySign, originZ + z + zShift * zSign, 0D * xSign, 0.05D * ySign, 0D * zSign))); - PacketDispatcher.sendPacketToAllAround(originX + x, originY + y, originZ + z, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSpawnParticle(Particles.LARGE_EXPLODE, originX + x + xShift * xSign, originY + y + yShift * ySign, originZ + z + zShift * zSign, 0D * xSign, 0.15D * ySign, 0D * zSign))); - } - else if (actionEvent.actionResult == ActionResult.FAILURE) { - if (!(actionEvent.world.getBlockId(originX + x, originY + y, originZ + z) == 0)) { - // TODO Fancy particle motion - PacketDispatcher.sendPacketToAllAround(originX + x, originY + y, originZ + z, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSpawnParticle(Particles.RED_DUST, originX + x + xShift * xSign, originY + y + yShift * ySign, originZ + z + zShift * zSign, 0D * xSign, 0.05D * ySign, 0D * zSign))); - PacketDispatcher.sendPacketToAllAround(originX + x, originY + y, originZ + z, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSpawnParticle(Particles.WITCH_MAGIC, originX + x + xShift * xSign, originY + y + yShift * ySign, originZ + z + zShift * zSign, 0D * xSign, 0.05D * ySign, 0D * zSign))); - } - } - } - } - } - } - - if (anySuccess) { - PacketDispatcher.sendPacketToAllAround(originX, originY, originZ, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSoundEvent(thePlayer.username, Sounds.TRANSMUTE, originX, originY, originZ, 0.5F, 1.0F))); - } - else { - PacketDispatcher.sendPacketToAllAround(originX, originY, originZ, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSoundEvent(thePlayer.username, Sounds.FAIL, originX, originY, originZ, 1.5F, 1.5F))); - } - } - - @ForgeSubscribe - public void onWorldTransmutationEvent(WorldTransmutationEvent event) { - - int id = event.world.getBlockId(event.x, event.y, event.z); - int meta = event.world.getBlockMetadata(event.x, event.y, event.z); - boolean result = false; - - Block currentBlock = Block.blocksList[id]; - - if (currentBlock != null) { - meta = currentBlock.damageDropped(meta); - } - - ItemStack worldStack = new ItemStack(id, 1, meta); - ItemStack targetStack = new ItemStack(event.targetID, 1, event.targetMeta); - - if (!worldStack.isItemEqual(targetStack)) { - if (EquivalencyHandler.instance().areWorldEquivalent(worldStack, targetStack)) { - if (event.itemStack != null) { - if (event.itemStack.getItemDamage() <= event.itemStack.getMaxDamage()) { - result = TransmutationHelper.transmuteInWorld(event.world, event.player, event.player.getCurrentEquippedItem(), event.x, event.y, event.z, event.targetID, event.targetMeta); - } - } - } - } - - if (result) { - event.actionResult = ActionResult.SUCCESS; - - int currentSlot = event.player.inventory.currentItem; - event.itemStack.damageItem(ConfigurationSettings.TRANSMUTE_COST_BLOCK, event.player); - - if (event.itemStack.stackSize < 1) { - event.player.inventory.setInventorySlotContents(currentSlot, null); - PacketDispatcher.sendPacketToPlayer(PacketTypeHandler.populatePacket(new PacketItemUpdate((byte) currentSlot, ItemUpdateTypes.DESTROYED)), (Player) event.player); - event.player.worldObj.playSoundAtEntity(event.player, "random.break", 0.8F, 0.8F + event.player.worldObj.rand.nextFloat() * 0.4F); - } - } - else { - event.actionResult = ActionResult.FAILURE; - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/proxy/ClientProxy.java b/ee3_common/com/pahimar/ee3/core/proxy/ClientProxy.java deleted file mode 100644 index cebe571f..00000000 --- a/ee3_common/com/pahimar/ee3/core/proxy/ClientProxy.java +++ /dev/null @@ -1,224 +0,0 @@ -package com.pahimar.ee3.core.proxy; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.common.MinecraftForge; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.client.audio.SoundHandler; -import com.pahimar.ee3.client.renderer.item.ItemAlchemicalChestRenderer; -import com.pahimar.ee3.client.renderer.item.ItemAludelRenderer; -import com.pahimar.ee3.client.renderer.item.ItemCalcinatorRenderer; -import com.pahimar.ee3.client.renderer.item.ItemGlassBellRenderer; -import com.pahimar.ee3.client.renderer.tileentity.TileEntityAlchemicalChestRenderer; -import com.pahimar.ee3.client.renderer.tileentity.TileEntityAludelRenderer; -import com.pahimar.ee3.client.renderer.tileentity.TileEntityCalcinatorRenderer; -import com.pahimar.ee3.client.renderer.tileentity.TileEntityGlassBellRenderer; -import com.pahimar.ee3.core.handlers.DrawBlockHighlightHandler; -import com.pahimar.ee3.core.handlers.KeyBindingHandler; -import com.pahimar.ee3.core.handlers.TransmutationTargetOverlayHandler; -import com.pahimar.ee3.core.util.ItemUtil; -import com.pahimar.ee3.core.util.KeyBindingUtil; -import com.pahimar.ee3.core.util.TransmutationHelper; -import com.pahimar.ee3.item.IChargeable; -import com.pahimar.ee3.lib.ActionTypes; -import com.pahimar.ee3.lib.BlockIds; -import com.pahimar.ee3.lib.Colours; -import com.pahimar.ee3.lib.RenderIds; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketRequestEvent; -import com.pahimar.ee3.tileentity.TileAlchemicalChest; -import com.pahimar.ee3.tileentity.TileAludel; -import com.pahimar.ee3.tileentity.TileCalcinator; -import com.pahimar.ee3.tileentity.TileEE; -import com.pahimar.ee3.tileentity.TileGlassBell; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.KeyBindingRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.network.PacketDispatcher; -import cpw.mods.fml.common.registry.TickRegistry; -import cpw.mods.fml.relauncher.Side; - -/** - * Equivalent-Exchange-3 - * - * ClientProxy - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ClientProxy extends CommonProxy { - - @Override - public void registerKeyBindingHandler() { - - KeyBindingRegistry.registerKeyBinding(new KeyBindingHandler()); - } - - @Override - public void registerRenderTickHandler() { - - TickRegistry.registerTickHandler(new TransmutationTargetOverlayHandler(), Side.CLIENT); - } - - @Override - public void registerDrawBlockHighlightHandler() { - - MinecraftForge.EVENT_BUS.register(new DrawBlockHighlightHandler()); - } - - @Override - public void setKeyBinding(String name, int value) { - - KeyBindingUtil.addKeyBinding(name, value); - KeyBindingUtil.addIsRepeating(false); - } - - @Override - public void registerSoundHandler() { - - MinecraftForge.EVENT_BUS.register(new SoundHandler()); - } - - @Override - public void initRenderingAndTextures() { - - RenderIds.calcinatorRenderId = RenderingRegistry.getNextAvailableRenderId(); - RenderIds.aludelRenderId = RenderingRegistry.getNextAvailableRenderId(); - RenderIds.alchemicalChestRenderId = RenderingRegistry.getNextAvailableRenderId(); - RenderIds.glassBellId = RenderingRegistry.getNextAvailableRenderId(); - - MinecraftForgeClient.registerItemRenderer(BlockIds.CALCINATOR, new ItemCalcinatorRenderer()); - MinecraftForgeClient.registerItemRenderer(BlockIds.ALUDEL_BASE, new ItemAludelRenderer()); - MinecraftForgeClient.registerItemRenderer(BlockIds.ALCHEMICAL_CHEST, new ItemAlchemicalChestRenderer()); - MinecraftForgeClient.registerItemRenderer(BlockIds.GLASS_BELL, new ItemGlassBellRenderer()); - } - - @Override - public void registerTileEntities() { - - super.registerTileEntities(); - - ClientRegistry.bindTileEntitySpecialRenderer(TileCalcinator.class, new TileEntityCalcinatorRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(TileAludel.class, new TileEntityAludelRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(TileAlchemicalChest.class, new TileEntityAlchemicalChestRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(TileGlassBell.class, new TileEntityGlassBellRenderer()); - } - - @Override - public void sendRequestEventPacket(byte eventType, int originX, int originY, int originZ, byte sideHit, byte rangeX, byte rangeY, byte rangeZ, String data) { - - PacketDispatcher.sendPacketToServer(PacketTypeHandler.populatePacket(new PacketRequestEvent(eventType, originX, originY, originZ, sideHit, rangeX, rangeY, rangeZ, data))); - } - - @Override - public void handleTileEntityPacket(int x, int y, int z, ForgeDirection orientation, byte state, String customName) { - - TileEntity tileEntity = FMLClientHandler.instance().getClient().theWorld.getBlockTileEntity(x, y, z); - - if (tileEntity != null) { - if (tileEntity instanceof TileEE) { - ((TileEE) tileEntity).setOrientation(orientation); - ((TileEE) tileEntity).setState(state); - ((TileEE) tileEntity).setCustomName(customName); - } - } - } - - @Override - public void handleTileWithItemPacket(int x, int y, int z, ForgeDirection orientation, byte state, String customName, int itemID, int metaData, int stackSize, int color) { - - World world = FMLClientHandler.instance().getClient().theWorld; - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - this.handleTileEntityPacket(x, y, z, orientation, state, customName); - - if (tileEntity != null) { - if (tileEntity instanceof TileGlassBell) { - - ItemStack itemStack = new ItemStack(itemID, stackSize, metaData); - if (color != Integer.parseInt(Colours.PURE_WHITE, 16)) { - ItemUtil.setColor(itemStack, color); - } - - ((TileGlassBell) tileEntity).setInventorySlotContents(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX, itemStack); - world.updateAllLightTypes(x, y, z); - } - else if (tileEntity instanceof TileAludel) { - - ItemStack itemStack = new ItemStack(itemID, stackSize, metaData); - if (color != Integer.parseInt(Colours.PURE_WHITE, 16)) { - ItemUtil.setColor(itemStack, color); - } - - ((TileAludel) tileEntity).setInventorySlotContents(TileAludel.INPUT_INVENTORY_INDEX, itemStack); - world.updateAllLightTypes(x, y, z); - } - } - } - - @Override - public void transmuteBlock(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int sideHit) { - - if (TransmutationHelper.targetBlockStack != null) { - if (itemStack != null) { - int pnX = 1; - int pnY = 1; - int pnZ = 1; - if (itemStack.getItem() instanceof IChargeable) { - int charge = ((IChargeable) itemStack.getItem()).getCharge(itemStack) * 2; - switch (ForgeDirection.getOrientation(sideHit)) { - case UP: { - pnX = 1 + charge; - pnZ = 1 + charge; - break; - } - case DOWN: { - pnX = 1 + charge; - pnZ = 1 + charge; - break; - } - case NORTH: { - pnX = 1 + charge; - pnY = 1 + charge; - break; - } - case SOUTH: { - pnX = 1 + charge; - pnY = 1 + charge; - break; - } - case EAST: { - pnY = 1 + charge; - pnZ = 1 + charge; - break; - } - case WEST: { - pnY = 1 + charge; - pnZ = 1 + charge; - break; - } - case UNKNOWN: { - pnX = 0; - pnY = 0; - pnZ = 0; - break; - } - default: - break; - } - } - - EquivalentExchange3.proxy.sendRequestEventPacket(ActionTypes.TRANSMUTATION, x, y, z, (byte) sideHit, (byte) pnX, (byte) pnY, (byte) pnZ, TransmutationHelper.formatTargetBlockInfo(TransmutationHelper.targetBlockStack)); - } - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/proxy/CommonProxy.java b/ee3_common/com/pahimar/ee3/core/proxy/CommonProxy.java deleted file mode 100644 index 1a9ff867..00000000 --- a/ee3_common/com/pahimar/ee3/core/proxy/CommonProxy.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.pahimar.ee3.core.proxy; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.client.gui.inventory.GuiAlchemicalBag; -import com.pahimar.ee3.client.gui.inventory.GuiAlchemicalChest; -import com.pahimar.ee3.client.gui.inventory.GuiAludel; -import com.pahimar.ee3.client.gui.inventory.GuiCalcinator; -import com.pahimar.ee3.client.gui.inventory.GuiGlassBell; -import com.pahimar.ee3.client.gui.inventory.GuiPortableCrafting; -import com.pahimar.ee3.client.gui.inventory.GuiPortableTransmutation; -import com.pahimar.ee3.inventory.ContainerAlchemicalBag; -import com.pahimar.ee3.inventory.ContainerAlchemicalChest; -import com.pahimar.ee3.inventory.ContainerAludel; -import com.pahimar.ee3.inventory.ContainerCalcinator; -import com.pahimar.ee3.inventory.ContainerGlassBell; -import com.pahimar.ee3.inventory.ContainerPortableCrafting; -import com.pahimar.ee3.inventory.ContainerPortableTransmutation; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.tileentity.TileAlchemicalChest; -import com.pahimar.ee3.tileentity.TileAludel; -import com.pahimar.ee3.tileentity.TileCalcinator; -import com.pahimar.ee3.tileentity.TileGlassBell; - -import cpw.mods.fml.common.network.IGuiHandler; -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * Equivalent-Exchange-3 - * - * CommonProxy - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CommonProxy implements IGuiHandler { - - public void registerKeyBindingHandler() { - - } - - public void registerRenderTickHandler() { - - } - - public void registerDrawBlockHighlightHandler() { - - } - - public void setKeyBinding(String name, int value) { - - } - - public void registerSoundHandler() { - - } - - public void initRenderingAndTextures() { - - } - - public void registerTileEntities() { - - GameRegistry.registerTileEntity(TileCalcinator.class, Strings.TE_CALCINATOR_NAME); - GameRegistry.registerTileEntity(TileAludel.class, Strings.TE_ALUDEL_NAME); - GameRegistry.registerTileEntity(TileAlchemicalChest.class, Strings.TE_ALCHEMICAL_CHEST_NAME); - GameRegistry.registerTileEntity(TileGlassBell.class, Strings.TE_GLASS_BELL_NAME); - } - - public void transmuteBlock(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int sideHit) { - - } - - public void sendRequestEventPacket(byte eventType, int originX, int originY, int originZ, byte sideHit, byte rangeX, byte rangeY, byte rangeZ, String data) { - - } - - public void handleTileEntityPacket(int x, int y, int z, ForgeDirection orientation, byte state, String customName) { - - } - - public void handleTileWithItemPacket(int x, int y, int z, ForgeDirection orientation, byte state, String customName, int itemID, int metaData, int stackSize, int color) { - - } - - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - - if (ID == GuiIds.PORTABLE_CRAFTING) - return new ContainerPortableCrafting(player.inventory, world, x, y, z); - else if (ID == GuiIds.PORTABLE_TRANSMUTATION) - return new ContainerPortableTransmutation(); - else if (ID == GuiIds.CALCINATOR) { - TileCalcinator tileCalcinator = (TileCalcinator) world.getBlockTileEntity(x, y, z); - return new ContainerCalcinator(player.inventory, tileCalcinator); - } - else if (ID == GuiIds.ALCHEMICAL_CHEST) { - TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z); - return new ContainerAlchemicalChest(player.inventory, tileAlchemicalChest); - } - else if (ID == GuiIds.ALCHEMICAL_BAG) - // TODO Alchemical Bag inventory work is incomplete - return new ContainerAlchemicalBag(player.inventory); - else if (ID == GuiIds.ALUDEL) { - TileAludel tileAludel = (TileAludel) world.getBlockTileEntity(x, y, z); - return new ContainerAludel(player.inventory, tileAludel); - } - else if (ID == GuiIds.GLASS_BELL) { - TileGlassBell tileGlassBell = (TileGlassBell) world.getBlockTileEntity(x, y, z); - return new ContainerGlassBell(player.inventory, tileGlassBell); - } - - return null; - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - - if (ID == GuiIds.PORTABLE_CRAFTING) - return new GuiPortableCrafting(player, world, x, y, z); - else if (ID == GuiIds.PORTABLE_TRANSMUTATION) - return new GuiPortableTransmutation(null); - else if (ID == GuiIds.CALCINATOR) { - TileCalcinator tileCalcinator = (TileCalcinator) world.getBlockTileEntity(x, y, z); - return new GuiCalcinator(player.inventory, tileCalcinator); - } - else if (ID == GuiIds.ALCHEMICAL_CHEST) { - TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z); - return new GuiAlchemicalChest(player.inventory, tileAlchemicalChest); - } - else if (ID == GuiIds.ALCHEMICAL_BAG) - // TODO Alchemical Bag inventory work is incomplete - return new GuiAlchemicalBag(player.inventory); - else if (ID == GuiIds.ALUDEL) { - TileAludel tileAludel = (TileAludel) world.getBlockTileEntity(x, y, z); - return new GuiAludel(player.inventory, tileAludel); - } - else if (ID == GuiIds.GLASS_BELL) { - TileGlassBell tileGlassBell = (TileGlassBell) world.getBlockTileEntity(x, y, z); - return new GuiGlassBell(player.inventory, tileGlassBell); - } - - return null; - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/EnergyStack.java b/ee3_common/com/pahimar/ee3/core/util/EnergyStack.java deleted file mode 100644 index dc1c46ff..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/EnergyStack.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.pahimar.ee3.core.util; - -public class EnergyStack { - - public static final String VANILLA_SMELTING_ENERGY_NAME = "vanillaFuelValueUnits"; - public static final int VANILLA_SMELTING_ENERGY_THRESHOLD = 200; - - public String energyName; - public int stackSize; - - public EnergyStack(String energyName, int stackSize) { - - this.energyName = energyName; - this.stackSize = stackSize; - } - - public EnergyStack() { - - this("", 0); - } - - public EnergyStack(String energyName) { - - this(energyName, 1); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("%dxenergyStack.%s", stackSize, energyName)); - - return stringBuilder.toString(); - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof EnergyStack)) { - return false; - } - - EnergyStack energyStack = (EnergyStack) object; - - return (this.stackSize == energyStack.stackSize && this.energyName.equalsIgnoreCase(energyStack.energyName)); - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/GeneralHelper.java b/ee3_common/com/pahimar/ee3/core/util/GeneralHelper.java deleted file mode 100644 index fc3cb7c0..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/GeneralHelper.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.IMob; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * Equivalent-Exchange-3 - * - * GeneralHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class GeneralHelper { - - public static ItemStack convertObjectToItemStack(Object obj) { - - if (obj instanceof Item) - return new ItemStack((Item) obj); - else if (obj instanceof Block) - return new ItemStack((Block) obj); - else if (obj instanceof ItemStack) - return (ItemStack) obj; - else - return null; - } - - public static Object[] convertSingleStackToPluralStacks(ItemStack stack) { - - ArrayList list = new ArrayList(); - ItemStack currentStack; - - for (int i = 0; i < stack.stackSize; i++) { - currentStack = new ItemStack(stack.itemID, 1, stack.getItemDamage()); - list.add(currentStack); - } - - return list.toArray(); - } - - public static boolean isHostileEntity(EntityLivingBase entity) { - - if (entity instanceof IMob) - return true; - else - return false; - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/ItemUtil.java b/ee3_common/com/pahimar/ee3/core/util/ItemUtil.java deleted file mode 100644 index d9b4f22d..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/ItemUtil.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.pahimar.ee3.core.util; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; - -import com.pahimar.ee3.item.ModItems; -import com.pahimar.ee3.lib.Colours; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -/** - * Equivalent-Exchange-3 - * - * ItemDropHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemUtil { - - private static double rand; - - public static String toString(ItemStack itemStack) { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append("ItemStack("); - - if (itemStack != null) { - - stringBuilder.append(String.format("%s", encodeItemStackAsString(itemStack))); - - if (itemStack.hasTagCompound()) { - stringBuilder.append(String.format("%s%s", Strings.TOKEN_DELIMITER, NBTHelper.encodeNBTAsString((itemStack.getTagCompound())))); - } - } - else { - stringBuilder.append("null"); - } - - stringBuilder.append(")"); - - return stringBuilder.toString(); - } - - public static String encodeItemStackAsString(ItemStack itemStack) { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("%s%s%s", itemStack.itemID, Strings.TOKEN_DELIMITER, itemStack.getItemDamage())); - - return stringBuilder.toString(); - } - - public static ItemStack decodeItemStackFromString(String encodedItemStack) { - - ItemStack decodedItemStack = null; - - final int UNDEFINED = -1; - final int ERROR = -2; - - int itemId = UNDEFINED; - int meta = UNDEFINED; - - String[] splitString = encodedItemStack.split(Strings.TOKEN_DELIMITER); - - // Grab itemId - if (splitString.length >= 1) { - - try { - itemId = Integer.parseInt(splitString[0]); - } catch (NumberFormatException e) { - itemId = ERROR; - } - } - - // Grab meta - if (splitString.length >= 2) { - - try { - meta = Integer.parseInt(splitString[1]); - } catch (NumberFormatException e) { - meta = ERROR; - } - } - - if (meta == UNDEFINED) { - meta = OreDictionary.WILDCARD_VALUE; - } - - if (itemId != UNDEFINED && itemId != ERROR) { - if (meta != ERROR) { - decodedItemStack = new ItemStack(itemId, 1, meta); - } - } - - return decodedItemStack; - } - - /** - * Compares two ItemStacks for equality, testing itemID, metaData, - * stackSize, and their NBTTagCompounds (if they are present) - * - * @param first - * The first ItemStack being tested for equality - * @param second - * The second ItemStack being tested for equality - * @return true if the two ItemStacks are equivalent, false otherwise - */ - public static boolean compare(ItemStack first, ItemStack second) { - - // Check to see if either argument is null - if ((first != null) && (second != null)) { - // Check the item IDs - if (first.itemID == second.itemID) { - // Check the meta data - - if ((first.getItemDamage() == OreDictionary.WILDCARD_VALUE) || (second.getItemDamage() == OreDictionary.WILDCARD_VALUE)) { - //return true; - } - - if (first.getItemDamage() == second.getItemDamage()) { - // Check the stack size - if (first.stackSize == second.stackSize) { - // If at least one of the ItemStacks has a NBTTagCompound, test for equality - if (first.hasTagCompound() || second.hasTagCompound()) { - - // If one of the stacks has a tag compound, but not both, they are not equal - if (!(first.hasTagCompound() && second.hasTagCompound())) { - return false; - } - // Otherwise, they both have tag compounds and we need to test them for equality - else { - return first.getTagCompound().equals(second.getTagCompound()); - } - } - // Otherwise, they must be equal if we have gotten this far (item IDs, meta data, and stack size all match) - else { - return true; - } - } - } - } - } - - return false; - } - - public static boolean hasColor(ItemStack itemStack) { - - return !itemStack.hasTagCompound() ? false : !itemStack.getTagCompound().hasKey(Strings.NBT_ITEM_DISPLAY) ? false : itemStack.getTagCompound().getCompoundTag(Strings.NBT_ITEM_DISPLAY).hasKey(Strings.NBT_ITEM_COLOR); - } - - public static int getColor(ItemStack itemStack) { - - NBTTagCompound nbtTagCompound = itemStack.getTagCompound(); - - if (nbtTagCompound == null) - return Integer.parseInt(Colours.PURE_WHITE, 16); - else { - - NBTTagCompound displayTagCompound = nbtTagCompound.getCompoundTag(Strings.NBT_ITEM_DISPLAY); - return displayTagCompound == null ? Integer.parseInt(Colours.PURE_WHITE, 16) : displayTagCompound.hasKey(Strings.NBT_ITEM_COLOR) ? displayTagCompound.getInteger(Strings.NBT_ITEM_COLOR) : Integer.parseInt(Colours.PURE_WHITE, 16); - } - } - - public static void setColor(ItemStack itemStack, int color) { - - if (itemStack != null) { - - NBTTagCompound nbtTagCompound = itemStack.getTagCompound(); - - if (nbtTagCompound == null) { - - nbtTagCompound = new NBTTagCompound(); - itemStack.setTagCompound(nbtTagCompound); - } - - NBTTagCompound colourTagCompound = nbtTagCompound.getCompoundTag(Strings.NBT_ITEM_DISPLAY); - - if (!nbtTagCompound.hasKey(Strings.NBT_ITEM_DISPLAY)) { - nbtTagCompound.setCompoundTag(Strings.NBT_ITEM_DISPLAY, colourTagCompound); - } - - colourTagCompound.setInteger(Strings.NBT_ITEM_COLOR, color); - } - } - - public static void dropMiniumShard(EntityPlayer player, EntityLivingBase entity) { - - if (GeneralHelper.isHostileEntity(entity)) { - rand = Math.random(); - - if (rand < 0.15d) { - entity.dropItem(ModItems.miniumShard.itemID, 1); - } - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/KeyBindingUtil.java b/ee3_common/com/pahimar/ee3/core/util/KeyBindingUtil.java deleted file mode 100644 index b4bbf975..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/KeyBindingUtil.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.util.ArrayList; - -import net.minecraft.client.settings.KeyBinding; - -import com.pahimar.ee3.configuration.ConfigurationSettings; - -/** - * Equivalent-Exchange-3 - * - * KeyBindingHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class KeyBindingUtil { - - public static ArrayList keyBindingsList; - public static ArrayList isRepeatingList; - - public static void addKeyBinding(String name, int value) { - - if (keyBindingsList == null) { - keyBindingsList = new ArrayList(); - } - - keyBindingsList.add(new KeyBinding(name, value)); - } - - public static void addIsRepeating(boolean value) { - - if (isRepeatingList == null) { - isRepeatingList = new ArrayList(); - } - - isRepeatingList.add(value); - } - - public static KeyBinding[] gatherKeyBindings() { - - return keyBindingsList.toArray(new KeyBinding[keyBindingsList.size()]); - } - - public static boolean[] gatherIsRepeating() { - - boolean[] isRepeating = new boolean[isRepeatingList.size()]; - - for (int x = 0; x < isRepeating.length; x++) { - isRepeating[x] = isRepeatingList.get(x).booleanValue(); - } - - return isRepeating; - } - - // TODO Still not ideal, won't work for every case. Specifically, make it context sensitive - public static boolean isClientSided(String keybinding) { - - if (keybinding.equalsIgnoreCase(ConfigurationSettings.KEYBINDING_TOGGLE)) - return true; - else - return false; - } -} diff --git a/ee3_common/com/pahimar/ee3/core/util/LocalizationUtil.java b/ee3_common/com/pahimar/ee3/core/util/LocalizationUtil.java deleted file mode 100644 index 44a840b8..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/LocalizationUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.pahimar.ee3.core.util; - -import cpw.mods.fml.common.registry.LanguageRegistry; - -/** - * Equivalent-Exchange-3 - * - * LocalizationHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class LocalizationUtil { - - /*** - * Simple test to determine if a specified file name represents a XML file - * or not - * - * @param fileName - * String representing the file name of the file in question - * @return True if the file name represents a XML file, false otherwise - */ - public static boolean isXMLLanguageFile(String fileName) { - - return fileName.endsWith(".xml"); - } - - /*** - * Returns the locale from file name - * - * @param fileName - * String representing the file name of the file in question - * @return String representation of the locale snipped from the file name - */ - public static String getLocaleFromFileName(String fileName) { - - return fileName.substring(fileName.lastIndexOf('/') + 1, fileName.lastIndexOf('.')); - } - - public static String getLocalizedString(String key) { - - return LanguageRegistry.instance().getStringLocalization(key); - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/LogHelper.java b/ee3_common/com/pahimar/ee3/core/util/LogHelper.java deleted file mode 100644 index 7cb52574..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/LogHelper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.pahimar.ee3.lib.Reference; - -import cpw.mods.fml.common.FMLLog; - -/** - * Equivalent-Exchange-3 - * - * LogHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class LogHelper { - - private static Logger eeLogger = Logger.getLogger(Reference.MOD_ID); - - public static void init() { - - eeLogger.setParent(FMLLog.getLogger()); - } - - public static void log(Level logLevel, String message) { - - eeLogger.log(logLevel, message); - } - - public static void severe(String message) { - - log(Level.SEVERE, message); - } - - public static void debug(String message) { - - log(Level.WARNING, "[DEBUG] " + message); - } - - public static void warning(String message) { - - log(Level.WARNING, message); - } - - public static void info(String message) { - - log(Level.INFO, message); - } - - public static void config(String message) { - - log(Level.CONFIG, message); - } - - public static void fine(String message) { - - log(Level.FINE, message); - } - - public static void finer(String message) { - - log(Level.FINER, message); - } - - public static void finest(String message) { - - log(Level.FINEST, message); - } -} diff --git a/ee3_common/com/pahimar/ee3/core/util/OreStack.java b/ee3_common/com/pahimar/ee3/core/util/OreStack.java deleted file mode 100644 index da143c7e..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/OreStack.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.util.ArrayList; -import java.util.Comparator; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class OreStack implements Comparator { - - public String oreName; - public int stackSize; - - public OreStack() { - - stackSize = 0; - oreName = null; - } - - public OreStack(String oreName, int stackSize) { - - this.oreName = oreName; - this.stackSize = stackSize; - } - - public OreStack(String oreName) { - - this(oreName, 1); - } - - public OreStack(int oreID) { - - this(OreDictionary.getOreName(oreID)); - } - - public OreStack(int oreID, int stackSize) { - - this(OreDictionary.getOreName(oreID), stackSize); - } - - public OreStack(ItemStack itemStack) { - - this(OreDictionary.getOreID(itemStack), itemStack.stackSize); - } - - public ArrayList getOres() { - - return OreDictionary.getOres(oreName); - } - - public int getOreID() { - - return OreDictionary.getOreID(oreName); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("%dxoreDictionary.%s", stackSize, oreName)); - - return stringBuilder.toString(); - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof OreStack)) - return false; - - OreStack oreStackObject = (OreStack) object; - - return stackSize == oreStackObject.stackSize && oreName.equals(oreStackObject.oreName); - } - - @Override - public int compare(OreStack oreStack1, OreStack oreStack2) { - - if (oreStack1 != null && oreStack2 != null) { - if (oreStack1.oreName.equals(oreStack2.oreName)) - return 0; - } - - return -1; - } - - public static boolean compareStacks(OreStack oreStack1, OreStack oreStack2) { - - return oreStack1.compareToStack(oreStack2); - } - - public boolean compareToStack(OreStack oreStack) { - - return compare(this, oreStack) == 0; - } -} diff --git a/ee3_common/com/pahimar/ee3/core/util/QualityHelper.java b/ee3_common/com/pahimar/ee3/core/util/QualityHelper.java deleted file mode 100644 index 72aab085..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/QualityHelper.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.pahimar.ee3.core.util; - -import net.minecraft.item.ItemStack; - -/** - * Equivalent-Exchange-3 - * - * QualityHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class QualityHelper { - - private static int[][] dustTable = { { 0, 0, 0, 1, 1, 1 }, { 0, 1, 1, 1, 2, 2 }, { 0, 1, 2, 2, 2, 2 }, { 1, 1, 2, 3, 3, 3 }, { 1, 2, 2, 3, 4, 4 }, { 1, 2, 2, 3, 4, 5 }, }; - - public static int getItemTierQuality(ItemStack item) { - - // TODO Return the 'Tier' level of the given ItemStack - return -1; - } - - public static int getFuelTierQuality(ItemStack fuel) { - - // TODO Return the 'Tier' level of the given ItemStack - return -1; - } - - public static int getDustTierQuality(ItemStack item, ItemStack fuel) { - - if (getItemTierQuality(item) >= 0 && getItemTierQuality(item) <= 5) { - if (getFuelTierQuality(fuel) >= 0 && getFuelTierQuality(fuel) <= 5) - return dustTable[getItemTierQuality(item)][getFuelTierQuality(fuel)]; - } - - return -1; - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/RecipeHelper.java b/ee3_common/com/pahimar/ee3/core/util/RecipeHelper.java deleted file mode 100644 index 8e616bf9..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/RecipeHelper.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.item.crafting.ShapedRecipes; -import net.minecraft.item.crafting.ShapelessRecipes; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; - -import com.pahimar.ee3.item.CustomWrappedStack; - -/** - * Equivalent-Exchange-3 - * - * RecipeHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class RecipeHelper { - - /** - * Discovers all instances of ItemStacks with wild card meta values in the - * vanilla Crafting Manager - * - * @return A list of CustomWrappedStacks that contains all wild card meta - * ItemStacks in the vanilla Crafting Manager - */ - public static ArrayList populateWildCards() { - - ArrayList wildCards = new ArrayList(); - - for (Object recipe : CraftingManager.getInstance().getRecipeList()) { - - if (recipe instanceof IRecipe) { - - if (((IRecipe) recipe).getRecipeOutput() instanceof ItemStack) { - - CustomWrappedStack recipeOutput = new CustomWrappedStack(((IRecipe) recipe).getRecipeOutput()); - ArrayList recipeInputs = RecipeHelper.getRecipeInputs((IRecipe) recipe); - ItemStack itemStack = null; - - if (recipeOutput.getWrappedStack() instanceof ItemStack) { - - itemStack = (ItemStack) recipeOutput.getWrappedStack(); - - if (itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && !wildCards.contains(recipeOutput)) { - wildCards.add(recipeOutput); - } - } - - for (CustomWrappedStack inputStack : recipeInputs) { - - if (inputStack.getWrappedStack() instanceof ItemStack) { - - itemStack = (ItemStack) inputStack.getWrappedStack(); - - if (itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE && !wildCards.contains(inputStack)) { - wildCards.add(inputStack); - } - } - } - } - } - } - - return wildCards; - } - - /** - * Returns a list of elements that constitute the input in a crafting recipe - * - * @param recipe - * The IRecipe being examined - * @return List of elements that constitute the input of the given IRecipe. - * Could be an ItemStack or an Arraylist - */ - public static ArrayList getRecipeInputs(IRecipe recipe) { - - ArrayList recipeInputs = new ArrayList(); - - if (recipe instanceof ShapedRecipes) { - - ShapedRecipes shapedRecipe = (ShapedRecipes) recipe; - - for (int i = 0; i < shapedRecipe.recipeItems.length; i++) { - - if (shapedRecipe.recipeItems[i] instanceof ItemStack) { - - ItemStack itemStack = shapedRecipe.recipeItems[i].copy(); - - if (itemStack.stackSize > 1) { - itemStack.stackSize = 1; - } - - recipeInputs.add(new CustomWrappedStack(itemStack)); - } - } - } - else if (recipe instanceof ShapelessRecipes) { - - ShapelessRecipes shapelessRecipe = (ShapelessRecipes) recipe; - - for (Object object : shapelessRecipe.recipeItems) { - - if (object instanceof ItemStack) { - - ItemStack itemStack = ((ItemStack) object).copy(); - - if (itemStack.stackSize > 1) { - itemStack.stackSize = 1; - } - - recipeInputs.add(new CustomWrappedStack(itemStack)); - } - } - } - else if (recipe instanceof ShapedOreRecipe) { - - ShapedOreRecipe shapedOreRecipe = (ShapedOreRecipe) recipe; - - for (int i = 0; i < shapedOreRecipe.getInput().length; i++) { - - /* - * If the element is a list, then it is an OreStack - */ - if (shapedOreRecipe.getInput()[i] instanceof ArrayList) { - CustomWrappedStack oreStack = new CustomWrappedStack(shapedOreRecipe.getInput()[i]); - - if (oreStack.getWrappedStack() instanceof OreStack) { - recipeInputs.add(new CustomWrappedStack(shapedOreRecipe.getInput()[i])); - } - } - else if (shapedOreRecipe.getInput()[i] instanceof ItemStack) { - - ItemStack itemStack = ((ItemStack) shapedOreRecipe.getInput()[i]).copy(); - - if (itemStack.stackSize > 1) { - itemStack.stackSize = 1; - } - - recipeInputs.add(new CustomWrappedStack(itemStack)); - } - } - } - else if (recipe instanceof ShapelessOreRecipe) { - - ShapelessOreRecipe shapelessOreRecipe = (ShapelessOreRecipe) recipe; - - for (Object object : shapelessOreRecipe.getInput()) { - - if (object instanceof ArrayList) { - recipeInputs.add(new CustomWrappedStack(object)); - } - else if (object instanceof ItemStack) { - - ItemStack itemStack = ((ItemStack) object).copy(); - - if (itemStack.stackSize > 1) { - itemStack.stackSize = 1; - } - - recipeInputs.add(new CustomWrappedStack(itemStack)); - } - } - } - - return recipeInputs; - } -} diff --git a/ee3_common/com/pahimar/ee3/core/util/ResourceLocationHelper.java b/ee3_common/com/pahimar/ee3/core/util/ResourceLocationHelper.java deleted file mode 100644 index 148c51da..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/ResourceLocationHelper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.pahimar.ee3.core.util; - -import com.pahimar.ee3.lib.Reference; - -import net.minecraft.util.ResourceLocation; - -public class ResourceLocationHelper { - - public static ResourceLocation getResourceLocation(String path) { - - return new ResourceLocation(Reference.MOD_ID.toLowerCase(), path); - } -} diff --git a/ee3_common/com/pahimar/ee3/core/util/TransmutationHelper.java b/ee3_common/com/pahimar/ee3/core/util/TransmutationHelper.java deleted file mode 100644 index a62d2584..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/TransmutationHelper.java +++ /dev/null @@ -1,146 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import com.pahimar.ee3.core.handlers.EquivalencyHandler; - -/** - * Equivalent-Exchange-3 - * - * TransmutationHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class TransmutationHelper { - - public static ItemStack previousBlockStack = null; - public static ItemStack currentBlockStack = null; - public static ItemStack targetBlockStack = null; - - public static boolean transmuteInWorld(World world, EntityPlayer player, ItemStack stack, int x, int y, int z, int targetID, int targetMeta) { - - if (Block.blocksList[targetID] != null) { - world.setBlock(x, y, z, targetID, targetMeta, 2); - return true; - } - - return false; - } - - public static String formatTargetBlockInfo(ItemStack targetBlock) { - - if (targetBlock != null) - return TransmutationHelper.targetBlockStack.itemID + ":" + TransmutationHelper.targetBlockStack.getItemDamage(); - else - return ""; - } - - public static void updateTargetBlock(World world, int x, int y, int z) { - - int id = world.getBlockId(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - Block currentBlock = Block.blocksList[id]; - - if (currentBlock != null) { - meta = currentBlock.damageDropped(meta); - - currentBlockStack = new ItemStack(id, 1, meta); - - if (previousBlockStack == null) { - previousBlockStack = currentBlockStack; - targetBlockStack = getNextBlock(currentBlockStack.itemID, currentBlockStack.getItemDamage()); - } - else { - if (!EquivalencyHandler.instance().areEquivalent(TransmutationHelper.previousBlockStack, currentBlockStack)) { - previousBlockStack = currentBlockStack; - targetBlockStack = getNextBlock(currentBlockStack.itemID, currentBlockStack.getItemDamage()); - } - } - } - } - - public static ItemStack getNextBlock(int id, int meta) { - - ArrayList list = EquivalencyHandler.instance().getEquivalencyList(id, meta); - - ItemStack nextStack = null; - - if (list != null) - return getNextBlock(id, meta, id, meta); - return nextStack; - } - - private static ItemStack getNextBlock(int id, int meta, int origId, int origMeta) { - - ArrayList list = EquivalencyHandler.instance().getEquivalencyList(id, meta); - - ItemStack nextStack = null; - - if (list != null) { - nextStack = EquivalencyHandler.instance().getNextInList(id, meta); - nextStack.stackSize = 1; - - /* - * If the current item is the same as the original one we started - * with, then we have recursed through the entire list and not found - * a next block so return the original. This is the "base case" for - * the recursion. - */ - if (nextStack.itemID == origId && nextStack.getItemDamage() == origMeta) - return nextStack; - else { - if (nextStack.getItem() instanceof ItemBlock) - return nextStack; - else - return getNextBlock(nextStack.itemID, nextStack.getItemDamage(), origId, origMeta); - } - } - - // In the event the list is null, return null - return nextStack; - } - - public static ItemStack getPreviousBlock(int itemID, int meta) { - - ArrayList list = EquivalencyHandler.instance().getEquivalencyList(itemID, meta); - - ItemStack prevStack = null; - - if (list != null) - return getPreviousBlock(itemID, meta, itemID, meta); - return prevStack; - } - - private static ItemStack getPreviousBlock(int id, int meta, int origId, int origMeta) { - - ArrayList list = EquivalencyHandler.instance().getEquivalencyList(id, meta); - - ItemStack prevStack = null; - if (list != null) { - prevStack = EquivalencyHandler.instance().getPrevInList(id, meta); - prevStack.stackSize = 1; - - if (prevStack.itemID == origId && prevStack.getItemDamage() == origMeta) - return prevStack; - else { - if (prevStack.getItem() instanceof ItemBlock) - return prevStack; - else - return getPreviousBlock(prevStack.itemID, prevStack.getItemDamage(), origId, origMeta); - } - } - - // In the event the list is null, return null - return prevStack; - } - -} diff --git a/ee3_common/com/pahimar/ee3/core/util/VersionHelper.java b/ee3_common/com/pahimar/ee3/core/util/VersionHelper.java deleted file mode 100644 index 1631b601..00000000 --- a/ee3_common/com/pahimar/ee3/core/util/VersionHelper.java +++ /dev/null @@ -1,224 +0,0 @@ -package com.pahimar.ee3.core.util; - -import java.io.InputStream; -import java.net.URL; -import java.util.Properties; - -import net.minecraftforge.common.Configuration; - -import com.pahimar.ee3.configuration.ConfigurationHandler; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.lib.Colours; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.lib.Strings; - -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.LanguageRegistry; - -/** - * Equivalent-Exchange-3 - * - * VersionHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class VersionHelper implements Runnable { - - private static VersionHelper instance = new VersionHelper(); - - // The (publicly available) remote version number authority file - private static final String REMOTE_VERSION_XML_FILE = "https://raw.github.com/pahimar/Equivalent-Exchange-3/master/version.xml"; - - public static Properties remoteVersionProperties = new Properties(); - - // All possible results of the remote version number check - public static final byte UNINITIALIZED = 0; - public static final byte CURRENT = 1; - public static final byte OUTDATED = 2; - public static final byte ERROR = 3; - public static final byte FINAL_ERROR = 4; - public static final byte MC_VERSION_NOT_FOUND = 5; - - // Var to hold the result of the remote version check, initially set to uninitialized - private static byte result = UNINITIALIZED; - public static String remoteVersion = null; - public static String remoteUpdateLocation = null; - - /*** - * Checks the version of the currently running instance of the mod against - * the remote version authority, and sets the result of the check - * appropriately - */ - public static void checkVersion() { - - InputStream remoteVersionRepoStream = null; - result = UNINITIALIZED; - - try { - URL remoteVersionURL = new URL(REMOTE_VERSION_XML_FILE); - remoteVersionRepoStream = remoteVersionURL.openStream(); - remoteVersionProperties.loadFromXML(remoteVersionRepoStream); - - String remoteVersionProperty = remoteVersionProperties.getProperty(Loader.instance().getMCVersionString()); - - if (remoteVersionProperty != null) { - String[] remoteVersionTokens = remoteVersionProperty.split("\\|"); - - if (remoteVersionTokens.length >= 2) { - remoteVersion = remoteVersionTokens[0]; - remoteUpdateLocation = remoteVersionTokens[1]; - } - else { - result = ERROR; - } - - if (remoteVersion != null) { - if (!ConfigurationSettings.LAST_DISCOVERED_VERSION.equalsIgnoreCase(remoteVersion)) { - ConfigurationHandler.set(Configuration.CATEGORY_GENERAL, ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME, remoteVersion); - } - - if (remoteVersion.equalsIgnoreCase(getVersionForCheck())) { - result = CURRENT; - } - else { - result = OUTDATED; - } - } - - } - else { - result = MC_VERSION_NOT_FOUND; - } - } - catch (Exception e) { - } - finally { - if (result == UNINITIALIZED) { - result = ERROR; - } - - try { - if (remoteVersionRepoStream != null) { - remoteVersionRepoStream.close(); - } - } - catch (Exception ex) { - } - } - } - - private static String getVersionForCheck() { - - String[] versionTokens = Reference.VERSION_NUMBER.split(" "); - - if (versionTokens.length >= 1) - return versionTokens[0]; - else - return Reference.VERSION_NUMBER; - } - - public static void logResult() { - - if (result == CURRENT || result == OUTDATED) { - LogHelper.info(getResultMessage()); - } - else { - LogHelper.warning(getResultMessage()); - } - } - - public static String getResultMessage() { - - if (result == UNINITIALIZED) - return LanguageRegistry.instance().getStringLocalization(Strings.UNINITIALIZED_MESSAGE); - else if (result == CURRENT) { - String returnString = LanguageRegistry.instance().getStringLocalization(Strings.CURRENT_MESSAGE); - returnString = returnString.replace("@REMOTE_MOD_VERSION@", remoteVersion); - returnString = returnString.replace("@MINECRAFT_VERSION@", Loader.instance().getMCVersionString()); - return returnString; - } - else if (result == OUTDATED && remoteVersion != null && remoteUpdateLocation != null) { - String returnString = LanguageRegistry.instance().getStringLocalization(Strings.OUTDATED_MESSAGE); - returnString = returnString.replace("@MOD_NAME@", Reference.MOD_NAME); - returnString = returnString.replace("@REMOTE_MOD_VERSION@", remoteVersion); - returnString = returnString.replace("@MINECRAFT_VERSION@", Loader.instance().getMCVersionString()); - returnString = returnString.replace("@MOD_UPDATE_LOCATION@", remoteUpdateLocation); - return returnString; - } - else if (result == OUTDATED && remoteVersion != null && remoteUpdateLocation != null) { - String returnString = LanguageRegistry.instance().getStringLocalization(Strings.OUTDATED_MESSAGE); - returnString = returnString.replace("@MOD_NAME@", Reference.MOD_NAME); - returnString = returnString.replace("@REMOTE_MOD_VERSION@", remoteVersion); - returnString = returnString.replace("@MINECRAFT_VERSION@", Loader.instance().getMCVersionString()); - returnString = returnString.replace("@MOD_UPDATE_LOCATION@", remoteUpdateLocation); - return returnString; - } - else if (result == ERROR) - return LanguageRegistry.instance().getStringLocalization(Strings.GENERAL_ERROR_MESSAGE); - else if (result == FINAL_ERROR) - return LanguageRegistry.instance().getStringLocalization(Strings.FINAL_ERROR_MESSAGE); - else if (result == MC_VERSION_NOT_FOUND) { - String returnString = LanguageRegistry.instance().getStringLocalization(Strings.MC_VERSION_NOT_FOUND); - returnString = returnString.replace("@MOD_NAME@", Reference.MOD_NAME); - returnString = returnString.replace("@MINECRAFT_VERSION@", Loader.instance().getMCVersionString()); - return returnString; - } - else { - result = ERROR; - return LanguageRegistry.instance().getStringLocalization(Strings.GENERAL_ERROR_MESSAGE); - } - } - - public static String getResultMessageForClient() { - - String returnString = LanguageRegistry.instance().getStringLocalization(Strings.OUTDATED_MESSAGE); - returnString = returnString.replace("@MOD_NAME@", Colours.TEXT_COLOUR_PREFIX_YELLOW + Reference.MOD_NAME + Colours.TEXT_COLOUR_PREFIX_WHITE); - returnString = returnString.replace("@REMOTE_MOD_VERSION@", Colours.TEXT_COLOUR_PREFIX_YELLOW + VersionHelper.remoteVersion + Colours.TEXT_COLOUR_PREFIX_WHITE); - returnString = returnString.replace("@MINECRAFT_VERSION@", Colours.TEXT_COLOUR_PREFIX_YELLOW + Loader.instance().getMCVersionString() + Colours.TEXT_COLOUR_PREFIX_WHITE); - returnString = returnString.replace("@MOD_UPDATE_LOCATION@", Colours.TEXT_COLOUR_PREFIX_YELLOW + VersionHelper.remoteUpdateLocation + Colours.TEXT_COLOUR_PREFIX_WHITE); - return returnString; - } - - public static byte getResult() { - - return result; - } - - @Override - public void run() { - - int count = 0; - - LogHelper.info(LanguageRegistry.instance().getStringLocalization(Strings.VERSION_CHECK_INIT_LOG_MESSAGE) + " " + REMOTE_VERSION_XML_FILE); - - try { - while (count < Reference.VERSION_CHECK_ATTEMPTS - 1 && (result == UNINITIALIZED || result == ERROR)) { - - checkVersion(); - count++; - logResult(); - - if (result == UNINITIALIZED || result == ERROR) { - Thread.sleep(10000); - } - } - - if (result == ERROR) { - result = FINAL_ERROR; - logResult(); - } - } - catch (InterruptedException e) { - e.printStackTrace(); - } - - } - - public static void execute() { - - new Thread(instance).start(); - } - -} diff --git a/ee3_common/com/pahimar/ee3/creativetab/CreativeTabEE3.java b/ee3_common/com/pahimar/ee3/creativetab/CreativeTabEE3.java deleted file mode 100644 index b8e27ccd..00000000 --- a/ee3_common/com/pahimar/ee3/creativetab/CreativeTabEE3.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.pahimar.ee3.creativetab; - -import net.minecraft.creativetab.CreativeTabs; - -import com.pahimar.ee3.lib.ItemIds; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * CreativeTabEE3 - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CreativeTabEE3 extends CreativeTabs { - - public CreativeTabEE3(int par1, String par2Str) { - - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * the itemID for the item to be displayed on the tab - */ - public int getTabIconItemIndex() { - - return ItemIds.MINIUM_SHARD; - } - -} diff --git a/ee3_common/com/pahimar/ee3/emc/DynEMC.java b/ee3_common/com/pahimar/ee3/emc/DynEMC.java deleted file mode 100644 index f5891f8d..00000000 --- a/ee3_common/com/pahimar/ee3/emc/DynEMC.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.pahimar.ee3.emc; - -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Set; - -import com.google.common.collect.Multimap; -import com.pahimar.ee3.core.util.LogHelper; -import com.pahimar.ee3.emc.graph.WeightedDirectedGraph; -import com.pahimar.ee3.emc.graph.WeightedEdge; -import com.pahimar.ee3.item.CustomWrappedStack; -import com.pahimar.ee3.item.crafting.RecipeRegistry; - -public class DynEMC { - - private static DynEMC dynEMC = null; - - private RecipeRegistry recipeRegistry; - private WeightedDirectedGraph graph; - - private DynEMC() { - - recipeRegistry = RecipeRegistry.getInstance(); - graph = new WeightedDirectedGraph(); - - init(); - } - - public static DynEMC getInstance() { - - if (dynEMC == null) { - dynEMC = new DynEMC(); - } - - return dynEMC; - } - - private void init() { - - populateGraph(); - } - - private void populateGraph() { - - for (CustomWrappedStack discoveredStack : recipeRegistry.getDiscoveredStacks()) { - graph.addNode(discoveredStack); - } - - Multimap> recipeMappings = recipeRegistry.getRecipeMappings(); - - Set recipeKeySet = recipeMappings.keySet(); - Iterator recipeKeySetIterator = recipeKeySet.iterator(); - CustomWrappedStack recipeOutput = null; - - while (recipeKeySetIterator.hasNext()) { - recipeOutput = recipeKeySetIterator.next(); - - for (List recipeInputs : recipeMappings.get(recipeOutput)) { - - CustomWrappedStack unWrappedRecipeOutput = new CustomWrappedStack(recipeOutput.getWrappedStack()); - - if (graph.nodeExists(unWrappedRecipeOutput)) { - for (CustomWrappedStack recipeInput : recipeInputs) { - - // Unwrapped the wrapped stacks so that we actually find them in the graph - - CustomWrappedStack unWrappedRecipeInput = new CustomWrappedStack(recipeInput.getWrappedStack()); - - if (graph.nodeExists(unWrappedRecipeInput)) { - if (recipeOutput.getStackSize() != 0) { - try { - graph.addEdge(unWrappedRecipeOutput, unWrappedRecipeInput, (recipeInput.getStackSize() * 1.0f) / recipeOutput.getStackSize()); - } catch (NoSuchElementException e) { - LogHelper.severe(e.getLocalizedMessage()); - } - } - } - else { - LogHelper.debug("Recipe output '" + unWrappedRecipeOutput.toString() + "' exists in the crafting relationship graph"); - LogHelper.debug("Recipe input '" + unWrappedRecipeInput.toString() + "' does not exist in the crafting relationship graph"); - } - } - } - else { - LogHelper.debug("Recipe output '" + unWrappedRecipeOutput.toString() + "' does not exist in the crafting relationship graph"); - } - } - } - } - - public List getCriticalNodes() { - - return graph.getCriticalNodes(); - } - - public int size() { - - return graph.size(); - } - - public void printDebugDump() { - - LogHelper.debug("Total node count: " + graph.getAllNodes().size()); - LogHelper.debug("Critical node count: " + graph.getCriticalNodes().size()); - LogHelper.debug("Orphan node count: " + graph.getOrphanNodes().size()); - - List critsMinusOrphans = graph.getCriticalNodes(); - critsMinusOrphans.removeAll(graph.getOrphanNodes()); - - LogHelper.debug("[Critical - Orphans] node count: " + critsMinusOrphans.size()); - - LogHelper.debug("***** START NODES *****"); - Iterator nodeIter = graph.iterator(); - while (nodeIter.hasNext()) { - CustomWrappedStack node = nodeIter.next(); - LogHelper.debug("Node: " + node); - } - LogHelper.debug("***** END NODES *****"); - - LogHelper.debug("***** START EDGES FROM *****"); - nodeIter = graph.iterator(); - while (nodeIter.hasNext()) { - CustomWrappedStack node = nodeIter.next(); - Set> edgesFrom = graph.edgesFrom(node); - for (WeightedEdge edge : edgesFrom) { - LogHelper.debug("Crafting Output: " + node); - LogHelper.debug("Crafting Input: " + edge.getTarget()); - LogHelper.debug("Weight: " + edge.getWeight()); - LogHelper.debug(""); - } - } - LogHelper.debug("***** END EDGES FROM *****"); - - LogHelper.debug("***** START EDGES TO *****"); - nodeIter = graph.iterator(); - while (nodeIter.hasNext()) { - CustomWrappedStack node = nodeIter.next(); - Set> edgesTo = graph.edgesTo(node); - Iterator> edgeIter = edgesTo.iterator(); - while (edgeIter.hasNext()) { - WeightedEdge edge = edgeIter.next(); - LogHelper.debug("From: " + node); - LogHelper.debug("To: " + edge.getTarget()); - LogHelper.debug("Weight: " + edge.getWeight()); - LogHelper.debug(""); - } - } - LogHelper.debug("***** END EDGES TO *****"); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("DynEMC Node Count: %s", graph.size())); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/EmcBlackList.java b/ee3_common/com/pahimar/ee3/emc/EmcBlackList.java deleted file mode 100644 index 0e64eb56..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EmcBlackList.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.pahimar.ee3.emc; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; - -import com.pahimar.ee3.item.CustomWrappedStack; - -public class EmcBlackList { - - private static EmcBlackList emcBlackList = null; - - private ArrayList stackBlackList = new ArrayList(); - - private EmcBlackList() { - - } - - public static EmcBlackList getInstance() { - - if (emcBlackList == null) { - - emcBlackList = new EmcBlackList(); - emcBlackList.init(); - } - - return emcBlackList; - } - - public List getBlackList() { - - return stackBlackList; - } - - public boolean add(Object object) { - - boolean wasAdded = false; - - if (CustomWrappedStack.canBeWrapped(object)) { - - CustomWrappedStack wrappedStack = new CustomWrappedStack(object); - wrappedStack.setStackSize(1); - - if (!stackBlackList.contains(wrappedStack)) { - stackBlackList.add(wrappedStack); - wasAdded = true; - } - } - - return wasAdded; - } - - public boolean contains(Object object) { - - if (CustomWrappedStack.canBeWrapped(object)) { - - CustomWrappedStack wrappedStack = new CustomWrappedStack(object); - wrappedStack.setStackSize(1); - - return stackBlackList.contains(wrappedStack); - } - - return false; - } - - public boolean remove(Object object) { - - boolean wasRemoved = false; - - if (CustomWrappedStack.canBeWrapped(object)) { - - CustomWrappedStack wrappedStack = new CustomWrappedStack(object); - wrappedStack.setStackSize(1); - - if (stackBlackList.contains(wrappedStack)) { - stackBlackList.remove(wrappedStack); - wasRemoved = true; - } - } - - return wasRemoved; - } - - private void init() { - - add(Block.bed); - add(Block.pistonExtension); - add(Block.pistonMoving); - add(Block.mobSpawner); - add(Block.redstoneWire); - add(Block.crops); - add(Block.furnaceBurning); - add(Block.signPost); - add(Block.doorWood); - add(Block.signWall); - add(Block.doorIron); - add(Block.torchRedstoneIdle); - add(Block.reed); - add(Block.portal); - add(Block.cake); - add(Block.redstoneRepeaterIdle); - add(Block.redstoneRepeaterActive); - add(Block.lockedChest); - add(Block.pumpkinStem); - add(Block.melonStem); - add(Block.netherStalk); - add(Block.brewingStand); - add(Block.cauldron); - add(Block.endPortal); - add(Block.redstoneLampActive); - add(Block.commandBlock); - add(Block.carrot); - add(Block.potato); - add(Block.skull); - add(Block.redstoneComparatorIdle); - add(Block.redstoneComparatorActive); - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/EmcComponent.java b/ee3_common/com/pahimar/ee3/emc/EmcComponent.java deleted file mode 100644 index 13c6fc9b..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EmcComponent.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.pahimar.ee3.emc; - -public class EmcComponent { - - private final EmcType emcType; - private final float percentage; - - public EmcComponent(EmcType emcType, float percentage) { - - this.emcType = emcType; - this.percentage = percentage; - } - - public EmcType getEmcType() { - - return emcType; - } - - public float getPercentage() { - - return percentage; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof EmcComponent)) { - - return false; - } - - EmcComponent emcBreakDown = (EmcComponent) object; - - return ((this.emcType == emcBreakDown.emcType) && (this.percentage == emcBreakDown.percentage)); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("", emcType, (percentage * 100))); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/EmcDefaultValues.java b/ee3_common/com/pahimar/ee3/emc/EmcDefaultValues.java deleted file mode 100644 index cac65ca2..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EmcDefaultValues.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.pahimar.ee3.emc; - -import java.util.HashMap; -import java.util.List; - -import com.pahimar.ee3.item.CustomWrappedStack; - -public class EmcDefaultValues { - - private static HashMap> defaultEmcValues = new HashMap>(); - - public static void init() { - - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/EmcMap.java b/ee3_common/com/pahimar/ee3/emc/EmcMap.java deleted file mode 100644 index 548ce166..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EmcMap.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.pahimar.ee3.emc; - -import java.util.HashMap; - -import com.pahimar.ee3.item.CustomWrappedStack; - -public class EmcMap { - - private static EmcMap emcMap = null; - - private HashMap emcMappings; - - private EmcMap() { - - emcMappings = new HashMap(); - } - - public static EmcMap getInstance() { - - if (emcMap == null) { - emcMap = new EmcMap(); - } - - return emcMap; - } - - public EmcValue getEmcValue(Object object) { - - EmcValue emcValue = null; - - if (CustomWrappedStack.canBeWrapped(object)) { - return emcMappings.get(new CustomWrappedStack(object)); - } - - return emcValue; - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/EmcType.java b/ee3_common/com/pahimar/ee3/emc/EmcType.java deleted file mode 100644 index 9630fe8c..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EmcType.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.pahimar.ee3.emc; - -public enum EmcType { - CORPOREAL, KINETIC, TEMPORAL, ESSENTIA, AMORPHOUS, VOID, OMNI; -} diff --git a/ee3_common/com/pahimar/ee3/emc/EmcValue.java b/ee3_common/com/pahimar/ee3/emc/EmcValue.java deleted file mode 100644 index 19f02442..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EmcValue.java +++ /dev/null @@ -1,161 +0,0 @@ -package com.pahimar.ee3.emc; - -import java.util.ArrayList; -import java.util.List; - -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * EMCEntry - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class EmcValue { - - private float value, recoveryPercentage; - private List emcComponents; - - public EmcValue() { - - value = 0F; - recoveryPercentage = 1F; - emcComponents = new ArrayList(); - } - - public EmcValue(float value) { - - this.value = value; - recoveryPercentage = 1F; - emcComponents = new ArrayList(); - } - - public EmcValue(float value, float recoveryPercentage) { - - this.value = value; - this.recoveryPercentage = recoveryPercentage; - emcComponents = new ArrayList(); - } - - public EmcValue(float value, float recoveryPercentage, List emcComponents) { - - this.value = value; - this.recoveryPercentage = recoveryPercentage; - this.emcComponents = emcComponents; - } - - public float getValue() { - - return value; - } - - public float getRecoveryPercentage() { - - return recoveryPercentage; - } - - public List getComponents() { - - return emcComponents; - } - - public EmcComponent getComponent(EmcType emcType) { - - for (EmcComponent emcComponent : emcComponents) { - if (emcComponent.getEmcType().equals(emcType)) { - return emcComponent; - } - } - - return null; - } - - public boolean containsEmcType(EmcType emcType) { - - for (EmcComponent emcComponent : emcComponents) { - if (emcComponent.getEmcType().equals(emcType)) { - return true; - } - } - - return false; - } - - public void setValue(float cost) { - - this.value = cost; - } - - public void setRecoveryPercentage(float recoveryPercentage) { - - this.recoveryPercentage = recoveryPercentage; - } - - public void addEmcComponent(EmcComponent emcComponent) { - - if (!containsEmcType(emcComponent.getEmcType())) { - emcComponents.add(emcComponent); - } - } - - public void addEmcComponent(EmcType emcType, float percentage) { - - addEmcComponent(new EmcComponent(emcType, percentage)); - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof EmcValue)) { - return false; - } - - EmcValue emcValue = (EmcValue) object; - - if (value == emcValue.value) { - if (recoveryPercentage == emcValue.recoveryPercentage) { - return emcComponents.equals(emcValue.getComponents()); - } - } - - return false; - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("V:%s", value)); - stringBuilder.append(Strings.TOKEN_DELIMITER); - stringBuilder.append(String.format("RP:%s", recoveryPercentage)); - stringBuilder.append(Strings.TOKEN_DELIMITER); - stringBuilder.append("["); - - for (int i = 0; i < emcComponents.size(); i++) { - if (i > 0) { - stringBuilder.append(Strings.TOKEN_DELIMITER); - } - stringBuilder.append(String.format("%s:%s", emcComponents.get(i).getEmcType(), emcComponents.get(i).getPercentage())); - } - - stringBuilder.append("]"); - - return stringBuilder.toString(); - } - - @Override - public int hashCode() { - - int hashCode = 1; - - hashCode = 37 * hashCode + Float.floatToIntBits(value); - hashCode = 37 * hashCode + Float.floatToIntBits(recoveryPercentage); - hashCode = 37 * hashCode + emcComponents.hashCode(); - - return hashCode; - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/EquivalencyGroup.java b/ee3_common/com/pahimar/ee3/emc/EquivalencyGroup.java deleted file mode 100644 index 724988aa..00000000 --- a/ee3_common/com/pahimar/ee3/emc/EquivalencyGroup.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.pahimar.ee3.emc; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.item.CustomWrappedStack; - -public class EquivalencyGroup { - - private List equivalentItems; - - public EquivalencyGroup() { - - equivalentItems = new ArrayList(); - } - - public EquivalencyGroup(List equivalentItems) { - - this.equivalentItems = new ArrayList(); - - for (ItemStack itemStack : equivalentItems) { - this.equivalentItems.add(new CustomWrappedStack(itemStack)); - } - } - - public List getMembers() { - - return equivalentItems; - } - - public boolean containsMember(ItemStack itemStack) { - - return containsMember(new CustomWrappedStack(itemStack)); - } - - public boolean containsMember(CustomWrappedStack customWrappedStack) { - - return equivalentItems.contains(customWrappedStack); - } - - public void addMember(ItemStack itemStack) { - - this.addMember(new CustomWrappedStack(itemStack)); - } - - public void addMember(CustomWrappedStack customWrappedStack) { - - if (!containsMember(customWrappedStack)) { - equivalentItems.add(customWrappedStack); - } - } - - public void setEquivalentItems(List equivalentItems) { - - this.equivalentItems = equivalentItems; - } - - public void removeMember(ItemStack itemStack) { - - removeMember(new CustomWrappedStack(itemStack)); - } - - public void removeMember(CustomWrappedStack customWrappedStack) { - - while (containsMember(customWrappedStack)) { - equivalentItems.remove(customWrappedStack); - } - } - - public void clearMembers() { - - equivalentItems = new ArrayList(); - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof EquivalencyGroup)) { - return false; - } - - EquivalencyGroup equivalencyGroup = (EquivalencyGroup) object; - - return (equivalentItems.equals(equivalencyGroup.equivalentItems)); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append("Equivalent Group Members: "); - for (CustomWrappedStack customWrappedStack : equivalentItems) { - stringBuilder.append(String.format("%s ", customWrappedStack)); - } - - return stringBuilder.toString(); - } - - @Override - public int hashCode() { - - int hashCode = 1; - - for (CustomWrappedStack customWrappedStack : equivalentItems) { - hashCode = 37 * hashCode + customWrappedStack.hashCode(); - } - - return hashCode; - } -} diff --git a/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java b/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java deleted file mode 100644 index 59e39bce..00000000 --- a/ee3_common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java +++ /dev/null @@ -1,272 +0,0 @@ -package com.pahimar.ee3.emc.graph; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.logging.Logger; - -import com.pahimar.ee3.core.util.LogHelper; - -public class WeightedDirectedGraph implements Iterable { - - private final Map>> graph = new HashMap>>(); - private List orderedNodes = new ArrayList(); - - public boolean addNode(T node) { - - // Ignore nodes already added - if (graph.containsKey(node)) - return false; - - orderedNodes.add(node); - graph.put(node, new TreeSet>(new Comparator>() { - - @Override - public int compare(WeightedEdge o1, WeightedEdge o2) { - - return orderedNodes.indexOf(o1.getTarget()) - orderedNodes.indexOf(o2.getTarget()); - } - })); - - return true; - } - - public void addEdge(T from, T to) { - - addEdge(from, to, 1); - } - - public void addEdge(T from, T to, float weight) { - - if (!(graph.containsKey(from) && graph.containsKey(to))) { - if (!graph.containsKey(from)) { - LogHelper.severe("From node doesn't exist: " + from.toString()); - LogHelper.severe("To node: " + to.toString()); - } - if (!graph.containsKey(to)) { - LogHelper.severe("From node: " + from.toString()); - LogHelper.severe("To node doesn't exist: " + to.toString()); - } - throw new NoSuchElementException("Missing nodes from graph"); - } - - // If a directed edge of the same weight doesn't already exist, add the new edge - if (!edgeExists(from, to, weight)) { - graph.get(from).add(new WeightedEdge(weight, to)); - } - } - - public boolean edgeExists(T from, T to) { - - if (!(graph.containsKey(from) && graph.containsKey(to))) - throw new NoSuchElementException("Missing nodes from graph"); - - Iterator> edgeIterator = graph.get(from).iterator(); - - while (edgeIterator.hasNext()) { - if (edgeIterator.next().getTarget().equals(to)) - return true; - } - - return false; - } - - public boolean edgeExists(T from, T to, float weight) { - - if (!(graph.containsKey(from) && graph.containsKey(to))) { - if (!graph.containsKey(from)) { - LOGGER.severe("From node doesn't exist: " + from.toString()); - LOGGER.severe("To node: " + to.toString()); - } - if (!graph.containsKey(to)) { - LOGGER.severe("To node doesn't exist: " + to.toString()); - LOGGER.severe("From node: " + from.toString()); - } - throw new NoSuchElementException("Missing nodes from graph"); - } - - return graph.get(from).contains(new WeightedEdge(weight, to)); - } - - public boolean nodeExists(T node) { - - return graph.containsKey(node); - } - - public Set> edgesFrom(T from) { - - if (!graph.containsKey(from)) - throw new NoSuchElementException("Missing node from graph"); - - return Collections.unmodifiableSortedSet(graph.get(from)); - } - - public Set> edgesTo(T to) { - - if (!graph.containsKey(to)) - throw new NoSuchElementException("Missing node from graph"); - - Set> edgesTo = new TreeSet>(new Comparator>() { - - @Override - public int compare(WeightedEdge o1, WeightedEdge o2) { - - return o1.hashCode() - o2.hashCode(); - } - }); - - for (T node : graph.keySet()) { - if (!node.equals(to)) { - Set> edgesFrom = edgesFrom(node); - - for (WeightedEdge fromEdge : edgesFrom) { - if (fromEdge.getTarget().equals(to)) { - edgesTo.add(new WeightedEdge(fromEdge.getWeight(), node)); - } - } - } - } - - return Collections.unmodifiableSet(edgesTo); - } - - public void removeNode(T node) { - - if (!graph.containsKey(node)) - throw new NoSuchElementException("Missing node from graph"); - - // Remove all edges from and to the node - removeAllEdgesFrom(node); - removeAllEdgesTo(node); - - // Remove the node - graph.remove(node); - } - - public void removeEdge(T from, T to) { - - removeEdge(from, to, 1); - } - - public void removeEdge(T from, T to, float weight) { - - if (!(graph.containsKey(from) && graph.containsKey(to))) - throw new NoSuchElementException("Missing nodes from graph"); - - graph.get(from).remove(new WeightedEdge(weight, to)); - } - - public void removeAllEdgesFrom(T node) { - - if (!graph.containsKey(node)) - throw new NoSuchElementException("Missing node from graph"); - - graph.get(node).clear(); - } - - public void removeAllEdgesTo(T node) { - - if (!graph.containsKey(node)) - throw new NoSuchElementException("Missing node from graph"); - - for (T aNode : graph.keySet()) { - Set> edgesFrom = edgesFrom(aNode); - - for (WeightedEdge fromEdge : edgesFrom) { - if (fromEdge.getTarget().equals(node)) { - graph.get(aNode).remove(fromEdge); - } - } - } - } - - public void removeAllEdgesBetween(T firstNode, T secondNode) { - - if (!(graph.containsKey(firstNode) && graph.containsKey(secondNode))) - throw new NoSuchElementException("Missing nodes from graph"); - - for (WeightedEdge edgeFrom : edgesFrom(firstNode)) { - if (edgeFrom.getTarget().equals(secondNode)) { - graph.get(firstNode).remove(edgeFrom); - } - } - - for (WeightedEdge edgeFrom : edgesFrom(secondNode)) { - if (edgeFrom.getTarget().equals(firstNode)) { - graph.get(secondNode).remove(edgeFrom); - } - } - } - - public List getAllNodes() { - - return orderedNodes; - } - - public List getCriticalNodes() { - - ArrayList criticalNodes = new ArrayList(); - - Iterator nodeIter = orderedNodes.iterator(); - - while (nodeIter.hasNext()) { - T currentNode = nodeIter.next(); - - if (this.edgesFrom(currentNode).size() == 0) { - criticalNodes.add(currentNode); - } - } - - return criticalNodes; - } - - public List getOrphanNodes() { - - ArrayList orphanedNodes = new ArrayList(); - - Iterator nodeIter = orderedNodes.iterator(); - - while (nodeIter.hasNext()) { - T currentNode = nodeIter.next(); - - if (this.edgesFrom(currentNode).size() == 0 && this.edgesTo(currentNode).size() == 0) { - orphanedNodes.add(currentNode); - } - } - - return orphanedNodes; - } - - @Override - public Iterator iterator() { - - return orderedNodes.iterator(); - } - - public int size() { - - return graph.size(); - } - - public boolean isEmpty() { - - return graph.isEmpty(); - } - - @Override - public String toString() { - - return graph.toString(); - } - - private static final Logger LOGGER = Logger.getLogger(WeightedDirectedGraph.class.getName()); - -} diff --git a/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java b/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java deleted file mode 100644 index 9b7d97ed..00000000 --- a/ee3_common/com/pahimar/ee3/emc/graph/WeightedEdge.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.pahimar.ee3.emc.graph; - -public class WeightedEdge { - - private float weight; - private T target; - - public WeightedEdge(float weight, T target) { - - this.weight = weight; - this.target = target; - } - - public float getWeight() { - - return weight; - } - - public T getTarget() { - - return target; - } - - public void setWeight(float weight) { - - this.weight = weight; - } - - public void setTarget(T target) { - - this.target = target; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof WeightedEdge)) { - return false; - } - - WeightedEdge edge = (WeightedEdge) object; - - return ((this.weight == edge.weight) && (target.equals(edge.target))); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("Weight: %s, Target: %s ", weight, target)); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/com/pahimar/ee3/event/ActionEvent.java b/ee3_common/com/pahimar/ee3/event/ActionEvent.java deleted file mode 100644 index bf2faf20..00000000 --- a/ee3_common/com/pahimar/ee3/event/ActionEvent.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.pahimar.ee3.event; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.event.Event; - -/** - * Equivalent-Exchange-3 - * - * ActionEvent - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ActionEvent extends Event { - - public enum ActionResult { - SUCCESS, DEFAULT, FAILURE - } - - public final byte actionType; - public ItemStack itemStack; - public final EntityPlayer player; - public final World world; - public final int x, y, z; - public final boolean hasActionOccured; - public final String data; - public ActionResult actionResult; - - public ActionEvent(byte actionType, ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, boolean hasActionOccured, String data) { - - this.actionType = actionType; - this.itemStack = itemStack; - this.player = player; - this.world = world; - this.x = x; - this.y = y; - this.z = z; - this.hasActionOccured = hasActionOccured; - this.data = data; - } - -} diff --git a/ee3_common/com/pahimar/ee3/event/ActionRequestEvent.java b/ee3_common/com/pahimar/ee3/event/ActionRequestEvent.java deleted file mode 100644 index 7aaab715..00000000 --- a/ee3_common/com/pahimar/ee3/event/ActionRequestEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.pahimar.ee3.event; - -import static net.minecraftforge.event.Event.Result.DEFAULT; -import static net.minecraftforge.event.Event.Result.DENY; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.event.Cancelable; -import net.minecraftforge.event.entity.player.PlayerEvent; - -/** - * Equivalent-Exchange-3 - * - * ActionRequestEvent - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -@Cancelable -public class ActionRequestEvent extends PlayerEvent { - - public final ActionEvent modEvent; - public final int x, y, z; - public final int sideHit; - public Result allowEvent; - - public ActionRequestEvent(EntityPlayer player, ActionEvent modEvent, int x, int y, int z, int sideHit) { - - super(player); - this.modEvent = modEvent; - this.x = x; - this.y = y; - this.z = z; - this.sideHit = sideHit; - if (sideHit == -1) { - allowEvent = DENY; - } - } - - @Override - public void setCanceled(boolean cancel) { - - super.setCanceled(cancel); - allowEvent = cancel ? DENY : allowEvent == DENY ? DENY : DEFAULT; - } - -} diff --git a/ee3_common/com/pahimar/ee3/event/WorldTransmutationEvent.java b/ee3_common/com/pahimar/ee3/event/WorldTransmutationEvent.java deleted file mode 100644 index 570b3682..00000000 --- a/ee3_common/com/pahimar/ee3/event/WorldTransmutationEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.pahimar.ee3.event; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Equivalent-Exchange-3 - * - * WorldTransmutationEvent - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class WorldTransmutationEvent extends ActionEvent { - - public int targetID, targetMeta; - - public WorldTransmutationEvent(byte actionType, ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, boolean hasActionOccured, String data) { - - super(actionType, itemStack, player, world, x, y, z, hasActionOccured, data); - targetID = Integer.parseInt(data.substring(0, data.indexOf(":"))); - targetMeta = Integer.parseInt(data.substring(data.indexOf(":") + 1)); - actionResult = ActionResult.DEFAULT; - } - -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalBag.java b/ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalBag.java deleted file mode 100644 index 04a8f51c..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalBag.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -/** - * Equivalent-Exchange-3 - * - * ContainerAlchemicalBag - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerAlchemicalBag extends Container { - - private final int BAG_INVENTORY_ROWS = 4; - private final int BAG_INVENTORY_COLUMNS = 13; - - private final int PLAYER_INVENTORY_ROWS = 3; - private final int PLAYER_INVENTORY_COLUMNS = 9; - - public ContainerAlchemicalBag(InventoryPlayer inventoryPlayer) { - - // Add the player's inventory slots to the container - for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex) { - for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * PLAYER_INVENTORY_COLUMNS + PLAYER_INVENTORY_COLUMNS, 44 + inventoryColumnIndex * 18, 104 + inventoryRowIndex * 18)); - } - } - - // Add the player's action bar slots to the container - for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 44 + actionBarSlotIndex * 18, 162)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - - return true; - } - - @Override - public void onContainerClosed(EntityPlayer player) { - - super.onContainerClosed(player); - - if (!player.worldObj.isRemote) { - InventoryPlayer invPlayer = player.inventory; - for (ItemStack itemStack : invPlayer.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); - } - } - } - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) { - - ItemStack newItemStack = null; - Slot slot = (Slot) inventorySlots.get(slotIndex); - - if (slot != null && slot.getHasStack()) { - ItemStack itemStack = slot.getStack(); - newItemStack = itemStack.copy(); - - if (slotIndex < BAG_INVENTORY_ROWS * BAG_INVENTORY_COLUMNS) { - if (!this.mergeItemStack(itemStack, BAG_INVENTORY_ROWS * BAG_INVENTORY_COLUMNS, inventorySlots.size(), false)) - return null; - } - else if (!this.mergeItemStack(itemStack, 0, BAG_INVENTORY_ROWS * BAG_INVENTORY_COLUMNS, false)) - return null; - - if (itemStack.stackSize == 0) { - slot.putStack((ItemStack) null); - } - else { - slot.onSlotChanged(); - } - } - - return newItemStack; - } -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalChest.java b/ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalChest.java deleted file mode 100644 index 9f8d690f..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerAlchemicalChest.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.tileentity.TileAlchemicalChest; - -/** - * Equivalent-Exchange-3 - * - * ContainerAlchemicalChest - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerAlchemicalChest extends Container { - - private TileAlchemicalChest tileAlchemicalChest; - - private final int CHEST_INVENTORY_ROWS = 4; - private final int CHEST_INVENTORY_COLUMNS = 13; - - private final int PLAYER_INVENTORY_ROWS = 3; - private final int PLAYER_INVENTORY_COLUMNS = 9; - - public ContainerAlchemicalChest(InventoryPlayer inventoryPlayer, TileAlchemicalChest tileAlchemicalChest) { - - this.tileAlchemicalChest = tileAlchemicalChest; - - tileAlchemicalChest.openChest(); - - // Add the Alchemical Chest slots to the container - for (int chestRowIndex = 0; chestRowIndex < CHEST_INVENTORY_ROWS; ++chestRowIndex) { - for (int chestColumnIndex = 0; chestColumnIndex < CHEST_INVENTORY_COLUMNS; ++chestColumnIndex) { - this.addSlotToContainer(new Slot(tileAlchemicalChest, chestColumnIndex + chestRowIndex * 13, 8 + chestColumnIndex * 18, 18 + chestRowIndex * 18)); - } - } - - // Add the player's inventory slots to the container - for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex) { - for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 44 + inventoryColumnIndex * 18, 104 + inventoryRowIndex * 18)); - } - } - - // Add the player's action bar slots to the container - for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 44 + actionBarSlotIndex * 18, 162)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - - return true; - } - - /** - * Callback for when the crafting gui is closed. - */ - @Override - public void onContainerClosed(EntityPlayer entityPlayer) { - - super.onContainerClosed(entityPlayer); - tileAlchemicalChest.closeChest(); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) { - - ItemStack newItemStack = null; - Slot slot = (Slot) inventorySlots.get(slotIndex); - - if (slot != null && slot.getHasStack()) { - ItemStack itemStack = slot.getStack(); - newItemStack = itemStack.copy(); - - if (slotIndex < CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS) { - if (!this.mergeItemStack(itemStack, CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS, inventorySlots.size(), false)) - return null; - } - else if (!this.mergeItemStack(itemStack, 0, CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS, false)) - return null; - - if (itemStack.stackSize == 0) { - slot.putStack((ItemStack) null); - } - else { - slot.onSlotChanged(); - } - } - - return newItemStack; - } -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerAludel.java b/ee3_common/com/pahimar/ee3/inventory/ContainerAludel.java deleted file mode 100644 index 8d410a94..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerAludel.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; - -import com.pahimar.ee3.item.ItemAlchemicalDust; -import com.pahimar.ee3.tileentity.TileAludel; - -/** - * Equivalent-Exchange-3 - * - * ContainerAludel - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerAludel extends Container { - - private final int PLAYER_INVENTORY_ROWS = 3; - private final int PLAYER_INVENTORY_COLUMNS = 9; - - public ContainerAludel(InventoryPlayer inventoryPlayer, TileAludel tileAludel) { - - this.addSlotToContainer(new Slot(tileAludel, TileAludel.FUEL_INVENTORY_INDEX, 44, 74)); - this.addSlotToContainer(new Slot(tileAludel, TileAludel.INPUT_INVENTORY_INDEX, 44, 18)); - this.addSlotToContainer(new Slot(tileAludel, TileAludel.DUST_INVENTORY_INDEX, 44, 39)); - this.addSlotToContainer(new Slot(tileAludel, TileAludel.OUTPUT_INVENTORY_INDEX, 120, 39)); - - // Add the player's inventory slots to the container - for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex) { - for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 8 + inventoryColumnIndex * 18, 106 + inventoryRowIndex * 18)); - } - } - - // Add the player's action bar slots to the container - for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 8 + actionBarSlotIndex * 18, 164)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) { - - ItemStack itemStack = null; - Slot slot = (Slot) inventorySlots.get(slotIndex); - - if (slot != null && slot.getHasStack()) { - - ItemStack slotItemStack = slot.getStack(); - itemStack = slotItemStack.copy(); - - /** - * If we are shift-clicking an item out of the Aludel's container, - * attempt to put it in the first available slot in the player's - * inventory - */ - if (slotIndex < TileAludel.INVENTORY_SIZE) { - - if (!this.mergeItemStack(slotItemStack, TileAludel.INVENTORY_SIZE, inventorySlots.size(), false)) { - return null; - } - } - else { - - /** - * If the stack being shift-clicked into the Aludel's container - * is a fuel, first try to put it in the fuel slot. If it cannot - * be merged into the fuel slot, try to put it in the input - * slot. - */ - if (TileEntityFurnace.isItemFuel(slotItemStack)) { - if (!this.mergeItemStack(slotItemStack, TileAludel.FUEL_INVENTORY_INDEX, TileAludel.INPUT_INVENTORY_INDEX, false)) { - return null; - } - } - - /** - * If the stack being shift-clicked into the Aludel's container - * is a dust, first try to put it in the dust slot. If it cannot - * be merged into the dust slot, try to put it in the input - * slot. - */ - else if (slotItemStack.getItem() instanceof ItemAlchemicalDust) { - if (!this.mergeItemStack(slotItemStack, TileAludel.DUST_INVENTORY_INDEX, TileAludel.OUTPUT_INVENTORY_INDEX, false)) { - return null; - } - } - - /** - * Finally, attempt to put stack into the input slot - */ - else if (!this.mergeItemStack(slotItemStack, TileAludel.INPUT_INVENTORY_INDEX, TileAludel.DUST_INVENTORY_INDEX, false)) { - return null; - } - } - - if (slotItemStack.stackSize == 0) { - slot.putStack((ItemStack) null); - } - else { - slot.onSlotChanged(); - } - } - - return itemStack; - } -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerCalcinator.java b/ee3_common/com/pahimar/ee3/inventory/ContainerCalcinator.java deleted file mode 100644 index 550c4b50..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerCalcinator.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; - -import com.pahimar.ee3.tileentity.TileCalcinator; - -/** - * Equivalent-Exchange-3 - * - * ContainerCalcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerCalcinator extends Container { - - public ContainerCalcinator(InventoryPlayer inventoryPlayer, TileCalcinator calcinator) { - - // Add the fuel slot to the container - this.addSlotToContainer(new Slot(calcinator, TileCalcinator.FUEL_INVENTORY_INDEX, 56, 62)); - - // Add the input slot to the container - this.addSlotToContainer(new Slot(calcinator, TileCalcinator.INPUT_INVENTORY_INDEX, 56, 17)); - - // Add the output results slot to the container - this.addSlotToContainer(new SlotCalcinator(calcinator, TileCalcinator.OUTPUT_INVENTORY_INDEX, 116, 35)); - - // Add the player's inventory slots to the container - for (int inventoryRowIndex = 0; inventoryRowIndex < 3; ++inventoryRowIndex) { - for (int inventoryColumnIndex = 0; inventoryColumnIndex < 9; ++inventoryColumnIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 8 + inventoryColumnIndex * 18, 94 + inventoryRowIndex * 18)); - } - } - - // Add the player's action bar slots to the container - for (int actionBarSlotIndex = 0; actionBarSlotIndex < 9; ++actionBarSlotIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 8 + actionBarSlotIndex * 18, 152)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) { - - ItemStack itemStack = null; - Slot slot = (Slot) inventorySlots.get(slotIndex); - - if (slot != null && slot.getHasStack()) { - - ItemStack slotItemStack = slot.getStack(); - itemStack = slotItemStack.copy(); - - /** - * If we are shift-clicking an item out of the Aludel's container, - * attempt to put it in the first available slot in the player's - * inventory - */ - if (slotIndex < TileCalcinator.INVENTORY_SIZE) { - - if (!this.mergeItemStack(slotItemStack, TileCalcinator.INVENTORY_SIZE, inventorySlots.size(), false)) { - return null; - } - } - else { - - /** - * If the stack being shift-clicked into the Aludel's container - * is a fuel, first try to put it in the fuel slot. If it cannot - * be merged into the fuel slot, try to put it in the input - * slot. - */ - if (TileEntityFurnace.isItemFuel(slotItemStack)) { - if (!this.mergeItemStack(slotItemStack, TileCalcinator.FUEL_INVENTORY_INDEX, TileCalcinator.OUTPUT_INVENTORY_INDEX, false)) { - return null; - } - } - - /** - * Finally, attempt to put stack into the input slot - */ - else if (!this.mergeItemStack(slotItemStack, TileCalcinator.INPUT_INVENTORY_INDEX, TileCalcinator.OUTPUT_INVENTORY_INDEX, false)) { - return null; - } - } - - if (slotItemStack.stackSize == 0) { - slot.putStack((ItemStack) null); - } - else { - slot.onSlotChanged(); - } - } - - return itemStack; - } - -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerGlassBell.java b/ee3_common/com/pahimar/ee3/inventory/ContainerGlassBell.java deleted file mode 100644 index 603e2f2c..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerGlassBell.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.tileentity.TileGlassBell; - -/** - * Equivalent-Exchange-3 - * - * ContainerGlassBell - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerGlassBell extends Container { - - private final int PLAYER_INVENTORY_ROWS = 3; - private final int PLAYER_INVENTORY_COLUMNS = 9; - - public ContainerGlassBell(InventoryPlayer inventoryPlayer, TileGlassBell tileGlassBell) { - - this.addSlotToContainer(new Slot(tileGlassBell, TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX, 80, 22)); - - // Add the player's inventory slots to the container - for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex) { - for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 8 + inventoryColumnIndex * 18, 58 + inventoryRowIndex * 18)); - } - } - - // Add the player's action bar slots to the container - for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex) { - this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 8 + actionBarSlotIndex * 18, 116)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) { - - ItemStack itemStack = null; - Slot slot = (Slot) inventorySlots.get(slotIndex); - - if (slot != null && slot.getHasStack()) { - ItemStack slotItemStack = slot.getStack(); - itemStack = slotItemStack.copy(); - - if (slotIndex < TileGlassBell.INVENTORY_SIZE) { - - if (!this.mergeItemStack(slotItemStack, 1, inventorySlots.size(), true)) { - return null; - } - } - else { - if (!this.mergeItemStack(slotItemStack, 0, TileGlassBell.INVENTORY_SIZE, false)) { - return null; - } - } - - if (slotItemStack.stackSize == 0) { - slot.putStack((ItemStack) null); - } - else { - slot.onSlotChanged(); - } - } - - return itemStack; - } -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerPortableCrafting.java b/ee3_common/com/pahimar/ee3/inventory/ContainerPortableCrafting.java deleted file mode 100644 index b41fab2c..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerPortableCrafting.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ContainerWorkbench; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -/** - * Equivalent-Exchange-3 - * - * ContainerPortableCrafting - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerPortableCrafting extends ContainerWorkbench { - - public ContainerPortableCrafting(InventoryPlayer inventoryPlayer, World world, int x, int y, int z) { - - super(inventoryPlayer, world, x, y, z); - } - - @Override - public boolean canInteractWith(EntityPlayer var1) { - - return true; - } - - @Override - public void onContainerClosed(EntityPlayer player) { - - super.onContainerClosed(player); - - if (!player.worldObj.isRemote) { - InventoryPlayer invPlayer = player.inventory; - for (ItemStack itemStack : invPlayer.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN); - } - } - } - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/inventory/ContainerPortableTransmutation.java b/ee3_common/com/pahimar/ee3/inventory/ContainerPortableTransmutation.java deleted file mode 100644 index da0f957b..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/ContainerPortableTransmutation.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -/** - * Equivalent-Exchange-3 - * - * ContainerPortableTransmutation - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ContainerPortableTransmutation extends Container { - - @Override - public boolean canInteractWith(EntityPlayer var1) { - - // TODO Auto-generated method stub - return false; - } - - @Override - public void onContainerClosed(EntityPlayer player) { - - super.onContainerClosed(player); - - if (!player.worldObj.isRemote) { - InventoryPlayer invPlayer = player.inventory; - for (ItemStack itemStack : invPlayer.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - } - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/inventory/SlotCalcinator.java b/ee3_common/com/pahimar/ee3/inventory/SlotCalcinator.java deleted file mode 100644 index d2b9ef67..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/SlotCalcinator.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.pahimar.ee3.inventory; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -/** - * Equivalent-Exchange-3 - * - * SlotCalcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class SlotCalcinator extends Slot { - - public SlotCalcinator(IInventory inventory, int x, int y, int z) { - - super(inventory, x, y, z); - } - - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - - return false; - } - -} diff --git a/ee3_common/com/pahimar/ee3/inventory/WorldSavedDataEE.java b/ee3_common/com/pahimar/ee3/inventory/WorldSavedDataEE.java deleted file mode 100644 index 6b87da05..00000000 --- a/ee3_common/com/pahimar/ee3/inventory/WorldSavedDataEE.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.pahimar.ee3.inventory; - -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.WorldSavedData; - -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * WorldSavedDataEE - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class WorldSavedDataEE extends WorldSavedData implements IInventory { - - public UUID uuid; - public ItemStack[] inventory; - - private final int INVENTORY_SIZE = 13 * 4; - - public WorldSavedDataEE(String filePath) { - - super(filePath); - inventory = new ItemStack[INVENTORY_SIZE]; - } - - @Override - public void readFromNBT(NBTTagCompound var1) { - - // TODO Auto-generated method stub - - } - - @Override - public void writeToNBT(NBTTagCompound var1) { - - // TODO Auto-generated method stub - - } - - @Override - public int getSizeInventory() { - - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - - return inventory[slot]; - } - - @Override - public ItemStack decrStackSize(int var1, int var2) { - - // TODO Auto-generated method stub - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int var1) { - - // TODO Auto-generated method stub - return null; - } - - @Override - public void setInventorySlotContents(int var1, ItemStack var2) { - - // TODO Auto-generated method stub - - } - - @Override - public String getInvName() { - - return "worldsaveddata" + "." + Strings.ALCHEMICAL_BAG_NAME; - } - - @Override - public int getInventoryStackLimit() { - - return 64; - } - - @Override - public void onInventoryChanged() { - - // TODO Auto-generated method stub - - } - - @Override - public boolean isUseableByPlayer(EntityPlayer var1) { - - // TODO Auto-generated method stub - return false; - } - - @Override - public void openChest() { - - } - - @Override - public void closeChest() { - - } - - @Override - public boolean isInvNameLocalized() { - - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - - return false; - } - -} diff --git a/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java b/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java deleted file mode 100644 index 60923788..00000000 --- a/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java +++ /dev/null @@ -1,290 +0,0 @@ -package com.pahimar.ee3.item; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import com.pahimar.ee3.core.util.EnergyStack; -import com.pahimar.ee3.core.util.ItemUtil; -import com.pahimar.ee3.core.util.OreStack; -import com.pahimar.ee3.lib.Reference; - -public class CustomWrappedStack { - - private int stackSize; - private ItemStack itemStack; - private OreStack oreStack; - private EnergyStack energyStack; - - /** - * Creates a new CustomWrappedStack object which wraps the given input. - * Valid inputs would be ItemStacks or OreStacks. If something other than an - * ItemStack or an OreStack is used as input, nothing is wrapped and the - * size of the wrapped stack is set to -1 to indicate an invalid wrapped - * stack. - * - * @param object - * The newly created wrapped stack object - */ - public CustomWrappedStack(Object object) { - - /* - * If we are given an Item or a Block, convert it to an ItemStack for further inspection - */ - if (object instanceof Item) { - object = new ItemStack((Item) object); - } - else if (object instanceof Block) { - object = new ItemStack((Block) object); - } - - /* - * We are given an ItemStack to wrap - */ - if (object instanceof ItemStack) { - - ItemStack itemStack = (ItemStack) object; - - /* - * If the ItemStack does not exist in the OreDictionary, wrap it as - * an ItemStack - */ - if (OreDictionary.getOreID(itemStack) == Reference.ORE_DICTIONARY_NOT_FOUND) { - this.itemStack = itemStack.copy(); - oreStack = null; - energyStack = null; - stackSize = this.itemStack.stackSize; - this.itemStack.stackSize = 1; - } - /* - * Else the ItemStack exists in the OreDictionary, so wrap it as an - * OreStack instead of an ItemStack - */ - else { - this.itemStack = null; - oreStack = new OreStack(itemStack); - energyStack = null; - stackSize = oreStack.stackSize; - oreStack.stackSize = 1; - } - } - /* - * Or we are given an OreStack to wrap - */ - else if (object instanceof OreStack) { - - itemStack = null; - oreStack = (OreStack) object; - energyStack = null; - stackSize = oreStack.stackSize; - oreStack.stackSize = 1; - } - else if (object instanceof ArrayList) { - - itemStack = null; - - ArrayList objectList = (ArrayList) object; - - if (!objectList.isEmpty()) { - for (Object listElement : objectList) { - if (listElement instanceof ItemStack) { - ItemStack stack = (ItemStack) listElement; - - if (OreDictionary.getOreID(stack) != Reference.ORE_DICTIONARY_NOT_FOUND) { - oreStack = new OreStack(stack); - stackSize = oreStack.stackSize; - oreStack.stackSize = 1; - break; - } - } - } - } - - energyStack = null; - } - /* - * Or we are given an EnergyStack to wrap - */ - else if (object instanceof EnergyStack) { - itemStack = null; - oreStack = null; - energyStack = (EnergyStack) object; - stackSize = energyStack.stackSize; - energyStack.stackSize = 1; - } - else if (object instanceof CustomWrappedStack) { - CustomWrappedStack wrappedStack = (CustomWrappedStack) object; - - itemStack = wrappedStack.itemStack; - oreStack = wrappedStack.oreStack; - energyStack = wrappedStack.energyStack; - stackSize = wrappedStack.stackSize; - } - /* - * Else, we are given something we cannot wrap - */ - else { - stackSize = -1; - } - } - - /** - * Returns the stack size of the wrapped stack, or -1 if we wrapped an - * invalid input - * - * @return The size of the wrapped stack - */ - public int getStackSize() { - - return stackSize; - } - - /** - * Sets the size of the wrapped stack - * - * @param stackSize - * The new size of the wrapped stack - */ - public void setStackSize(int stackSize) { - - this.stackSize = stackSize; - } - - /** - * Returns the wrapped stack - * - * @return The wrapped ItemStack, OreStack, or EnergyStack, or null if - * something other than an ItemStack, OreStack, or EnergyStack was - * used to create this object - */ - public Object getWrappedStack() { - - if (itemStack != null) { - return itemStack; - } - else if (oreStack != null) { - return oreStack; - } - else if (energyStack != null) { - return energyStack; - } - - return null; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof CustomWrappedStack)) - return false; - - CustomWrappedStack customWrappedStack = (CustomWrappedStack) object; - - if (itemStack != null) { - if (customWrappedStack.itemStack != null) - return ItemUtil.compare(itemStack, customWrappedStack.itemStack) && stackSize == customWrappedStack.itemStack.stackSize; - else if (customWrappedStack.oreStack != null) { - for (ItemStack oreDictItemStack : OreDictionary.getOres(customWrappedStack.oreStack.oreName)) { - if (ItemUtil.compare(itemStack, oreDictItemStack) && stackSize == customWrappedStack.stackSize) - return true; - } - } - } - else if (oreStack != null) { - if (customWrappedStack.itemStack != null) { - for (ItemStack oreDictItemStack : OreDictionary.getOres(oreStack.oreName)) { - if (ItemUtil.compare(customWrappedStack.itemStack, oreDictItemStack) && stackSize == customWrappedStack.stackSize) - return true; - } - } - else if (customWrappedStack.oreStack != null) - return oreStack.oreName.equalsIgnoreCase(customWrappedStack.oreStack.oreName) && stackSize == customWrappedStack.stackSize; - } - else if (energyStack != null) { - if (customWrappedStack.energyStack != null) { - return energyStack.energyName.equalsIgnoreCase(customWrappedStack.energyStack.energyName) && stackSize == customWrappedStack.stackSize; - } - } - - return false; - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - if (itemStack != null) { - stringBuilder.append(String.format("%sxitemStack[%s:%s:%s:%s]", this.stackSize, itemStack.itemID, itemStack.getItemDamage(), itemStack.getItemName(), itemStack.getItem().getClass().getCanonicalName())); - } - else if (oreStack != null) { - stringBuilder.append(String.format("%dxoreDictionary.%s", stackSize, oreStack.oreName)); - } - else if (energyStack != null) { - stringBuilder.append(String.format("%dxenergyStack.%s", stackSize, energyStack.energyName)); - } - else { - stringBuilder.append("null"); - } - - return stringBuilder.toString(); - } - - public String encodeAsPropertyKey() { - - StringBuilder stringBuilder = new StringBuilder(); - - if (itemStack != null) { - stringBuilder.append(String.format("%sxitemStack[%s:%s:%s:%s]", this.stackSize, itemStack.itemID, itemStack.getItemDamage(), itemStack.getItemName(), itemStack.getItem().getClass().getCanonicalName())); - } - else if (oreStack != null) { - stringBuilder.append(String.format("%dxoreDictionary.%s", stackSize, oreStack.oreName)); - } - else if (energyStack != null) { - stringBuilder.append(String.format("%dxenergyStack.%s", stackSize, energyStack.energyName)); - } - - return stringBuilder.toString(); - } - - @Override - public int hashCode() { - - int hashCode = 1; - - hashCode = 37 * hashCode + stackSize; - - if (itemStack != null) { - hashCode = 37 * hashCode + itemStack.itemID; - - if (itemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) { - hashCode = 37 * hashCode; - } - else { - hashCode = 37 * hashCode + itemStack.getItemDamage(); - } - - try { - hashCode = 37 * hashCode + itemStack.getItemName().hashCode(); - } catch (ArrayIndexOutOfBoundsException e) { - - } - } - else if (oreStack != null) { - hashCode = 37 * hashCode + oreStack.oreName.hashCode(); - } - else if (energyStack != null) { - hashCode = 37 * hashCode + energyStack.energyName.hashCode(); - } - - return hashCode; - } - - public static boolean canBeWrapped(Object object) { - - return (object instanceof CustomWrappedStack || object instanceof ItemStack || object instanceof OreStack || object instanceof EnergyStack || object instanceof Item || object instanceof Block); - } -} diff --git a/ee3_common/com/pahimar/ee3/item/IChargeable.java b/ee3_common/com/pahimar/ee3/item/IChargeable.java deleted file mode 100644 index 50221d76..00000000 --- a/ee3_common/com/pahimar/ee3/item/IChargeable.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.item.ItemStack; - -/** - * Equivalent-Exchange-3 - * - * IChargeable - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public interface IChargeable { - - public abstract short getCharge(ItemStack stack); - - public abstract void setCharge(ItemStack stack, short charge); - - public abstract void increaseCharge(ItemStack stack); - - public abstract void decreaseCharge(ItemStack stack); - -} diff --git a/ee3_common/com/pahimar/ee3/item/IKeyBound.java b/ee3_common/com/pahimar/ee3/item/IKeyBound.java deleted file mode 100644 index e185698b..00000000 --- a/ee3_common/com/pahimar/ee3/item/IKeyBound.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Equivalent-Exchange-3 - * - * IKeyBound - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public interface IKeyBound { - - public abstract void doKeyBindingAction(EntityPlayer thePlayer, ItemStack itemStack, String keyBinding); - -} diff --git a/ee3_common/com/pahimar/ee3/item/ITransmutationStone.java b/ee3_common/com/pahimar/ee3/item/ITransmutationStone.java deleted file mode 100644 index e0668267..00000000 --- a/ee3_common/com/pahimar/ee3/item/ITransmutationStone.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Equivalent-Exchange-3 - * - * ITransmutationStone - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public interface ITransmutationStone { - - public abstract void openPortableCraftingGUI(EntityPlayer thePlayer, ItemStack itemStack); - - public abstract void openPortableTransmutationGUI(EntityPlayer thePlayer, ItemStack itemStack); - - public abstract void transmuteBlock(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int sideHit); - -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemAlchemicalBag.java b/ee3_common/com/pahimar/ee3/item/ItemAlchemicalBag.java deleted file mode 100644 index 805d9ce4..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemAlchemicalBag.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Icon; -import net.minecraft.world.World; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.core.util.ItemUtil; -import com.pahimar.ee3.lib.Colours; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemAlchemicalBag - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemAlchemicalBag extends ItemEE { - - private static final String[] ALCHEMICAL_BAG_SUBTYPES = new String[] { "Open", "OpenDrawString", "Closed", "ClosedDrawString" }; - - @SideOnly(Side.CLIENT) - private Icon[] icons; - - public ItemAlchemicalBag(int id) { - - super(id); - this.setUnlocalizedName(Strings.ALCHEMICAL_BAG_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - - icons = new Icon[ALCHEMICAL_BAG_SUBTYPES.length]; - - for (int i = 0; i < ALCHEMICAL_BAG_SUBTYPES.length; ++i) { - icons[i] = iconRegister.registerIcon(Reference.MOD_ID.toLowerCase() + ":" + Strings.ALCHEMICAL_BAG_NAME + ALCHEMICAL_BAG_SUBTYPES[i]); - } - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - - if (!world.isRemote) { - NBTHelper.setBoolean(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN, true); - entityPlayer.openGui(EquivalentExchange3.instance, GuiIds.ALCHEMICAL_BAG, entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ); - } - - return itemStack; - } - - @Override - public boolean getShareTag() { - - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() { - - return true; - } - - @Override - public Icon getIcon(ItemStack itemStack, int renderPass) { - - // If the bag is open - if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - if (renderPass != 1) - return icons[0]; - else - return icons[1]; - } - // Else, the bag is closed - else { - if (renderPass != 1) - return icons[2]; - else - return icons[3]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack itemStack, int renderPass) { - - if (renderPass == 1) - return Integer.parseInt(Colours.PURE_WHITE, 16); - else { - int bagColor = this.getColor(itemStack); - - if (bagColor < 0) { - bagColor = Integer.parseInt(Colours.PURE_WHITE, 16); - } - - return bagColor; - } - } - - public boolean hasColor(ItemStack itemStack) { - - return ItemUtil.hasColor(itemStack); - } - - public int getColor(ItemStack itemStack) { - - return ItemUtil.getColor(itemStack); - } - - public void setColor(ItemStack itemStack, int color) { - - if (itemStack != null) { - if (!(itemStack.getItem() instanceof ItemAlchemicalBag)) - // TODO Localize - throw new UnsupportedOperationException("Can\'t dye non-bags!"); - else { - ItemUtil.setColor(itemStack, color); - } - } - } - - public void removeColor(ItemStack itemStack) { - - if (itemStack != null) { - - NBTTagCompound nbtTagCompound = itemStack.getTagCompound(); - - if (nbtTagCompound != null) { - - NBTTagCompound displayTagCompound = nbtTagCompound.getCompoundTag(Strings.NBT_ITEM_DISPLAY); - - if (displayTagCompound.hasKey(Strings.NBT_ITEM_COLOR)) { - - displayTagCompound.removeTag(Strings.NBT_ITEM_COLOR); - } - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemAlchemicalDust.java b/ee3_common/com/pahimar/ee3/item/ItemAlchemicalDust.java deleted file mode 100644 index f1a9f870..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemAlchemicalDust.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.pahimar.ee3.item; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.lib.Strings; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemAlchemicalDust - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemAlchemicalDust extends ItemEE { - - private static final String[] ALCHEMICAL_DUST_NAMES = new String[] { "Ash", "Minium", "Verdant", "Azure", "Amaranthine", "Iridescent" }; - - @SideOnly(Side.CLIENT) - private Icon[] icons; - - public ItemAlchemicalDust(int id) { - - super(id); - this.setHasSubtypes(true); - this.setUnlocalizedName(Strings.ALCHEMICAL_DUST_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - maxStackSize = 64; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - - int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5); - return super.getUnlocalizedName() + ALCHEMICAL_DUST_NAMES[meta]; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value - */ - public Icon getIconFromDamage(int meta) { - - int j = MathHelper.clamp_int(meta, 0, 5); - return icons[j]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - - icons = new Icon[ALCHEMICAL_DUST_NAMES.length]; - - for (int i = 0; i < ALCHEMICAL_DUST_NAMES.length; ++i) { - icons[i] = iconRegister.registerIcon(Reference.MOD_ID.toLowerCase() + ":" + Strings.ALCHEMICAL_DUST_NAME + ALCHEMICAL_DUST_NAMES[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack stack) { - - int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 5); - - if (meta == 5) - return true; - else - return false; - } - - @Override - public String getItemDisplayName(ItemStack itemStack) { - - int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5); - - switch (meta) { - case 0: - return EnumChatFormatting.WHITE + super.getItemDisplayName(itemStack); - case 1: - return EnumChatFormatting.WHITE + super.getItemDisplayName(itemStack); - case 2: - return EnumChatFormatting.GREEN + super.getItemDisplayName(itemStack); - case 3: - return EnumChatFormatting.BLUE + super.getItemDisplayName(itemStack); - case 4: - return EnumChatFormatting.DARK_PURPLE + super.getItemDisplayName(itemStack); - case 5: - return EnumChatFormatting.GOLD + super.getItemDisplayName(itemStack); - default: - return EnumChatFormatting.WHITE + super.getItemDisplayName(itemStack); - } - } - - @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) - @SideOnly(Side.CLIENT) - public void getSubItems(int id, CreativeTabs creativeTab, List list) { - - for (int meta = 0; meta < 6; ++meta) { - list.add(new ItemStack(id, 1, meta)); - } - } -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemEE.java b/ee3_common/com/pahimar/ee3/item/ItemEE.java deleted file mode 100644 index f9cb8b79..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemEE.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.item.Item; - -import com.pahimar.ee3.lib.Reference; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemEE - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemEE extends Item { - - public ItemEE(int id) { - - super(id - Reference.SHIFTED_ID_RANGE_CORRECTION); - maxStackSize = 1; - setNoRepair(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) { - - itemIcon = iconRegister.registerIcon(Reference.MOD_ID.toLowerCase() + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1)); - } -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemInertStone.java b/ee3_common/com/pahimar/ee3/item/ItemInertStone.java deleted file mode 100644 index 73587dde..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemInertStone.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.pahimar.ee3.item; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * ItemInertStone - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemInertStone extends ItemEE { - - public ItemInertStone(int id) { - - super(id); - this.setUnlocalizedName(Strings.INERT_STONE_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - } -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemMiniumShard.java b/ee3_common/com/pahimar/ee3/item/ItemMiniumShard.java deleted file mode 100644 index 1867b7e5..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemMiniumShard.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.pahimar.ee3.item; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * ItemMiniumShard - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemMiniumShard extends ItemEE { - - public ItemMiniumShard(int id) { - - super(id); - this.setUnlocalizedName(Strings.MINIUM_SHARD_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - maxStackSize = 64; - } -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemMiniumStone.java b/ee3_common/com/pahimar/ee3/item/ItemMiniumStone.java deleted file mode 100644 index c19fd90c..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemMiniumStone.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.TransmutationHelper; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemMiniumStone - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemMiniumStone extends ItemEE - implements ITransmutationStone, IKeyBound { - - public ItemMiniumStone(int id) { - - super(id); - this.setUnlocalizedName(Strings.MINIUM_STONE_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.setMaxDamage(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY - 1); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - - return NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN) || NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - - @Override - public String getItemDisplayName(ItemStack itemStack) { - - return EnumChatFormatting.BLUE + super.getItemDisplayName(itemStack); - } - - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) { - - return false; - } - - @Override - public boolean getShareTag() { - - return true; - } - - @Override - public ItemStack getContainerItemStack(ItemStack itemStack) { - - ItemStack copiedStack = itemStack.copy(); - - copiedStack.setItemDamage(copiedStack.getItemDamage() + 1); - - // Hacky hacky hack hack - copiedStack.stackSize = 1; - - return copiedStack; - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int sideHit, float hitVecX, float hitVecY, float hitVecZ) { - - if (world.isRemote) { - transmuteBlock(itemStack, entityPlayer, world, x, y, z, sideHit); - } - return true; - } - - @Override - public void openPortableCraftingGUI(EntityPlayer thePlayer, ItemStack itemStack) { - - NBTHelper.setBoolean(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN, true); - thePlayer.openGui(EquivalentExchange3.instance, GuiIds.PORTABLE_CRAFTING, thePlayer.worldObj, (int) thePlayer.posX, (int) thePlayer.posY, (int) thePlayer.posZ); - } - - @Override - public void openPortableTransmutationGUI(EntityPlayer thePlayer, ItemStack itemStack) { - - NBTHelper.setBoolean(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN, true); - thePlayer.openGui(EquivalentExchange3.instance, GuiIds.PORTABLE_TRANSMUTATION, thePlayer.worldObj, (int) thePlayer.posX, (int) thePlayer.posY, (int) thePlayer.posZ); - } - - @Override - public void transmuteBlock(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int sideHit) { - - EquivalentExchange3.proxy.transmuteBlock(itemStack, player, world, x, y, z, sideHit); - } - - @Override - public void doKeyBindingAction(EntityPlayer thePlayer, ItemStack itemStack, String keyBinding) { - - if (keyBinding.equals(ConfigurationSettings.KEYBINDING_EXTRA)) { - if (!thePlayer.isSneaking()) { - openPortableCraftingGUI(thePlayer, itemStack); - } - else { - openPortableTransmutationGUI(thePlayer, itemStack); - } - } - else if (keyBinding.equals(ConfigurationSettings.KEYBINDING_TOGGLE)) { - if (TransmutationHelper.targetBlockStack != null) { - if (!thePlayer.isSneaking()) { - TransmutationHelper.targetBlockStack = TransmutationHelper.getNextBlock(TransmutationHelper.targetBlockStack.itemID, TransmutationHelper.targetBlockStack.getItemDamage()); - } - else { - TransmutationHelper.targetBlockStack = TransmutationHelper.getPreviousBlock(TransmutationHelper.targetBlockStack.itemID, TransmutationHelper.targetBlockStack.getItemDamage()); - } - } - } - - } - -} diff --git a/ee3_common/com/pahimar/ee3/item/ItemPhilosophersStone.java b/ee3_common/com/pahimar/ee3/item/ItemPhilosophersStone.java deleted file mode 100644 index 4a8ac3e4..00000000 --- a/ee3_common/com/pahimar/ee3/item/ItemPhilosophersStone.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.core.util.TransmutationHelper; -import com.pahimar.ee3.lib.GuiIds; -import com.pahimar.ee3.lib.Sounds; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.nbt.NBTHelper; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketSoundEvent; - -import cpw.mods.fml.common.network.PacketDispatcher; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Equivalent-Exchange-3 - * - * ItemPhilosophersStone - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemPhilosophersStone extends ItemEE - implements ITransmutationStone, IChargeable, IKeyBound { - - private int maxChargeLevel; - - public ItemPhilosophersStone(int id) { - - super(id); - this.setUnlocalizedName(Strings.PHILOSOPHERS_STONE_NAME); - this.setCreativeTab(EquivalentExchange3.tabsEE3); - this.setMaxDamage(ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY - 1); - maxChargeLevel = 3; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - - return NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN) || NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN); - } - - @Override - public String getItemDisplayName(ItemStack itemStack) { - - return EnumChatFormatting.YELLOW + super.getItemDisplayName(itemStack); - } - - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) { - - return false; - } - - @Override - public boolean getShareTag() { - - return true; - } - - @Override - public ItemStack getContainerItemStack(ItemStack itemStack) { - - ItemStack copiedStack = itemStack.copy(); - - copiedStack.setItemDamage(copiedStack.getItemDamage() + 1); - - // Hacky hacky hack hack - copiedStack.stackSize = 1; - - return copiedStack; - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int sideHit, float hitVecX, float hitVecY, float hitVecZ) { - - if (world.isRemote) { - transmuteBlock(itemStack, entityPlayer, world, x, y, z, sideHit); - } - return true; - } - - @Override - public void openPortableCraftingGUI(EntityPlayer thePlayer, ItemStack itemStack) { - - NBTHelper.setBoolean(itemStack, Strings.NBT_ITEM_CRAFTING_GUI_OPEN, true); - thePlayer.openGui(EquivalentExchange3.instance, GuiIds.PORTABLE_CRAFTING, thePlayer.worldObj, (int) thePlayer.posX, (int) thePlayer.posY, (int) thePlayer.posZ); - } - - @Override - public void openPortableTransmutationGUI(EntityPlayer thePlayer, ItemStack itemStack) { - - NBTHelper.setBoolean(itemStack, Strings.NBT_ITEM_TRANSMUTATION_GUI_OPEN, true); - thePlayer.openGui(EquivalentExchange3.instance, GuiIds.PORTABLE_TRANSMUTATION, thePlayer.worldObj, (int) thePlayer.posX, (int) thePlayer.posY, (int) thePlayer.posZ); - } - - @Override - public void transmuteBlock(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int sideHit) { - - EquivalentExchange3.proxy.transmuteBlock(itemStack, player, world, x, y, z, sideHit); - } - - @Override - public short getCharge(ItemStack stack) { - - return NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY); - } - - @Override - public void setCharge(ItemStack stack, short charge) { - - if (charge <= maxChargeLevel) { - NBTHelper.setShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY, charge); - } - } - - @Override - public void increaseCharge(ItemStack stack) { - - if (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) < maxChargeLevel) { - NBTHelper.setShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY, (short) (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) + 1)); - } - } - - @Override - public void decreaseCharge(ItemStack stack) { - - if (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) > 0) { - NBTHelper.setShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY, (short) (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) - 1)); - } - } - - @Override - public void doKeyBindingAction(EntityPlayer thePlayer, ItemStack itemStack, String keyBinding) { - - if (keyBinding.equals(ConfigurationSettings.KEYBINDING_EXTRA)) { - if (!thePlayer.isSneaking()) { - openPortableCraftingGUI(thePlayer, itemStack); - } - else { - openPortableTransmutationGUI(thePlayer, itemStack); - } - } - else if (keyBinding.equals(ConfigurationSettings.KEYBINDING_TOGGLE)) { - if (TransmutationHelper.targetBlockStack != null) { - if (!thePlayer.isSneaking()) { - TransmutationHelper.targetBlockStack = TransmutationHelper.getNextBlock(TransmutationHelper.targetBlockStack.itemID, TransmutationHelper.targetBlockStack.getItemDamage()); - } - else { - TransmutationHelper.targetBlockStack = TransmutationHelper.getPreviousBlock(TransmutationHelper.targetBlockStack.itemID, TransmutationHelper.targetBlockStack.getItemDamage()); - } - } - } - else if (keyBinding.equals(ConfigurationSettings.KEYBINDING_CHARGE)) { - if (!thePlayer.isSneaking()) { - if (getCharge(itemStack) == maxChargeLevel) { - PacketDispatcher.sendPacketToAllAround(thePlayer.posX, thePlayer.posY, thePlayer.posZ, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSoundEvent(thePlayer.username, Sounds.FAIL, thePlayer.posX, thePlayer.posY, thePlayer.posZ, 1.5F, 1.5F))); - } - else { - increaseCharge(itemStack); - PacketDispatcher.sendPacketToAllAround(thePlayer.posX, thePlayer.posY, thePlayer.posZ, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSoundEvent(thePlayer.username, Sounds.CHARGE_UP, thePlayer.posX, thePlayer.posY, thePlayer.posZ, 0.5F, 0.5F + 0.5F * (getCharge(itemStack) * 1.0F / maxChargeLevel)))); - } - } - else { - if (getCharge(itemStack) == 0) { - PacketDispatcher.sendPacketToAllAround(thePlayer.posX, thePlayer.posY, thePlayer.posZ, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSoundEvent(thePlayer.username, Sounds.FAIL, thePlayer.posX, thePlayer.posY, thePlayer.posZ, 1.5F, 1.5F))); - } - else { - decreaseCharge(itemStack); - PacketDispatcher.sendPacketToAllAround(thePlayer.posX, thePlayer.posY, thePlayer.posZ, 64D, thePlayer.worldObj.provider.dimensionId, PacketTypeHandler.populatePacket(new PacketSoundEvent(thePlayer.username, Sounds.CHARGE_DOWN, thePlayer.posX, thePlayer.posY, thePlayer.posZ, 0.5F, 1.0F - (0.5F - 0.5F * (getCharge(itemStack) * 1.0F / maxChargeLevel))))); - } - } - } - - } - -} diff --git a/ee3_common/com/pahimar/ee3/item/ModItems.java b/ee3_common/com/pahimar/ee3/item/ModItems.java deleted file mode 100644 index 86664414..00000000 --- a/ee3_common/com/pahimar/ee3/item/ModItems.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.pahimar.ee3.item; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.pahimar.ee3.lib.ItemIds; - -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * Equivalent-Exchange-3 - * - * ModItems - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ModItems { - - /* Mod item instances */ - public static Item miniumShard; - public static Item inertStone; - public static Item miniumStone; - public static Item philStone; - public static Item alchemicalDust; - public static Item alchemicalBag; - - public static void init() { - - /* Initialize each mod item individually */ - miniumShard = new ItemMiniumShard(ItemIds.MINIUM_SHARD); - inertStone = new ItemInertStone(ItemIds.INERT_STONE); - miniumStone = new ItemMiniumStone(ItemIds.MINIUM_STONE); - philStone = new ItemPhilosophersStone(ItemIds.PHILOSOPHERS_STONE); - alchemicalDust = new ItemAlchemicalDust(ItemIds.ALCHEMICAL_DUST); - alchemicalBag = new ItemAlchemicalBag(ItemIds.ALCHEMICAL_BAG); - - miniumStone.setContainerItem(miniumStone); - philStone.setContainerItem(philStone); - - GameRegistry.addRecipe(new ItemStack(inertStone), new Object[] { "sis", "igi", "sis", Character.valueOf('s'), Block.stone, Character.valueOf('i'), Item.ingotIron, Character.valueOf('g'), Item.ingotGold }); - - GameRegistry.addRecipe(new ItemStack(miniumStone), new Object[] { "sss", "sis", "sss", Character.valueOf('s'), miniumShard, Character.valueOf('i'), inertStone }); - - } -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/CalcinationManager.java b/ee3_common/com/pahimar/ee3/item/crafting/CalcinationManager.java deleted file mode 100644 index 750be9e3..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/CalcinationManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -/** - * Equivalent-Exchange-3 - * - * CalcinationManager - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class CalcinationManager { - - private static final CalcinationManager calcinationBase = new CalcinationManager(); - - public static final CalcinationManager calcination() { - - return calcinationBase; - } -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/RecipeRegistry.java b/ee3_common/com/pahimar/ee3/item/crafting/RecipeRegistry.java deleted file mode 100644 index 48079f93..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/RecipeRegistry.java +++ /dev/null @@ -1,301 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.pahimar.ee3.core.util.EnergyStack; -import com.pahimar.ee3.core.util.ItemUtil; -import com.pahimar.ee3.core.util.OreStack; -import com.pahimar.ee3.core.util.RecipeHelper; -import com.pahimar.ee3.item.CustomWrappedStack; - -public class RecipeRegistry { - - private static RecipeRegistry recipeRegistry = null; - - private Multimap> recipeMap; - private ArrayList discoveredStacks; - private ArrayList recipelessStacks; - private List wildCardStacks; - - private RecipeRegistry() { - - recipeMap = HashMultimap.create(); - wildCardStacks = RecipeHelper.populateWildCards(); - discoveredStacks = new ArrayList(); - recipelessStacks = new ArrayList(); - } - - public static RecipeRegistry getInstance() { - - if (recipeRegistry == null) { - recipeRegistry = new RecipeRegistry(); - recipeRegistry.init(); - } - - return recipeRegistry; - } - - private void init() { - - Multimap> recipes = HashMultimap.create(); - - // Add potion recipes - recipes.putAll(RecipesPotions.getPotionRecipes()); - - // Add smelting recipes in the vanilla smelting manager - recipes.putAll(RecipesSmelting.getSmeltingRecipes()); - - // Add recipes in the vanilla crafting manager - recipes.putAll(RecipesVanilla.getVanillaRecipes()); - - // Add recipes gathered via IMC - // TODO Gather IMC recipes - - // Populate the discovered stacks list with all stacks that we are involved in a recipe we are aware of - discoverStacks(recipes); - - // Add items that have no recipe, using the list of discovered stacks to determine if it's in a recipe or not - for (CustomWrappedStack stack : recipelessStacks) { - recipes.put(stack, new ArrayList()); - } - - // Iterate through every recipe in the map, and add them to the registry - Set recipeKeySet = recipes.keySet(); - Iterator recipeKeySetIterator = recipeKeySet.iterator(); - CustomWrappedStack recipeOutput = null; - - while (recipeKeySetIterator.hasNext()) { - recipeOutput = recipeKeySetIterator.next(); - - for (List recipeInputs : recipes.get(recipeOutput)) { - addRecipe(recipeOutput, recipeInputs); - } - } - } - - private void discoverStacks(Multimap> recipes) { - - Set recipeKeySet = recipes.keySet(); - Iterator recipeKeySetIterator = recipeKeySet.iterator(); - CustomWrappedStack recipeOutput = null; - - // Discover all stacks involved in the recipes we know about - while (recipeKeySetIterator.hasNext()) { - recipeOutput = recipeKeySetIterator.next(); - - if (!discoveredStacks.contains(new CustomWrappedStack(recipeOutput.getWrappedStack())) && recipeOutput.getWrappedStack() != null) { - discoveredStacks.add(new CustomWrappedStack(recipeOutput.getWrappedStack())); - } - - for (List recipeInputs : recipes.get(recipeOutput)) { - for (CustomWrappedStack recipeInput : recipeInputs) { - - CustomWrappedStack unwrappedRecipeInput = new CustomWrappedStack(recipeInput.getWrappedStack()); - - if (!discoveredStacks.contains(unwrappedRecipeInput) && recipeInput.getWrappedStack() != null) { - discoveredStacks.add(unwrappedRecipeInput); - } - } - } - } - - CustomWrappedStack customWrappedStack; - - // Discover all stacks from the vanilla Items array - for (int i = 0; i < Item.itemsList.length; i++) { - - if (Item.itemsList[i] != null) { - - if (Item.itemsList[i].getHasSubtypes()) { - - for (int meta = 0; meta < 16; meta++) { - - customWrappedStack = new CustomWrappedStack(new ItemStack(Item.itemsList[i].itemID, 1, meta)); - - if (!discoveredStacks.contains(customWrappedStack)) { - discoveredStacks.add(customWrappedStack); - } - } - } - else { - - customWrappedStack = new CustomWrappedStack(new ItemStack(Item.itemsList[i])); - - if (!discoveredStacks.contains(customWrappedStack)) { - discoveredStacks.add(customWrappedStack); - } - } - } - } - - /* - * For every stack we have discovered, check to see if we know a recipe for it. If we don't - * and we haven't already added it to the recipeless stack list, add it to the recipeless stack - * list - */ - for (CustomWrappedStack discoveredStack : discoveredStacks) { - - if (recipes.get(discoveredStack).size() == 0 && !recipelessStacks.contains(discoveredStack)) { - recipelessStacks.add(discoveredStack); - } - } - } - - public boolean hasRecipe(CustomWrappedStack customWrappedStack) { - - return recipeMap.containsKey(customWrappedStack); - } - - public boolean hasRecipe(ItemStack itemStack) { - - return hasRecipe(new CustomWrappedStack(itemStack)); - } - - public int countRecipesFor(CustomWrappedStack customWrappedStack) { - - Collection> keys = recipeMap.get(customWrappedStack); - - return keys.size(); - } - - public int countRecipesFor(ItemStack itemStack) { - - return countRecipesFor(new CustomWrappedStack(itemStack)); - } - - public Collection> getRecipesFor(CustomWrappedStack customWrappedStack) { - - return recipeMap.get(customWrappedStack); - } - - public Collection> getRecipesFor(ItemStack itemStack) { - - return getRecipesFor(new CustomWrappedStack(itemStack)); - } - - /* - * Item: Item (Output) <- { ... } - */ - public void addRecipe(CustomWrappedStack recipeOutput, List recipeInputs) { - - ArrayList collatedStacks = new ArrayList(); - - CustomWrappedStack wrappedInputStack = null; - boolean found = false; - - /** - * For every input in the input list, check to see if we have discovered - * it already - If we have, add it to the one we already have - If we - * have not, add it to the collection of discovered items - */ - for (Object object : recipeInputs) { - - if (object instanceof ItemStack || object instanceof OreStack) { - wrappedInputStack = new CustomWrappedStack(object); - } - else if (object instanceof CustomWrappedStack) { - wrappedInputStack = (CustomWrappedStack) object; - } - - if (wildCardStacks.contains(wrappedInputStack)) { - Iterator wildIter = wildCardStacks.iterator(); - while (wildIter.hasNext()) { - CustomWrappedStack wildCard = wildIter.next(); - if (wildCard.equals(wrappedInputStack)) { - wrappedInputStack = wildCard; - break; - } - } - } - - if (collatedStacks.size() == 0) { - collatedStacks.add(wrappedInputStack); - } - else { - found = false; - - for (int i = 0; i < collatedStacks.size(); i++) { - if (collatedStacks.get(i) != null) { - if (wrappedInputStack.getWrappedStack() instanceof ItemStack && collatedStacks.get(i).getWrappedStack() instanceof ItemStack) { - if (ItemUtil.compare((ItemStack) wrappedInputStack.getWrappedStack(), (ItemStack) collatedStacks.get(i).getWrappedStack())) { - collatedStacks.get(i).setStackSize(collatedStacks.get(i).getStackSize() + wrappedInputStack.getStackSize()); - found = true; - } - } - else if (wrappedInputStack.getWrappedStack() instanceof OreStack && collatedStacks.get(i).getWrappedStack() instanceof OreStack) { - if (OreStack.compareStacks((OreStack) wrappedInputStack.getWrappedStack(), (OreStack) collatedStacks.get(i).getWrappedStack())) { - collatedStacks.get(i).setStackSize(collatedStacks.get(i).getStackSize() + wrappedInputStack.getStackSize()); - found = true; - } - } - else if (wrappedInputStack.getWrappedStack() instanceof EnergyStack && collatedStacks.get(i).getWrappedStack() instanceof EnergyStack) { - if (((EnergyStack) wrappedInputStack.getWrappedStack()).energyName.equalsIgnoreCase(((EnergyStack) collatedStacks.get(i).getWrappedStack()).energyName)) { - collatedStacks.get(i).setStackSize(collatedStacks.get(i).getStackSize() + wrappedInputStack.getStackSize()); - found = true; - } - } - } - } - - if (!found) { - collatedStacks.add(wrappedInputStack); - } - } - } - - if (!recipeMap.containsEntry(recipeOutput, collatedStacks)) { - recipeMap.put(recipeOutput, collatedStacks); - } - } - - public int size() { - - return recipeMap.size(); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - for (CustomWrappedStack key : recipeMap.keySet()) { - - Collection> recipeMappings = recipeMap.get(key); - - for (List recipeList : recipeMappings) { - stringBuilder.append(String.format("Recipe Output: %s, Recipe Input: %s\n", key.toString(), recipeList.toString())); - } - } - - return stringBuilder.toString(); - } - - public Multimap> getRecipeMappings() { - - return recipeMap; - } - - public List getDiscoveredStacks() { - - return discoveredStacks; - } - - public List getRecipelessStacks() { - - return recipelessStacks; - } - - public List getWildCardStacks() { - - return wildCardStacks; - } -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/RecipesAlchemicalBagDyes.java b/ee3_common/com/pahimar/ee3/item/crafting/RecipesAlchemicalBagDyes.java deleted file mode 100644 index 74d8adb2..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/RecipesAlchemicalBagDyes.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -import java.util.ArrayList; - -import net.minecraft.block.BlockColored; -import net.minecraft.entity.passive.EntitySheep; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.world.World; - -import com.pahimar.ee3.item.ItemAlchemicalBag; - -/** - * Equivalent-Exchange-3 - * - * RecipesAlchemicalBagDyes - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class RecipesAlchemicalBagDyes implements IRecipe { - - @Override - public boolean matches(InventoryCrafting inventoryCrafting, World world) { - - ItemStack itemStack = null; - ArrayList arrayList = new ArrayList(); - - for (int i = 0; i < inventoryCrafting.getSizeInventory(); ++i) { - - ItemStack currentStack = inventoryCrafting.getStackInSlot(i); - - if (currentStack != null) { - - if (currentStack.getItem() instanceof ItemAlchemicalBag) { - - if (itemStack != null) - return false; - - itemStack = currentStack; - } - else { - - if (currentStack.itemID != Item.dyePowder.itemID) - return false; - - arrayList.add(currentStack); - } - } - } - - return itemStack != null && !arrayList.isEmpty(); - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inventoryCrafting) { - - ItemStack itemStack = null; - ItemAlchemicalBag itemAlchemicalBag = null; - int[] colorChannels = new int[3]; - int i = 0; - int j = 0; - int k, j1, k1, l1; - int currentColor, newColor; - float red, green, blue; - - for (k = 0; k < inventoryCrafting.getSizeInventory(); ++k) { - - ItemStack currentStack = inventoryCrafting.getStackInSlot(k); - - if (currentStack != null) { - - if (currentStack.getItem() instanceof ItemAlchemicalBag) { - - itemAlchemicalBag = (ItemAlchemicalBag) currentStack.getItem(); - - if (itemStack != null) - return null; - - itemStack = currentStack.copy(); - itemStack.stackSize = 1; - - if (itemAlchemicalBag.hasColor(currentStack)) { - - currentColor = itemAlchemicalBag.getColor(itemStack); - red = (currentColor >> 16 & 255) / 255.0F; - green = (currentColor >> 8 & 255) / 255.0F; - blue = (currentColor & 255) / 255.0F; - i = (int) (i + Math.max(red, Math.max(green, blue)) * 255.0F); - colorChannels[0] = (int) (colorChannels[0] + red * 255.0F); - colorChannels[1] = (int) (colorChannels[1] + green * 255.0F); - colorChannels[2] = (int) (colorChannels[2] + blue * 255.0F); - ++j; - } - } - else { - - if (currentStack.itemID != Item.dyePowder.itemID) - return null; - - float[] dyeColorChannels = EntitySheep.fleeceColorTable[BlockColored.getBlockFromDye(currentStack.getItemDamage())]; - j1 = (int) (dyeColorChannels[0] * 255.0F); - k1 = (int) (dyeColorChannels[1] * 255.0F); - newColor = (int) (dyeColorChannels[2] * 255.0F); - i += Math.max(j1, Math.max(k1, newColor)); - colorChannels[0] += j1; - colorChannels[1] += k1; - colorChannels[2] += newColor; - ++j; - } - } - } - - if (itemAlchemicalBag == null) - return null; - else { - - k = colorChannels[0] / j; - l1 = colorChannels[1] / j; - currentColor = colorChannels[2] / j; - red = (float) i / (float) j; - green = Math.max(k, Math.max(l1, currentColor)); - k = (int) (k * red / green); - l1 = (int) (l1 * red / green); - currentColor = (int) (currentColor * red / green); - newColor = (k << 8) + l1; - newColor = (newColor << 8) + currentColor; - itemAlchemicalBag.setColor(itemStack, newColor); - return itemStack; - } - } - - @Override - public int getRecipeSize() { - - return 10; - } - - @Override - public ItemStack getRecipeOutput() { - - return null; - } - -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/RecipesPotions.java b/ee3_common/com/pahimar/ee3/item/crafting/RecipesPotions.java deleted file mode 100644 index c270bac9..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/RecipesPotions.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.pahimar.ee3.item.CustomWrappedStack; - -public class RecipesPotions { - - private static Multimap> potionRecipes = null; - - private static CustomWrappedStack reagentWater = new CustomWrappedStack(new ItemStack(Block.waterStill)); - private static CustomWrappedStack reagentNetherWart = new CustomWrappedStack(new ItemStack(372, 1, 0)); - private static CustomWrappedStack reagentGlowstoneDust = new CustomWrappedStack(new ItemStack(Item.glowstone)); - private static CustomWrappedStack reagentRedstoneDust = new CustomWrappedStack(new ItemStack(331, 1, 0)); - private static CustomWrappedStack reagentGunpowder = new CustomWrappedStack(new ItemStack(Item.gunpowder)); - private static CustomWrappedStack reagentGoldenCarrot = new CustomWrappedStack(new ItemStack(Item.goldenCarrot)); - private static CustomWrappedStack reagentMagmaCream = new CustomWrappedStack(new ItemStack(Item.magmaCream)); - private static CustomWrappedStack reagentSugar = new CustomWrappedStack(new ItemStack(Item.sugar)); - private static CustomWrappedStack reagentGlisteringMelon = new CustomWrappedStack(new ItemStack(Item.speckledMelon)); - private static CustomWrappedStack reagentSpiderEye = new CustomWrappedStack(new ItemStack(Item.spiderEye)); - private static CustomWrappedStack reagentGhastTear = new CustomWrappedStack(new ItemStack(Item.ghastTear)); - private static CustomWrappedStack reagentFermentedSpiderEye = new CustomWrappedStack(new ItemStack(Item.fermentedSpiderEye)); - private static CustomWrappedStack reagentBlazePowder = new CustomWrappedStack(new ItemStack(Item.blazePowder)); - - private static CustomWrappedStack bottleWater = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 0)); - - private static CustomWrappedStack potionAwkward = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16)); - private static CustomWrappedStack potionThick = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 32)); - private static CustomWrappedStack potionMundane = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 128)); - private static CustomWrappedStack potionMundaneExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 64)); - private static CustomWrappedStack potionMundaneSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16512)); - private static CustomWrappedStack potionMundaneSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16448)); - - private static CustomWrappedStack potionRegeneration = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8193)); - private static CustomWrappedStack potionRegenerationEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8225)); - private static CustomWrappedStack potionRegenerationExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8257)); - private static CustomWrappedStack potionRegenerationSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16385)); - private static CustomWrappedStack potionRegenerationSplashEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16417)); - private static CustomWrappedStack potionRegenerationSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16449)); - - private static CustomWrappedStack potionSwiftness = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8194)); - private static CustomWrappedStack potionSwiftnessEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8226)); - private static CustomWrappedStack potionSwiftnessExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8258)); - private static CustomWrappedStack potionSwiftnessSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16386)); - private static CustomWrappedStack potionSwiftnessSplashEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16418)); - private static CustomWrappedStack potionSwiftnessSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16450)); - - private static CustomWrappedStack potionFireResist = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8195)); - private static CustomWrappedStack potionFireResistExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8259)); - private static CustomWrappedStack potionFireResistSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16387)); - private static CustomWrappedStack potionFireResistSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16451)); - - private static CustomWrappedStack potionPoison = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8196)); - private static CustomWrappedStack potionPoisonEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8228)); - private static CustomWrappedStack potionPoisonExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8260)); - private static CustomWrappedStack potionPoisonSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16388)); - private static CustomWrappedStack potionPoisonSplashEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16420)); - private static CustomWrappedStack potionPoisonSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16452)); - - private static CustomWrappedStack potionHealing = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8197)); - private static CustomWrappedStack potionHealingEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8229)); - private static CustomWrappedStack potionHealingSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16389)); - private static CustomWrappedStack potionHealingSplashEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16421)); - - private static CustomWrappedStack potionNightVision = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8198)); - private static CustomWrappedStack potionNightVisionExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8262)); - private static CustomWrappedStack potionNightVisionSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16390)); - private static CustomWrappedStack potionNightVisionSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16454)); - - private static CustomWrappedStack potionWeakness = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8200)); - private static CustomWrappedStack potionWeaknessExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8264)); - private static CustomWrappedStack potionWeaknessSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16392)); - private static CustomWrappedStack potionWeaknessSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16456)); - - private static CustomWrappedStack potionStrength = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8201)); - private static CustomWrappedStack potionStrengthEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8233)); - private static CustomWrappedStack potionStrengthExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8265)); - private static CustomWrappedStack potionStrengthSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16393)); - private static CustomWrappedStack potionStrengthSplashEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16425)); - private static CustomWrappedStack potionStrengthSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16457)); - - private static CustomWrappedStack potionSlowness = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8202)); - private static CustomWrappedStack potionSlownessExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8266)); - private static CustomWrappedStack potionSlownessSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16394)); - private static CustomWrappedStack potionSlownessSplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16458)); - - private static CustomWrappedStack potionHarming = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8204)); - private static CustomWrappedStack potionHarmingEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8236)); - private static CustomWrappedStack potionHarmingSplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16396)); - private static CustomWrappedStack potionHarmingSplashEnhanced = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16428)); - - private static CustomWrappedStack potionInvisibility = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8206)); - private static CustomWrappedStack potionInvisibilityExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 8270)); - private static CustomWrappedStack potionInvisibilitySplash = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16398)); - private static CustomWrappedStack potionInvisibilitySplashExtended = new CustomWrappedStack(new ItemStack(Item.potion.itemID, 1, 16462)); - - public static Multimap> getPotionRecipes() { - - if (potionRecipes == null) { - init(); - } - - return potionRecipes; - } - - private static void init() { - - potionRecipes = HashMultimap.create(); - - potionRecipes.put(bottleWater, Arrays.asList(reagentWater)); - - potionRecipes.put(potionAwkward, Arrays.asList(bottleWater, reagentNetherWart)); - - potionRecipes.put(potionNightVision, Arrays.asList(potionAwkward, reagentGoldenCarrot)); - potionRecipes.put(potionNightVision, Arrays.asList(potionNightVisionExtended, reagentGlowstoneDust)); - potionRecipes.put(potionNightVisionSplash, Arrays.asList(potionNightVisionSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionNightVisionSplash, Arrays.asList(potionNightVision, reagentGunpowder)); - - potionRecipes.put(potionNightVisionExtended, Arrays.asList(potionNightVision, reagentRedstoneDust)); - potionRecipes.put(potionNightVisionSplashExtended, Arrays.asList(potionNightVisionSplash, reagentRedstoneDust)); - potionRecipes.put(potionNightVisionSplashExtended, Arrays.asList(potionNightVisionExtended, reagentGunpowder)); - - potionRecipes.put(potionInvisibility, Arrays.asList(potionNightVision, reagentFermentedSpiderEye)); - potionRecipes.put(potionInvisibility, Arrays.asList(potionInvisibilityExtended, reagentGlowstoneDust)); - potionRecipes.put(potionInvisibilitySplash, Arrays.asList(potionNightVisionSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionInvisibilitySplash, Arrays.asList(potionInvisibilitySplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionInvisibilitySplash, Arrays.asList(potionInvisibility, reagentGunpowder)); - - potionRecipes.put(potionInvisibilityExtended, Arrays.asList(potionInvisibility, reagentRedstoneDust)); - potionRecipes.put(potionInvisibilityExtended, Arrays.asList(potionNightVisionExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionInvisibilitySplashExtended, Arrays.asList(potionInvisibilitySplash, reagentRedstoneDust)); - potionRecipes.put(potionInvisibilitySplashExtended, Arrays.asList(potionNightVisionSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionInvisibilitySplashExtended, Arrays.asList(potionInvisibilityExtended, reagentGunpowder)); - - potionRecipes.put(potionFireResist, Arrays.asList(potionAwkward, reagentMagmaCream)); - potionRecipes.put(potionFireResist, Arrays.asList(potionFireResistExtended, reagentGlowstoneDust)); - potionRecipes.put(potionFireResistSplash, Arrays.asList(potionFireResistSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionFireResistSplash, Arrays.asList(potionFireResist, reagentGunpowder)); - - potionRecipes.put(potionFireResistExtended, Arrays.asList(potionFireResist, reagentRedstoneDust)); - potionRecipes.put(potionFireResistSplashExtended, Arrays.asList(potionFireResistSplash, reagentRedstoneDust)); - potionRecipes.put(potionFireResistSplashExtended, Arrays.asList(potionFireResistExtended, reagentGunpowder)); - - potionRecipes.put(potionSlowness, Arrays.asList(potionFireResist, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlowness, Arrays.asList(potionSlownessExtended, reagentGlowstoneDust)); - potionRecipes.put(potionSlowness, Arrays.asList(potionSwiftness, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlowness, Arrays.asList(potionSwiftnessExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplash, Arrays.asList(potionFireResistSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplash, Arrays.asList(potionSlownessSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionSlownessSplash, Arrays.asList(potionSwiftnessSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplash, Arrays.asList(potionSwiftnessSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplash, Arrays.asList(potionSlowness, reagentGunpowder)); - - potionRecipes.put(potionSlownessExtended, Arrays.asList(potionFireResistExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessExtended, Arrays.asList(potionSwiftnessEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplashExtended, Arrays.asList(potionFireResistSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplashExtended, Arrays.asList(potionSwiftnessSplashEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionSlownessSplashExtended, Arrays.asList(potionSlownessExtended, reagentGunpowder)); - - potionRecipes.put(potionSwiftness, Arrays.asList(potionAwkward, reagentSugar)); - potionRecipes.put(potionSwiftnessSplash, Arrays.asList(potionSwiftness, reagentGunpowder)); - - potionRecipes.put(potionSwiftnessExtended, Arrays.asList(potionSwiftness, reagentRedstoneDust)); - potionRecipes.put(potionSwiftnessExtended, Arrays.asList(potionSwiftnessEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionSwiftnessSplashExtended, Arrays.asList(potionSwiftnessSplash, reagentRedstoneDust)); - potionRecipes.put(potionSwiftnessSplashExtended, Arrays.asList(potionSwiftnessSplashEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionSwiftnessSplashExtended, Arrays.asList(potionSwiftnessExtended, reagentGunpowder)); - - potionRecipes.put(potionSwiftnessEnhanced, Arrays.asList(potionSwiftness, reagentGlowstoneDust)); - potionRecipes.put(potionSwiftnessEnhanced, Arrays.asList(potionSwiftnessExtended, reagentGlowstoneDust)); - potionRecipes.put(potionSwiftnessSplashEnhanced, Arrays.asList(potionSwiftnessSplash, reagentGlowstoneDust)); - potionRecipes.put(potionSwiftnessSplashEnhanced, Arrays.asList(potionSwiftnessSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionSwiftnessSplashEnhanced, Arrays.asList(potionSwiftnessEnhanced, reagentGunpowder)); - - potionRecipes.put(potionHealing, Arrays.asList(potionAwkward, reagentGlisteringMelon)); - potionRecipes.put(potionHealing, Arrays.asList(potionHealingEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionHealingSplash, Arrays.asList(potionHealingSplashEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionHealingSplash, Arrays.asList(potionHealing, reagentGunpowder)); - - potionRecipes.put(potionHealingEnhanced, Arrays.asList(potionHealing, reagentGlowstoneDust)); - potionRecipes.put(potionHealingSplashEnhanced, Arrays.asList(potionHealingSplash, reagentGlowstoneDust)); - potionRecipes.put(potionHealingSplashEnhanced, Arrays.asList(potionHealingEnhanced, reagentGunpowder)); - - potionRecipes.put(potionHarming, Arrays.asList(potionHealing, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarming, Arrays.asList(potionPoison, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarming, Arrays.asList(potionPoisonExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarming, Arrays.asList(potionHarmingEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionHarmingSplash, Arrays.asList(potionHealingSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingSplash, Arrays.asList(potionPoisonSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingSplash, Arrays.asList(potionPoisonSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingSplash, Arrays.asList(potionHarmingSplashEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionHarmingSplash, Arrays.asList(potionHarming, reagentGunpowder)); - - potionRecipes.put(potionHarmingEnhanced, Arrays.asList(potionHealingEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingEnhanced, Arrays.asList(potionHarming, reagentGlowstoneDust)); - potionRecipes.put(potionHarmingEnhanced, Arrays.asList(potionPoisonEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingSplashEnhanced, Arrays.asList(potionHealingSplashEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingSplashEnhanced, Arrays.asList(potionHarmingSplash, reagentGlowstoneDust)); - potionRecipes.put(potionHarmingSplashEnhanced, Arrays.asList(potionPoisonSplashEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionHarmingSplashEnhanced, Arrays.asList(potionHarmingEnhanced, reagentGunpowder)); - - potionRecipes.put(potionPoison, Arrays.asList(potionAwkward, reagentSpiderEye)); - potionRecipes.put(potionPoisonSplash, Arrays.asList(potionPoison, reagentGunpowder)); - - potionRecipes.put(potionPoisonExtended, Arrays.asList(potionPoisonExtended, reagentRedstoneDust)); - potionRecipes.put(potionPoisonExtended, Arrays.asList(potionPoisonEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionPoisonSplashExtended, Arrays.asList(potionPoisonSplashExtended, reagentRedstoneDust)); - potionRecipes.put(potionPoisonSplashExtended, Arrays.asList(potionPoisonSplashEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionPoisonSplashExtended, Arrays.asList(potionPoisonExtended, reagentGunpowder)); - - potionRecipes.put(potionPoisonEnhanced, Arrays.asList(potionPoison, reagentGlowstoneDust)); - potionRecipes.put(potionPoisonEnhanced, Arrays.asList(potionPoisonExtended, reagentGlowstoneDust)); - potionRecipes.put(potionPoisonSplashEnhanced, Arrays.asList(potionPoisonSplash, reagentGlowstoneDust)); - potionRecipes.put(potionPoisonSplashEnhanced, Arrays.asList(potionPoisonSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionPoisonSplashEnhanced, Arrays.asList(potionPoisonEnhanced, reagentGunpowder)); - - potionRecipes.put(potionRegeneration, Arrays.asList(potionAwkward, reagentGhastTear)); - potionRecipes.put(potionRegenerationSplash, Arrays.asList(potionRegeneration, reagentGunpowder)); - - potionRecipes.put(potionRegenerationExtended, Arrays.asList(potionRegeneration, reagentRedstoneDust)); - potionRecipes.put(potionRegenerationExtended, Arrays.asList(potionRegenerationEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionRegenerationSplashExtended, Arrays.asList(potionRegenerationSplash, reagentRedstoneDust)); - potionRecipes.put(potionRegenerationSplashExtended, Arrays.asList(potionRegenerationSplashEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionRegenerationSplashExtended, Arrays.asList(potionRegenerationExtended, reagentGunpowder)); - - potionRecipes.put(potionRegenerationEnhanced, Arrays.asList(potionRegeneration, reagentGlowstoneDust)); - potionRecipes.put(potionRegenerationEnhanced, Arrays.asList(potionRegenerationExtended, reagentGlowstoneDust)); - potionRecipes.put(potionRegenerationSplashEnhanced, Arrays.asList(potionRegenerationSplash, reagentGlowstoneDust)); - potionRecipes.put(potionRegenerationSplashEnhanced, Arrays.asList(potionRegenerationSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionRegenerationSplashEnhanced, Arrays.asList(potionRegenerationEnhanced, reagentGunpowder)); - - potionRecipes.put(potionWeakness, Arrays.asList(potionAwkward, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeakness, Arrays.asList(potionRegeneration, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeakness, Arrays.asList(potionRegenerationEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeakness, Arrays.asList(potionStrength, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeakness, Arrays.asList(potionStrengthEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeakness, Arrays.asList(potionMundane, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeakness, Arrays.asList(potionWeaknessExtended, reagentGlowstoneDust)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionRegenerationSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionRegenerationSplashEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionStrengthSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionStrengthSplashEnhanced, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionMundaneSplash, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionWeaknessSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionWeaknessSplash, Arrays.asList(potionWeakness, reagentGunpowder)); - - potionRecipes.put(potionWeaknessExtended, Arrays.asList(potionWeakness, reagentRedstoneDust)); - potionRecipes.put(potionWeaknessExtended, Arrays.asList(potionRegenerationExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessExtended, Arrays.asList(potionStrengthExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessExtended, Arrays.asList(potionMundaneExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplashExtended, Arrays.asList(potionWeaknessSplash, reagentRedstoneDust)); - potionRecipes.put(potionWeaknessSplashExtended, Arrays.asList(potionRegenerationSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplashExtended, Arrays.asList(potionStrengthSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplashExtended, Arrays.asList(potionMundaneSplashExtended, reagentFermentedSpiderEye)); - potionRecipes.put(potionWeaknessSplashExtended, Arrays.asList(potionWeaknessExtended, reagentGunpowder)); - - potionRecipes.put(potionStrength, Arrays.asList(potionAwkward, reagentBlazePowder)); - potionRecipes.put(potionStrengthSplash, Arrays.asList(potionStrength, reagentGunpowder)); - - potionRecipes.put(potionStrengthEnhanced, Arrays.asList(potionStrength, reagentGlowstoneDust)); - potionRecipes.put(potionStrengthEnhanced, Arrays.asList(potionStrengthExtended, reagentGlowstoneDust)); - potionRecipes.put(potionStrengthSplashEnhanced, Arrays.asList(potionStrengthSplash, reagentGlowstoneDust)); - potionRecipes.put(potionStrengthSplashEnhanced, Arrays.asList(potionStrengthSplashExtended, reagentGlowstoneDust)); - potionRecipes.put(potionStrengthSplashEnhanced, Arrays.asList(potionStrengthEnhanced, reagentGunpowder)); - - potionRecipes.put(potionStrengthExtended, Arrays.asList(potionStrength, reagentRedstoneDust)); - potionRecipes.put(potionStrengthExtended, Arrays.asList(potionStrengthEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionStrengthSplashExtended, Arrays.asList(potionStrengthSplash, reagentRedstoneDust)); - potionRecipes.put(potionStrengthSplashExtended, Arrays.asList(potionStrengthSplashEnhanced, reagentRedstoneDust)); - potionRecipes.put(potionStrengthSplashExtended, Arrays.asList(potionStrengthExtended, reagentGunpowder)); - - potionRecipes.put(potionThick, Arrays.asList(bottleWater, reagentGlowstoneDust)); - - potionRecipes.put(potionMundane, Arrays.asList(bottleWater, reagentSugar)); - potionRecipes.put(potionMundane, Arrays.asList(bottleWater, reagentGlisteringMelon)); - potionRecipes.put(potionMundane, Arrays.asList(bottleWater, reagentSpiderEye)); - potionRecipes.put(potionMundane, Arrays.asList(bottleWater, reagentBlazePowder)); - potionRecipes.put(potionMundane, Arrays.asList(bottleWater, reagentMagmaCream)); - potionRecipes.put(potionMundane, Arrays.asList(bottleWater, reagentGhastTear)); - potionRecipes.put(potionMundaneSplash, Arrays.asList(potionMundane, reagentGunpowder)); - - potionRecipes.put(potionMundaneExtended, Arrays.asList(bottleWater, reagentRedstoneDust)); - potionRecipes.put(potionMundaneSplashExtended, Arrays.asList(potionMundaneExtended, reagentGunpowder)); - } -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/RecipesSmelting.java b/ee3_common/com/pahimar/ee3/item/crafting/RecipesSmelting.java deleted file mode 100644 index 21f3e7c0..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/RecipesSmelting.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.pahimar.ee3.core.util.EnergyStack; -import com.pahimar.ee3.item.CustomWrappedStack; - -public class RecipesSmelting { - - private static Multimap> smeltingRecipes = null; - - private static final CustomWrappedStack smeltingEnergy = new CustomWrappedStack(new EnergyStack(EnergyStack.VANILLA_SMELTING_ENERGY_NAME, EnergyStack.VANILLA_SMELTING_ENERGY_THRESHOLD)); - - public static Multimap> getSmeltingRecipes() { - - if (smeltingRecipes == null) { - init(); - } - - return smeltingRecipes; - } - - private static void init() { - - smeltingRecipes = HashMultimap.create(); - - @SuppressWarnings("unchecked") - Map smeltingList = FurnaceRecipes.smelting().getSmeltingList(); - Map, ItemStack> metaSmeltingList = FurnaceRecipes.smelting().getMetaSmeltingList(); - - for (Integer i : smeltingList.keySet()) { - smeltingRecipes.put(new CustomWrappedStack(smeltingList.get(i)), Arrays.asList(smeltingEnergy, new CustomWrappedStack(new ItemStack(i, 1, 0)))); - } - - for (List idMetaPair : metaSmeltingList.keySet()) { - if (idMetaPair.size() == 2) { - smeltingRecipes.put(new CustomWrappedStack(metaSmeltingList.get(idMetaPair)), Arrays.asList(smeltingEnergy, new CustomWrappedStack(new ItemStack(idMetaPair.get(0), 1, idMetaPair.get(1))))); - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/RecipesVanilla.java b/ee3_common/com/pahimar/ee3/item/crafting/RecipesVanilla.java deleted file mode 100644 index 5b504acb..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/RecipesVanilla.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.pahimar.ee3.core.util.RecipeHelper; -import com.pahimar.ee3.item.CustomWrappedStack; - -public class RecipesVanilla { - - private static Multimap> vanillaRecipes = null; - - ArrayList discoveredItems = new ArrayList(); - - public static Multimap> getVanillaRecipes() { - - if (vanillaRecipes == null) { - init(); - } - - return vanillaRecipes; - } - - private static void init() { - - vanillaRecipes = HashMultimap.create(); - - for (Object recipeObject : CraftingManager.getInstance().getRecipeList()) { - - if (recipeObject instanceof IRecipe) { - - IRecipe recipe = (IRecipe) recipeObject; - ItemStack recipeOutput = recipe.getRecipeOutput(); - - if (recipeOutput != null) { - - ArrayList recipeInputs = RecipeHelper.getRecipeInputs(recipe); - vanillaRecipes.put(new CustomWrappedStack(recipeOutput), recipeInputs); - } - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/item/crafting/TransmutationManager.java b/ee3_common/com/pahimar/ee3/item/crafting/TransmutationManager.java deleted file mode 100644 index 9ec6d0f3..00000000 --- a/ee3_common/com/pahimar/ee3/item/crafting/TransmutationManager.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.pahimar.ee3.item.crafting; - -import java.util.ArrayList; -import java.util.List; - -/** - * Equivalent-Exchange-3 - * - * TransmutationManager - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class TransmutationManager { - - /** The static instance of this class */ - private static final TransmutationManager instance = new TransmutationManager(); - - /** A list of all the recipes added */ - private List recipes = new ArrayList(); - - /** - * Returns the static instance of this class - */ - public static final TransmutationManager getInstance() { - - return instance; - } - - private TransmutationManager() { - - } - - /** - * returns the List<> of all recipes - */ - public List getRecipeList() { - - return recipes; - } -} diff --git a/ee3_common/com/pahimar/ee3/lib/ActionTypes.java b/ee3_common/com/pahimar/ee3/lib/ActionTypes.java deleted file mode 100644 index 975decd6..00000000 --- a/ee3_common/com/pahimar/ee3/lib/ActionTypes.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * ActionTypes - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ActionTypes { - - public static final byte TRANSMUTATION = 0; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/BlockIds.java b/ee3_common/com/pahimar/ee3/lib/BlockIds.java deleted file mode 100644 index 98958c07..00000000 --- a/ee3_common/com/pahimar/ee3/lib/BlockIds.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * BlockIds - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class BlockIds { - - /* Default block ids */ - public static int CALCINATOR_DEFAULT = 2451; - public static int RED_WATER_STILL_DEFAULT = 2453; - public static int ALUDEL_BASE_DEFAULT = 2454; - public static int ALCHEMICAL_CHEST_DEFAULT = 2455; - public static int GLASS_BELL_DEFAULT = 2456; - - /* Current block ids */ - public static int CALCINATOR; - public static int ALUDEL_BASE; - public static int ALCHEMICAL_CHEST; - public static int RED_WATER_STILL; - public static int GLASS_BELL; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/Colours.java b/ee3_common/com/pahimar/ee3/lib/Colours.java deleted file mode 100644 index 1fb92e01..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Colours.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Colours - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Colours { - - public static final String PURE_WHITE = "ffffff"; - - /* Text colour related constants */ - public static final String TEXT_COLOUR_PREFIX_YELLOW = "\u00a7e"; - public static final String TEXT_COLOUR_PREFIX_GRAY = "\u00a77"; - public static final String TEXT_COLOUR_PREFIX_WHITE = "\u00a7f"; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/Commands.java b/ee3_common/com/pahimar/ee3/lib/Commands.java deleted file mode 100644 index 60aea439..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Commands.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Commands - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Commands { - - /* Command related contants */ - public static final String ALL = "all"; - public static final String SELF = "self"; - public static final String ON = "on"; - public static final String OFF = "off"; - - public static final String COMMAND_EE3 = "ee3"; - public static final String COMMAND_ON = "on"; - public static final String COMMAND_OFF = "off"; - public static final String COMMAND_ALL = "all"; - public static final String COMMAND_SELF = "self"; - public static final String COMMAND_OVERLAY = "overlay"; - public static final String COMMAND_POSITION = "position"; - public static final String COMMAND_OPACITY = "opacity"; - public static final String COMMAND_SCALE = "scale"; - public static final String COMMAND_TOP = "top"; - public static final String COMMAND_BOTTOM = "bottom"; - public static final String COMMAND_LEFT = "left"; - public static final String COMMAND_RIGHT = "right"; - public static final String COMMAND_PARTICLES = "particles"; - public static final String COMMAND_SOUNDS = "sounds"; - public static final String COMMAND_VERSION = "version"; - public static final String COMMAND_CHANGELOG = "changelog"; - public static final String COMMAND_EE3_USAGE = "ee3 [ overlay | particles | sounds | version ]"; - public static final String COMMAND_OVERLAY_USAGE = "ee3 overlay [ on | off | position | scale | opacity ]"; - public static final String COMMAND_OVERLAY_POSITION_USAGE = "ee3 overlay position [ top | bottom ] [ left | right ]"; - public static final String COMMAND_OVERLAY_OPACITY_USAGE = "ee3 overlay opacity ### "; - public static final String COMMAND_OVERLAY_SCALE_USAGE = "ee3 overlay scale ### "; - public static final String COMMAND_PARTICLES_USAGE = "ee3 particles [ on | off ]"; - public static final String COMMAND_SOUNDS_USAGE = "ee3 sounds [ all | self | off ]"; - public static final String COMMAND_VERSION_USAGE = "command.ee3.version.usage"; - - public static final String COMMAND_OVERLAY_TURNED_ON = "command.ee3.overlay.turned_on"; - public static final String COMMAND_OVERLAY_TURNED_OFF = "command.ee3.overlay.turned_off"; - public static final String COMMAND_OVERLAY_POSITION_TOP_LEFT = "command.ee3.overlay.position.top_left"; - public static final String COMMAND_OVERLAY_POSITION_TOP_RIGHT = "command.ee3.overlay.position.top_right"; - public static final String COMMAND_OVERLAY_POSITION_BOTTOM_LEFT = "command.ee3.overlay.position.bottom_left"; - public static final String COMMAND_OVERLAY_POSITION_BOTTOM_RIGHT = "command.ee3.overlay.position.bottom_right"; - public static final String COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT = "command.ee3.overlay.opacity.usage.additional_text"; - public static final String COMMAND_OVERLAY_OPACITY_UPDATED = "command.ee3.overlay.opacity.updated"; - public static final String COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT = "command.ee3.overlay.opacity.usage.additional_text"; - public static final String COMMAND_OVERLAY_SCALE_UPDATED = "command.ee3.overlay.scale.updated"; - public static final String COMMAND_PARTICLES_TURNED_ON = "command.ee3.particles.turned_on"; - public static final String COMMAND_PARTICLES_TURNED_OFF = "command.ee3.particles.turned_off"; - public static final String COMMAND_SOUNDS_SET_TO_ALL = "command.ee3.sounds.set_to_all"; - public static final String COMMAND_SOUNDS_SET_TO_SELF = "command.ee3.sounds.set_to_self"; - public static final String COMMAND_SOUNDS_TURNED_OFF = "command.ee3.sounds.turned_off"; -} diff --git a/ee3_common/com/pahimar/ee3/lib/GuiIds.java b/ee3_common/com/pahimar/ee3/lib/GuiIds.java deleted file mode 100644 index 771bb125..00000000 --- a/ee3_common/com/pahimar/ee3/lib/GuiIds.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * GuiIds - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class GuiIds { - - public static final int PORTABLE_CRAFTING = 0; - public static final int PORTABLE_TRANSMUTATION = 1; - public static final int CALCINATOR = 2; - public static final int ALUDEL = 3; - public static final int ALCHEMICAL_CHEST = 4; - public static final int ALCHEMICAL_BAG = 5; - public static final int SHARED_ALCHEMICAL_INVENTORY = 6; - public static final int GLASS_BELL = 7; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/InterModComms.java b/ee3_common/com/pahimar/ee3/lib/InterModComms.java deleted file mode 100644 index c4133e50..00000000 --- a/ee3_common/com/pahimar/ee3/lib/InterModComms.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.pahimar.ee3.lib; - -public class InterModComms { - - // Interacting with the Recipe Registry - public static final String ADD_RECIPE = "add-recipe"; - - // Interacting with the EMC BlackList - public static final String ADD_BLACKLIST_ENTRY = "add-blacklist-entry"; - public static final String REMOVE_BLACKLIST_ENTRY = "remove-blacklist-entry"; - - // Interacting with the EMC value mappings - public static final String SET_EMC_VALUE = "set-emc-value"; -} diff --git a/ee3_common/com/pahimar/ee3/lib/ItemIds.java b/ee3_common/com/pahimar/ee3/lib/ItemIds.java deleted file mode 100644 index ea44434e..00000000 --- a/ee3_common/com/pahimar/ee3/lib/ItemIds.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * ItemIds - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemIds { - - /* Default item ids */ - public static int MINIUM_SHARD_DEFAULT = 27000; - public static int INERT_STONE_DEFAULT = 27001; - public static int MINIUM_STONE_DEFAULT = 27002; - public static int PHILOSOPHERS_STONE_DEFAULT = 27003; - public static int ALCHEMICAL_DUST_DEFAULT = 27004; - public static int ALCHEMICAL_BAG_DEFAULT = 27005; - - /* Current item ids */ - public static int MINIUM_SHARD; - public static int INERT_STONE; - public static int MINIUM_STONE; - public static int PHILOSOPHERS_STONE; - public static int ALCHEMICAL_DUST; - public static int ALCHEMICAL_BAG; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/ItemUpdateTypes.java b/ee3_common/com/pahimar/ee3/lib/ItemUpdateTypes.java deleted file mode 100644 index 373c3145..00000000 --- a/ee3_common/com/pahimar/ee3/lib/ItemUpdateTypes.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * ItemUpdateTypes - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class ItemUpdateTypes { - - public static final byte DESTROYED = 0; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/Localizations.java b/ee3_common/com/pahimar/ee3/lib/Localizations.java deleted file mode 100644 index 33a9c87e..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Localizations.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Localizations - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Localizations { - - private static final String LANG_RESOURCE_LOCATION = "/assets/ee3/lang/"; - - public static String[] localeFiles = { LANG_RESOURCE_LOCATION + "cs_CZ.xml", LANG_RESOURCE_LOCATION + "cy_GB.xml", LANG_RESOURCE_LOCATION + "da_DK.xml", LANG_RESOURCE_LOCATION + "de_DE.xml", LANG_RESOURCE_LOCATION + "en_US.xml", LANG_RESOURCE_LOCATION + "es_ES.xml", LANG_RESOURCE_LOCATION + "fi_FI.xml", LANG_RESOURCE_LOCATION + "fr_FR.xml", LANG_RESOURCE_LOCATION + "it_IT.xml", LANG_RESOURCE_LOCATION + "ja_JP.xml", LANG_RESOURCE_LOCATION + "la_IT.xml", LANG_RESOURCE_LOCATION + "nl_NL.xml", LANG_RESOURCE_LOCATION + "nb_NO.xml", LANG_RESOURCE_LOCATION + "pl_PL.xml", LANG_RESOURCE_LOCATION + "pt_BR.xml", LANG_RESOURCE_LOCATION + "pt_PT.xml", LANG_RESOURCE_LOCATION + "ru_RU.xml", LANG_RESOURCE_LOCATION + "sk_SK.xml", LANG_RESOURCE_LOCATION + "sr_SP.xml", LANG_RESOURCE_LOCATION + "sv_SE.xml", LANG_RESOURCE_LOCATION + "tr_TR.xml", LANG_RESOURCE_LOCATION + "zh_CN.xml", LANG_RESOURCE_LOCATION + "zh_TW.xml", LANG_RESOURCE_LOCATION + "el_GR.xml" }; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/Models.java b/ee3_common/com/pahimar/ee3/lib/Models.java deleted file mode 100644 index 88a11b25..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Models.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.pahimar.ee3.lib; - -public class Models { - - // Base file paths - public static final String MODEL_LOCATION = "/assets/ee3/models/"; - - public static final String ALUDEL = MODEL_LOCATION + "aludel.obj"; - public static final String CALCINATOR = MODEL_LOCATION + "calcinator.obj"; - public static final String GLASS_BELL = MODEL_LOCATION + "aludel.obj"; -} diff --git a/ee3_common/com/pahimar/ee3/lib/Particles.java b/ee3_common/com/pahimar/ee3/lib/Particles.java deleted file mode 100644 index 9ca785a2..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Particles.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Particles - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Particles { - - /* Vanilla particle names (not necessarily all of them) */ - public static final String NORMAL_SMOKE = "smoke"; - public static final String LARGE_SMOKE = "largesmoke"; - public static final String NORMAL_EXPLODE = "explode"; - public static final String LARGE_EXPLODE = "largeexplode"; - public static final String HUGE_EXPLODE = "hugeexplode"; - public static final String HEART = "heart"; - public static final String DEATH_SUSPEND = "deathsuspend"; - public static final String SUSPEND = "suspend"; - public static final String WITCH_MAGIC = "witchMagic"; - public static final String BUBBLE = "bubble"; - public static final String SPLASH = "splash"; - public static final String SNOWBALL_POOF = "snowballpoof"; - public static final String SNOW_SHOVEL = "snowshovel"; - public static final String NOTE = "note"; - public static final String PORTAL = "portal"; - public static final String MOB_SPELL = "mobSpell"; - public static final String MOB_SPELL_AMBIENT = "mobSpellAmbient"; - public static final String FIREWORKS_SPARKLE = "fireworksSpark"; - public static final String SLIME = "slime"; - public static final String CRIT = "crit"; - public static final String FLAME = "flame"; - public static final String ENCHANTMENT_TABLE = "enchantmenttable"; - public static final String DRIP_WATER = "dripWater"; - public static final String DRIP_LAVA = "dripLava"; - public static final String TOWN_AURA = "townaura"; - public static final String RED_DUST = "reddust"; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/Reference.java b/ee3_common/com/pahimar/ee3/lib/Reference.java deleted file mode 100644 index 4a8bd425..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Reference.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Reference - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Reference { - - /* Debug Mode On-Off */ - public static final boolean DEBUG_MODE = false; - - /* General Mod related constants */ - public static final String MOD_ID = "EE3"; - public static final String MOD_NAME = "Equivalent Exchange 3"; - public static final String VERSION_NUMBER = "@VERSION@ (build @BUILD_NUMBER@)"; - public static final String CHANNEL_NAME = MOD_ID; - public static final String DEPENDENCIES = "required-after:Forge@[7.7.1.650,)"; - public static final String FINGERPRINT = "@FINGERPRINT@"; - public static final int SECOND_IN_TICKS = 20; - public static final int SHIFTED_ID_RANGE_CORRECTION = 256; - public static final String SERVER_PROXY_CLASS = "com.pahimar.ee3.core.proxy.CommonProxy"; - public static final String CLIENT_PROXY_CLASS = "com.pahimar.ee3.core.proxy.ClientProxy"; - public static final int VERSION_CHECK_ATTEMPTS = 3; - - public static final int ORE_DICTIONARY_NOT_FOUND = -1; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/RenderIds.java b/ee3_common/com/pahimar/ee3/lib/RenderIds.java deleted file mode 100644 index 0cb617e1..00000000 --- a/ee3_common/com/pahimar/ee3/lib/RenderIds.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * RenderIds - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class RenderIds { - - public static int calcinatorRenderId; - public static int aludelRenderId; - public static int alchemicalChestRenderId; - public static int glassBellId; -} diff --git a/ee3_common/com/pahimar/ee3/lib/Sounds.java b/ee3_common/com/pahimar/ee3/lib/Sounds.java deleted file mode 100644 index 242cc796..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Sounds.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Sounds - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Sounds { - - private static final String SOUND_RESOURCE_LOCATION = Reference.MOD_ID.toLowerCase() + ":"; - private static final String SOUND_PREFIX = Reference.MOD_ID.toLowerCase() + ":"; - - public static String[] soundFiles = { SOUND_RESOURCE_LOCATION + "chargeDown.ogg", SOUND_RESOURCE_LOCATION + "chargeUp.ogg", SOUND_RESOURCE_LOCATION + "destruct.ogg", SOUND_RESOURCE_LOCATION + "fail.ogg", SOUND_RESOURCE_LOCATION + "gust.ogg", SOUND_RESOURCE_LOCATION + "heal.ogg", SOUND_RESOURCE_LOCATION + "kinesis.ogg", SOUND_RESOURCE_LOCATION + "launch.ogg", SOUND_RESOURCE_LOCATION + "nova.ogg", SOUND_RESOURCE_LOCATION + "philball.ogg", SOUND_RESOURCE_LOCATION + "tock.ogg", SOUND_RESOURCE_LOCATION + "transmute.ogg", SOUND_RESOURCE_LOCATION + "wall.ogg", SOUND_RESOURCE_LOCATION + "waterball.ogg", SOUND_RESOURCE_LOCATION + "wind.ogg" }; - - public static final String CHARGE_DOWN = SOUND_PREFIX + "chargeDown"; - public static final String CHARGE_UP = SOUND_PREFIX + "chargeUp"; - public static final String DESTRUCTION = SOUND_PREFIX + "destruct"; - public static final String FAIL = SOUND_PREFIX + "fail"; - public static final String GUST = SOUND_PREFIX + "gust"; - public static final String HEAL = SOUND_PREFIX + "heal"; - public static final String KINESIS = SOUND_PREFIX + "kinesis"; - public static final String LAUNCH = SOUND_PREFIX + "launch"; - public static final String NOVA = SOUND_PREFIX + "nova"; - public static final String PHILOSOPHERS_BALL = SOUND_PREFIX + "philball"; - public static final String TOCK = SOUND_PREFIX + "tock"; - public static final String TRANSMUTE = SOUND_PREFIX + "transmute"; - public static final String WALL = SOUND_PREFIX + "wall"; - public static final String WATER_BALL = SOUND_PREFIX + "waterball"; - public static final String WIND = SOUND_PREFIX + "wind"; - - public static final String CHEST_OPEN = "random.chestopen"; - public static final String CHEST_CLOSE = "random.chestclosed"; - public static final String CHARGE_FAIL = FAIL; - -} diff --git a/ee3_common/com/pahimar/ee3/lib/Strings.java b/ee3_common/com/pahimar/ee3/lib/Strings.java deleted file mode 100644 index 2ee765b5..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Strings.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.pahimar.ee3.lib; - -/** - * Equivalent-Exchange-3 - * - * Strings - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Strings { - - /* General keys */ - public static final String TRUE = "true"; - public static final String FALSE = "false"; - public static final String TOKEN_DELIMITER = "."; - - /* Fingerprint check related constants */ - public static final String INVALID_FINGERPRINT_MESSAGE = "The copy of Equivalent Exchange 3 that you are running has been modified from the original, and unpredictable things may happen. Please consider re-downloading the original version of the mod."; - - /* Version check related constants */ - public static final String VERSION_CHECK_INIT_LOG_MESSAGE = "version.init_log_message"; - public static final String UNINITIALIZED_MESSAGE = "version.uninitialized"; - public static final String CURRENT_MESSAGE = "version.current"; - public static final String OUTDATED_MESSAGE = "version.outdated"; - public static final String GENERAL_ERROR_MESSAGE = "version.general_error"; - public static final String FINAL_ERROR_MESSAGE = "version.final_error"; - public static final String MC_VERSION_NOT_FOUND = "version.mc_version_not_found"; - - /* NBT related constants */ - public static final String NBT_ITEM_CHARGE_LEVEL_KEY = "itemChargeLevel"; - public static final String NBT_ITEM_MODE_KEY = "itemMode"; - public static final String NBT_ITEM_CRAFTING_GUI_OPEN = "itemCraftingGuiOpen"; - public static final String NBT_ITEM_TRANSMUTATION_GUI_OPEN = "itemTransmutationGuiOpen"; - public static final String NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN = "itemAlchemicalBagGuiOpen"; - public static final String NBT_ITEM_DISPLAY = "display"; - public static final String NBT_ITEM_COLOR = "color"; - public static final String NBT_TE_STATE_KEY = "teState"; - public static final String NBT_TE_CUSTOM_NAME = "CustomName"; - public static final String NBT_TE_DIRECTION_KEY = "teDirection"; - public static final String NBT_ENCODED_RECIPE_OUTPUT = "recipeOutput"; - public static final String NBT_ENCODED_RECIPE_INPUTS = "recipeInputs"; - public static final String NBT_ENCODED_RECIPE_INPUT_PREFIX = "recipeInput_"; - public static final String NBT_ENCODED_ATTR_TYPE = "type"; - public static final String NBT_ENCODED_ATTR_TYPE_ITEM = "ItemStack"; - public static final String NBT_ENCODED_ATTR_TYPE_ORE = "OreStack"; - public static final String NBT_ENCODED_ATTR_TYPE_ENERGY = "EnergyStack"; - public static final String NBT_ENCODED_ATTR_SIZE = "Count"; - public static final String NBT_ENCODED_ATTR_ITEM_ID = "id"; - public static final String NBT_ENCODED_ATTR_ITEM_META = "Damage"; - public static final String NBT_ENCODED_ATTR_ITEM_TAG_COMPOUND = "tag"; - public static final String NBT_ENCODED_ATTR_ORE_NAME = "oreName"; - public static final String NBT_ENCODED_ATTR_ENERGY_NAME = "energyName"; - - /* Block name constants */ - public static final String CALCINATOR_NAME = "calcinator"; - public static final String ALUDEL_NAME = "aludel"; - public static final String ALCHEMICAL_CHEST_NAME = "alchemicalChest"; - public static final String GLASS_BELL_NAME = "glassBell"; - public static final String RED_WATER_STILL_NAME = "redWaterStill"; - public static final String RED_WATER_FLOWING_NAME = "redWaterFlowing"; - - /* Item name constants */ - public static final String MINIUM_SHARD_NAME = "shardMinium"; - public static final String INERT_STONE_NAME = "stoneInert"; - public static final String MINIUM_STONE_NAME = "stoneMinium"; - public static final String PHILOSOPHERS_STONE_NAME = "stonePhilosophers"; - public static final String ALCHEMICAL_DUST_NAME = "alchemicalDust"; - public static final String ALCHEMICAL_BAG_NAME = "alchemicalBag"; - - /* TileEntity name constants */ - public static final String TE_CALCINATOR_NAME = "tileCalcinator"; - public static final String TE_ALUDEL_NAME = "tileAludel"; - public static final String TE_ALCHEMICAL_CHEST_NAME = "tileAlchemicalChest"; - public static final String TE_GLASS_BELL_NAME = "tileGlassBell"; - - /* Transmutation cost related constants */ - public static final String TRANSMUTATION_COST = "_cost"; - public static final String TRANSMUTATION_COST_ITEM = "item" + TRANSMUTATION_COST; - public static final String TRANSMUTATION_COST_BLOCK = "block" + TRANSMUTATION_COST; - public static final String TRANSMUTATION_COST_MOB = "mob" + TRANSMUTATION_COST; - - /* Container related constants */ - public static final String CONTAINER_CALCINATOR_NAME = "container." + CALCINATOR_NAME; - public static final String CONTAINER_ALUDEL_NAME = "container." + ALUDEL_NAME; - public static final String CONTAINER_ALCHEMICAL_CHEST_NAME = "container." + ALCHEMICAL_CHEST_NAME; - public static final String CONTAINER_ALCHEMICAL_BAG_NAME = "container." + ALCHEMICAL_BAG_NAME; - public static final String CONTAINER_GLASS_BELL_NAME = "container." + GLASS_BELL_NAME; - public static final String CONTAINER_INVENTORY = "container.inventory"; - public static final String CONTAINER_PORTABLE_CRAFTING = "container.crafting"; -} diff --git a/ee3_common/com/pahimar/ee3/lib/Textures.java b/ee3_common/com/pahimar/ee3/lib/Textures.java deleted file mode 100644 index 51af8788..00000000 --- a/ee3_common/com/pahimar/ee3/lib/Textures.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.pahimar.ee3.lib; - -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.ResourceLocation; - -import com.pahimar.ee3.core.util.ResourceLocationHelper; - -/** - * Equivalent-Exchange-3 - * - * Sprites - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class Textures { - - // Base file paths - public static final String MODEL_SHEET_LOCATION = "textures/models/"; - public static final String ARMOR_SHEET_LOCATION = "textures/armor/"; - public static final String GUI_SHEET_LOCATION = "textures/gui/"; - public static final String EFFECTS_LOCATION = "textures/effects/"; - - // Item/Block sprite sheets - public static final ResourceLocation VANILLA_BLOCK_TEXTURE_SHEET = TextureMap.field_110575_b; - public static final ResourceLocation VANILLA_ITEM_TEXTURE_SHEET = TextureMap.field_110576_c; - - // Armor sprite sheets - - // GUI textures - public static final ResourceLocation GUI_CALCINATOR = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "calcinator.png"); - public static final ResourceLocation GUI_ALUDEL = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "aludel.png"); - public static final ResourceLocation GUI_ALCHEMICAL_STORAGE = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "alchemicalStorage.png"); - public static final ResourceLocation GUI_SHARED_ALCHEMICAL_STORAGE = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "sharedAlchemicalStorage.png"); - public static final ResourceLocation GUI_PORTABLE_CRAFTING = ResourceLocationHelper.getResourceLocation("/gui/crafting.png"); - public static final ResourceLocation GUI_PORTABLE_TRANSMUTATION = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "portableTransmutation.png"); - public static final ResourceLocation GUI_GLASS_BELL = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "glassBell.png"); - - // Model textures - public static final ResourceLocation MODEL_CALCINATOR = ResourceLocationHelper.getResourceLocation(MODEL_SHEET_LOCATION + "calcinator.png"); - public static final ResourceLocation MODEL_ALUDEL = ResourceLocationHelper.getResourceLocation(MODEL_SHEET_LOCATION + "aludel.png"); - public static final ResourceLocation MODEL_ALCHEMICAL_CHEST = ResourceLocationHelper.getResourceLocation(MODEL_SHEET_LOCATION + "alchemicalChest.png"); - public static final ResourceLocation MODEL_GLASS_BELL = ResourceLocationHelper.getResourceLocation(MODEL_SHEET_LOCATION + "aludel.png"); - - // Effect textures - public static final ResourceLocation EFFECT_WORLD_TRANSMUTATION = ResourceLocationHelper.getResourceLocation(EFFECTS_LOCATION + "noise.png"); - -} diff --git a/ee3_common/com/pahimar/ee3/nbt/NBTHelper.java b/ee3_common/com/pahimar/ee3/nbt/NBTHelper.java deleted file mode 100644 index 06e87be5..00000000 --- a/ee3_common/com/pahimar/ee3/nbt/NBTHelper.java +++ /dev/null @@ -1,508 +0,0 @@ -package com.pahimar.ee3.nbt; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagEnd; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -import com.pahimar.ee3.core.util.EnergyStack; -import com.pahimar.ee3.core.util.OreStack; -import com.pahimar.ee3.item.CustomWrappedStack; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * NBTHelper - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class NBTHelper { - - /** - * Encodes the given NBT object as a String - * @param nbtBase - * @return String encoding of the given NBT object - */ - public static String encodeNBTAsString(NBTBase nbtBase) { - - StringBuilder stringBuilder = new StringBuilder(); - - if (nbtBase != null) { - // Encode the name of the tag, and the type of the tag - stringBuilder.append(String.format("'%s':%s:", nbtBase.getName(), NBTBase.getTagName(nbtBase.getId()))); - - // Encode the value of the tag, depending on the type of the tag - switch (nbtBase.getId()) - { - case 0: { - stringBuilder.append(((NBTTagEnd) nbtBase).toString()); - break; - } - case 1: { - stringBuilder.append(String.format("%s", ((NBTTagByte) nbtBase).data)); - break; - } - case 2: { - stringBuilder.append(String.format("%s", ((NBTTagShort) nbtBase).data)); - break; - } - case 3: { - stringBuilder.append(String.format("%s", ((NBTTagInt) nbtBase).data)); - break; - } - case 4: { - stringBuilder.append(String.format("%s", ((NBTTagLong) nbtBase).data)); - break; - } - case 5: { - stringBuilder.append(String.format("%s", ((NBTTagFloat) nbtBase).data)); - break; - } - case 6: { - stringBuilder.append(String.format("%s", ((NBTTagDouble) nbtBase).data)); - break; - } - case 7: { - NBTTagByteArray byteArray = (NBTTagByteArray) nbtBase; - - stringBuilder.append("["); - - for (int i = 0; i < byteArray.byteArray.length; i++) { - stringBuilder.append(byteArray.byteArray[i]); - - if (i < byteArray.byteArray.length - 1) { - stringBuilder.append("|"); - } - } - - stringBuilder.append("]"); - - break; - } - case 8: { - stringBuilder.append(String.format("%s", ((NBTTagString) nbtBase).data)); - break; - } - case 9: { - NBTTagList tagList = (NBTTagList) nbtBase; - - stringBuilder.append("["); - - for (int i = 0; i < tagList.tagCount(); i++) { - Object tagObject = tagList.tagAt(i); - - if (tagObject instanceof NBTBase) { - stringBuilder.append(encodeNBTAsString((NBTBase) tagObject)); - } - - if (i < tagList.tagCount() - 1) { - stringBuilder.append("|"); - } - } - - stringBuilder.append("]"); - - break; - } - case 10: { - NBTTagCompound tagCompound = (NBTTagCompound) nbtBase; - - stringBuilder.append("["); - - Iterator tagIterator = tagCompound.getTags().iterator(); - - while (tagIterator.hasNext()) { - Object tagObject = tagIterator.next(); - - if (tagObject instanceof NBTBase) { - stringBuilder.append(encodeNBTAsString((NBTBase) tagObject)); - } - - if (tagIterator.hasNext()) { - stringBuilder.append("|"); - } - } - - stringBuilder.append("]"); - - break; - } - case 11: { - NBTTagIntArray intArray = (NBTTagIntArray) nbtBase; - - stringBuilder.append("["); - - for (int i = 0; i < intArray.intArray.length; i++) { - stringBuilder.append(intArray.intArray[i]); - - if (i < intArray.intArray.length - 1) { - stringBuilder.append("|"); - } - } - - stringBuilder.append("]"); - - break; - } - default: { - stringBuilder.append("UNKNOWN"); - break; - } - } - } - - return stringBuilder.toString(); - } - - // TODO Link this method to some API stuffs - public static NBTTagCompound encodeStackAsNBT(Object stackObject) { - - return encodeStackAsNBT("", stackObject); - } - - public static NBTTagCompound encodeStackAsNBT(String name, Object object) { - - NBTTagCompound encodedStack = new NBTTagCompound(name); - - if (CustomWrappedStack.canBeWrapped(object)) { - - CustomWrappedStack wrappedStack = new CustomWrappedStack(object); - - if (wrappedStack.getWrappedStack() instanceof ItemStack) { - - ItemStack itemStack = (ItemStack) wrappedStack.getWrappedStack(); - encodedStack.setString(Strings.NBT_ENCODED_ATTR_TYPE, Strings.NBT_ENCODED_ATTR_TYPE_ITEM); - itemStack.writeToNBT(encodedStack); - } - else if (wrappedStack.getWrappedStack() instanceof OreStack) { - OreStack oreStack = (OreStack) wrappedStack.getWrappedStack(); - - encodedStack.setString(Strings.NBT_ENCODED_ATTR_TYPE, Strings.NBT_ENCODED_ATTR_TYPE_ORE); - encodedStack.setString(Strings.NBT_ENCODED_ATTR_ORE_NAME, oreStack.oreName); - encodedStack.setShort(Strings.NBT_ENCODED_ATTR_SIZE, (short) wrappedStack.getStackSize()); - } - else if (wrappedStack.getWrappedStack() instanceof EnergyStack) { - EnergyStack energyStack = (EnergyStack) wrappedStack.getWrappedStack(); - - encodedStack.setString(Strings.NBT_ENCODED_ATTR_TYPE, Strings.NBT_ENCODED_ATTR_TYPE_ENERGY); - encodedStack.setString(Strings.NBT_ENCODED_ATTR_ENERGY_NAME, energyStack.energyName); - encodedStack.setShort(Strings.NBT_ENCODED_ATTR_SIZE, (short) wrappedStack.getStackSize()); - } - } - - return encodedStack; - } - - public static NBTTagCompound encodeRecipeAsNBT(Object recipeOutput, List recipeInputs) { - - NBTTagCompound encodedRecipe = new NBTTagCompound(); - - NBTTagCompound recipeOutputNBTCompound = encodeStackAsNBT(Strings.NBT_ENCODED_RECIPE_OUTPUT, recipeOutput); - NBTTagList recipeInputsNBTList = new NBTTagList(Strings.NBT_ENCODED_RECIPE_INPUTS); - - for (int i = 0; i < recipeInputs.size(); i++) { - recipeInputsNBTList.appendTag(encodeStackAsNBT(Strings.NBT_ENCODED_RECIPE_INPUT_PREFIX.concat(Integer.toString(i)), recipeInputs.get(i))); - } - - encodedRecipe.setCompoundTag(Strings.NBT_ENCODED_RECIPE_OUTPUT, recipeOutputNBTCompound); - encodedRecipe.setTag(Strings.NBT_ENCODED_RECIPE_INPUTS, recipeInputsNBTList); - - return encodedRecipe; - } - - /** - * - * @param encodedStack - * A NBTTagCompound containing the encoded information of either - * a ItemStack, OreStack, or EnergyStack - * @return A CustomWrappedStack containing the encoded stack provided in the - * NBTTagCompound (could be ItemStack, OreStack, or EnergyStack). - * Returns null in the event that no valid stack was able to be - * parsed from the encoded NBTTagCompound. - */ - public static CustomWrappedStack decodeStackFromNBT(NBTTagCompound encodedStack) { - - CustomWrappedStack decodedStack = null; - - // If the encoded tag compound is of type ItemStack, parse out the ItemStack info - if (encodedStack.hasKey(Strings.NBT_ENCODED_ATTR_TYPE)) { - if (encodedStack.getString(Strings.NBT_ENCODED_ATTR_TYPE).equalsIgnoreCase(Strings.NBT_ENCODED_ATTR_TYPE_ITEM)) { - - ItemStack itemStack = new ItemStack(0, 0, 0); - itemStack.readFromNBT(encodedStack); - decodedStack = new CustomWrappedStack(itemStack); - } - // Else if the encoded tag compound is of type OreStack, parse out the OreStack info - else if (encodedStack.getString(Strings.NBT_ENCODED_ATTR_TYPE).equalsIgnoreCase(Strings.NBT_ENCODED_ATTR_TYPE_ORE)) { - - if (encodedStack.hasKey(Strings.NBT_ENCODED_ATTR_ORE_NAME) && encodedStack.hasKey(Strings.NBT_ENCODED_ATTR_SIZE)) { - if ((encodedStack.getString(Strings.NBT_ENCODED_ATTR_ORE_NAME).length() > 0) && (encodedStack.getShort(Strings.NBT_ENCODED_ATTR_SIZE) >= 0)) { - decodedStack = new CustomWrappedStack(new OreStack(encodedStack.getString(Strings.NBT_ENCODED_ATTR_ORE_NAME), encodedStack.getShort(Strings.NBT_ENCODED_ATTR_SIZE))); - } - } - } - // Else if the encoded tag compound is of type EnergyStack, parse out the EnergyStack info - else if (encodedStack.getString(Strings.NBT_ENCODED_ATTR_TYPE).equalsIgnoreCase(Strings.NBT_ENCODED_ATTR_TYPE_ENERGY)) { - - if (encodedStack.hasKey(Strings.NBT_ENCODED_ATTR_ENERGY_NAME) && encodedStack.hasKey(Strings.NBT_ENCODED_ATTR_SIZE)) { - if ((encodedStack.getString(Strings.NBT_ENCODED_ATTR_ENERGY_NAME).length() > 0) && (encodedStack.getShort(Strings.NBT_ENCODED_ATTR_SIZE) >= 0)) { - decodedStack = new CustomWrappedStack(new EnergyStack(encodedStack.getString(Strings.NBT_ENCODED_ATTR_ENERGY_NAME), encodedStack.getShort(Strings.NBT_ENCODED_ATTR_SIZE))); - } - } - } - } - - /* - * This will only return non-null in the event that a proper - * ItemStack|OreStack|EnergyStack was decoded from the encoded - * NBTTagCompound - */ - return decodedStack; - } - - public static Map> decodeRecipeFromNBT(NBTTagCompound encodedRecipe) { - - HashMap> decodedRecipe = new HashMap>(); - - CustomWrappedStack recipeOutput = null; - ArrayList recipeInputs = new ArrayList(); - - CustomWrappedStack decodedStack = null; - NBTTagCompound encodedStack = null; - - // Decode the recipe output - if (encodedRecipe.hasKey(Strings.NBT_ENCODED_RECIPE_OUTPUT)) { - - decodedStack = decodeStackFromNBT(encodedRecipe.getCompoundTag(Strings.NBT_ENCODED_RECIPE_OUTPUT)); - - if (decodedStack != null) { - recipeOutput = decodedStack; - } - } - - // Decode the recipe inputs - if (encodedRecipe.hasKey("recipeInputs")) { - NBTTagList recipeInputsTagList = encodedRecipe.getTagList(Strings.NBT_ENCODED_RECIPE_INPUTS); - - for (int i = 0; i < recipeInputsTagList.tagCount(); i++) { - if (recipeInputsTagList.tagAt(i) instanceof NBTTagCompound) { - - encodedStack = (NBTTagCompound) recipeInputsTagList.tagAt(i); - decodedStack = decodeStackFromNBT(encodedStack); - - if (decodedStack != null) { - recipeInputs.add(decodedStack); - } - } - } - } - - // If we decoded both a recipe output and some inputs for it, add it to the map - if (recipeOutput != null && recipeInputs.size() > 0) { - decodedRecipe.put(recipeOutput, recipeInputs); - } - - return decodedRecipe; - } - - /** - * Initializes the NBT Tag Compound for the given ItemStack if it is null - * - * @param itemStack - * The ItemStack for which its NBT Tag Compound is being checked - * for initialization - */ - private static void initNBTTagCompound(ItemStack itemStack) { - - if (itemStack.stackTagCompound == null) { - itemStack.setTagCompound(new NBTTagCompound()); - } - } - - public static boolean hasTag(ItemStack itemStack, String keyName) { - - if (itemStack.stackTagCompound != null) - return itemStack.stackTagCompound.hasKey(keyName); - - return false; - } - - public static void removeTag(ItemStack itemStack, String keyName) { - - if (itemStack.stackTagCompound != null) { - itemStack.stackTagCompound.removeTag(keyName); - } - } - - // String - public static String getString(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setString(itemStack, keyName, ""); - } - - return itemStack.stackTagCompound.getString(keyName); - } - - public static void setString(ItemStack itemStack, String keyName, String keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setString(keyName, keyValue); - } - - // boolean - public static boolean getBoolean(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setBoolean(itemStack, keyName, false); - } - - return itemStack.stackTagCompound.getBoolean(keyName); - } - - public static void setBoolean(ItemStack itemStack, String keyName, boolean keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setBoolean(keyName, keyValue); - } - - // byte - public static byte getByte(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setByte(itemStack, keyName, (byte) 0); - } - - return itemStack.stackTagCompound.getByte(keyName); - } - - public static void setByte(ItemStack itemStack, String keyName, byte keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setByte(keyName, keyValue); - } - - // short - public static short getShort(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setShort(itemStack, keyName, (short) 0); - } - - return itemStack.stackTagCompound.getShort(keyName); - } - - public static void setShort(ItemStack itemStack, String keyName, short keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setShort(keyName, keyValue); - } - - // int - public static int getInt(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setInteger(itemStack, keyName, 0); - } - - return itemStack.stackTagCompound.getInteger(keyName); - } - - public static void setInteger(ItemStack itemStack, String keyName, int keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setInteger(keyName, keyValue); - } - - // long - public static long getLong(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setLong(itemStack, keyName, 0); - } - - return itemStack.stackTagCompound.getLong(keyName); - } - - public static void setLong(ItemStack itemStack, String keyName, long keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setLong(keyName, keyValue); - } - - // float - public static float getFloat(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setFloat(itemStack, keyName, 0); - } - - return itemStack.stackTagCompound.getFloat(keyName); - } - - public static void setFloat(ItemStack itemStack, String keyName, float keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setFloat(keyName, keyValue); - } - - // double - public static double getDouble(ItemStack itemStack, String keyName) { - - initNBTTagCompound(itemStack); - - if (!itemStack.stackTagCompound.hasKey(keyName)) { - setDouble(itemStack, keyName, 0); - } - - return itemStack.stackTagCompound.getDouble(keyName); - } - - public static void setDouble(ItemStack itemStack, String keyName, double keyValue) { - - initNBTTagCompound(itemStack); - - itemStack.stackTagCompound.setDouble(keyName, keyValue); - } - -} diff --git a/ee3_common/com/pahimar/ee3/network/PacketHandler.java b/ee3_common/com/pahimar/ee3/network/PacketHandler.java deleted file mode 100644 index d8d589a5..00000000 --- a/ee3_common/com/pahimar/ee3/network/PacketHandler.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.pahimar.ee3.network; - -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet250CustomPayload; - -import com.pahimar.ee3.network.packet.PacketEE; - -import cpw.mods.fml.common.network.IPacketHandler; -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketHandler implements IPacketHandler { - - /*** - * Handles Packet250CustomPayload packets that are registered to an - * Equivalent Exchange 3 network channel - * - * @param manager - * The NetworkManager associated with the current platform - * (client/server) - * @param packet - * The Packet250CustomPayload that was received - * @param player - * The Player associated with the packet - */ - @Override - public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { - - // Build a PacketEE object from the data contained within the Packet250CustomPayload packet - PacketEE packetEE = PacketTypeHandler.buildPacket(packet.data); - - // Execute the appropriate actions based on the PacketEE type - packetEE.execute(manager, player); - } - -} diff --git a/ee3_common/com/pahimar/ee3/network/PacketTypeHandler.java b/ee3_common/com/pahimar/ee3/network/PacketTypeHandler.java deleted file mode 100644 index c0e736d2..00000000 --- a/ee3_common/com/pahimar/ee3/network/PacketTypeHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.pahimar.ee3.network; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; - -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet250CustomPayload; - -import com.pahimar.ee3.lib.Reference; -import com.pahimar.ee3.network.packet.PacketEE; -import com.pahimar.ee3.network.packet.PacketItemUpdate; -import com.pahimar.ee3.network.packet.PacketKeyPressed; -import com.pahimar.ee3.network.packet.PacketRequestEvent; -import com.pahimar.ee3.network.packet.PacketSoundEvent; -import com.pahimar.ee3.network.packet.PacketSpawnParticle; -import com.pahimar.ee3.network.packet.PacketTileUpdate; -import com.pahimar.ee3.network.packet.PacketTileWithItemUpdate; - -/** - * Equivalent-Exchange-3 - * - * PacketTypeHandler - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public enum PacketTypeHandler { - KEY(PacketKeyPressed.class), - TILE(PacketTileUpdate.class), - REQUEST_EVENT(PacketRequestEvent.class), - SPAWN_PARTICLE(PacketSpawnParticle.class), - SOUND_EVENT(PacketSoundEvent.class), - ITEM_UPDATE(PacketItemUpdate.class), - TILE_WITH_ITEM(PacketTileWithItemUpdate.class); - - private Class clazz; - - PacketTypeHandler(Class clazz) { - - this.clazz = clazz; - } - - public static PacketEE buildPacket(byte[] data) { - - ByteArrayInputStream bis = new ByteArrayInputStream(data); - int selector = bis.read(); - DataInputStream dis = new DataInputStream(bis); - - PacketEE packet = null; - - try { - packet = values()[selector].clazz.newInstance(); - } - catch (Exception e) { - e.printStackTrace(System.err); - } - - packet.readPopulate(dis); - - return packet; - } - - public static PacketEE buildPacket(PacketTypeHandler type) { - - PacketEE packet = null; - - try { - packet = values()[type.ordinal()].clazz.newInstance(); - } - catch (Exception e) { - e.printStackTrace(System.err); - } - - return packet; - } - - public static Packet populatePacket(PacketEE packetEE) { - - byte[] data = packetEE.populate(); - - Packet250CustomPayload packet250 = new Packet250CustomPayload(); - packet250.channel = Reference.CHANNEL_NAME; - packet250.data = data; - packet250.length = data.length; - packet250.isChunkDataPacket = packetEE.isChunkDataPacket; - - return packet250; - } -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketEE.java b/ee3_common/com/pahimar/ee3/network/packet/PacketEE.java deleted file mode 100644 index 87471082..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketEE.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.network.INetworkManager; - -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketEE - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketEE { - - public PacketTypeHandler packetType; - public boolean isChunkDataPacket; - - public PacketEE(PacketTypeHandler packetType, boolean isChunkDataPacket) { - - this.packetType = packetType; - this.isChunkDataPacket = isChunkDataPacket; - } - - public byte[] populate() { - - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream(bos); - - try { - dos.writeByte(packetType.ordinal()); - this.writeData(dos); - } - catch (IOException e) { - e.printStackTrace(System.err); - } - - return bos.toByteArray(); - } - - public void readPopulate(DataInputStream data) { - - try { - this.readData(data); - } - catch (IOException e) { - e.printStackTrace(System.err); - } - } - - public void readData(DataInputStream data) throws IOException { - - } - - public void writeData(DataOutputStream dos) throws IOException { - - } - - public void execute(INetworkManager network, Player player) { - - } - - public void setKey(int key) { - - } -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketItemUpdate.java b/ee3_common/com/pahimar/ee3/network/packet/PacketItemUpdate.java deleted file mode 100644 index 0383c6c5..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketItemUpdate.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.network.INetworkManager; - -import com.pahimar.ee3.lib.ItemUpdateTypes; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketItemUpdate - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketItemUpdate extends PacketEE { - - public byte slot; - public byte updateType; - - public PacketItemUpdate() { - - super(PacketTypeHandler.ITEM_UPDATE, false); - } - - public PacketItemUpdate(byte slot, byte updateType) { - - super(PacketTypeHandler.ITEM_UPDATE, false); - this.slot = slot; - this.updateType = updateType; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeByte(slot); - data.writeByte(updateType); - } - - @Override - public void readData(DataInputStream data) throws IOException { - - slot = data.readByte(); - updateType = data.readByte(); - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EntityPlayer thePlayer = (EntityPlayer) player; - ItemStack destroyedStack = thePlayer.inventory.getStackInSlot(slot); - - if (updateType == ItemUpdateTypes.DESTROYED) { - thePlayer.renderBrokenItemStack(destroyedStack); - } - } -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketKeyPressed.java b/ee3_common/com/pahimar/ee3/network/packet/PacketKeyPressed.java deleted file mode 100644 index b3672f74..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketKeyPressed.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.network.INetworkManager; - -import com.pahimar.ee3.item.IKeyBound; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketKeyPressed - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketKeyPressed extends PacketEE { - - public String key; - - public PacketKeyPressed() { - - super(PacketTypeHandler.KEY, false); - } - - public PacketKeyPressed(String key) { - - super(PacketTypeHandler.KEY, false); - this.key = key; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeUTF(key); - } - - @Override - public void readData(DataInputStream data) throws IOException { - - key = data.readUTF(); - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EntityPlayer thePlayer = (EntityPlayer) player; - - if (thePlayer.getCurrentEquippedItem() != null && thePlayer.getCurrentEquippedItem().getItem() instanceof IKeyBound) { - ((IKeyBound) thePlayer.getCurrentEquippedItem().getItem()).doKeyBindingAction(thePlayer, thePlayer.getCurrentEquippedItem(), key); - } - } -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketRequestEvent.java b/ee3_common/com/pahimar/ee3/network/packet/PacketRequestEvent.java deleted file mode 100644 index 7a93193a..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketRequestEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.network.INetworkManager; - -import com.pahimar.ee3.core.handlers.WorldTransmutationHandler; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketRequestEvent - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketRequestEvent extends PacketEE { - - public byte eventType; - public int originX, originY, originZ; - public byte sideHit; - public byte rangeX, rangeY, rangeZ; - public String data; - - public PacketRequestEvent() { - - super(PacketTypeHandler.REQUEST_EVENT, false); - } - - public PacketRequestEvent(byte eventType, int originX, int originY, int originZ, byte sideHit, byte rangeX, byte rangeY, byte rangeZ, String data) { - - super(PacketTypeHandler.REQUEST_EVENT, false); - this.eventType = eventType; - this.originX = originX; - this.originY = originY; - this.originZ = originZ; - this.sideHit = sideHit; - this.rangeX = rangeX; - this.rangeY = rangeY; - this.rangeZ = rangeZ; - this.data = data; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeByte(eventType); - data.writeInt(originX); - data.writeInt(originY); - data.writeInt(originZ); - data.writeByte(sideHit); - data.writeByte(rangeX); - data.writeByte(rangeY); - data.writeByte(rangeZ); - data.writeUTF(this.data); - } - - @Override - public void readData(DataInputStream data) throws IOException { - - eventType = data.readByte(); - originX = data.readInt(); - originY = data.readInt(); - originZ = data.readInt(); - sideHit = data.readByte(); - rangeX = data.readByte(); - rangeY = data.readByte(); - rangeZ = data.readByte(); - this.data = data.readUTF(); - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EntityPlayer thePlayer = (EntityPlayer) player; - WorldTransmutationHandler.handleWorldTransmutation(thePlayer, originX, originY, originZ, rangeX, rangeY, rangeZ, sideHit, data); - } -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketSoundEvent.java b/ee3_common/com/pahimar/ee3/network/packet/PacketSoundEvent.java deleted file mode 100644 index 59a48121..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketSoundEvent.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.network.INetworkManager; - -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.lib.Commands; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketSoundEvent - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketSoundEvent extends PacketEE { - - public String playerName; - public String soundName; - public double x, y, z; - public float volume, pitch; - - public PacketSoundEvent() { - - super(PacketTypeHandler.SOUND_EVENT, false); - } - - public PacketSoundEvent(String playerName, String soundName, double x, double y, double z, float volume, float pitch) { - - super(PacketTypeHandler.SOUND_EVENT, false); - this.playerName = playerName; - this.soundName = soundName; - this.x = x; - this.y = y; - this.z = z; - this.volume = volume; - this.pitch = pitch; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeUTF(playerName); - data.writeUTF(soundName); - data.writeDouble(x); - data.writeDouble(y); - data.writeDouble(z); - data.writeFloat(volume); - data.writeFloat(pitch); - } - - @Override - public void readData(DataInputStream data) throws IOException { - - playerName = data.readUTF(); - soundName = data.readUTF(); - x = data.readDouble(); - y = data.readDouble(); - z = data.readDouble(); - volume = data.readFloat(); - pitch = data.readFloat(); - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EntityPlayer thePlayer = (EntityPlayer) player; - - if (ConfigurationSettings.ENABLE_SOUNDS.equalsIgnoreCase(Commands.ALL)) { - FMLClientHandler.instance().getClient().sndManager.playSound(soundName, (float) x, (float) y, (float) z, volume, pitch); - } - else if (ConfigurationSettings.ENABLE_SOUNDS.equalsIgnoreCase(Commands.SELF)) { - if (thePlayer.username.equalsIgnoreCase(playerName)) { - FMLClientHandler.instance().getClient().sndManager.playSound(soundName, (float) x, (float) y, (float) z, volume, pitch); - } - } - } -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketSpawnParticle.java b/ee3_common/com/pahimar/ee3/network/packet/PacketSpawnParticle.java deleted file mode 100644 index ba8e05ee..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketSpawnParticle.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.network.INetworkManager; - -import com.pahimar.ee3.configuration.ConfigurationSettings; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketSpawnParticle - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketSpawnParticle extends PacketEE { - - public String particleName; - public double x, y, z; - public double velocityX, velocityY, velocityZ; - - public PacketSpawnParticle() { - - super(PacketTypeHandler.SPAWN_PARTICLE, false); - } - - public PacketSpawnParticle(String particleName, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { - - super(PacketTypeHandler.SPAWN_PARTICLE, false); - this.particleName = particleName; - this.x = x; - this.y = y; - this.z = z; - this.velocityX = velocityX; - this.velocityY = velocityY; - this.velocityZ = velocityZ; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeUTF(particleName); - data.writeDouble(x); - data.writeDouble(y); - data.writeDouble(z); - data.writeDouble(velocityX); - data.writeDouble(velocityY); - data.writeDouble(velocityZ); - - } - - @Override - public void readData(DataInputStream data) throws IOException { - - particleName = data.readUTF(); - x = data.readDouble(); - y = data.readDouble(); - z = data.readDouble(); - velocityX = data.readDouble(); - velocityY = data.readDouble(); - velocityZ = data.readDouble(); - - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EntityPlayer thePlayer = (EntityPlayer) player; - - if (ConfigurationSettings.ENABLE_PARTICLE_FX) { - thePlayer.worldObj.spawnParticle(particleName, x, y, z, velocityX, velocityY, velocityZ); - } - } - -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketTileUpdate.java b/ee3_common/com/pahimar/ee3/network/packet/PacketTileUpdate.java deleted file mode 100644 index 266137f2..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketTileUpdate.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.network.INetworkManager; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -/** - * Equivalent-Exchange-3 - * - * PacketTileUpdate - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class PacketTileUpdate extends PacketEE { - - public int x, y, z; - public byte orientation; - public byte state; - public String customName; - - public PacketTileUpdate() { - - super(PacketTypeHandler.TILE, true); - } - - public PacketTileUpdate(int x, int y, int z, ForgeDirection orientation, byte state, String customName) { - - super(PacketTypeHandler.TILE, true); - this.x = x; - this.y = y; - this.z = z; - this.orientation = (byte) orientation.ordinal(); - this.state = state; - this.customName = customName; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeInt(x); - data.writeInt(y); - data.writeInt(z); - data.writeByte(orientation); - data.writeByte(state); - data.writeUTF(customName); - } - - @Override - public void readData(DataInputStream data) throws IOException { - - x = data.readInt(); - y = data.readInt(); - z = data.readInt(); - orientation = data.readByte(); - state = data.readByte(); - customName = data.readUTF(); - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EquivalentExchange3.proxy.handleTileEntityPacket(x, y, z, ForgeDirection.getOrientation(orientation), state, customName); - } - -} diff --git a/ee3_common/com/pahimar/ee3/network/packet/PacketTileWithItemUpdate.java b/ee3_common/com/pahimar/ee3/network/packet/PacketTileWithItemUpdate.java deleted file mode 100644 index 0fc0193b..00000000 --- a/ee3_common/com/pahimar/ee3/network/packet/PacketTileWithItemUpdate.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.pahimar.ee3.network.packet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.network.INetworkManager; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.network.PacketTypeHandler; - -import cpw.mods.fml.common.network.Player; - -public class PacketTileWithItemUpdate extends PacketEE { - - public int x, y, z; - public byte orientation; - public byte state; - public String customName; - public int itemID, metaData, stackSize, color; - - public PacketTileWithItemUpdate() { - - super(PacketTypeHandler.TILE_WITH_ITEM, true); - } - - public PacketTileWithItemUpdate(int x, int y, int z, ForgeDirection orientation, byte state, String customName, int itemID, int metaData, int stackSize, int color) { - - super(PacketTypeHandler.TILE_WITH_ITEM, true); - this.x = x; - this.y = y; - this.z = z; - this.orientation = (byte) orientation.ordinal(); - this.state = state; - this.customName = customName; - this.itemID = itemID; - this.metaData = metaData; - this.stackSize = stackSize; - this.color = color; - } - - @Override - public void writeData(DataOutputStream data) throws IOException { - - data.writeInt(x); - data.writeInt(y); - data.writeInt(z); - data.writeByte(orientation); - data.writeByte(state); - data.writeUTF(customName); - data.writeInt(itemID); - data.writeInt(metaData); - data.writeInt(stackSize); - data.writeInt(color); - } - - @Override - public void readData(DataInputStream data) throws IOException { - - x = data.readInt(); - y = data.readInt(); - z = data.readInt(); - orientation = data.readByte(); - state = data.readByte(); - customName = data.readUTF(); - itemID = data.readInt(); - metaData = data.readInt(); - stackSize = data.readInt(); - color = data.readInt(); - } - - @Override - public void execute(INetworkManager manager, Player player) { - - EquivalentExchange3.proxy.handleTileWithItemPacket(x, y, z, ForgeDirection.getOrientation(orientation), state, customName, itemID, metaData, stackSize, color); - } -} diff --git a/ee3_common/com/pahimar/ee3/recipe/RecipesCalcinator.java b/ee3_common/com/pahimar/ee3/recipe/RecipesCalcinator.java deleted file mode 100644 index 8822efa1..00000000 --- a/ee3_common/com/pahimar/ee3/recipe/RecipesCalcinator.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.pahimar.ee3.recipe; - -/** - * Equivalent-Exchange-3 - * - * RecipesCalcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class RecipesCalcinator { - -} diff --git a/ee3_common/com/pahimar/ee3/tileentity/TileAlchemicalChest.java b/ee3_common/com/pahimar/ee3/tileentity/TileAlchemicalChest.java deleted file mode 100644 index 994410fa..00000000 --- a/ee3_common/com/pahimar/ee3/tileentity/TileAlchemicalChest.java +++ /dev/null @@ -1,268 +0,0 @@ -package com.pahimar.ee3.tileentity; - -import net.minecraft.block.Block; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -import com.pahimar.ee3.block.ModBlocks; -import com.pahimar.ee3.lib.Sounds; -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * TileAlchemicalChest - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class TileAlchemicalChest extends TileEE implements IInventory { - - /** The current angle of the chest lid (between 0 and 1) */ - public float lidAngle; - - /** The angle of the chest lid last tick */ - public float prevLidAngle; - - /** The number of players currently using this chest */ - public int numUsingPlayers; - - /** Server sync counter (once per 20 ticks) */ - private int ticksSinceSync; - - public static final int INVENTORY_SIZE = 13 * 4; - - /** - * The ItemStacks that hold the items currently being used in the Alchemical - * Chest - */ - private ItemStack[] inventory; - - public TileAlchemicalChest() { - - super(); - inventory = new ItemStack[INVENTORY_SIZE]; - } - - @Override - public int getSizeInventory() { - - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - - return inventory[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - if (itemStack.stackSize <= amount) { - setInventorySlotContents(slot, null); - } - else { - itemStack = itemStack.splitStack(amount); - if (itemStack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - - return itemStack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - - if (inventory[slot] != null) { - ItemStack itemStack = inventory[slot]; - inventory[slot] = null; - return itemStack; - } - else - return null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - - inventory[slot] = itemStack; - - if (itemStack != null && itemStack.stackSize > this.getInventoryStackLimit()) { - itemStack.stackSize = this.getInventoryStackLimit(); - } - - this.onInventoryChanged(); - } - - @Override - public String getInvName() { - - return this.hasCustomName() ? this.getCustomName() : Strings.CONTAINER_ALCHEMICAL_CHEST_NAME; - } - - @Override - public int getInventoryStackLimit() { - - return 64; - } - - /** - * Called when a client event is received with the event number and - * argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int eventID, int numUsingPlayers) { - - if (eventID == 1) { - this.numUsingPlayers = numUsingPlayers; - return true; - } - else - return super.receiveClientEvent(eventID, numUsingPlayers); - } - - @Override - public void openChest() { - - ++numUsingPlayers; - worldObj.addBlockEvent(xCoord, yCoord, zCoord, ModBlocks.alchemicalChest.blockID, 1, numUsingPlayers); - } - - @Override - public void closeChest() { - - --numUsingPlayers; - worldObj.addBlockEvent(xCoord, yCoord, zCoord, ModBlocks.alchemicalChest.blockID, 1, numUsingPlayers); - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, - * e.g. the mob spawner uses this to count ticks and creates a new spawn - * inside its implementation. - */ - @Override - public void updateEntity() { - - super.updateEntity(); - - if (++ticksSinceSync % 20 * 4 == 0) { - worldObj.addBlockEvent(xCoord, yCoord, zCoord, Block.enderChest.blockID, 1, numUsingPlayers); - } - - prevLidAngle = lidAngle; - float angleIncrement = 0.1F; - double adjustedXCoord, adjustedZCoord; - - if (numUsingPlayers > 0 && lidAngle == 0.0F) { - adjustedXCoord = xCoord + 0.5D; - adjustedZCoord = zCoord + 0.5D; - worldObj.playSoundEffect(adjustedXCoord, yCoord + 0.5D, adjustedZCoord, Sounds.CHEST_OPEN, 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - - if (numUsingPlayers == 0 && lidAngle > 0.0F || numUsingPlayers > 0 && lidAngle < 1.0F) { - float var8 = lidAngle; - - if (numUsingPlayers > 0) { - lidAngle += angleIncrement; - } - else { - lidAngle -= angleIncrement; - } - - if (lidAngle > 1.0F) { - lidAngle = 1.0F; - } - - if (lidAngle < 0.5F && var8 >= 0.5F) { - adjustedXCoord = xCoord + 0.5D; - adjustedZCoord = zCoord + 0.5D; - worldObj.playSoundEffect(adjustedXCoord, yCoord + 0.5D, adjustedZCoord, Sounds.CHEST_CLOSE, 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - - if (lidAngle < 0.0F) { - lidAngle = 0.0F; - } - } - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - - super.readFromNBT(nbtTagCompound); - - // Read in the ItemStacks in the inventory from NBT - NBTTagList tagList = nbtTagCompound.getTagList("Items"); - inventory = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < tagList.tagCount(); ++i) { - NBTTagCompound tagCompound = (NBTTagCompound) tagList.tagAt(i); - byte slot = tagCompound.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - - super.writeToNBT(nbtTagCompound); - - // Write the ItemStacks in the inventory to NBT - NBTTagList tagList = new NBTTagList(); - for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) { - if (inventory[currentIndex] != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - inventory[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } - } - nbtTagCompound.setTag("Items", tagList); - - } - - @Override - public boolean isInvNameLocalized() { - - return this.hasCustomName(); - } - - @Override - public boolean isItemValidForSlot(int side, ItemStack itemStack) { - - return true; - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(super.toString()); - - stringBuilder.append("TileAlchemicalChest Data - "); - for (int i = 0; i < inventory.length; i++) { - if (i != 0) { - stringBuilder.append(", "); - } - - if (inventory[i] != null) { - stringBuilder.append(String.format("inventory[%d]: %s", i, inventory[i].toString())); - } - else { - stringBuilder.append(String.format("inventory[%d]: empty", i)); - } - } - stringBuilder.append("\n"); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/com/pahimar/ee3/tileentity/TileAludel.java b/ee3_common/com/pahimar/ee3/tileentity/TileAludel.java deleted file mode 100644 index f54409cf..00000000 --- a/ee3_common/com/pahimar/ee3/tileentity/TileAludel.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.pahimar.ee3.tileentity; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.packet.Packet; - -import com.pahimar.ee3.core.util.ItemUtil; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketTileWithItemUpdate; - -/** - * Equivalent-Exchange-3 - * - * TileAludel - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class TileAludel extends TileEE implements IInventory { - - /** - * The ItemStacks that hold the items currently being used in the Aludel - */ - private ItemStack[] inventory; - - public static final int INVENTORY_SIZE = 4; - - public static final int FUEL_INVENTORY_INDEX = 0; - public static final int INPUT_INVENTORY_INDEX = 1; - public static final int DUST_INVENTORY_INDEX = 2; - public static final int OUTPUT_INVENTORY_INDEX = 3; - - public TileAludel() { - - inventory = new ItemStack[INVENTORY_SIZE]; - } - - @Override - public int getSizeInventory() { - - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - - return inventory[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - if (itemStack.stackSize <= amount) { - setInventorySlotContents(slot, null); - } - else { - itemStack = itemStack.splitStack(amount); - if (itemStack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - - return itemStack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - setInventorySlotContents(slot, null); - } - return itemStack; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - - inventory[slot] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { - itemStack.stackSize = getInventoryStackLimit(); - } - } - - @Override - public String getInvName() { - - return this.hasCustomName() ? this.getCustomName() : Strings.CONTAINER_ALUDEL_NAME; - } - - @Override - public int getInventoryStackLimit() { - - return 64; - } - - @Override - public void openChest() { - - } - - @Override - public void closeChest() { - - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - - super.readFromNBT(nbtTagCompound); - - // Read in the ItemStacks in the inventory from NBT - NBTTagList tagList = nbtTagCompound.getTagList("Items"); - inventory = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < tagList.tagCount(); ++i) { - NBTTagCompound tagCompound = (NBTTagCompound) tagList.tagAt(i); - byte slot = tagCompound.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - - super.writeToNBT(nbtTagCompound); - - // Write the ItemStacks in the inventory to NBT - NBTTagList tagList = new NBTTagList(); - for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) { - if (inventory[currentIndex] != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - inventory[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } - } - nbtTagCompound.setTag("Items", tagList); - } - - @Override - public boolean isInvNameLocalized() { - - return this.hasCustomName(); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - - return true; - } - - @Override - public Packet getDescriptionPacket() { - - ItemStack itemStack = getStackInSlot(INPUT_INVENTORY_INDEX); - - if (itemStack != null && itemStack.stackSize > 0) - return PacketTypeHandler.populatePacket(new PacketTileWithItemUpdate(xCoord, yCoord, zCoord, orientation, state, customName, itemStack.itemID, itemStack.getItemDamage(), itemStack.stackSize, ItemUtil.getColor(itemStack))); - else - return super.getDescriptionPacket(); - } - - @Override - public void onInventoryChanged() { - - worldObj.updateAllLightTypes(xCoord, yCoord, zCoord); - - if (worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord) instanceof TileGlassBell) { - worldObj.updateAllLightTypes(xCoord, yCoord + 1, zCoord); - } - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(super.toString()); - - stringBuilder.append("TileAludel Data - "); - for (int i = 0; i < inventory.length; i++) { - if (i != 0) { - stringBuilder.append(", "); - } - - if (inventory[i] != null) { - stringBuilder.append(String.format("inventory[%d]: %s", i, inventory[i].toString())); - } - else { - stringBuilder.append(String.format("inventory[%d]: empty", i)); - } - } - stringBuilder.append("\n"); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/com/pahimar/ee3/tileentity/TileCalcinator.java b/ee3_common/com/pahimar/ee3/tileentity/TileCalcinator.java deleted file mode 100644 index e3090deb..00000000 --- a/ee3_common/com/pahimar/ee3/tileentity/TileCalcinator.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.pahimar.ee3.tileentity; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -import com.pahimar.ee3.lib.Strings; - -/** - * Equivalent-Exchange-3 - * - * TileCalcinator - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class TileCalcinator extends TileEE implements IInventory { - - /** - * The ItemStacks that hold the items currently being used in the Calcinator - */ - private ItemStack[] inventory; - - public static final int INVENTORY_SIZE = 3; - - public static final int FUEL_INVENTORY_INDEX = 0; - public static final int INPUT_INVENTORY_INDEX = 1; - public static final int OUTPUT_INVENTORY_INDEX = 2; - - public TileCalcinator() { - - inventory = new ItemStack[INVENTORY_SIZE]; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - - return inventory.length; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int slot) { - - return inventory[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - if (itemStack.stackSize <= amount) { - setInventorySlotContents(slot, null); - } - else { - itemStack = itemStack.splitStack(amount); - if (itemStack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - - return itemStack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - setInventorySlotContents(slot, null); - } - return itemStack; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - - inventory[slot] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { - itemStack.stackSize = getInventoryStackLimit(); - } - } - - @Override - public String getInvName() { - - return this.hasCustomName() ? this.getCustomName() : Strings.CONTAINER_CALCINATOR_NAME; - } - - @Override - public int getInventoryStackLimit() { - - return 64; - } - - @Override - public void openChest() { - - } - - @Override - public void closeChest() { - - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - - super.readFromNBT(nbtTagCompound); - - // Read in the ItemStacks in the inventory from NBT - NBTTagList tagList = nbtTagCompound.getTagList("Items"); - inventory = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < tagList.tagCount(); ++i) { - NBTTagCompound tagCompound = (NBTTagCompound) tagList.tagAt(i); - byte slot = tagCompound.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - - super.writeToNBT(nbtTagCompound); - - // Write the ItemStacks in the inventory to NBT - NBTTagList tagList = new NBTTagList(); - for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) { - if (inventory[currentIndex] != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - inventory[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } - } - nbtTagCompound.setTag("Items", tagList); - } - - @Override - public boolean isInvNameLocalized() { - - return this.hasCustomName(); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - - return true; - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(super.toString()); - - stringBuilder.append("TileCalcinator Data - "); - for (int i = 0; i < inventory.length; i++) { - if (i != 0) { - stringBuilder.append(", "); - } - - if (inventory[i] != null) { - stringBuilder.append(String.format("inventory[%d]: %s", i, inventory[i].toString())); - } - else { - stringBuilder.append(String.format("inventory[%d]: empty", i)); - } - } - stringBuilder.append("\n"); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/com/pahimar/ee3/tileentity/TileEE.java b/ee3_common/com/pahimar/ee3/tileentity/TileEE.java deleted file mode 100644 index e1153baa..00000000 --- a/ee3_common/com/pahimar/ee3/tileentity/TileEE.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.pahimar.ee3.tileentity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; - -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketTileUpdate; - -/** - * Equivalent-Exchange-3 - * - * TileEE - * - * @author pahimar - * @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) - * - */ -public class TileEE extends TileEntity { - - protected ForgeDirection orientation; - protected byte state; - protected String customName; - - public TileEE() { - - orientation = ForgeDirection.SOUTH; - state = 0; - customName = ""; - } - - public ForgeDirection getOrientation() { - - return orientation; - } - - public void setOrientation(ForgeDirection orientation) { - - this.orientation = orientation; - } - - public void setOrientation(int orientation) { - - this.orientation = ForgeDirection.getOrientation(orientation); - } - - public short getState() { - - return state; - } - - public void setState(byte state) { - - this.state = state; - } - - public boolean hasCustomName() { - - return customName != null && customName.length() > 0; - } - - public String getCustomName() { - - return customName; - } - - public void setCustomName(String customName) { - - this.customName = customName; - } - - public boolean isUseableByPlayer(EntityPlayer player) { - - return true; - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - - super.readFromNBT(nbtTagCompound); - - if (nbtTagCompound.hasKey(Strings.NBT_TE_DIRECTION_KEY)) { - orientation = ForgeDirection.getOrientation(nbtTagCompound.getByte(Strings.NBT_TE_DIRECTION_KEY)); - } - - if (nbtTagCompound.hasKey(Strings.NBT_TE_STATE_KEY)) { - state = nbtTagCompound.getByte(Strings.NBT_TE_STATE_KEY); - } - - if (nbtTagCompound.hasKey(Strings.NBT_TE_CUSTOM_NAME)) { - customName = nbtTagCompound.getString(Strings.NBT_TE_CUSTOM_NAME); - } - } - - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - - super.writeToNBT(nbtTagCompound); - - nbtTagCompound.setByte(Strings.NBT_TE_DIRECTION_KEY, (byte) orientation.ordinal()); - nbtTagCompound.setByte(Strings.NBT_TE_STATE_KEY, state); - - if (this.hasCustomName()) { - nbtTagCompound.setString(Strings.NBT_TE_CUSTOM_NAME, customName); - } - } - - @Override - public Packet getDescriptionPacket() { - - return PacketTypeHandler.populatePacket(new PacketTileUpdate(xCoord, yCoord, zCoord, orientation, state, customName)); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(String.format("TileEE Data - xCoord: %d, yCoord: %d, zCoord: %d, customName: '%s', orientation: %s, state: %d\n", xCoord, yCoord, zCoord, customName, orientation, state)); - - return stringBuilder.toString(); - } - -} diff --git a/ee3_common/com/pahimar/ee3/tileentity/TileGlassBell.java b/ee3_common/com/pahimar/ee3/tileentity/TileGlassBell.java deleted file mode 100644 index d89ccd0b..00000000 --- a/ee3_common/com/pahimar/ee3/tileentity/TileGlassBell.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.pahimar.ee3.tileentity; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.packet.Packet; - -import com.pahimar.ee3.core.util.ItemUtil; -import com.pahimar.ee3.lib.Strings; -import com.pahimar.ee3.network.PacketTypeHandler; -import com.pahimar.ee3.network.packet.PacketTileWithItemUpdate; - -public class TileGlassBell extends TileEE implements IInventory { - - /** - * The ItemStacks that hold the items currently being used in the Glass Bell - */ - private ItemStack[] inventory; - - public static final int INVENTORY_SIZE = 1; - - public static final int DISPLAY_SLOT_INVENTORY_INDEX = 0; - - public TileGlassBell() { - - inventory = new ItemStack[INVENTORY_SIZE]; - } - - @Override - public int getSizeInventory() { - - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - - return inventory[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - if (itemStack.stackSize <= amount) { - setInventorySlotContents(slot, null); - } - else { - itemStack = itemStack.splitStack(amount); - if (itemStack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - - return itemStack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - - ItemStack itemStack = getStackInSlot(slot); - if (itemStack != null) { - setInventorySlotContents(slot, null); - } - return itemStack; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - - inventory[slot] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { - itemStack.stackSize = getInventoryStackLimit(); - } - } - - @Override - public String getInvName() { - - return this.hasCustomName() ? this.getCustomName() : Strings.CONTAINER_GLASS_BELL_NAME; - } - - @Override - public int getInventoryStackLimit() { - - return 64; - } - - @Override - public void openChest() { - - } - - @Override - public void closeChest() { - - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) { - - super.readFromNBT(nbtTagCompound); - - // Read in the ItemStacks in the inventory from NBT - NBTTagList tagList = nbtTagCompound.getTagList("Items"); - inventory = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < tagList.tagCount(); ++i) { - NBTTagCompound tagCompound = (NBTTagCompound) tagList.tagAt(i); - byte slot = tagCompound.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) { - - super.writeToNBT(nbtTagCompound); - - // Write the ItemStacks in the inventory to NBT - NBTTagList tagList = new NBTTagList(); - for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) { - if (inventory[currentIndex] != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - inventory[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } - } - nbtTagCompound.setTag("Items", tagList); - } - - @Override - public boolean isInvNameLocalized() { - - return this.hasCustomName(); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - - return true; - } - - @Override - public Packet getDescriptionPacket() { - - ItemStack itemStack = getStackInSlot(DISPLAY_SLOT_INVENTORY_INDEX); - - if (itemStack != null && itemStack.stackSize > 0) - return PacketTypeHandler.populatePacket(new PacketTileWithItemUpdate(xCoord, yCoord, zCoord, orientation, state, customName, itemStack.itemID, itemStack.getItemDamage(), itemStack.stackSize, ItemUtil.getColor(itemStack))); - else - return super.getDescriptionPacket(); - } - - @Override - public void onInventoryChanged() { - - worldObj.updateAllLightTypes(xCoord, yCoord, zCoord); - } - - @Override - public String toString() { - - StringBuilder stringBuilder = new StringBuilder(); - - stringBuilder.append(super.toString()); - - stringBuilder.append("TileGlassBell Data - "); - for (int i = 0; i < inventory.length; i++) { - if (i != 0) { - stringBuilder.append(", "); - } - - if (inventory[i] != null) { - stringBuilder.append(String.format("inventory[%d]: %s", i, inventory[i].toString())); - } - else { - stringBuilder.append(String.format("inventory[%d]: empty", i)); - } - } - stringBuilder.append("\n"); - - return stringBuilder.toString(); - } -} diff --git a/ee3_common/mcmod.info b/ee3_common/mcmod.info deleted file mode 100644 index 72715578..00000000 --- a/ee3_common/mcmod.info +++ /dev/null @@ -1,21 +0,0 @@ -[ -{ - "modid": "EE3", - "name": "Equivalent Exchange 3", - "description": "Transmute stuff into other stuff! Become a Minecraft God!", - "version": "@VERSION@", - "url": "http://www.minecraftforum.net/topic/1106178-", - "updateUrl": "", - "authorList": [ - "pahimar", - "x3n0ph0b3" - ], - "credits": "By pahimar, based on Equivalent Exchange 1 & 2 by x3n0ph0b3", - "logoFile": "/mods/ee3/textures/logo/logo.png", - "screenshots": [ - ], - "parent":"", - "dependencies": [ - ] -} -] \ No newline at end of file