• R/O
  • HTTP
  • SSH
  • HTTPS

ChemiCraftNext: Commit


Commit MetaInfo

Revisión6e880cc07db0e4c487194494f0f2ab130a4686b9 (tree)
Tiempo2013-04-21 13:25:31
Autormozipi <mozipi_2@yaho...>
Commitermozipi

Log Message

finalBuild(1.5.1移行)

Cambiar Resumen

Diferencia incremental

--- a/common/pcc/addon/crops/ChemicalCrops.java
+++ b/common/pcc/addon/crops/ChemicalCrops.java
@@ -19,7 +19,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
1919 import cpw.mods.fml.common.network.NetworkMod;
2020 import cpw.mods.fml.common.registry.GameRegistry;
2121
22-@Mod(modid="ChemiCraft|Crops", name="ChemicalCrops(ChemiCraft-Addon)", version="v1.0.0")
22+@Mod(modid="ChemiCraftCrops", name="ChemicalCrops(ChemiCraft-Addon)", version="v1.0.0")
2323 @NetworkMod(clientSideRequired = true, serverSideRequired = false)
2424 public class ChemicalCrops {
2525
--- a/common/pcc/chemicraft/base/ChemiCraftBase.java
+++ b/common/pcc/chemicraft/base/ChemiCraftBase.java
@@ -35,14 +35,14 @@ import cpw.mods.fml.common.network.NetworkMod;
3535 import cpw.mods.fml.common.registry.GameRegistry;
3636 import cpw.mods.fml.common.registry.LanguageRegistry;
3737
38-@Mod(modid = "ChemiCraft|Base", name = "ChemiCraftBase", version = "Beta1")
38+@Mod(modid = "ChemiCraftBase", name = "ChemiCraftBase", version = "Beta1")
3939 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.5", channels = "chemicraftbase", packetHandler = PacketHandler.class)
4040 public class ChemiCraftBase extends ChemiCraft {
4141
4242 /**
4343 * this is ChemiCraft instance.
4444 */
45- @Instance("ChemiCraft|Base")
45+ @Instance("ChemiCraftBase")
4646 public static ChemiCraftBase instance;
4747
4848 /**
@@ -172,7 +172,7 @@ public class ChemiCraftBase extends ChemiCraft {
172172 * @param event アノテーション呼び出しにより呼び出す必要なし
173173 */
174174 @PreInit
175- public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
175+ public void chemiPreLoadMethod(FMLPreInitializationEvent event) {
176176 Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
177177 cfg.load();
178178
--- a/common/pcc/chemicraft/base/compounds/CompoundWater.java
+++ b/common/pcc/chemicraft/base/compounds/CompoundWater.java
@@ -28,8 +28,8 @@ public class CompoundWater implements ICompoundHandler {
2828 }
2929
3030 @Override
31- public int getIconIndexHandler() {
32- return 1;
31+ public String getIconIndexHandler() {
32+ return "ChemiCraft:Composite";
3333 }
3434
3535 }
--- a/common/pcc/chemicraft/core/ChemiCraftAPI.java
+++ b/common/pcc/chemicraft/core/ChemiCraftAPI.java
@@ -3,6 +3,8 @@ package pcc.chemicraft.core;
33 import java.util.ArrayList;
44 import java.util.Arrays;
55 import java.util.HashMap;
6+import java.util.Iterator;
7+import java.util.TreeMap;
68
79 import net.minecraft.item.ItemStack;
810 import pcc.chemicraft.ChemiCraftData;
@@ -69,6 +71,18 @@ public class ChemiCraftAPI {
6971
7072
7173 /**
74+ * 化合物の英語名からダメージ値へのマップ
75+ */
76+ private static TreeMap<String, Integer> compoundsDamageToString = new TreeMap<String, Integer>();
77+
78+
79+ /**
80+ * 化合物のテクスチャマップ
81+ */
82+ private static TreeMap<Integer, String> compoundsTexture = new TreeMap<Integer, String>();
83+
84+
85+ /**
7286 * List of compounds handlers.
7387 */
7488 private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
@@ -150,6 +164,7 @@ public class ChemiCraftAPI {
150164
151165
152166
167+ private static int compoundTexturePointer = 0;
153168 /**
154169 * 化合物を追加します
155170 * @param name 化合物の名前
@@ -157,6 +172,10 @@ public class ChemiCraftAPI {
157172 public static void addCompound(String name){
158173 ChemiCraftCore.logger.write("addCompound:" + name
159174 , EnumLoggingType.INFO);
175+
176+ compoundsDamageToString.put(name, compoundTexturePointer);
177+ compoundsTexture.put(compoundTexturePointer, "ChemiCraft:CompoundEmpty");
178+ compoundTexturePointer++;
160179 compoundsNameListHash.add("en_US", name);
161180 compoundHash.put(name, compoundHash.size());
162181 }
@@ -392,6 +411,15 @@ public class ChemiCraftAPI {
392411 ChemiCraftCore.logger.write("settingCompoundHandler:" + "Name-" + handlerItemName + "/CompoundHandler-" + compoundHandler,
393412 EnumLoggingType.INFO);
394413
414+ if (compoundHandler.getIconIndexHandler() != null) {
415+ int p = compoundsDamageToString.get(handlerItemName);
416+ if (p != -1) {
417+ compoundsTexture.put(p, compoundHandler.getIconIndexHandler());
418+ } else {
419+ System.out.println("化合物が存在しません(settingCompoundHandler)");
420+ }
421+ }
422+
395423 compoundHandlers.add(compoundHandler);
396424 compoundHandlerItemNames.add(handlerItemName);
397425 }
@@ -530,4 +558,15 @@ public class ChemiCraftAPI {
530558 return toolAndWeaponSharpless;
531559 }
532560
561+
562+
563+ public static ArrayList<String> getCompoundsTexture() {
564+ Iterator<String> it = compoundsTexture.values().iterator();
565+ ArrayList<String> li = new ArrayList<String>();
566+ while (it.hasNext()) {
567+ li.add(it.next());
568+ }
569+ return li;
570+ }
571+
533572 }
--- a/common/pcc/chemicraft/core/ChemiCraftCore.java
+++ b/common/pcc/chemicraft/core/ChemiCraftCore.java
@@ -45,7 +45,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
4545 * ChemiCraft本体
4646 * @author P.C.C.
4747 */
48-@Mod(modid = "ChemiCraft|Core", name = "ChemiCraft", version = "Beta1")
48+@Mod(modid = "ChemiCraftCore", name = "ChemiCraft", version = "Beta1")
4949 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.5", channels = "chemicraftcore", packetHandler = PacketHandler.class)
5050 public class ChemiCraftCore extends ChemiCraft{
5151
@@ -76,7 +76,7 @@ public class ChemiCraftCore extends ChemiCraft{
7676 /**
7777 * this is ChemiCraft instance.
7878 */
79- @Instance("ChemiCraft|Core")
79+ @Instance("ChemiCraftCore")
8080 public static ChemiCraftCore instance;
8181
8282 /**
@@ -169,7 +169,7 @@ public class ChemiCraftCore extends ChemiCraft{
169169 * @param event アノテーション呼び出しにより呼び出す必要なし
170170 */
171171 @PreInit
172- public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
172+ public void chemiPreLoadMethod(FMLPreInitializationEvent event) {
173173 Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
174174 cfg.load();
175175
--- a/common/pcc/chemicraft/core/client/ClientProxy.java
+++ b/common/pcc/chemicraft/core/client/ClientProxy.java
@@ -26,7 +26,6 @@ public class ClientProxy extends CommonProxy {
2626
2727 @Override
2828 public void registerRenderInformation() {
29- MinecraftForgeClient.preloadTexture(ChemiCraft.TEXTURE);
3029 MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_PYROLYSIS_TEXTURE);
3130 MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_ELECTROLYSIS_TEXTURE);
3231 MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_CHEMICALCOMBINATION_TEXTURE);
--- a/common/pcc/chemicraft/core/compounds/CompoundDebug.java
+++ /dev/null
@@ -1,45 +0,0 @@
1-package pcc.chemicraft.core.compounds;
2-
3-import net.minecraft.entity.Entity;
4-import net.minecraft.entity.player.EntityPlayer;
5-import net.minecraft.entity.projectile.EntityLargeFireball;
6-import net.minecraft.item.ItemStack;
7-import net.minecraft.world.World;
8-import pcc.chemicraft.util.ICompoundHandler;
9-
10-public class CompoundDebug implements ICompoundHandler {
11-
12- @Override
13- public ItemStack onItemRightClickHandler(ItemStack par1ItemStack,
14- World par2World, EntityPlayer par3EntityPlayer) {
15- if (!par2World.isRemote) {
16- double var1 = par3EntityPlayer.posX;
17- double var2 = par3EntityPlayer.posY + 10;
18- double var3 = par3EntityPlayer.posZ;
19- double var4 = par3EntityPlayer.posX;
20- double var5 = par3EntityPlayer.posY;
21- double var6 = par3EntityPlayer.posZ;
22- par2World.spawnEntityInWorld(new EntityLargeFireball(par2World, var1, var2, var3, var4, var5, var6));
23- }
24- return par1ItemStack;
25- }
26-
27- @Override
28- public boolean onItemUseHandler(ItemStack par1ItemStack,
29- EntityPlayer par2EntityPlayer, World par3World, int par4, int par5,
30- int par6, int par7, float par8, float par9, float par10) {
31- return false;
32- }
33-
34- @Override
35- public void onUpdateHandler(ItemStack par1ItemStack, World par2World,
36- Entity par3Entity, int par4, boolean par5) {
37-
38- }
39-
40- @Override
41- public int getIconIndexHandler() {
42- return 0;
43- }
44-
45-}
--- a/common/pcc/chemicraft/core/item/ItemCompounds.java
+++ b/common/pcc/chemicraft/core/item/ItemCompounds.java
@@ -1,5 +1,6 @@
11 package pcc.chemicraft.core.item;
22
3+import java.util.ArrayList;
34 import java.util.List;
45
56 import net.minecraft.client.renderer.texture.IconRegister;
@@ -10,7 +11,6 @@ import net.minecraft.item.Item;
1011 import net.minecraft.item.ItemStack;
1112 import net.minecraft.util.Icon;
1213 import net.minecraft.world.World;
13-import pcc.chemicraft.ChemiCraft;
1414 import pcc.chemicraft.core.ChemiCraftAPI;
1515 import pcc.chemicraft.core.ChemiCraftCore;
1616 import cpw.mods.fml.relauncher.Side;
@@ -18,7 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly;
1818
1919 public class ItemCompounds extends Item {
2020
21- public Icon[] icons;
21+ private Icon[] icons;
2222
2323 public ItemCompounds(int par1){
2424 super(par1);
@@ -43,8 +43,7 @@ public class ItemCompounds extends Item {
4343
4444
4545 @Override
46- public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
47- {
46+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
4847 try {
4948 for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
5049 if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
@@ -60,7 +59,7 @@ public class ItemCompounds extends Item {
6059
6160
6261 @Override
63- public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
62+ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
6463 try {
6564 for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){
6665 if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){
@@ -87,14 +86,6 @@ public class ItemCompounds extends Item {
8786
8887
8988 @Override
90- @SideOnly(Side.CLIENT)
91- public Icon getIconFromDamage(int par1) {
92- return this.icons[par1];
93- }
94-
95-
96-
97- @Override
9889 public String getUnlocalizedName(ItemStack par1ItemStack){
9990 return super.getUnlocalizedName() + "." + ChemiCraftCore.instance.api.getCompoundsName().get("en_US", par1ItemStack.getItemDamage());
10091 }
@@ -104,11 +95,17 @@ public class ItemCompounds extends Item {
10495 @Override
10596 @SideOnly(Side.CLIENT)
10697 public void updateIcons(IconRegister par1IconRegister) {
107- this.icons = new Icon[ChemiCraftCore.instance.api.getCompoundsName().sizeElementsList("en_US")];
108-
109- for (int i = 0; i < ChemiCraftCore.instance.api.getCompoundsName().sizeElementsList("en_US"); i++) {
110- this.icons[i] = par1IconRegister.registerIcon(ChemiCraft.TEXTURE + "compounds_" + ChemiCraftCore.instance.api.getCompoundsName().get("en_US", i));
98+ ArrayList<String> textures = ChemiCraftAPI.getCompoundsTexture();
99+ this.icons = new Icon[textures.size()];
100+ for (int i = 0; i < textures.size(); i++) {
101+ this.icons[i] = par1IconRegister.registerIcon(textures.get(i));
111102 }
112103 }
113104
105+ @Override
106+ @SideOnly(Side.CLIENT)
107+ public Icon getIconFromDamage(int par1) {
108+ return this.icons[par1];
109+ }
110+
114111 }
--- a/common/pcc/chemicraft/core/tileentity/TileEntityPyrolysisTable.java
+++ b/common/pcc/chemicraft/core/tileentity/TileEntityPyrolysisTable.java
@@ -66,9 +66,6 @@ public class TileEntityPyrolysisTable extends TileEntity {
6666
6767 @Override
6868 public void updateEntity() {
69-
70- System.out.println("完成時間:" + (MAX_BURN_TIME / (10 * (this.heat / CENTER_HEAT))) / 20 + "seconds");
71-
7269 // boolean var2 = false;
7370
7471 boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
--- a/common/pcc/chemicraft/util/ICompoundHandler.java
+++ b/common/pcc/chemicraft/util/ICompoundHandler.java
@@ -52,6 +52,6 @@ public interface ICompoundHandler {
5252 * iconIndexの指定
5353 * @return iconIndex
5454 */
55- public int getIconIndexHandler();
55+ public String getIconIndexHandler();
5656
5757 }
Show on old repository browser