|
3 | 3 | import java.util.*; |
4 | 4 |
|
5 | 5 | import net.minecraft.block.Block; |
6 | | -import net.minecraft.entity.player.EntityPlayer; |
7 | | -import net.minecraft.entity.player.InventoryPlayer; |
8 | 6 | import net.minecraft.item.*; |
9 | 7 | import net.minecraft.launchwrapper.Launch; |
10 | 8 | import net.minecraft.nbt.NBTTagCompound; |
11 | | -import net.minecraft.stats.StatList; |
12 | 9 | import net.minecraft.util.StatCollector; |
13 | 10 | import net.minecraft.world.World; |
14 | 11 | import net.minecraft.world.biome.BiomeGenBase; |
15 | 12 | import net.minecraftforge.common.BiomeDictionary; |
16 | | -import net.minecraftforge.common.MinecraftForge; |
17 | | -import net.minecraftforge.common.util.ForgeDirection; |
18 | | -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; |
19 | 13 | import net.minecraftforge.fluids.*; |
20 | 14 | import net.minecraftforge.oredict.OreDictionary; |
21 | | -import net.pufferlab.primal.blocks.BlockContainerPrimal; |
22 | 15 | import net.pufferlab.primal.utils.*; |
23 | 16 | import net.pufferlab.primal.world.GlobalTickingData; |
24 | 17 |
|
@@ -49,28 +42,6 @@ public static boolean isClose(double number, double number2) { |
49 | 42 | return false; |
50 | 43 | } |
51 | 44 |
|
52 | | - public static void damageItemIndex(int index, int amount, InventoryPlayer invPlayer) { |
53 | | - if (!(invPlayer.player.capabilities.isCreativeMode)) { |
54 | | - ItemStack stack = invPlayer.getStackInSlot(index); |
55 | | - if (stack.isItemStackDamageable()) { |
56 | | - if (stack.attemptDamageItem(amount, invPlayer.player.getRNG())) { |
57 | | - invPlayer.player.renderBrokenItemStack(stack); |
58 | | - --stack.stackSize; |
59 | | - |
60 | | - if (invPlayer.player != null) { |
61 | | - EntityPlayer entityplayer = (EntityPlayer) invPlayer.player; |
62 | | - entityplayer.addStat(StatList.objectBreakStats[Item.getIdFromItem(stack.getItem())], 1); |
63 | | - } |
64 | | - if (stack.stackSize <= 0) { |
65 | | - invPlayer.setInventorySlotContents(index, (ItemStack) null); |
66 | | - MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(invPlayer.player, stack)); |
67 | | - } |
68 | | - } |
69 | | - |
70 | | - } |
71 | | - } |
72 | | - } |
73 | | - |
74 | 45 | public static NBTTagCompound getOrCreateTagCompound(ItemStack item) { |
75 | 46 | NBTTagCompound tag = item.getTagCompound(); |
76 | 47 | if (tag == null) { |
@@ -150,74 +121,6 @@ public static boolean equalsStack(ItemStack check, FluidStack wild) { |
150 | 121 | return wild.getFluid() == stack.getFluid(); |
151 | 122 | } |
152 | 123 |
|
153 | | - public static void place(ItemStack stack, World world, int x, int y, int z, Block toPlace, int metadata, |
154 | | - EntityPlayer player) { |
155 | | - if (world.isAirBlock(x, y, z) && world.isSideSolid(x, y - 1, z, ForgeDirection.UP)) { |
156 | | - if (world.checkNoEntityCollision(toPlace.getCollisionBoundingBoxFromPool(world, x, y, z)) |
157 | | - && world.setBlock(x, y, z, toPlace, metadata, 3)) { |
158 | | - world.setBlock(x, y, z, toPlace, metadata, 2); |
159 | | - toPlace.onBlockPlacedBy(world, x, y, z, player, stack); |
160 | | - if (toPlace instanceof BlockContainerPrimal block2) { |
161 | | - block2.onBlockSidePlacedBy(world, x, y, z, player, stack, 0); |
162 | | - } |
163 | | - stack.stackSize -= 1; |
164 | | - playSound(world, x, y, z, toPlace); |
165 | | - player.swingItem(); |
166 | | - } |
167 | | - } |
168 | | - } |
169 | | - |
170 | | - public static void placeNoConsume(ItemStack stack, World world, int x, int y, int z, Block toPlace, int metadata, |
171 | | - EntityPlayer player) { |
172 | | - if (world.isAirBlock(x, y, z) && world.isSideSolid(x, y - 1, z, ForgeDirection.UP)) { |
173 | | - if (world.checkNoEntityCollision(toPlace.getCollisionBoundingBoxFromPool(world, x, y, z)) |
174 | | - && world.setBlock(x, y, z, toPlace, metadata, 3)) { |
175 | | - world.setBlock(x, y, z, toPlace, metadata, 2); |
176 | | - toPlace.onBlockPlacedBy(world, x, y, z, player, stack); |
177 | | - if (toPlace instanceof BlockContainerPrimal block2) { |
178 | | - block2.onBlockSidePlacedBy(world, x, y, z, player, stack, 0); |
179 | | - } |
180 | | - playSound(world, x, y, z, toPlace); |
181 | | - player.swingItem(); |
182 | | - } |
183 | | - } |
184 | | - } |
185 | | - |
186 | | - public static void placeSilent(ItemStack stack, World world, int x, int y, int z, Block toPlace, int metadata, |
187 | | - EntityPlayer player) { |
188 | | - if (world.isAirBlock(x, y, z) && world.isSideSolid(x, y - 1, z, ForgeDirection.UP)) { |
189 | | - if (world.checkNoEntityCollision(toPlace.getCollisionBoundingBoxFromPool(world, x, y, z)) |
190 | | - && world.setBlock(x, y, z, toPlace, metadata, 3)) { |
191 | | - world.setBlock(x, y, z, toPlace, metadata, 2); |
192 | | - toPlace.onBlockPlacedBy(world, x, y, z, player, stack); |
193 | | - if (toPlace instanceof BlockContainerPrimal block2) { |
194 | | - block2.onBlockSidePlacedBy(world, x, y, z, player, stack, 0); |
195 | | - } |
196 | | - player.swingItem(); |
197 | | - } |
198 | | - } |
199 | | - } |
200 | | - |
201 | | - public static void playSound(World world, int x, int y, int z, Block block) { |
202 | | - world.playSoundEffect( |
203 | | - x + 0.5f, |
204 | | - y + 0.5f, |
205 | | - z + 0.5f, |
206 | | - block.stepSound.func_150496_b(), |
207 | | - (block.stepSound.getVolume() + 1.0F) / 2.0F, |
208 | | - block.stepSound.getPitch() * 0.8F); |
209 | | - } |
210 | | - |
211 | | - public static void playSound(World world, int x, int y, int z, SoundTypePrimal stepSound) { |
212 | | - world.playSoundEffect( |
213 | | - x + 0.5f, |
214 | | - y + 0.5f, |
215 | | - z + 0.5f, |
216 | | - stepSound.getPath(), |
217 | | - (stepSound.getVolume() + 1.0F) / 2.0F, |
218 | | - stepSound.getPitch() * 0.8F); |
219 | | - } |
220 | | - |
221 | 124 | public static boolean contains(int[] array, int targetString) { |
222 | 125 | if (array == null) return false; |
223 | 126 | for (int element : array) { |
|
0 commit comments