炎上起こしたのでソースバックアップ用
修订版 | afe3566266d18f5b916a3a3211acd202d57c4c6c (tree) |
---|---|
时间 | 2013-04-21 15:05:41 |
作者 | ponkotate <ponkotate@user...> |
Commiter | ponkotate |
Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
@@ -19,11 +19,11 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
19 | 19 | import cpw.mods.fml.common.network.NetworkMod; |
20 | 20 | import cpw.mods.fml.common.registry.GameRegistry; |
21 | 21 | |
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") | |
23 | 23 | @NetworkMod(clientSideRequired = true, serverSideRequired = false) |
24 | 24 | public class ChemicalCrops { |
25 | 25 | |
26 | - @Instance("ChemiCraft|Crops") | |
26 | + @Instance("ChemiCraftCrops") | |
27 | 27 | public static ChemicalCrops instance; |
28 | 28 | |
29 | 29 | @SidedProxy(clientSide = "pcc.addon.crops.ClientProxy", serverSide = "pcc.addon.crops.CommonProxy") |
@@ -35,14 +35,14 @@ import cpw.mods.fml.common.network.NetworkMod; | ||
35 | 35 | import cpw.mods.fml.common.registry.GameRegistry; |
36 | 36 | import cpw.mods.fml.common.registry.LanguageRegistry; |
37 | 37 | |
38 | -@Mod(modid = "ChemiCraft|Base", name = "ChemiCraftBase", version = "Beta1") | |
38 | +@Mod(modid = "ChemiCraftBase", name = "ChemiCraftBase", version = "Beta1") | |
39 | 39 | @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.5", channels = "chemicraftbase", packetHandler = PacketHandler.class) |
40 | 40 | public class ChemiCraftBase extends ChemiCraft { |
41 | 41 | |
42 | 42 | /** |
43 | 43 | * this is ChemiCraft instance. |
44 | 44 | */ |
45 | - @Instance("ChemiCraft|Base") | |
45 | + @Instance("ChemiCraftBase") | |
46 | 46 | public static ChemiCraftBase instance; |
47 | 47 | |
48 | 48 | /** |
@@ -172,7 +172,7 @@ public class ChemiCraftBase extends ChemiCraft { | ||
172 | 172 | * @param event アノテーション呼び出しにより呼び出す必要なし |
173 | 173 | */ |
174 | 174 | @PreInit |
175 | - public void chemiPreLoadMethod(final FMLPreInitializationEvent event) { | |
175 | + public void chemiPreLoadMethod(FMLPreInitializationEvent event) { | |
176 | 176 | Configuration cfg = new Configuration(event.getSuggestedConfigurationFile()); |
177 | 177 | cfg.load(); |
178 | 178 |
@@ -28,8 +28,8 @@ public class CompoundWater implements ICompoundHandler { | ||
28 | 28 | } |
29 | 29 | |
30 | 30 | @Override |
31 | - public int getIconIndexHandler() { | |
32 | - return 1; | |
31 | + public String getIconIndexHandler() { | |
32 | + return "ChemiCraft:Composite"; | |
33 | 33 | } |
34 | 34 | |
35 | 35 | } |
@@ -3,6 +3,8 @@ package pcc.chemicraft.core; | ||
3 | 3 | import java.util.ArrayList; |
4 | 4 | import java.util.Arrays; |
5 | 5 | import java.util.HashMap; |
6 | +import java.util.Iterator; | |
7 | +import java.util.TreeMap; | |
6 | 8 | |
7 | 9 | import net.minecraft.item.ItemStack; |
8 | 10 | import pcc.chemicraft.ChemiCraftData; |
@@ -69,6 +71,18 @@ public class ChemiCraftAPI { | ||
69 | 71 | |
70 | 72 | |
71 | 73 | /** |
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 | + /** | |
72 | 86 | * List of compounds handlers. |
73 | 87 | */ |
74 | 88 | private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>(); |
@@ -150,6 +164,7 @@ public class ChemiCraftAPI { | ||
150 | 164 | |
151 | 165 | |
152 | 166 | |
167 | + private static int compoundTexturePointer = 0; | |
153 | 168 | /** |
154 | 169 | * 化合物を追加します |
155 | 170 | * @param name 化合物の名前 |
@@ -157,6 +172,10 @@ public class ChemiCraftAPI { | ||
157 | 172 | public static void addCompound(String name){ |
158 | 173 | ChemiCraftCore.logger.write("addCompound:" + name |
159 | 174 | , EnumLoggingType.INFO); |
175 | + | |
176 | + compoundsDamageToString.put(name, compoundTexturePointer); | |
177 | + compoundsTexture.put(compoundTexturePointer, "ChemiCraft:CompoundEmpty"); | |
178 | + compoundTexturePointer++; | |
160 | 179 | compoundsNameListHash.add("en_US", name); |
161 | 180 | compoundHash.put(name, compoundHash.size()); |
162 | 181 | } |
@@ -392,6 +411,15 @@ public class ChemiCraftAPI { | ||
392 | 411 | ChemiCraftCore.logger.write("settingCompoundHandler:" + "Name-" + handlerItemName + "/CompoundHandler-" + compoundHandler, |
393 | 412 | EnumLoggingType.INFO); |
394 | 413 | |
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 | + | |
395 | 423 | compoundHandlers.add(compoundHandler); |
396 | 424 | compoundHandlerItemNames.add(handlerItemName); |
397 | 425 | } |
@@ -530,4 +558,15 @@ public class ChemiCraftAPI { | ||
530 | 558 | return toolAndWeaponSharpless; |
531 | 559 | } |
532 | 560 | |
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 | + | |
533 | 572 | } |
@@ -45,7 +45,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry; | ||
45 | 45 | * ChemiCraft本体 |
46 | 46 | * @author P.C.C. |
47 | 47 | */ |
48 | -@Mod(modid = "ChemiCraft|Core", name = "ChemiCraft", version = "Beta1") | |
48 | +@Mod(modid = "ChemiCraftCore", name = "ChemiCraft", version = "Beta1") | |
49 | 49 | @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.5", channels = "chemicraftcore", packetHandler = PacketHandler.class) |
50 | 50 | public class ChemiCraftCore extends ChemiCraft{ |
51 | 51 |
@@ -76,7 +76,7 @@ public class ChemiCraftCore extends ChemiCraft{ | ||
76 | 76 | /** |
77 | 77 | * this is ChemiCraft instance. |
78 | 78 | */ |
79 | - @Instance("ChemiCraft|Core") | |
79 | + @Instance("ChemiCraftCore") | |
80 | 80 | public static ChemiCraftCore instance; |
81 | 81 | |
82 | 82 | /** |
@@ -169,7 +169,7 @@ public class ChemiCraftCore extends ChemiCraft{ | ||
169 | 169 | * @param event アノテーション呼び出しにより呼び出す必要なし |
170 | 170 | */ |
171 | 171 | @PreInit |
172 | - public void chemiPreLoadMethod(final FMLPreInitializationEvent event) { | |
172 | + public void chemiPreLoadMethod(FMLPreInitializationEvent event) { | |
173 | 173 | Configuration cfg = new Configuration(event.getSuggestedConfigurationFile()); |
174 | 174 | cfg.load(); |
175 | 175 |
@@ -26,7 +26,6 @@ public class ClientProxy extends CommonProxy { | ||
26 | 26 | |
27 | 27 | @Override |
28 | 28 | public void registerRenderInformation() { |
29 | - MinecraftForgeClient.preloadTexture(ChemiCraft.TEXTURE); | |
30 | 29 | MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_PYROLYSIS_TEXTURE); |
31 | 30 | MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_ELECTROLYSIS_TEXTURE); |
32 | 31 | MinecraftForgeClient.preloadTexture(ChemiCraft.GUI_CHEMICALCOMBINATION_TEXTURE); |
@@ -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 | -} |
@@ -1,5 +1,6 @@ | ||
1 | 1 | package pcc.chemicraft.core.item; |
2 | 2 | |
3 | +import java.util.ArrayList; | |
3 | 4 | import java.util.List; |
4 | 5 | |
5 | 6 | import net.minecraft.client.renderer.texture.IconRegister; |
@@ -10,7 +11,6 @@ import net.minecraft.item.Item; | ||
10 | 11 | import net.minecraft.item.ItemStack; |
11 | 12 | import net.minecraft.util.Icon; |
12 | 13 | import net.minecraft.world.World; |
13 | -import pcc.chemicraft.ChemiCraft; | |
14 | 14 | import pcc.chemicraft.core.ChemiCraftAPI; |
15 | 15 | import pcc.chemicraft.core.ChemiCraftCore; |
16 | 16 | import cpw.mods.fml.relauncher.Side; |
@@ -18,7 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly; | ||
18 | 18 | |
19 | 19 | public class ItemCompounds extends Item { |
20 | 20 | |
21 | - public Icon[] icons; | |
21 | + private Icon[] icons; | |
22 | 22 | |
23 | 23 | public ItemCompounds(int par1){ |
24 | 24 | super(par1); |
@@ -43,8 +43,7 @@ public class ItemCompounds extends Item { | ||
43 | 43 | |
44 | 44 | |
45 | 45 | @Override |
46 | - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) | |
47 | - { | |
46 | + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { | |
48 | 47 | try { |
49 | 48 | for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){ |
50 | 49 | if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){ |
@@ -60,7 +59,7 @@ public class ItemCompounds extends Item { | ||
60 | 59 | |
61 | 60 | |
62 | 61 | @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) { | |
64 | 63 | try { |
65 | 64 | for(int i=0;i < ChemiCraftAPI.instance().getCompoundHandlerItemName().size();i++){ |
66 | 65 | if(ChemiCraftAPI.instance().getCompoundsName().getKeyList(par1ItemStack.getItemDamage()).equals(ChemiCraftAPI.instance().getCompoundHandlerItemName().get(i))){ |
@@ -87,14 +86,6 @@ public class ItemCompounds extends Item { | ||
87 | 86 | |
88 | 87 | |
89 | 88 | @Override |
90 | - @SideOnly(Side.CLIENT) | |
91 | - public Icon getIconFromDamage(int par1) { | |
92 | - return this.icons[par1]; | |
93 | - } | |
94 | - | |
95 | - | |
96 | - | |
97 | - @Override | |
98 | 89 | public String getUnlocalizedName(ItemStack par1ItemStack){ |
99 | 90 | return super.getUnlocalizedName() + "." + ChemiCraftCore.instance.api.getCompoundsName().get("en_US", par1ItemStack.getItemDamage()); |
100 | 91 | } |
@@ -104,11 +95,17 @@ public class ItemCompounds extends Item { | ||
104 | 95 | @Override |
105 | 96 | @SideOnly(Side.CLIENT) |
106 | 97 | 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)); | |
111 | 102 | } |
112 | 103 | } |
113 | 104 | |
105 | + @Override | |
106 | + @SideOnly(Side.CLIENT) | |
107 | + public Icon getIconFromDamage(int par1) { | |
108 | + return this.icons[par1]; | |
109 | + } | |
110 | + | |
114 | 111 | } |
@@ -66,9 +66,6 @@ public class TileEntityPyrolysisTable extends TileEntity { | ||
66 | 66 | |
67 | 67 | @Override |
68 | 68 | public void updateEntity() { |
69 | - | |
70 | - System.out.println("完成時間:" + (MAX_BURN_TIME / (10 * (this.heat / CENTER_HEAT))) / 20 + "seconds"); | |
71 | - | |
72 | 69 | // boolean var2 = false; |
73 | 70 | |
74 | 71 | boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord); |
@@ -52,6 +52,6 @@ public interface ICompoundHandler { | ||
52 | 52 | * iconIndexの指定 |
53 | 53 | * @return iconIndex |
54 | 54 | */ |
55 | - public int getIconIndexHandler(); | |
55 | + public String getIconIndexHandler(); | |
56 | 56 | |
57 | 57 | } |
@@ -5,9 +5,9 @@ | ||
5 | 5 | "description": "", |
6 | 6 | "version": "", |
7 | 7 | "credits": "", |
8 | - "authors": ["Ponkotate", "ProjectChemiCraft"], | |
8 | + "authors": ["Ponkotate", "inaka", "ProjectChemiCraft"], | |
9 | 9 | "logoFile": "/chemicraft_logo.png", |
10 | - "url": "http://chemicraft.sourceforge.jp/index.php/", | |
10 | + "url": "http://chemicraft.sourceforge.jp/", | |
11 | 11 | "updateUrl": "", |
12 | 12 | "parent": "", |
13 | 13 | "screenshots": [], |
@@ -21,9 +21,9 @@ | ||
21 | 21 | "description": "", |
22 | 22 | "version": "", |
23 | 23 | "credits": "", |
24 | - "authors": ["Ponkotate", "ProjectChemiCraft"], | |
24 | + "authors": ["Ponkotate", "inaka", "ProjectChemiCraft"], | |
25 | 25 | "logoFile": "/chemicraft_logo.png", |
26 | - "url": "http://chemicraft.sourceforge.jp/index.php/", | |
26 | + "url": "http://chemicraft.sourceforge.jp/", | |
27 | 27 | "updateUrl": "", |
28 | 28 | "parent": "ChemiCraft|Core", |
29 | 29 | "screenshots": [], |
@@ -39,7 +39,7 @@ | ||
39 | 39 | "credits": "", |
40 | 40 | "authors": ["Mozipi"], |
41 | 41 | "logoFile": "/chemicraft_logo.png", |
42 | - "url": "http://chemicraft.sourceforge.jp/index.php/", | |
42 | + "url": "http://chemicraft.sourceforge.jp/", | |
43 | 43 | "updateUrl": "", |
44 | 44 | "parent": "ChemiCraft|Core", |
45 | 45 | "screenshots": [], |