Package net.minecraft.world

Examples of net.minecraft.world.World


  private ModelZombieJar model = new ModelZombieJar();

  @Override
  public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {

    World world = te.getWorldObj();
    TileKillerJoe gen = (TileKillerJoe) te;
    float swingProg = gen.getSwingProgress(tick);

    float f = world.getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
    int l = world.getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
    int l1 = l % 65536;
    int l2 = l / 65536;
    Tessellator.instance.setColorOpaque_F(f, f, f);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) l1, (float) l2);
View Full Code Here


  @Override
  public boolean onProject(IProjector projector, Set<Vector3> fields)
  {
    if (projector.getTicks() % 60 == 0)
    {
      World world = ((TileEntity) projector).worldObj;

      if (!world.isRemote)
      {
        for (Vector3 point : projector.getInteriorPoints())
        {
View Full Code Here

  {
    int[] blockInfo = null;

    if (projector.getTicks() % 40 == 0)
    {
      World world = ((TileEntity) projector).worldObj;

      if (projector.getMode() instanceof ItemModeCustom && !(projector.getModuleCount(ModularForceFieldSystem.itemModuleCamouflage) > 0))
      {
        HashMap<Vector3, int[]> fieldBlocks = ((ItemModeCustom) projector.getMode()).getFieldBlockMap(projector, projector.getModeStack());
        Vector3 fieldCenter = new Vector3((TileEntity) projector).translate(projector.getTranslation());
        Vector3 relativePosition = position.clone().subtract(fieldCenter);
        relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());
        blockInfo = fieldBlocks.get(relativePosition.round());
      }

      // Search nearby inventories to extract blocks.
      for (int dir = 0; dir < 6; dir++)
      {
        ForgeDirection direction = ForgeDirection.getOrientation(dir);
        TileEntity tileEntity = VectorHelper.getTileEntityFromSide(((TileEntity) projector).worldObj, new Vector3((TileEntity) projector), direction);

        if (tileEntity instanceof IInventory)
        {
          IInventory inventory = ((IInventory) tileEntity);

          for (int i = 0; i < inventory.getSizeInventory(); i++)
          {
            ItemStack checkStack = inventory.getStackInSlot(i);

            if (checkStack != null)
            {
              EventStabilize evt = new EventStabilize(world, position.intX(), position.intY(), position.intZ(), checkStack);
              MinecraftForge.EVENT_BUS.post(evt);

              if (!evt.isCanceled())
              {
                if (checkStack.getItem() instanceof ItemBlock)
                {
                  if (blockInfo == null || (blockInfo[0] == ((ItemBlock) checkStack.getItem()).getBlockID() && (blockInfo[1] == checkStack.getItemDamage() || projector.getModuleCount(ModularForceFieldSystem.itemModuleApproximation) > 0)) || (projector.getModuleCount(ModularForceFieldSystem.itemModuleApproximation) > 0 && this.isApproximationEqual(blockInfo[0], checkStack)))
                  {
                    try
                    {
                      if (world.canPlaceEntityOnSide(((ItemBlock) checkStack.getItem()).getBlockID(), position.intX(), position.intY(), position.intZ(), false, 0, null, checkStack))
                      {
                        int metadata = blockInfo != null ? blockInfo[1] : (checkStack.getHasSubtypes() ? checkStack.getItemDamage() : 0);
                        Block block = blockInfo != null ? Block.blocksList[blockInfo[0]] : null;

                        if (Blacklist.stabilizationBlacklist.contains(block) || block instanceof BlockFluid || block instanceof IFluidBlock)
View Full Code Here

public class SoundUtil {

  @SideOnly(Side.CLIENT)
  public static void playClientSoundFX(String name, TileEntity te) {
    World world = Minecraft.getMinecraft().thePlayer.worldObj;   
    Minecraft.getMinecraft().theWorld.playSound(te.xCoord + 0.5, te.yCoord + 0.5, te.zCoord + 0.5, name, 0.1F, 0.5F * ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.8F),true);
  }
View Full Code Here

    Block block = accessor.getBlock();
    TileEntity te = accessor.getTileEntity();
    Item item = Item.getItemFromBlock(block);
    EntityPlayer player = accessor.getPlayer();
    World world = player.worldObj;
    MovingObjectPosition pos = accessor.getPosition();

    int x = pos.blockX, y = pos.blockY, z = pos.blockZ;

    if(block instanceof AbstractMachineBlock<?>) {
View Full Code Here

  private EnchanterModel model = new EnchanterModel();

  @Override
  public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {

    World world = te.getWorldObj();
    TileEnchanter gen = (TileEnchanter) te;

    float f = world.getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
    int l = world.getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
    int l1 = l % 65536;
    int l2 = l / 65536;
    Tessellator.instance.setColorOpaque_F(f, f, f);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) l1, (float) l2);
View Full Code Here

  }

  @Override
  public IMessage onMessage(PacketTeleportEffects message, MessageContext ctx) {
    EntityPlayer player = EnderIO.proxy.getClientPlayer();
    World world = player.worldObj;
    Random rand = world.rand;
    for (int i = 0; i < 15; i++) {
      double xOff = (rand.nextDouble() - 0.5) * 1.1;
      double yOff = (rand.nextDouble() - 0.5) * 0.2;
      double zOff = (rand.nextDouble() - 0.5) * 1.1;
 
View Full Code Here

  public boolean isRecievedCart(EntityMinecart mc) {
    return newlySpawnedCarts.contains(mc.getPersistentID());
  }

  public boolean isClear() {
    World worldObj = transciever.getWorldObj();

    BlockCoord railCoord = new BlockCoord(transciever).getLocation(ForgeDirection.UP);
    int meta = worldObj.getBlockMetadata(railCoord.x, railCoord.y, railCoord.z);

    double buf = 1;
    ForgeDirection dir = BlockEnderRail.getDirection(meta);
    Vector3d offset = ForgeDirectionOffsets.forDirCopy(dir);
    offset.scale(buf);
    offset.x = Math.abs(offset.x);
    offset.z = Math.abs(offset.z);
    List res = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(railCoord.x - offset.x, railCoord.y,
        railCoord.z - offset.z, railCoord.x + 1 + offset.x, railCoord.y + 1, railCoord.z + 1 + offset.z));
    return res == null || res.isEmpty();
  }
View Full Code Here

    }
    return carts;
  }

  private void loadCartsToSpawn() {
    World worldObj = transciever.getWorldObj();
    while (cartList.tagCount() > 0) {
      NBTTagList entityList = (NBTTagList) cartList.removeTag(0);
      List<Entity> ents = new ArrayList<Entity>(entityList.tagCount());
      for (int i = 0; i < entityList.tagCount(); i++) {
        NBTTagCompound entityRoot = entityList.getCompoundTagAt(i);
View Full Code Here

    if(entity == null) {
      return;
    }
    double oX = entity.posX;
    double oZ = entity.posZ;
    World world = transciever.getWorldObj();
    MinecraftServer minecraftserver = MinecraftServer.getServer();
    WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);
    for (int i = 0; i < 4; i++) {
      int x = transciever.xCoord + randOffset(2);
      int y = transciever.yCoord + 1;
      int z = transciever.zCoord + randOffset(2);
      Block b = world.getBlock(x, y, z);
      entity.setPosition(x + 0.5, entity.posY, z + 0.5);
      if(world.canPlaceEntityOnSide(b, x, y, z, false, ForgeDirection.UP.ordinal(), entity, null)) {
        resetForRandomRandomSpawn(entity);
        if(worldserver.spawnEntityInWorld(entity)) {
          //entity.onUpdate();
          worldserver.updateEntity(entity);
          return;
View Full Code Here

TOP

Related Classes of net.minecraft.world.World

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.