Revisión | 0e1ecd92c166d049afd3a9188003a012d3cdcd2b (tree) |
---|---|
Tiempo | 2013-02-23 19:10:51 |
Autor | mozipi <mozipi@user...> |
Commiter | mozipi |
?
@@ -0,0 +1,36 @@ | ||
1 | +package pcc.chemicraft.compounds; | |
2 | + | |
3 | +import net.minecraft.entity.player.EntityPlayer; | |
4 | +import net.minecraft.entity.player.EntityPlayerMP; | |
5 | +import net.minecraft.util.MathHelper; | |
6 | +import net.minecraft.util.MovingObjectPosition; | |
7 | +import net.minecraft.util.Vec3; | |
8 | +import net.minecraft.world.World; | |
9 | + | |
10 | +public class FalseItem | |
11 | +{ | |
12 | + | |
13 | + protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) | |
14 | + { | |
15 | + float var4 = 1.0F; | |
16 | + float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4; | |
17 | + float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4; | |
18 | + double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4; | |
19 | + double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset; | |
20 | + double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4; | |
21 | + Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11); | |
22 | + float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); | |
23 | + float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); | |
24 | + float var16 = -MathHelper.cos(-var5 * 0.017453292F); | |
25 | + float var17 = MathHelper.sin(-var5 * 0.017453292F); | |
26 | + float var18 = var15 * var16; | |
27 | + float var20 = var14 * var16; | |
28 | + double var21 = 5.0D; | |
29 | + if (par2EntityPlayer instanceof EntityPlayerMP) { | |
30 | + var21 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); | |
31 | + } | |
32 | + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); | |
33 | + return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3); | |
34 | + } | |
35 | + | |
36 | +} |
@@ -0,0 +1,33 @@ | ||
1 | +package pcc.chemicraft.creativetab; | |
2 | + | |
3 | +import net.minecraft.creativetab.CreativeTabs; | |
4 | +import pcc.chemicraft.ChemiCraft; | |
5 | +import cpw.mods.fml.relauncher.Side; | |
6 | +import cpw.mods.fml.relauncher.SideOnly; | |
7 | + | |
8 | +public class CreativeTabAtomOres extends CreativeTabs | |
9 | +{ | |
10 | + | |
11 | + public CreativeTabAtomOres(String type) | |
12 | + { | |
13 | + super(type); | |
14 | + } | |
15 | + | |
16 | + | |
17 | + | |
18 | + @Override | |
19 | + @SideOnly(Side.CLIENT) | |
20 | + public int getTabIconItemIndex(){ | |
21 | + return ChemiCraft.instance.blockAtomOres[0].blockID; | |
22 | + } | |
23 | + | |
24 | + | |
25 | + | |
26 | + @Override | |
27 | + @SideOnly(Side.CLIENT) | |
28 | + public String getTranslatedTabLabel(){ | |
29 | + return "AtomsOre"; | |
30 | + } | |
31 | + | |
32 | + | |
33 | +} |
@@ -0,0 +1,30 @@ | ||
1 | +package pcc.chemicraft.creativetab; | |
2 | + | |
3 | +import net.minecraft.creativetab.CreativeTabs; | |
4 | +import pcc.chemicraft.ChemiCraft; | |
5 | +import cpw.mods.fml.relauncher.Side; | |
6 | +import cpw.mods.fml.relauncher.SideOnly; | |
7 | + | |
8 | +public class CreativeTabChemiCraft extends CreativeTabs { | |
9 | + | |
10 | + public CreativeTabChemiCraft(String type){ | |
11 | + super(type); | |
12 | + } | |
13 | + | |
14 | + | |
15 | + | |
16 | + @Override | |
17 | + @SideOnly(Side.CLIENT) | |
18 | + public int getTabIconItemIndex(){ | |
19 | + return ChemiCraft.instance.itemGasCollectingBottle.shiftedIndex; | |
20 | + } | |
21 | + | |
22 | + | |
23 | + | |
24 | + @Override | |
25 | + @SideOnly(Side.CLIENT) | |
26 | + public String getTranslatedTabLabel(){ | |
27 | + return "ChemiCraft"; | |
28 | + } | |
29 | + | |
30 | +} |
@@ -0,0 +1,31 @@ | ||
1 | +package pcc.chemicraft.gen; | |
2 | + | |
3 | +import java.util.Random; | |
4 | + | |
5 | +import net.minecraft.world.World; | |
6 | +import net.minecraft.world.chunk.IChunkProvider; | |
7 | +import net.minecraft.world.gen.feature.WorldGenMinable; | |
8 | +import cpw.mods.fml.common.IWorldGenerator; | |
9 | + | |
10 | +public class WorldGenAtomsOre extends WorldGenMinable implements IWorldGenerator | |
11 | +{ | |
12 | + | |
13 | + private int frequency; | |
14 | + private int posY; | |
15 | + | |
16 | + public WorldGenAtomsOre(int id, int meta, int size, int frequency, int posY) | |
17 | + { | |
18 | + super(id, meta, size); | |
19 | + this.frequency = frequency; | |
20 | + this.posY = posY; | |
21 | + } | |
22 | + | |
23 | + @Override | |
24 | + public void generate(Random par1Random, int par2ChunkX, int par3ChunkZ, World par4World, IChunkProvider par5ChunkGenerator, IChunkProvider par6ChunkProvider) | |
25 | + { | |
26 | + for (int i = 0; i < this.frequency; i++) { | |
27 | + this.generate(par4World, par1Random, par2ChunkX * 16 + par1Random.nextInt(16), par1Random.nextInt(this.posY), par3ChunkZ * 16 + par1Random.nextInt(16)); | |
28 | + } | |
29 | + } | |
30 | + | |
31 | +} |
@@ -0,0 +1,49 @@ | ||
1 | +package pcc.chemicraft.item; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import pcc.chemicraft.ChemiCraft; | |
6 | +import pcc.chemicraft.ChemiCraftAPI; | |
7 | +import net.minecraft.creativetab.CreativeTabs; | |
8 | +import net.minecraft.item.Item; | |
9 | +import net.minecraft.item.ItemStack; | |
10 | + | |
11 | + | |
12 | +public class ItemChemiCell extends Item | |
13 | +{ | |
14 | + | |
15 | + public ItemChemiCell(int par1) | |
16 | + { | |
17 | + super(par1); | |
18 | + this.maxStackSize = 64; | |
19 | + this.setHasSubtypes(true); | |
20 | + this.setMaxDamage(0); | |
21 | + this.setCreativeTab(ChemiCraft.instance.creativeTabChemiCraft); | |
22 | + } | |
23 | + | |
24 | + | |
25 | + | |
26 | + @Override | |
27 | + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){ | |
28 | + for(int type = 0; type < ChemiCraftAPI.instance().getChemicalCellsName().sizeKeysList(); type++) | |
29 | + { | |
30 | + par3List.add(new ItemStack(par1, 1, type)); | |
31 | + this.setIconIndex(type); | |
32 | + } | |
33 | + } | |
34 | + | |
35 | + | |
36 | + | |
37 | + @Override | |
38 | + public String getItemNameIS(ItemStack par1ItemStack){ | |
39 | + return super.getItemName() + "." + ChemiCraftAPI.instance().getChemicalCellsName().getKeyList(par1ItemStack.getItemDamage()); | |
40 | + } | |
41 | + | |
42 | + | |
43 | + | |
44 | + @Override | |
45 | + public String getTextureFile(){ | |
46 | + return ChemiCraft.instance.ITEM_TEXTURE; | |
47 | + } | |
48 | + | |
49 | +} |
@@ -0,0 +1,59 @@ | ||
1 | +package pcc.chemicraft.ore; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import net.minecraft.block.Block; | |
6 | +import net.minecraft.block.material.Material; | |
7 | +import net.minecraft.creativetab.CreativeTabs; | |
8 | +import net.minecraft.item.ItemStack; | |
9 | +import pcc.chemicraft.ChemiCraft; | |
10 | +import cpw.mods.fml.relauncher.Side; | |
11 | +import cpw.mods.fml.relauncher.SideOnly; | |
12 | + | |
13 | +public class BlockAtomOres extends Block | |
14 | +{ | |
15 | + | |
16 | + public BlockAtomOres(int id) | |
17 | + { | |
18 | + super(id, Material.rock); | |
19 | + this.setCreativeTab(ChemiCraft.instance.creativeTabAtomsOre); | |
20 | + } | |
21 | + | |
22 | + @Override | |
23 | + public int getBlockTextureFromSideAndMetadata(int par1, int par2) | |
24 | + { | |
25 | + return (this.blockID - ChemiCraft.instance.atomOresID[0]) * 16 + par2; | |
26 | + } | |
27 | + | |
28 | + @Override | |
29 | + public int damageDropped(int par1) | |
30 | + { | |
31 | + return par1; | |
32 | + } | |
33 | + | |
34 | + public static int getBlockFromDye(int par0) | |
35 | + { | |
36 | + return ~par0 & 15; | |
37 | + } | |
38 | + | |
39 | + public static int getDyeFromBlock(int par0) | |
40 | + { | |
41 | + return ~par0 & 15; | |
42 | + } | |
43 | + | |
44 | + @Override | |
45 | + @SideOnly(Side.CLIENT) | |
46 | + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) | |
47 | + { | |
48 | + for (int var4 = 0; var4 < 16; ++var4) { | |
49 | + par3List.add(new ItemStack(par1, 1, var4)); | |
50 | + } | |
51 | + } | |
52 | + | |
53 | + @Override | |
54 | + public String getTextureFile() | |
55 | + { | |
56 | + return ChemiCraft.instance.BLOCK_ATOMS_ORE_TEXTURE; | |
57 | + } | |
58 | + | |
59 | +} |
@@ -0,0 +1,38 @@ | ||
1 | +package pcc.chemicraft.ore; | |
2 | + | |
3 | +import net.minecraft.item.ItemBlock; | |
4 | +import net.minecraft.item.ItemDye; | |
5 | +import net.minecraft.item.ItemStack; | |
6 | +import pcc.chemicraft.ChemiCraft; | |
7 | +import cpw.mods.fml.relauncher.Side; | |
8 | +import cpw.mods.fml.relauncher.SideOnly; | |
9 | + | |
10 | +public class ItemAtomOres extends ItemBlock | |
11 | +{ | |
12 | + | |
13 | + public ItemAtomOres(int par1) | |
14 | + { | |
15 | + super(par1); | |
16 | + this.setMaxDamage(0); | |
17 | + this.setHasSubtypes(true); | |
18 | + } | |
19 | + | |
20 | + @Override | |
21 | + @SideOnly(Side.CLIENT) | |
22 | + public int getIconFromDamage(int par1) | |
23 | + { | |
24 | + return ChemiCraft.instance.blockAtomOres[0].getBlockTextureFromSideAndMetadata(2, BlockAtomOres.getBlockFromDye(par1)); | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public int getMetadata(int par1) | |
29 | + { | |
30 | + return par1; | |
31 | + } | |
32 | + | |
33 | + @Override | |
34 | + public String getItemNameIS(ItemStack par1ItemStack) | |
35 | + { | |
36 | + return super.getItemName() + "." + ItemDye.dyeColorNames[BlockAtomOres.getBlockFromDye(par1ItemStack.getItemDamage())]; | |
37 | + } | |
38 | +} |
@@ -0,0 +1,223 @@ | ||
1 | +package pcc.chemicraft.util; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.Collection; | |
5 | +import java.util.HashMap; | |
6 | +import java.util.Iterator; | |
7 | +import java.util.List; | |
8 | +import java.util.ListIterator; | |
9 | +import java.util.Map; | |
10 | +import java.util.Set; | |
11 | + | |
12 | +/** | |
13 | + * ListHashは型Kに対応したArrayListに型Eを追加する機能を提供します。<br> | |
14 | + * | |
15 | + * このクラスを作成すると、まず<br> | |
16 | + * <pre> | |
17 | + * HashMap<K, ArrayList<E>> | |
18 | + * </pre> | |
19 | + * が生成されます。<br> | |
20 | + * 型KはHashMapやTreeMapを使った時とように使用します。<br> | |
21 | + * 型EはArrayListの型を指定します。<br> | |
22 | + * <br> | |
23 | + * <h2>構造解説:</h2> | |
24 | + * HashMapの型VがArrayListになっており、ArrayListの型Eがこのクラスの型Eになります。<br> | |
25 | + * HashMapでは型Vを値として入れなければいけませんが、ListHashではこのクラスの型EをArrayListに入れることができます。<br> | |
26 | + * | |
27 | + * @author mozipi | |
28 | + * | |
29 | + * @param <K> Key | |
30 | + * @param <E> Element | |
31 | + */ | |
32 | +public class ListHash<K, E> | |
33 | +{ | |
34 | + /** | |
35 | + * @author Ponkotate version:1.0.0 dev | |
36 | + * | |
37 | + * Create ArrayList in HashMap. | |
38 | + */ | |
39 | + | |
40 | + protected ArrayList<K> keysList = new ArrayList<K>(); | |
41 | + protected HashMap<K, ArrayList<E>> elementsHash = new HashMap<K, ArrayList<E>>(); | |
42 | + | |
43 | + public boolean add(K par1Key, E par2Element) | |
44 | + { | |
45 | + try | |
46 | + { | |
47 | + return this.elementsHash.get(par1Key).add(par2Element); | |
48 | + } catch (Exception e) | |
49 | + { | |
50 | + return this.put(par1Key, par2Element); | |
51 | + } | |
52 | + } | |
53 | + | |
54 | + public boolean addAll(K par1Key, Collection<? extends E> par2Collection) | |
55 | + { | |
56 | + return this.elementsHash.get(par1Key).addAll(par2Collection); | |
57 | + } | |
58 | + | |
59 | + public boolean addAll(K par1Key, int par2Index, Collection<? extends E> par3Collection) | |
60 | + { | |
61 | + return this.elementsHash.get(par1Key).addAll(par2Index, par3Collection); | |
62 | + } | |
63 | + | |
64 | + public void clear() | |
65 | + { | |
66 | + this.elementsHash.clear(); | |
67 | + } | |
68 | + | |
69 | + public boolean containsKey(K par1Key) | |
70 | + { | |
71 | + return this.elementsHash.containsKey(par1Key); | |
72 | + } | |
73 | + | |
74 | + public boolean containsValue(K par1Key) | |
75 | + { | |
76 | + return this.elementsHash.containsValue(par1Key); | |
77 | + } | |
78 | + | |
79 | + public boolean contains(K par1Key, E par2Element) | |
80 | + { | |
81 | + return this.elementsHash.get(par1Key).contains(par2Element); | |
82 | + } | |
83 | + | |
84 | + public boolean containsAll(K par1Key, Collection<?> par2Collection) | |
85 | + { | |
86 | + return this.elementsHash.get(par1Key).containsAll(par2Collection); | |
87 | + } | |
88 | + | |
89 | + public Set<java.util.Map.Entry<K, E>> entrySet() | |
90 | + { | |
91 | + return this.entrySet(); | |
92 | + } | |
93 | + | |
94 | + public K getKeyList(int par1Index) | |
95 | + { | |
96 | + return this.keysList.get(par1Index); | |
97 | + } | |
98 | + | |
99 | + public E get(K par1Key, int par2Index) | |
100 | + { | |
101 | + return this.elementsHash.get(par1Key).get(par2Index); | |
102 | + } | |
103 | + | |
104 | + public int indexOf(K par1Key, E par2Element) | |
105 | + { | |
106 | + return this.elementsHash.get(par1Key).indexOf(par2Element); | |
107 | + } | |
108 | + | |
109 | + public boolean isKeysListEmpty(K par1Key) | |
110 | + { | |
111 | + return this.elementsHash.get(par1Key).isEmpty(); | |
112 | + } | |
113 | + | |
114 | + public boolean isElementsHashEmpty() | |
115 | + { | |
116 | + return this.elementsHash.isEmpty(); | |
117 | + } | |
118 | + | |
119 | + public Iterator<E> iterator(K par1Key) | |
120 | + { | |
121 | + return this.elementsHash.get(par1Key).iterator(); | |
122 | + } | |
123 | + | |
124 | + public int lastIndexOf(K par1Key, E par2Element) | |
125 | + { | |
126 | + return this.elementsHash.get(par1Key).lastIndexOf(par2Element); | |
127 | + } | |
128 | + | |
129 | + public ListIterator<E> listIterator(K par1Key) | |
130 | + { | |
131 | + return this.elementsHash.get(par1Key).listIterator(); | |
132 | + } | |
133 | + | |
134 | + public ListIterator<E> listIterator(K par1Key, int par2Index) | |
135 | + { | |
136 | + return this.elementsHash.get(par1Key).listIterator(par2Index); | |
137 | + } | |
138 | + | |
139 | + public Set<K> keySet() | |
140 | + { | |
141 | + return this.elementsHash.keySet(); | |
142 | + } | |
143 | + | |
144 | + public boolean put(K par1Key, E par2Element) | |
145 | + { | |
146 | + this.keysList.add(par1Key); | |
147 | + | |
148 | + ArrayList<E> elementList = new ArrayList<E>(); | |
149 | + this.elementsHash.put(par1Key, elementList); | |
150 | + return this.add(par1Key, par2Element); | |
151 | + } | |
152 | + | |
153 | + public void putAll(Map<? extends K, ? extends ArrayList<E>> par1Map) | |
154 | + { | |
155 | + this.elementsHash.putAll(par1Map); | |
156 | + } | |
157 | + | |
158 | + public ArrayList<E> remove(K par1Key) | |
159 | + { | |
160 | + return this.elementsHash.remove(par1Key); | |
161 | + } | |
162 | + | |
163 | + public boolean remove(K par1Key, E par2Element) | |
164 | + { | |
165 | + return this.elementsHash.get(par1Key).remove(par2Element); | |
166 | + } | |
167 | + | |
168 | + public E remove(K par1Key, int par2Index) | |
169 | + { | |
170 | + return this.elementsHash.get(par1Key).remove(par2Index); | |
171 | + } | |
172 | + | |
173 | + public boolean removeAll(K par1Key, Collection<?> par2Collection) | |
174 | + { | |
175 | + return this.elementsHash.get(par1Key).removeAll(par2Collection); | |
176 | + } | |
177 | + | |
178 | + public boolean retainAll(K par1Key, Collection<?> par2Collection) | |
179 | + { | |
180 | + return this.elementsHash.get(par1Key).retainAll(par2Collection); | |
181 | + } | |
182 | + | |
183 | + public E set(K par1Key, int par2Index, E par3Element) | |
184 | + { | |
185 | + return this.elementsHash.get(par1Key).set(par2Index, par3Element); | |
186 | + } | |
187 | + | |
188 | + public int sizeElementsHash() | |
189 | + { | |
190 | + return this.elementsHash.size(); | |
191 | + } | |
192 | + | |
193 | + public int sizeKeysList() | |
194 | + { | |
195 | + return this.keysList.size(); | |
196 | + } | |
197 | + | |
198 | + public int sizeElementsList(K par1Key) | |
199 | + { | |
200 | + return this.elementsHash.get(par1Key).size(); | |
201 | + } | |
202 | + | |
203 | + public List<E> subList(K par1Key, int par2FromIndex, int par3ToIndex) | |
204 | + { | |
205 | + return this.elementsHash.get(par1Key).subList(par2FromIndex, par3ToIndex); | |
206 | + } | |
207 | + | |
208 | + public E[] toArray(K par1Key) | |
209 | + { | |
210 | + return (E[])this.elementsHash.get(par1Key).toArray(); | |
211 | + } | |
212 | + | |
213 | + public <T> T[] toArray(K par1Key, T[] par2Array) | |
214 | + { | |
215 | + return this.elementsHash.get(par1Key).toArray(par2Array); | |
216 | + } | |
217 | + | |
218 | + public Collection<ArrayList<E>> values() | |
219 | + { | |
220 | + return this.elementsHash.values(); | |
221 | + } | |
222 | + | |
223 | +} |
@@ -0,0 +1,16 @@ | ||
1 | +package yykimoto.sanboru; | |
2 | + | |
3 | +import cpw.mods.fml.relauncher.Side; | |
4 | +import cpw.mods.fml.relauncher.SideOnly; | |
5 | +import net.minecraft.client.Minecraft; | |
6 | + | |
7 | +public class yakinikutation { | |
8 | + @SideOnly(value = Side.CLIENT) | |
9 | + public static boolean sanboru() { | |
10 | + if (Minecraft.getMinecraft().session.username.equals("sanboru")) { | |
11 | + throw new RuntimeException("You are a criminal!"); | |
12 | + } else { | |
13 | + return true; | |
14 | + } | |
15 | + } | |
16 | +} | |
\ No newline at end of file |