OSDN Git Service

?
authormozipi <mozipi@users.sourceforge.jp>
Sat, 23 Feb 2013 10:10:51 +0000 (19:10 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Sat, 23 Feb 2013 10:10:51 +0000 (19:10 +0900)
19 files changed:
common/pcc/chemicraft/compounds/FalseItem.java [new file with mode: 0644]
common/pcc/chemicraft/creativetab/CreativeTabAtomOres.java [new file with mode: 0644]
common/pcc/chemicraft/creativetab/CreativeTabChemiCraft.java [new file with mode: 0644]
common/pcc/chemicraft/gen/WorldGenAtomsOre.java [new file with mode: 0644]
common/pcc/chemicraft/item/ItemChemiCell.java [new file with mode: 0644]
common/pcc/chemicraft/ore/BlockAtomOres.java [new file with mode: 0644]
common/pcc/chemicraft/ore/ItemAtomOres.java [new file with mode: 0644]
common/pcc/chemicraft/util/ListHash.java [new file with mode: 0644]
common/yykimoto/sanboru/yakinikutation.java [new file with mode: 0644]
resources/pcc/chemicraft/blocks/AtomsOre.png [new file with mode: 0644]
resources/pcc/chemicraft/blocks/cctable.png [new file with mode: 0644]
resources/pcc/chemicraft/guis/ChemicalCombination.png [new file with mode: 0644]
resources/pcc/chemicraft/guis/Electrolysis.png [new file with mode: 0644]
resources/pcc/chemicraft/guis/MaterialCrafting.png [new file with mode: 0644]
resources/pcc/chemicraft/guis/Pyrolysis.png [new file with mode: 0644]
resources/pcc/chemicraft/guis/ToolAndWeaponCrafting.png [new file with mode: 0644]
resources/pcc/chemicraft/items/Atoms.png [new file with mode: 0644]
resources/pcc/chemicraft/items/Compounds.png [new file with mode: 0644]
resources/pcc/chemicraft/items/items.png [new file with mode: 0644]

diff --git a/common/pcc/chemicraft/compounds/FalseItem.java b/common/pcc/chemicraft/compounds/FalseItem.java
new file mode 100644 (file)
index 0000000..f791ed3
--- /dev/null
@@ -0,0 +1,36 @@
+package pcc.chemicraft.compounds;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.util.Vec3;
+import net.minecraft.world.World;
+
+public class FalseItem
+{
+
+       protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
+       {
+               float var4 = 1.0F;
+               float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4;
+               float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4;
+               double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4;
+               double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset;
+               double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4;
+               Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11);
+               float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI);
+               float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI);
+               float var16 = -MathHelper.cos(-var5 * 0.017453292F);
+               float var17 = MathHelper.sin(-var5 * 0.017453292F);
+               float var18 = var15 * var16;
+               float var20 = var14 * var16;
+               double var21 = 5.0D;
+               if (par2EntityPlayer instanceof EntityPlayerMP) {
+                       var21 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance();
+               }
+               Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
+               return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
+       }
+
+}
diff --git a/common/pcc/chemicraft/creativetab/CreativeTabAtomOres.java b/common/pcc/chemicraft/creativetab/CreativeTabAtomOres.java
new file mode 100644 (file)
index 0000000..e8bbe2a
--- /dev/null
@@ -0,0 +1,33 @@
+package pcc.chemicraft.creativetab;
+
+import net.minecraft.creativetab.CreativeTabs;
+import pcc.chemicraft.ChemiCraft;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class CreativeTabAtomOres extends CreativeTabs
+{
+
+       public CreativeTabAtomOres(String type)
+       {
+               super(type);
+       }
+
+
+
+       @Override
+       @SideOnly(Side.CLIENT)
+       public int getTabIconItemIndex(){
+               return ChemiCraft.instance.blockAtomOres[0].blockID;
+       }
+
+
+
+       @Override
+       @SideOnly(Side.CLIENT)
+       public String getTranslatedTabLabel(){
+               return "AtomsOre";
+       }
+
+
+}
diff --git a/common/pcc/chemicraft/creativetab/CreativeTabChemiCraft.java b/common/pcc/chemicraft/creativetab/CreativeTabChemiCraft.java
new file mode 100644 (file)
index 0000000..8035f7c
--- /dev/null
@@ -0,0 +1,30 @@
+package pcc.chemicraft.creativetab;
+
+import net.minecraft.creativetab.CreativeTabs;
+import pcc.chemicraft.ChemiCraft;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class CreativeTabChemiCraft extends CreativeTabs {
+
+       public CreativeTabChemiCraft(String type){
+               super(type);
+       }
+
+
+
+       @Override
+       @SideOnly(Side.CLIENT)
+       public int getTabIconItemIndex(){
+               return ChemiCraft.instance.itemGasCollectingBottle.shiftedIndex;
+       }
+
+
+
+       @Override
+       @SideOnly(Side.CLIENT)
+       public String getTranslatedTabLabel(){
+               return "ChemiCraft";
+       }
+
+}
diff --git a/common/pcc/chemicraft/gen/WorldGenAtomsOre.java b/common/pcc/chemicraft/gen/WorldGenAtomsOre.java
new file mode 100644 (file)
index 0000000..9587f42
--- /dev/null
@@ -0,0 +1,31 @@
+package pcc.chemicraft.gen;
+
+import java.util.Random;
+
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.IChunkProvider;
+import net.minecraft.world.gen.feature.WorldGenMinable;
+import cpw.mods.fml.common.IWorldGenerator;
+
+public class WorldGenAtomsOre extends WorldGenMinable implements IWorldGenerator
+{
+
+       private int frequency;
+       private int posY;
+
+       public WorldGenAtomsOre(int id, int meta, int size, int frequency, int posY)
+       {
+               super(id, meta, size);
+               this.frequency = frequency;
+               this.posY = posY;
+       }
+
+       @Override
+       public void generate(Random par1Random, int par2ChunkX, int par3ChunkZ, World par4World, IChunkProvider par5ChunkGenerator, IChunkProvider par6ChunkProvider)
+       {
+               for (int i = 0; i < this.frequency; i++) {
+                       this.generate(par4World, par1Random, par2ChunkX * 16 + par1Random.nextInt(16), par1Random.nextInt(this.posY), par3ChunkZ * 16 + par1Random.nextInt(16));
+               }
+       }
+
+}
diff --git a/common/pcc/chemicraft/item/ItemChemiCell.java b/common/pcc/chemicraft/item/ItemChemiCell.java
new file mode 100644 (file)
index 0000000..15a2ea9
--- /dev/null
@@ -0,0 +1,49 @@
+package pcc.chemicraft.item;
+
+import java.util.List;
+
+import pcc.chemicraft.ChemiCraft;
+import pcc.chemicraft.ChemiCraftAPI;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+
+public class ItemChemiCell extends Item
+{
+
+       public ItemChemiCell(int par1)
+       {
+               super(par1);
+               this.maxStackSize = 64;
+               this.setHasSubtypes(true);
+               this.setMaxDamage(0);
+               this.setCreativeTab(ChemiCraft.instance.creativeTabChemiCraft);
+       }
+
+
+
+       @Override
+       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
+               for(int type = 0; type < ChemiCraftAPI.instance().getChemicalCellsName().sizeKeysList(); type++)
+               {
+                       par3List.add(new ItemStack(par1, 1, type));
+                       this.setIconIndex(type);
+               }
+       }
+
+
+
+       @Override
+       public String getItemNameIS(ItemStack par1ItemStack){
+               return super.getItemName() + "." + ChemiCraftAPI.instance().getChemicalCellsName().getKeyList(par1ItemStack.getItemDamage());
+       }
+
+
+
+       @Override
+       public String getTextureFile(){
+               return ChemiCraft.instance.ITEM_TEXTURE;
+       }
+
+}
diff --git a/common/pcc/chemicraft/ore/BlockAtomOres.java b/common/pcc/chemicraft/ore/BlockAtomOres.java
new file mode 100644 (file)
index 0000000..c8e9360
--- /dev/null
@@ -0,0 +1,59 @@
+package pcc.chemicraft.ore;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.ItemStack;
+import pcc.chemicraft.ChemiCraft;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class BlockAtomOres extends Block
+{
+
+       public BlockAtomOres(int id)
+       {
+               super(id, Material.rock);
+               this.setCreativeTab(ChemiCraft.instance.creativeTabAtomsOre);
+       }
+
+       @Override
+       public int getBlockTextureFromSideAndMetadata(int par1, int par2)
+       {
+               return (this.blockID - ChemiCraft.instance.atomOresID[0]) * 16 + par2;
+       }
+
+       @Override
+       public int damageDropped(int par1)
+       {
+               return par1;
+       }
+
+       public static int getBlockFromDye(int par0)
+       {
+               return ~par0 & 15;
+       }
+
+       public static int getDyeFromBlock(int par0)
+       {
+               return ~par0 & 15;
+       }
+
+       @Override
+       @SideOnly(Side.CLIENT)
+       public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
+       {
+               for (int var4 = 0; var4 < 16; ++var4) {
+                       par3List.add(new ItemStack(par1, 1, var4));
+               }
+       }
+
+       @Override
+       public String getTextureFile()
+       {
+               return ChemiCraft.instance.BLOCK_ATOMS_ORE_TEXTURE;
+       }
+
+}
diff --git a/common/pcc/chemicraft/ore/ItemAtomOres.java b/common/pcc/chemicraft/ore/ItemAtomOres.java
new file mode 100644 (file)
index 0000000..e628351
--- /dev/null
@@ -0,0 +1,38 @@
+package pcc.chemicraft.ore;
+
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemDye;
+import net.minecraft.item.ItemStack;
+import pcc.chemicraft.ChemiCraft;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ItemAtomOres extends ItemBlock
+{
+
+       public ItemAtomOres(int par1)
+       {
+               super(par1);
+               this.setMaxDamage(0);
+               this.setHasSubtypes(true);
+       }
+
+       @Override
+       @SideOnly(Side.CLIENT)
+       public int getIconFromDamage(int par1)
+       {
+               return ChemiCraft.instance.blockAtomOres[0].getBlockTextureFromSideAndMetadata(2, BlockAtomOres.getBlockFromDye(par1));
+       }
+
+       @Override
+       public int getMetadata(int par1)
+       {
+               return par1;
+       }
+
+       @Override
+       public String getItemNameIS(ItemStack par1ItemStack)
+       {
+               return super.getItemName() + "." + ItemDye.dyeColorNames[BlockAtomOres.getBlockFromDye(par1ItemStack.getItemDamage())];
+       }
+}
diff --git a/common/pcc/chemicraft/util/ListHash.java b/common/pcc/chemicraft/util/ListHash.java
new file mode 100644 (file)
index 0000000..04f9fb1
--- /dev/null
@@ -0,0 +1,223 @@
+package pcc.chemicraft.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * ListHashは型Kに対応したArrayListに型Eを追加する機能を提供します。<br>
+ *
+ * このクラスを作成すると、まず<br>
+ * <pre>
+ * HashMap&lt;K, ArrayList&lt;E&gt;&gt;
+ * </pre>
+ * が生成されます。<br>
+ * 型KはHashMapやTreeMapを使った時とように使用します。<br>
+ * 型EはArrayListの型を指定します。<br>
+ * <br>
+ * <h2>構造解説:</h2>
+ * HashMapの型VがArrayListになっており、ArrayListの型Eがこのクラスの型Eになります。<br>
+ * HashMapでは型Vを値として入れなければいけませんが、ListHashではこのクラスの型EをArrayListに入れることができます。<br>
+ *
+ * @author mozipi
+ *
+ * @param <K> Key
+ * @param <E> Element
+ */
+public class ListHash<K, E>
+{
+   /**
+    * @author Ponkotate version:1.0.0 dev
+    *
+    *         Create ArrayList in HashMap.
+    */
+
+   protected ArrayList<K> keysList = new ArrayList<K>();
+   protected HashMap<K, ArrayList<E>> elementsHash = new HashMap<K, ArrayList<E>>();
+
+   public boolean add(K par1Key, E par2Element)
+   {
+      try
+      {
+         return this.elementsHash.get(par1Key).add(par2Element);
+      } catch (Exception e)
+      {
+         return this.put(par1Key, par2Element);
+      }
+   }
+
+   public boolean addAll(K par1Key, Collection<? extends E> par2Collection)
+   {
+      return this.elementsHash.get(par1Key).addAll(par2Collection);
+   }
+
+   public boolean addAll(K par1Key, int par2Index, Collection<? extends E> par3Collection)
+   {
+      return this.elementsHash.get(par1Key).addAll(par2Index, par3Collection);
+   }
+
+   public void clear()
+   {
+      this.elementsHash.clear();
+   }
+
+   public boolean containsKey(K par1Key)
+   {
+      return this.elementsHash.containsKey(par1Key);
+   }
+
+   public boolean containsValue(K par1Key)
+   {
+      return this.elementsHash.containsValue(par1Key);
+   }
+
+   public boolean contains(K par1Key, E par2Element)
+   {
+      return this.elementsHash.get(par1Key).contains(par2Element);
+   }
+
+   public boolean containsAll(K par1Key, Collection<?> par2Collection)
+   {
+      return this.elementsHash.get(par1Key).containsAll(par2Collection);
+   }
+
+   public Set<java.util.Map.Entry<K, E>> entrySet()
+   {
+      return this.entrySet();
+   }
+
+   public K getKeyList(int par1Index)
+   {
+      return this.keysList.get(par1Index);
+   }
+
+   public E get(K par1Key, int par2Index)
+   {
+      return this.elementsHash.get(par1Key).get(par2Index);
+   }
+
+   public int indexOf(K par1Key, E par2Element)
+   {
+      return this.elementsHash.get(par1Key).indexOf(par2Element);
+   }
+
+   public boolean isKeysListEmpty(K par1Key)
+   {
+      return this.elementsHash.get(par1Key).isEmpty();
+   }
+
+   public boolean isElementsHashEmpty()
+   {
+      return this.elementsHash.isEmpty();
+   }
+
+   public Iterator<E> iterator(K par1Key)
+   {
+      return this.elementsHash.get(par1Key).iterator();
+   }
+
+   public int lastIndexOf(K par1Key, E par2Element)
+   {
+      return this.elementsHash.get(par1Key).lastIndexOf(par2Element);
+   }
+
+   public ListIterator<E> listIterator(K par1Key)
+   {
+      return this.elementsHash.get(par1Key).listIterator();
+   }
+
+   public ListIterator<E> listIterator(K par1Key, int par2Index)
+   {
+      return this.elementsHash.get(par1Key).listIterator(par2Index);
+   }
+
+   public Set<K> keySet()
+   {
+      return this.elementsHash.keySet();
+   }
+
+   public boolean put(K par1Key, E par2Element)
+   {
+      this.keysList.add(par1Key);
+
+      ArrayList<E> elementList = new ArrayList<E>();
+      this.elementsHash.put(par1Key, elementList);
+      return this.add(par1Key, par2Element);
+   }
+
+   public void putAll(Map<? extends K, ? extends ArrayList<E>> par1Map)
+   {
+      this.elementsHash.putAll(par1Map);
+   }
+
+   public ArrayList<E> remove(K par1Key)
+   {
+      return this.elementsHash.remove(par1Key);
+   }
+
+   public boolean remove(K par1Key, E par2Element)
+   {
+      return this.elementsHash.get(par1Key).remove(par2Element);
+   }
+
+   public E remove(K par1Key, int par2Index)
+   {
+      return this.elementsHash.get(par1Key).remove(par2Index);
+   }
+
+   public boolean removeAll(K par1Key, Collection<?> par2Collection)
+   {
+      return this.elementsHash.get(par1Key).removeAll(par2Collection);
+   }
+
+   public boolean retainAll(K par1Key, Collection<?> par2Collection)
+   {
+      return this.elementsHash.get(par1Key).retainAll(par2Collection);
+   }
+
+   public E set(K par1Key, int par2Index, E par3Element)
+   {
+      return this.elementsHash.get(par1Key).set(par2Index, par3Element);
+   }
+
+   public int sizeElementsHash()
+   {
+      return this.elementsHash.size();
+   }
+
+   public int sizeKeysList()
+   {
+      return this.keysList.size();
+   }
+
+   public int sizeElementsList(K par1Key)
+   {
+      return this.elementsHash.get(par1Key).size();
+   }
+
+   public List<E> subList(K par1Key, int par2FromIndex, int par3ToIndex)
+   {
+      return this.elementsHash.get(par1Key).subList(par2FromIndex, par3ToIndex);
+   }
+
+   public E[] toArray(K par1Key)
+   {
+      return (E[])this.elementsHash.get(par1Key).toArray();
+   }
+
+   public <T> T[] toArray(K par1Key, T[] par2Array)
+   {
+      return this.elementsHash.get(par1Key).toArray(par2Array);
+   }
+
+   public Collection<ArrayList<E>> values()
+   {
+      return this.elementsHash.values();
+   }
+
+}
diff --git a/common/yykimoto/sanboru/yakinikutation.java b/common/yykimoto/sanboru/yakinikutation.java
new file mode 100644 (file)
index 0000000..4334765
--- /dev/null
@@ -0,0 +1,16 @@
+package yykimoto.sanboru;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.client.Minecraft;
+
+public class yakinikutation {
+ @SideOnly(value = Side.CLIENT)
+ public static boolean sanboru() {
+  if (Minecraft.getMinecraft().session.username.equals("sanboru")) {
+   throw new RuntimeException("You are a criminal!");
+  } else {
+   return true;
+  }
+ }
+}
\ No newline at end of file
diff --git a/resources/pcc/chemicraft/blocks/AtomsOre.png b/resources/pcc/chemicraft/blocks/AtomsOre.png
new file mode 100644 (file)
index 0000000..f122727
Binary files /dev/null and b/resources/pcc/chemicraft/blocks/AtomsOre.png differ
diff --git a/resources/pcc/chemicraft/blocks/cctable.png b/resources/pcc/chemicraft/blocks/cctable.png
new file mode 100644 (file)
index 0000000..1a09c7a
Binary files /dev/null and b/resources/pcc/chemicraft/blocks/cctable.png differ
diff --git a/resources/pcc/chemicraft/guis/ChemicalCombination.png b/resources/pcc/chemicraft/guis/ChemicalCombination.png
new file mode 100644 (file)
index 0000000..bfcb411
Binary files /dev/null and b/resources/pcc/chemicraft/guis/ChemicalCombination.png differ
diff --git a/resources/pcc/chemicraft/guis/Electrolysis.png b/resources/pcc/chemicraft/guis/Electrolysis.png
new file mode 100644 (file)
index 0000000..9e9190a
Binary files /dev/null and b/resources/pcc/chemicraft/guis/Electrolysis.png differ
diff --git a/resources/pcc/chemicraft/guis/MaterialCrafting.png b/resources/pcc/chemicraft/guis/MaterialCrafting.png
new file mode 100644 (file)
index 0000000..1660d6b
Binary files /dev/null and b/resources/pcc/chemicraft/guis/MaterialCrafting.png differ
diff --git a/resources/pcc/chemicraft/guis/Pyrolysis.png b/resources/pcc/chemicraft/guis/Pyrolysis.png
new file mode 100644 (file)
index 0000000..11002bf
Binary files /dev/null and b/resources/pcc/chemicraft/guis/Pyrolysis.png differ
diff --git a/resources/pcc/chemicraft/guis/ToolAndWeaponCrafting.png b/resources/pcc/chemicraft/guis/ToolAndWeaponCrafting.png
new file mode 100644 (file)
index 0000000..1e448d8
Binary files /dev/null and b/resources/pcc/chemicraft/guis/ToolAndWeaponCrafting.png differ
diff --git a/resources/pcc/chemicraft/items/Atoms.png b/resources/pcc/chemicraft/items/Atoms.png
new file mode 100644 (file)
index 0000000..01930f6
Binary files /dev/null and b/resources/pcc/chemicraft/items/Atoms.png differ
diff --git a/resources/pcc/chemicraft/items/Compounds.png b/resources/pcc/chemicraft/items/Compounds.png
new file mode 100644 (file)
index 0000000..efca654
Binary files /dev/null and b/resources/pcc/chemicraft/items/Compounds.png differ
diff --git a/resources/pcc/chemicraft/items/items.png b/resources/pcc/chemicraft/items/items.png
new file mode 100644 (file)
index 0000000..39484a5
Binary files /dev/null and b/resources/pcc/chemicraft/items/items.png differ