Examples of World


Examples of net.minecraft.server.v1_7_R4.World

    // canSpawnStructureAtCoords
    @Override
    protected boolean a(int chunkX, int chunkZ)
    {
        Random rand = b;
        World worldMC = c;
        if (rand.nextInt(80) < Math.max(Math.abs(chunkX), Math.abs(chunkZ)))
        {
            LocalWorld world = WorldHelper.toLocalWorld(worldMC);
            LocalBiome biome = world.getBiome(chunkX * 16 + 8, chunkZ * 16 + 8);
            if (rand.nextDouble() * 100.0 < biome.getBiomeConfig().mineshaftsRarity)
View Full Code Here

Examples of net.minecraft.src.World

      player.sendChatMessage("Cleared " + removedDrops + " item drop(s).");
   }

   public static int removeItemDrops(Player player, int radius) {
      Coordinate pos = player.getPosition();
      World world = player.getWorld().getMinecraftWorld();
      AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(
               pos.getX() - radius, pos.getY() - radius, pos.getZ() - radius,
               pos.getX() + radius, pos.getY() + radius, pos.getZ() + radius
      );
      List<?> nearbyEntities = world.getEntitiesWithinAABBExcludingEntity(
               player.getMinecraftPlayer(), boundingBox
      );
      int removedDrops = 0;
      for(int entityIndex = 0; entityIndex < nearbyEntities.size(); entityIndex++) {
         Entity entity = (Entity)nearbyEntities.get(entityIndex);
View Full Code Here

Examples of net.minecraft.world.World

    return BaubleType.AMULET;
  }

  @Override
  public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
    World par2World = player.worldObj;
    if (isEnabled(par1ItemStack) && !par2World.isRemote) {
      if (player.ticksExisted % 20 == 0) {
        if (player instanceof EntityPlayer) {
          boolean removed = false;
                    int damage = 1;

          Collection<PotionEffect> potions = player.getActivePotionEffects();

          if (player.isBurning()) {
            player.extinguish();
            removed = true;
          } else for (PotionEffect potion : potions) {
            int id = potion.getPotionID();
            boolean badEffect;
            badEffect = ReflectionHelper.getPrivateValue(Potion.class, Potion.potionTypes[id], new String[]{ "isBadEffect", "field_76418_K" });
                        if (Potion.potionTypes[id] instanceof PotionWarpWard) {
                            badEffect = false;
                        }
                        if (badEffect) {
              player.removePotionEffect(id);
              removed = true;
                            int[] warpPotionIDs = new int[]{Config.potionBlurredID, Config.potionDeathGazeID, Config.potionInfVisExhaustID, Config.potionSunScornedID, Config.potionUnHungerID};
                            if (ArrayUtils.contains(warpPotionIDs, potion.getPotionID())) {
                                damage = 10;
                            }
                            break;
            }
          }

          if (removed) {


                        par1ItemStack.damageItem(damage, player);
                        par2World.playSoundAtEntity(player, "thaumcraft:wand", 0.3F, 0.1F);
          }
        }
      }
    }
  }
View Full Code Here

Examples of net.minecraft.world.World

    return BaubleType.AMULET;
  }

  @Override
  public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
    World par2World = player.worldObj;
    if (par1ItemStack.getItemDamage() == 1 && !par2World.isRemote) {
      int r = LibFeatures.XP_TALISMAN_RANGE;
      int currentXP = getXP(par1ItemStack);
      int xpToAdd = 0;
      int maxXP = LibFeatures.XP_TALISMAN_MAX_XP - currentXP; // Max, to prevent overflow.
      if (maxXP <= 0) {
        par1ItemStack.setItemDamage(0);
        return; // Can't take any XP.
      }

      AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(player.posX - r, player.posY - r, player.posZ - r, player.posX + r, player.posY + r, player.posZ + r);
      List<EntityXPOrb> orbs = par2World.getEntitiesWithinAABB(EntityXPOrb.class, boundingBox);

      for (EntityXPOrb orb : orbs) {
        if (!orb.isDead) {
          int xp = orb.getXpValue();
          if (xpToAdd + xp <= maxXP) {
View Full Code Here

Examples of net.minecraft.world.World

      message.player = TTClientProxy.getPlayer();
    else {
      message.player = ctx.getServerHandler().playerEntity;
    }
    if (server != null) {
      World world = server.worldServerForDimension(message.dim);

      if (world == null) {
        MiscHelper.printCurrentStackTrace("No world found for dimension " + message.dim + "!");
        return null;
      }

      TileEntity tile = world.getTileEntity(message.x, message.y, message.z);
      if (tile != null) {
        message.tile = (T) tile;
      }
    }
    return null;
View Full Code Here

Examples of net.minecraft.world.World

    setHasSubtypes(true);
  }

  @Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe))
      return false;

    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    boolean silk = EnchantmentHelper.getSilkTouchModifier(player);

    switch (ToolHandler.getMode(stack)) {
      case 0:
        break;
      case 1: {
        boolean doX = direction.offsetX == 0;
        boolean doY = direction.offsetY == 0;
        boolean doZ = direction.offsetZ == 0;

        ToolHandler.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolHandler.materialsAxe, silk, fortune);
        break;
      }
      case 2: {
        Block blck = world.getBlock(x, y, z);
        if (Utils.isWoodLog(world, x, y, z)) {
          while (blck != Blocks.air) {
                        BlockUtils.breakFurthestBlock(world, x, y, z, blck, player);
            blck = world.getBlock(x, y, z);
          }

          List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5));
          for (EntityItem item : items) {
            item.setPosition(x + 0.5, y + 0.5, z + 0.5);
            item.ticksExisted += 20;
          }
        }
View Full Code Here

Examples of net.minecraft.world.World

    return (p_150897_1_ == Blocks.bedrock) || super.func_150897_b(p_150897_1_);
  }

  @Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick))
      return false;

    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    Block blk = world.getBlock(x, y, z);

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    boolean silk = EnchantmentHelper.getSilkTouchModifier(player);
    if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock && ((world.provider.isSurfaceWorld() && y < 5) || (y > 253 && world.provider instanceof WorldProviderBedrock))) {
      world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class));
    }
    if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock && (y <= 253 && world.provider instanceof WorldProviderBedrock)) {
      world.setBlock(x, y, z, Blocks.air);
    }
    switch (ToolHandler.getMode(stack)) {
      case 0:
        break;
      case 1: {
View Full Code Here

Examples of net.minecraft.world.World

    return par1ItemStack;
  }

  @Override
  public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
    World world = player.worldObj;
    Material mat = world.getBlock(x, y, z).getMaterial();
    if (!ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel))
      return false;
    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    boolean silk = EnchantmentHelper.getSilkTouchModifier(player);

    switch (ToolHandler.getMode(stack)) {
      case 0:
        break;
      case 1: {
        boolean doX = direction.offsetX == 0;
        boolean doY = direction.offsetY == 0;
        boolean doZ = direction.offsetZ == 0;

        ToolHandler.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolHandler.materialsShovel, silk, fortune);
        break;
      }
      case 2: {
        Block blk = world.getBlock(x, y, z);
        ToolHandler.removeBlocksInIteration(player, world, x, y, z, 0, -8, 0, 1, 8, 1, blk, ToolHandler.materialsShovel, silk, fortune);
        break;
      }
    }
    return false;
View Full Code Here

Examples of net.minecraft.world.World

    public abstract World getWorld(T target);

    @Override
    public Object[] execute(final Object target, IComputerAccess computer, ILuaContext context, final Callable<Object[]> callable) throws Exception {
      @SuppressWarnings("unchecked")
      World world = getWorld((T)target);
      Preconditions.checkNotNull(world, "Trying to execute OnTick method, but no available world");

      final Responder responder = new Responder(context, computer);
View Full Code Here

Examples of net.myexperiments.gos.World

*/

}
public void InitGOS(VCGame view) throws IOException{

world = new World();
world.CurrentTurn = 0;
gtge = view;

//TheGame.SystemConfig = new Properties();
//TheGame.SystemConfig.load(new FileInputStream(GOSSystem.CONFIGDIRECTORY
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.