public NameAuxiliary nameAuxiliary = auxiliary.new NameAuxiliary();\r
public ArrayAuxiliary arrayAuxiliary = auxiliary.new ArrayAuxiliary();\r
\r
+ private ChemiCraftAPI api = ChemiCraftAPI.instance;\r
+\r
@Mod.PreInit\r
public void chemiPreLoadMethod(FMLPreInitializationEvent event) {\r
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
\r
private void settingProcessing(FMLPostInitializationEvent event){\r
\r
- ChemiCraftAPI.instance.addCompound("Test");\r
- ChemiCraftAPI.instance.addCompound("Test2");\r
- ChemiCraftAPI.instance.settingCompoundHandler("Test", new CompoundHandlerTest());\r
-\r
// Blockを追加します\r
this.blockDecompositionTable = new BlockDecompositionTable(this.decompositionTableID, 0, Material.ground).setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("DecompositionTable");\r
this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 0, Material.ground).setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("ChemicalCombinationTable");\r
ChemiCraftAPI.instance.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");\r
\r
// 化合物のレシピを追加します\r
- ChemiCraftAPI.instance.addChemicalCombinationRecipe(new ItemStack[]{new ItemStack(this.itemAtoms, 5), new ItemStack(this.itemAtoms, 7)}, new ItemStack(this.itemCompounds, 0));\r
+ ChemiCraftAPI.instance.addChemicalCombinationRecipe(new ItemStack[]{new ItemStack(this.itemAtoms, 1, CARBON), new ItemStack(this.itemAtoms, 1, OXYGEN) }, new ItemStack(this.itemCompounds, 1, api.getDamageByName("CarbonDioxide")));\r
\r
//手榴弾の追加\r
ChemiCraftAPI.instance.addMaterialRecipe(new ItemStack[]{null, new ItemStack(Block.stone), null, new ItemStack(Block.stone), new ItemStack(Item.gunpowder), new ItemStack(Block.stone), null, new ItemStack(Block.stone), null}, new ItemStack(this.itemAtomGrenade, 16, 0), new NBTRecipeGrenade());\r
{
super.slotClick(par1, par2, par3, par4EntityPlayer);
if(par1 == 16){
+ if(this.inv.getStackInSlot(16) == null) return super.slotClick(par1, par2, par3, par4EntityPlayer);
for(int i = 0;i < 16;i++){
if(this.inv.getStackInSlot(i) != null){
- if(this.inv.getStackInSlot(i).stackSize >= 1){
+ if(this.inv.getStackInSlot(i).stackSize > 1){
this.putStackInSlot(i, new ItemStack(this.inv.getStackInSlot(i).itemID, --this.inv.getStackInSlot(i).stackSize, this.inv.getStackInSlot(i).getItemDamage()));
}else{
this.putStackInSlot(i, null);
}
//trimToSize & sorting.
- materialID.trimToSize();
- materialDamage.trimToSize();
- recipeID.trimToSize();
- recipeDamage.trimToSize();
Collections.sort(materialID);
Collections.sort(materialDamage);
Collections.sort(recipeID);
Collections.sort(recipeDamage);
+ materialID.trimToSize();
+ materialDamage.trimToSize();
+ recipeID.trimToSize();
+ recipeDamage.trimToSize();
//Size check.
if(materialID.size() != recipeID.size()){ match = false;}
//Just loop of materialID.size().
for(int j = 0;j < materialID.size();j++){
- //ID check.
- if(materialID.get(j) != recipeID.get(j)){ match = false;}
- //Damage check.
- if(materialDamage.get(j) != recipeDamage.get(j)){ match = false;}
+ if(match){
+ //ID check.
+ if(materialID.get(j) != recipeID.get(j).hashCode()){ match = false;}
+ //Damage check.
+ if(materialDamage.get(j) != recipeDamage.get(j).hashCode()){ match = false;}
+ }
}
//if "match == true"