2014-10-28 21:10:08 -04:00
|
|
|
package info.jbcs.minecraft.chisel.utils;
|
2014-03-16 22:26:43 +01:00
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
2014-11-24 18:48:10 -05:00
|
|
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2014-03-16 22:26:43 +01:00
|
|
|
import net.minecraft.client.Minecraft;
|
2014-11-24 18:48:10 -05:00
|
|
|
import net.minecraft.client.gui.GuiScreen;
|
2014-03-16 22:26:43 +01:00
|
|
|
import net.minecraft.client.renderer.texture.TextureMap;
|
2014-11-24 18:48:10 -05:00
|
|
|
import net.minecraft.entity.item.EntityItem;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2014-03-16 22:26:43 +01:00
|
|
|
import net.minecraft.util.IIcon;
|
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
|
import net.minecraft.world.World;
|
2014-11-24 18:48:10 -05:00
|
|
|
import scala.collection.parallel.ParIterableLike;
|
2014-03-16 22:26:43 +01:00
|
|
|
|
2014-04-21 19:13:15 +01:00
|
|
|
public class GeneralClient
|
|
|
|
|
{
|
|
|
|
|
public static Random rand = new Random();
|
2014-11-24 18:48:10 -05:00
|
|
|
private static EntityItem ghostItem;
|
2014-04-21 19:13:15 +01:00
|
|
|
|
|
|
|
|
public static void playChiselSound(World world, int x, int y, int z, String sound)
|
|
|
|
|
{
|
|
|
|
|
Minecraft.getMinecraft().theWorld.playSound(x + 0.5, y + 0.5, z + 0.5, sound, 0.3f + 0.7f * rand.nextFloat(), 0.6f + 0.4f * rand.nextFloat(), true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static IIcon getMissingIcon()
|
|
|
|
|
{
|
|
|
|
|
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static HashMap<String, ResourceLocation> resources = new HashMap<String, ResourceLocation>();
|
|
|
|
|
|
|
|
|
|
public static void bind(String textureName)
|
|
|
|
|
{
|
|
|
|
|
ResourceLocation res = resources.get(textureName);
|
|
|
|
|
|
|
|
|
|
if(res == null)
|
|
|
|
|
{
|
|
|
|
|
res = new ResourceLocation(textureName);
|
|
|
|
|
resources.put(textureName, res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Minecraft.getMinecraft().getTextureManager().bindTexture(res);
|
|
|
|
|
}
|
2014-11-24 18:48:10 -05:00
|
|
|
|
2014-03-16 22:26:43 +01:00
|
|
|
}
|