From 9b2477df55543507ce91a180f7827428ec01fc94 Mon Sep 17 00:00:00 2001 From: mozipi Date: Thu, 6 Dec 2012 03:26:33 +0900 Subject: [PATCH] =?utf8?q?=E5=A4=89=E6=9B=B4=E7=82=B9=E3=82=92=E3=81=9D?= =?utf8?q?=E3=81=AE=E3=81=BE=E3=81=BE=E3=81=AB=E3=81=97=E3=81=A6=E4=BF=AE?= =?utf8?q?=E6=AD=A3=E3=81=97=E3=80=81=E9=96=93=E9=81=95=E3=81=A3=E3=81=A6?= =?utf8?q?=E3=81=84=E3=82=8B=E3=81=A8=E3=81=93=E3=82=8D=E3=82=92=E6=B6=88?= =?utf8?q?=E5=8E=BB&=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- common/chemicraft/AtomInfo.java | 26 ++--- common/chemicraft/Auxiliary.java | 20 ++-- common/chemicraft/BlockScienceCraftingTable.java | 30 +++++ common/chemicraft/ChemiCraft.java | 124 ++++++++++++++------- common/chemicraft/ChemiCraftAPI.java | 74 +++++++++--- common/chemicraft/ChemiCraftTabs.java | 58 ++++++++++ common/chemicraft/CommonProxy.java | 2 +- common/chemicraft/CompoundHandlerTest.java | 2 +- .../chemicraft/ContainerScienceCraftingTable.java | 61 ++++++++++ common/chemicraft/CreativeTabAtoms.java | 4 +- common/chemicraft/GuiScienceCraftingTable.java | 65 +++++++++++ common/chemicraft/ICompoundHandler.java | 2 +- common/chemicraft/ItemAtoms.java | 6 +- common/chemicraft/ItemCompounds.java | 6 +- common/chemicraft/ItemGasCollectingBottle.java | 8 +- common/chemicraft/TileEntityDecompose.java | 77 ------------- .../chemicraft/TileEntityScienceCraftingTable.java | 27 +++++ src/chemicraft/client/ClientProxy.java | 2 +- 18 files changed, 420 insertions(+), 174 deletions(-) create mode 100644 common/chemicraft/BlockScienceCraftingTable.java create mode 100644 common/chemicraft/ChemiCraftTabs.java create mode 100644 common/chemicraft/ContainerScienceCraftingTable.java create mode 100644 common/chemicraft/GuiScienceCraftingTable.java delete mode 100644 common/chemicraft/TileEntityDecompose.java create mode 100644 common/chemicraft/TileEntityScienceCraftingTable.java diff --git a/common/chemicraft/AtomInfo.java b/common/chemicraft/AtomInfo.java index f11ef33..9523468 100644 --- a/common/chemicraft/AtomInfo.java +++ b/common/chemicraft/AtomInfo.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import net.minecraft.src.EntityPlayer; import net.minecraft.src.ItemStack; @@ -16,29 +16,29 @@ public class AtomInfo { this.biomeName = par1World.getBiomeGenForCoords(posX, posZ).biomeName; - this.posX = (int) par2EntityPlayer.posX; // X座標 - this.posY = (int) par2EntityPlayer.posY; // Y座標 - this.posZ = (int) par2EntityPlayer.posZ; // Z座標 + this.posX = (int) par2EntityPlayer.posX; // XÀ•W + this.posY = (int) par2EntityPlayer.posY; // YÀ•W + this.posZ = (int) par2EntityPlayer.posZ; // ZÀ•W boolean rainy = par1World.isRaining(); boolean thunder = par1World.isThundering(); - if (rainy && thunder){ // 雨且つ雷 + if (rainy && thunder){ // ‰JŠŽ‚—‹ this.weather = "THUNDER"; - }else if(rainy){ // 雨または雪 + }else if(rainy){ // ‰J‚Ü‚½‚͐á this.weather = "RAINY"; - }else{ //晴れ + }else{ //°‚ê this.weather = "SUNNY"; } } /** - * Y座標との比較 + * YÀ•W‚Æ‚Ì”äŠr * @param EntityPlayer EntityPlayer - * @param y Y座標 - * @param biomeName バイオームの名前(nullでも可) - * @param weather 天気(nullでも可) - * @param par1 入手数 - * @param par2 種類(ダメージ値) + * @param y YÀ•W + * @param biomeName ƒoƒCƒI[ƒ€‚Ì–¼‘O(null‚Å‚à‰Â) + * @param weather “V‹C(null‚Å‚à‰Â) + * @param par1 “üŽè” + * @param par2 Ží—Þ(ƒ_ƒ[ƒW’l) */ private boolean equivalentBiome(String biomeName){ boolean ver1 = biomeName != null ? ((this.biomeName == biomeName) ? true : false) : true; diff --git a/common/chemicraft/Auxiliary.java b/common/chemicraft/Auxiliary.java index 6a88b97..946bb34 100644 --- a/common/chemicraft/Auxiliary.java +++ b/common/chemicraft/Auxiliary.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import net.minecraft.src.Block; import net.minecraft.src.Item; @@ -13,7 +13,7 @@ public class Auxiliary { class NameAuxiliary{ /** - * 名前を追加する。 + * –¼‘O‚ð’ljÁ‚·‚éB * @param object * @param Name */ @@ -22,7 +22,7 @@ public class Auxiliary { } /** - * 名前を追加する(ItemStack版) + * –¼‘O‚ð’ljÁ‚·‚é(ItemStack”Å) * @param object * @param name * @param meta @@ -30,10 +30,10 @@ public class Auxiliary { public void addName(ItemStack itemstack,Object name){ LanguageRegistry.addName(itemstack, (String) name); } - + /** - * 指定した言語で名前を追加する。 + * Žw’肵‚½Œ¾Œê‚Å–¼‘O‚ð’ljÁ‚·‚éB * @param object * @param name */ @@ -42,7 +42,7 @@ public class Auxiliary { } /** - * 指定した言語で名前を追加する(ItemStack版) + * Žw’肵‚½Œ¾Œê‚Å–¼‘O‚ð’ljÁ‚·‚é(ItemStack”Å) * @param object * @param name */ @@ -52,7 +52,7 @@ public class Auxiliary { } /** - * メタデータ+配列で名前を追加する(Block版) + * ƒƒ^ƒf[ƒ^+”z—ñ‚Å–¼‘O‚ð’ljÁ‚·‚é(Block”Å) * @param object * @param name */ @@ -63,7 +63,7 @@ public class Auxiliary { } /** - * メタデータ+配列で名前を追加する(Item版) + * ƒƒ^ƒf[ƒ^+”z—ñ‚Å–¼‘O‚ð’ljÁ‚·‚é(Item”Å) * @param object * @param name */ @@ -74,7 +74,7 @@ public class Auxiliary { } /** - * メタデータ+配列で指定した言語で名前を追加する(Block版) + * ƒƒ^ƒf[ƒ^+”z—ñ‚ÅŽw’肵‚½Œ¾Œê‚Å–¼‘O‚ð’ljÁ‚·‚é(Block”Å) * @param object * @param name */ @@ -85,7 +85,7 @@ public class Auxiliary { } /** - * メタデータ+配列で指定した言語で名前を追加する(Item版) + * ƒƒ^ƒf[ƒ^+”z—ñ‚ÅŽw’肵‚½Œ¾Œê‚Å–¼‘O‚ð’ljÁ‚·‚é(Item”Å) * @param object * @param name */ diff --git a/common/chemicraft/BlockScienceCraftingTable.java b/common/chemicraft/BlockScienceCraftingTable.java new file mode 100644 index 0000000..d5d1de7 --- /dev/null +++ b/common/chemicraft/BlockScienceCraftingTable.java @@ -0,0 +1,30 @@ +package chemicraft; + +import cpw.mods.fml.common.Mod; +import net.minecraft.src.BlockContainer; +import net.minecraft.src.CreativeTabs; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.Material; +import net.minecraft.src.TileEntity; +import net.minecraft.src.World; + +public class BlockScienceCraftingTable extends BlockContainer { + + public BlockScienceCraftingTable(int par1, int par2, Material par3Material) { + super(par1, par2, par3Material); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.guiScienceCraftingTableID, par1World, par2, par3, par4); + return true; + } + + @Override + public TileEntity createNewTileEntity(World var1) { + return new TileEntityScienceCraftingTable(); + } + +} diff --git a/common/chemicraft/ChemiCraft.java b/common/chemicraft/ChemiCraft.java index f9ea799..d727bb9 100644 --- a/common/chemicraft/ChemiCraft.java +++ b/common/chemicraft/ChemiCraft.java @@ -1,23 +1,19 @@ package chemicraft; -import java.util.ArrayList; -import java.util.Properties; - import net.minecraft.src.Block; import net.minecraft.src.CreativeTabs; import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; +import net.minecraft.src.Material; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.Property; +import chemicraft.Auxiliary.NameAuxiliary; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; 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.LanguageRegistry; @Mod( modid = "chemiCraft", name="ChemiCraft", version="テスト版") //ID,名前,バージョン @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "[1.3.2]", packetHandler = PacketHandler.class) //クライアント、サーバー共に必要 1.3.2用 @@ -25,8 +21,6 @@ import cpw.mods.fml.common.registry.LanguageRegistry; public class ChemiCraft { - public static final CreativeTabs tabAtoms = new CreativeTabAtoms("tabAtoms"); - public static final String[] atomsName = { "Hydrogen", "Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon", "Sodium","Magnesium","Aluminium","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium", @@ -54,68 +48,118 @@ public class ChemiCraft "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン", "フランシウム", "ラジウム", "アクチニウム", "トリウム", "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム", "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム", "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム", - "レントゲニウム", "コペルニシウム", "ウンウントリウム", "フレロビウム", "ウンウンペンチウム", "リバモリウム", "ウンウンセプチウム", "ウンウンオクチウム" + "レントゲニウム", "コペルニシウム", "ウンウントリウム", "ウンウンクアジウム", "ウンウンペンチウム", "ウンウンヘキシウム", "", "ウンウンオクチウム" }; - // プロキシ + /** + * このmodのインスタンス + */ + @Mod.Instance("chemiCraft") + public static ChemiCraft instance; + + /** + * ChemiCraftのProxy + */ @SidedProxy(clientSide = "chemicraft.client.ClientProxy", serverSide = "chemicraft.CommonProxy") public static CommonProxy proxy; - - // このクラスのインスタンス - @Instance("chemiCraft") - public static ChemiCraft instance; - - private ChemiCraftAPI chemiCraftAPI = ChemiCraftAPI.instance; - public static int gasCollectingBottleID; + /** + * ChemiCraftのCreativeTab + */ + public static CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft"); + + /** + * ItemID + */ public static int atomsID; public static int compoundsID; + public static int gasCollectingBottleID; - public static Item itemGasCollectingBottle; - public static Item itemAtoms; - public static Item itemCompounds; + /** + * BlockID + */ + public static int scienceCraftingTableID; - private Auxiliary Auxiliary = new Auxiliary(); - private Auxiliary.NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary(); + /** + * GUIID + */ + public static int guiScienceCraftingTableID; - // コンストラクタ - @Mod.Init - public void chemiLoadMethod(FMLInitializationEvent event) - { + /** + * Block型変数 + */ + public static Block blockScienceCraftingTable; - //化合物の追加 - ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "å¡©"); - } + /** + * Item型変数 + */ + public static Item itemAtoms; + public static Item itemCompounds; + public static Item itemGasCollectingBottle; + + /** + * このmodに必要な補助クラスのインスタンス + */ + private static Auxiliary Auxiliary = new Auxiliary(); + private static NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary(); - @Mod.PreInit // 前処理 + @Mod.PreInit public void chemiPreLoadMethod(FMLPreInitializationEvent event) { Configuration cfg = new Configuration(event.getSuggestedConfigurationFile()); cfg.load(); - Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25000); - Property atomsIDProp = cfg.getItem("atomsID", 25001); - Property compoundsIDProp = cfg.getItem("compoundsID", 25002); - gasCollectingBottleID = gasCollectingBottleIDProp.getInt(); + + Property scienceCraftingTableIDProp = cfg.getBlock("scienceCraftingTable", 200); + Property atomsIDProp = cfg.getItem("atomsID", 25000); + Property compoundsIDProp = cfg.getItem("compoundsID", 25001); + Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002); + Property guiScienceCraftingTableIDProp = cfg.get("GUI", "GUIScienceCraftingTableID", 1000); + + scienceCraftingTableID = scienceCraftingTableIDProp.getInt(); atomsID = atomsIDProp.getInt(); compoundsID = compoundsIDProp.getInt(); + gasCollectingBottleID = gasCollectingBottleIDProp.getInt(); + guiScienceCraftingTableID = guiScienceCraftingTableIDProp.getInt(); + cfg.save(); } - @Mod.PostInit // ModLoader.loadメソッドと同等 + @Mod.PostInit public void chemiPostLoadMethod(FMLPostInitializationEvent event) { - itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle"); + //API用の処理 + NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray()); + NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray()); + + //Blockを追加します + blockScienceCraftingTable = new BlockScienceCraftingTable(scienceCraftingTableID, Block.workbench.blockIndexInTexture, Material.ground).setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("ScienceCraftingTable"); + + //Itemを追加します itemAtoms = new ItemAtoms(atomsID).setItemName("atoms"); itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds"); + itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle"); + + //BlockをMinecraftに登録します + GameRegistry.registerBlock(blockScienceCraftingTable); + //Blockの名前を設定します + NameAuxiliary.addName(blockScienceCraftingTable, "ScienceCraftingTable"); + NameAuxiliary.addName(blockScienceCraftingTable, "ja_JP", "科学作業台"); + + //Itemの名前を設定します NameAuxiliary.addName(itemAtoms, atomsName); NameAuxiliary.addName(itemAtoms, "ja_JP", atomsNameJP); - NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray()); - NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray()); NameAuxiliary.addName(itemGasCollectingBottle, "GasCollectingBottle"); NameAuxiliary.addName(itemGasCollectingBottle, "ja_JP", "集気瓶"); - ChemiCraftAPI.addCompoundHandler("Salt", new CompoundHandlerTest()); + //化合物の名前を設定し追加します + ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "å¡©"); + + //TileEntityを追加します + GameRegistry.registerTileEntity(TileEntityScienceCraftingTable.class, "TileEntityScienceCraftingTable"); + + //GUIを追加します + NetworkRegistry.instance().registerGuiHandler(instance, proxy); } diff --git a/common/chemicraft/ChemiCraftAPI.java b/common/chemicraft/ChemiCraftAPI.java index 5630753..5f1a892 100644 --- a/common/chemicraft/ChemiCraftAPI.java +++ b/common/chemicraft/ChemiCraftAPI.java @@ -1,50 +1,73 @@ -package chemicraft; +package chemicraft; import java.util.ArrayList; public class ChemiCraftAPI { + /** + * Instance of the ChemiCraftAPI. + */ public static ChemiCraftAPI instance = new ChemiCraftAPI(); - private boolean addLanguage = false; + /** + * List of compounds names. + */ private static ArrayList compoundsNameList = new ArrayList(); + + /** + * List of compounds names(Some kind of language). + */ private static ArrayList compoundsLangNameList = new ArrayList(); + + /** + * List of compounds the language names. + */ private static ArrayList compoundsLangList = new ArrayList(); + + /** + * List of compounds handlers. + */ private static ArrayList compoundHandlers = new ArrayList(); + + /** + * List of item name of handler to compounds. + */ private static ArrayList compoundHandlerItemNames = new ArrayList(); + /** + * add compound. + * @param name compound name. + */ public static void addCompound(String name){ compoundsNameList.add(name); compoundsLangNameList.add(""); compoundsLangList.add(""); } + /** + * add compound corresponding to the language. + * @param lang Language to the corresponding + * @param englishName compound name + * @param langName compound name(specified language) + */ public static void addLangCompound(String lang, String englishName, String langName){ compoundsNameList.add(englishName); compoundsLangNameList.add(langName); compoundsLangList.add(lang); } - public static ArrayList getCompoundsName(){ - compoundsNameList.trimToSize(); - return compoundsNameList; - } - - public static ArrayList getCompoundsLangName(){ - compoundsLangNameList.trimToSize(); - return compoundsLangNameList; - } - - public static ArrayList getCompoundsLang(){ - compoundsLangList.trimToSize(); - return compoundsLangList; - } - - public static void addCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){ + /** + * setting compound handler. + * @param handlerItemName + * @param compoundHandler + */ + public static void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){ ChemiCraftAPI.compoundHandlers.add(compoundHandler); compoundHandlerItemNames.add(handlerItemName); } + //ˆÈ~ƒVƒXƒeƒ€ŠÖŒW‚̃ƒ\ƒbƒh////////////////////////////////////////////////////// + public static ArrayList getCompoundHandler(){ compoundHandlers.trimToSize(); return compoundHandlers; @@ -56,4 +79,19 @@ public class ChemiCraftAPI { return compoundHandlerItemNames; } + public static ArrayList getCompoundsName(){ + compoundsNameList.trimToSize(); + return compoundsNameList; + } + + public static ArrayList getCompoundsLangName(){ + compoundsLangNameList.trimToSize(); + return compoundsLangNameList; + } + + public static ArrayList getCompoundsLang(){ + compoundsLangList.trimToSize(); + return compoundsLangList; + } + } diff --git a/common/chemicraft/ChemiCraftTabs.java b/common/chemicraft/ChemiCraftTabs.java new file mode 100644 index 0000000..0840ee5 --- /dev/null +++ b/common/chemicraft/ChemiCraftTabs.java @@ -0,0 +1,58 @@ +package chemicraft; + +public class ChemiCraftTabs { + + /** + * tab‚ÌID + */ + private int id; + + /** + * tab‚ÉOverlay‚·‚éTextureID + */ + private int texture; + + + + /** + * tab‚Ì–¼‘O + */ + private String tabName; + + public ChemiCraftTabs(int id, int texture, String tabName){ + this.id = id; + this.texture = texture; + this.tabName = tabName; + } + + + + /** + * ID‚ð•Ô‚µ‚Ü‚· + * @return tab‚ÌID + */ + public int getID(){ + return this.id; + } + + + + /** + * tab‚ÉOverlay‚·‚éTextureID‚ð•Ô‚µ‚Ü‚· + * @return tab‚ÉOverlay‚·‚éTextureID + */ + public int getTexture(){ + return this.texture; + } + + + + /** + * tab‚Ì–¼‘O‚ð•Ô‚µ‚Ü‚· + * @return tab‚Ì–¼‘O + */ + public String getTabName(){ + return this.tabName; + } + +} diff --git a/common/chemicraft/CommonProxy.java b/common/chemicraft/CommonProxy.java index 1dcc5a3..3608d31 100644 --- a/common/chemicraft/CommonProxy.java +++ b/common/chemicraft/CommonProxy.java @@ -28,4 +28,4 @@ public class CommonProxy implements IGuiHandler { return null; } -} +} \ No newline at end of file diff --git a/common/chemicraft/CompoundHandlerTest.java b/common/chemicraft/CompoundHandlerTest.java index 5f10799..e13d149 100644 --- a/common/chemicraft/CompoundHandlerTest.java +++ b/common/chemicraft/CompoundHandlerTest.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import net.minecraft.src.Entity; import net.minecraft.src.EntityPlayer; diff --git a/common/chemicraft/ContainerScienceCraftingTable.java b/common/chemicraft/ContainerScienceCraftingTable.java new file mode 100644 index 0000000..06c739e --- /dev/null +++ b/common/chemicraft/ContainerScienceCraftingTable.java @@ -0,0 +1,61 @@ +package chemicraft; + +import net.minecraft.src.Block; +import net.minecraft.src.Container; +import net.minecraft.src.CraftingManager; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.IInventory; +import net.minecraft.src.InventoryCraftResult; +import net.minecraft.src.InventoryCrafting; +import net.minecraft.src.InventoryPlayer; +import net.minecraft.src.ItemStack; +import net.minecraft.src.Slot; +import net.minecraft.src.SlotCrafting; +import net.minecraft.src.World; + +public class ContainerScienceCraftingTable extends Container +{ + private World worldObj; + private int posX; + private int posY; + private int posZ; + + public ContainerScienceCraftingTable(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) + { + this.worldObj = par2World; + this.posX = par3; + this.posY = par4; + this.posZ = par5; + int var6; + int var7; + + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory par1IInventory) + { + } + + /** + * Callback for when the crafting gui is closed. + */ + public void onCraftGuiClosed(EntityPlayer par1EntityPlayer) + { + super.onCraftGuiClosed(par1EntityPlayer); + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.scienceCraftingTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** + * Called to transfer a stack from one inventory to the other eg. when shift clicking. + */ + public ItemStack transferStackInSlot(int par1) + { + return null; + } +} diff --git a/common/chemicraft/CreativeTabAtoms.java b/common/chemicraft/CreativeTabAtoms.java index fac365d..21a9948 100644 --- a/common/chemicraft/CreativeTabAtoms.java +++ b/common/chemicraft/CreativeTabAtoms.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import net.minecraft.src.*; import cpw.mods.fml.common.Side; @@ -17,7 +17,7 @@ public class CreativeTabAtoms extends CreativeTabs{ { return ChemiCraft.itemGasCollectingBottle.shiftedIndex; } - + @Override @SideOnly(Side.CLIENT) public String getTranslatedTabLabel() diff --git a/common/chemicraft/GuiScienceCraftingTable.java b/common/chemicraft/GuiScienceCraftingTable.java new file mode 100644 index 0000000..1e340e5 --- /dev/null +++ b/common/chemicraft/GuiScienceCraftingTable.java @@ -0,0 +1,65 @@ +package chemicraft; + +import java.util.ArrayList; + +import net.minecraft.src.GuiContainer; +import net.minecraft.src.InventoryPlayer; +import net.minecraft.src.MinecraftException; +import net.minecraft.src.World; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.common.Side; +import cpw.mods.fml.common.asm.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiScienceCraftingTable extends GuiContainer +{ + + private ArrayList tabList = new ArrayList(); + + public GuiScienceCraftingTable(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) + { + super(new ContainerScienceCraftingTable(par1InventoryPlayer, par2World, par3, par4, par5)); + } + + @Override + protected void drawGuiContainerForegroundLayer() + { + //this.fontRenderer.drawString(StatCollector.translateToLocal("container.crafting"), 28, 6, 4210752); + //this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + int var4 = this.mc.renderEngine.getTexture("/ChemiCraft/guis/Decomposition.png"); + int var7 = this.mc.renderEngine.getTexture("/gui/allitems.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(var4); + int var5 = (this.width - this.xSize) / 2; + int var6 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); + + for(int i = 0;i < tabList.size();i++){ + this.mc.renderEngine.bindTexture(var7); + int var8 = var5 + tabList.get(i).getID() * 28; + int var9 = var6 - 32; + this.drawTexturedModalRect(var8, var9, 0, 0, 28, 32); + } + } + + private void addTabs(int id, int Texture, String name){ + for(int i = 0;i < tabList.size();i++){ + if(id == tabList.get(i).getID()){ + try { + throw new Exception("ChemiCraft“à‚ŃGƒ‰[:ChemiCraftTabs‚ÌID‚ªd•¡‚µ‚Ä‚¢‚Ü‚·"); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + tabList.add(new ChemiCraftTabs(id, Texture, name)); + } + +} diff --git a/common/chemicraft/ICompoundHandler.java b/common/chemicraft/ICompoundHandler.java index c542618..3e69c18 100644 --- a/common/chemicraft/ICompoundHandler.java +++ b/common/chemicraft/ICompoundHandler.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import net.minecraft.src.Entity; import net.minecraft.src.EntityPlayer; diff --git a/common/chemicraft/ItemAtoms.java b/common/chemicraft/ItemAtoms.java index 94cc019..12d9469 100644 --- a/common/chemicraft/ItemAtoms.java +++ b/common/chemicraft/ItemAtoms.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import java.util.List; @@ -17,7 +17,7 @@ public class ItemAtoms extends Item { this.maxStackSize = 1; this.setHasSubtypes(true); this.setMaxDamage(0); - this.setCreativeTab(ChemiCraft.tabAtoms); + this.setCreativeTab(ChemiCraft.instance.creativeTab); } @SideOnly(Side.CLIENT) @@ -41,7 +41,7 @@ public class ItemAtoms extends Item { public String getTextureFile() { this.isDefaultTexture = false; - return "/ChemiCraft/Atoms.png"; + return "/ChemiCraft/items/Atoms.png"; } @SideOnly(Side.CLIENT) diff --git a/common/chemicraft/ItemCompounds.java b/common/chemicraft/ItemCompounds.java index dc381ba..dfdeb0e 100644 --- a/common/chemicraft/ItemCompounds.java +++ b/common/chemicraft/ItemCompounds.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import java.util.List; @@ -17,7 +17,7 @@ public class ItemCompounds extends Item { this.maxStackSize = 1; this.setHasSubtypes(true); this.setMaxDamage(0); - this.setCreativeTab(ChemiCraft.tabAtoms); + this.setCreativeTab(ChemiCraft.instance.creativeTab); } @Override @@ -52,7 +52,7 @@ public class ItemCompounds extends Item { public String getTextureFile() { this.isDefaultTexture = false; - return "/ChemiCraft/Compounds.png"; + return "/ChemiCraft/items/Compounds.png"; } @SideOnly(Side.CLIENT) diff --git a/common/chemicraft/ItemGasCollectingBottle.java b/common/chemicraft/ItemGasCollectingBottle.java index 60547a0..26f3201 100644 --- a/common/chemicraft/ItemGasCollectingBottle.java +++ b/common/chemicraft/ItemGasCollectingBottle.java @@ -1,4 +1,4 @@ -package chemicraft; +package chemicraft; import java.util.Random; @@ -6,11 +6,11 @@ import net.minecraft.src.*; public class ItemGasCollectingBottle extends Item { - protected ItemGasCollectingBottle(int id) { + public ItemGasCollectingBottle(int id) { super(id); this.setMaxStackSize(1); this.setMaxDamage(2); - this.setCreativeTab(ChemiCraft.tabAtoms); + this.setCreativeTab(ChemiCraft.instance.creativeTab); } @Override @@ -26,7 +26,7 @@ public class ItemGasCollectingBottle extends Item { public String getTextureFile() { this.isDefaultTexture = false; - return "/ChemiCraft/items.png"; + return "/ChemiCraft/items/sprite.png"; } } diff --git a/common/chemicraft/TileEntityDecompose.java b/common/chemicraft/TileEntityDecompose.java deleted file mode 100644 index f8ab952..0000000 --- a/common/chemicraft/TileEntityDecompose.java +++ /dev/null @@ -1,77 +0,0 @@ -package chemicraft; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.IInventory; -import net.minecraft.src.ItemStack; -import net.minecraft.src.TileEntity; - -public class TileEntityDecompose extends TileEntity implements IInventory -{ - // 0:物質アイテム 1~:原子アイテム - private ItemStack[] invContents; - - public TileEntityDecompose() - { - invContents = new ItemStack[36]; - } - - @Override - public int getSizeInventory() - { - return 17; - } - - @Override - public ItemStack getStackInSlot(int var1) - { - return null; - } - - @Override - public ItemStack decrStackSize(int var1, int var2) - { - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int var1) - { - return null; - } - - @Override - public void setInventorySlotContents(int var1, ItemStack var2) - { - - } - - @Override - public String getInvName() - { - return null; - } - - @Override - public int getInventoryStackLimit() - { - return 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer var1) - { - return false; - } - - @Override - public void openChest() - { - - } - - @Override - public void closeChest() - { - - } -} diff --git a/common/chemicraft/TileEntityScienceCraftingTable.java b/common/chemicraft/TileEntityScienceCraftingTable.java new file mode 100644 index 0000000..e8ac3ca --- /dev/null +++ b/common/chemicraft/TileEntityScienceCraftingTable.java @@ -0,0 +1,27 @@ +package chemicraft; + +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.IInventory; +import net.minecraft.src.ItemStack; +import net.minecraft.src.NBTTagCompound; +import net.minecraft.src.Packet; +import net.minecraft.src.TileEntity; + +public class TileEntityScienceCraftingTable extends TileEntity { + + public TileEntityScienceCraftingTable(){ + } + + @Override + public void updateEntity(){ + super.updateEntity(); + } + + @Override + public void readFromNBT(NBTTagCompound par1){ + } + + @Override + public void writeToNBT(NBTTagCompound par1){ + } +} diff --git a/src/chemicraft/client/ClientProxy.java b/src/chemicraft/client/ClientProxy.java index 66d8dbb..4bdf5e1 100644 --- a/src/chemicraft/client/ClientProxy.java +++ b/src/chemicraft/client/ClientProxy.java @@ -1,9 +1,9 @@ package chemicraft.client; -import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.src.EntityPlayer; import net.minecraft.src.World; import chemicraft.CommonProxy; +import cpw.mods.fml.client.FMLClientHandler; public class ClientProxy extends CommonProxy { -- 2.11.0